|
Server : Apache System : Linux iZ6xhqomji47p1Z 5.10.134-15.al8.x86_64 #1 SMP Thu Jul 20 00:44:04 CST 2023 x86_64 User : www ( 1000) PHP Version : 8.1.30 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv Directory : /www/wwwroot/fsjlkj.cn/application/admin/template/member/ |
{include file="public/layout" /}
<body class="bodystyle" style="overflow: auto;min-width:auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page" style="min-width: auto;box-shadow:none;padding-bottom: 0px;">
<form class="form-horizontal" id="post_form" action="{:url('Member/attr_edit')}" method="post">
<!-- 常规选项 -->
<div class="ncap-form-default tab_div_1">
<dl class="row">
<dt class="tit">
<label for="name"><em>*</em>字段标题</label>
</dt>
<dd class="opt">
<input type="text" value="{$info.title|default=''}" name="title" id="title" class="input-txt" autocomplete="off">
<p class="notic"></p>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label for="dtype"><em>*</em>字段类型</label>
</dt>
<dd class="opt">
{in name="$info.dtype" value="mobile,email"}
{$info.title}
<input type="hidden" name="dtype" value="{$info.dtype}">
{else /}
{volist name='$field' id='vo'}
<div style="width: 150px; float: left;">
<label><input type="radio" name="dtype" value="{$vo.name}" data-ifoption="{$vo.ifoption|default=0}" {eq name="$info.dtype" value="$vo.name"} checked="checked" {/eq} data-text="{$vo.title}">{$vo.title}</label>
</div>
{if condition="$i % 4 == 0"}<br/>{/if}
{/volist}
{/in}
<span class="err"></span>
<p class="notic"></p>
</dd>
</dl>
<dl class="row" id="dl_dfvalue">
<dt class="tit">
<label id="label_dfvalue">默认值</label>
</dt>
<dd class="opt">
<textarea rows="5" cols="60" id="dfvalue" name="dfvalue" placeholder="如果定义属性类型为下拉框、单选项、多选项时,此处填写被选择的项目(用“,”分开,如“男,女,人妖”)。" style="height:60px;">{$info.dfvalue|default=''}</textarea>
<span class="err"></span>
<p class="notic">如果定义属性类型为下拉框、单选项、多选项时,此处填写被选择的项目(用“,”分开,如“男,女,人妖”)。</p>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label>字段状态</label>
</dt>
<dd class="opt">
<label class="curpoin">
<input type="radio" name="is_hidden" value="0" {if condition="empty($info.is_hidden)"} checked="checked"{/if}/>开启
</label>
<label class="curpoin">
<input type="radio" name="is_hidden" value="1" {if condition="!empty($info.is_hidden)"} checked="checked"{/if}/>关闭
</label>
<p class="notic"></p>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label>字段必填</label>
</dt>
<dd class="opt">
<label class="curpoin">
<input type="radio" name="is_required" value="1" {if condition="!empty($info.is_required)"} checked="checked"{/if}/>是
</label>
<label class="curpoin">
<input type="radio" name="is_required" value="0" {if condition="empty($info.is_required)"} checked="checked"{/if}/>否
</label>
<p class="notic">只针对前台的会员属性有效。</p>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label>注册显示</label>
</dt>
<dd class="opt">
<label class="curpoin">
<input type="radio" name="is_reg" value="1" {if condition="!empty($info.is_reg)"} checked="checked"{/if}/>是
</label>
<label class="curpoin">
<input type="radio" name="is_reg" value="0" {if condition="empty($info.is_reg)"} checked="checked"{/if}/>否
</label>
<p class="notic">只针对前台的会员属性有效。</p>
</dd>
</dl>
</div>
<!-- 常规选项 -->
<div class="ncap-form-default">
<div class="bot">
<input type="hidden" name="id" id="id" value="{$info.para_id|default=''}">
<a href="JavaScript:void(0);" onclick="check_submit();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
</div>
</div>
</form>
</div>
<script type="text/javascript">
$(function(){
dtype_change($('#dtype'));
$('#dtype').change(function(){
dtype_change(this);
});
function dtype_change(obj){
var dtype = $(obj).val();
var ifoption = $(obj).find('option:selected').data('ifoption');
if (0 <= $.inArray(dtype, ['datetime','switch','img','imgs','file'])) {
$('#dl_dfvalue').hide();
} else {
if (1 == ifoption) {
$('#label_dfvalue').html('<em>*</em>默认值');
} else {
$('#label_dfvalue').html('默认值');
}
$('#dl_dfvalue').show();
}
}
});
var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
function check_submit(){
if($('input[name="title"]').val() == ''){
showErrorMsg('属性标题不能为空!');
$('input[name=title]').focus();
return false;
}
if($('#dtype').val() == ''){
showErrorMsg('请选择属性类型!');
$('input[name=dtype]').focus();
return false;
} else {
var ifoption = $('#dtype').find('option:selected').data('ifoption');
if (1 == ifoption) {
if ($.trim($('#dfvalue').val()) == '') {
showErrorMsg('默认值不能为空!');
$('#dfvalue').focus();
return false;
}
}
}
if($('#dtype').val() == 'radio' || $('#dtype').val() == 'checkbox' || $('#dtype').val() == 'select'){
var data = $.trim($('#dfvalue').val());
data = data.split(',');
for(var i = 0;i < data.length ;i++) {
for(var j = i+1;j < data.length;j++) {
if ($.trim(data[i]) == $.trim(data [j])){
showErrorMsg('默认值不能含有相同的值!');
$('textarea[name=dfvalue]').focus();
return false;
}
}
}
}
layer_loading('正在处理');
$.ajax({
type : 'post',
url : "{:url('Member/attr_edit', ['_ajax'=>1])}",
data : $('#post_form').serialize(),
dataType : 'json',
success : function(res){
layer.closeAll();
if(res.code == 1){
var _parent = parent;
_parent.layer.close(parentObj);
_parent.layer.msg(res.msg, {shade: layer_shade, time: 1000}, function(){
_parent.window.location.reload();
});
}else{
showErrorMsg(res.msg);
}
},
error: function(e){
layer.closeAll();
layer.alert(e.responseText, {icon: 5, title:false});
}
});
}
</script>
{include file="public/footer" /}