264 lines
15 KiB
HTML
Executable File
264 lines
15 KiB
HTML
Executable File
<!-- Content Wrapper. Contains page content -->
|
|
<div class="content-wrapper">
|
|
<!-- Content Header (Page header) -->
|
|
<section class="content-header">
|
|
<h1>
|
|
编辑会员
|
|
</h1>
|
|
<ol class="breadcrumb">
|
|
<li><a href="<?php echo url('/admin');?>"><i class="fa fa-dashboard"></i> 首页</a></li>
|
|
<li><a href="<?php echo url('/admin/customer/lists');?>"> 会员列表</a></li>
|
|
<li class="active"> 会员</li>
|
|
</ol>
|
|
</section>
|
|
|
|
<!-- Main content -->
|
|
<section class="content">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<form class="form-horizontal" action="<?php echo url('/admin/customer/update');?>" method="post">
|
|
<div class="nav-tabs-custom">
|
|
<ul class="nav nav-tabs">
|
|
<li class="active">
|
|
<a data-toggle="tab" href="#tabfirst">基本信息</a>
|
|
</li>
|
|
<li>
|
|
<a data-toggle="tab" href="#tabsecond">会员头像</a>
|
|
</li>
|
|
</ul>
|
|
<div class="tab-content">
|
|
<!-- /.tab-pane -->
|
|
<div class="tab-pane active" id="tabfirst">
|
|
|
|
<div class="form-group">
|
|
<label for="group_id" class="col-sm-2 control-label">会员组</label>
|
|
<div class="col-sm-5">
|
|
<select class="form-control" name="group_id" id="group_id">
|
|
<option value="0">请选择所属组</option>
|
|
<?php echo $groupOption;?>
|
|
</select>
|
|
</div>
|
|
<div class="col-sm-5">
|
|
<span class="help-block">(会员组)</span>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="email" class="col-sm-2 control-label">电子邮箱</label>
|
|
<div class="col-sm-5">
|
|
<input type="text" class="form-control" name="email" id="email" required value="<?php echo $customer['email'];?>">
|
|
</div>
|
|
<div class="col-sm-5">
|
|
<span class="help-block">(电子邮箱)</span>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="telephone" class="col-sm-2 control-label">电话</label>
|
|
<div class="col-sm-5">
|
|
<input type="text" class="form-control" name="telephone" id="telephone" required value="<?php echo $customer['telephone'];?>">
|
|
</div>
|
|
<div class="col-sm-5">
|
|
<span class="help-block">(电话)</span>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="firstname" class="col-sm-2 control-label">会员名称<em style="color:red;">*</em></label>
|
|
<div class="col-sm-5">
|
|
<input type="text" class="form-control" name="firstname" id="firstname" required value="<?php echo $customer['firstname'];?>">
|
|
<input type="hidden" name="lastname" id="lastname" value="<?php echo $customer['lastname'];?>">
|
|
</div>
|
|
<div class="col-sm-5">
|
|
<span class="help-block">(会员名称)</span>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="newsletter" class="col-sm-2 control-label">性别</label>
|
|
<div class="col-sm-5">
|
|
<label class="radio-inline">
|
|
<input type="radio" name="sex" value="男" <?php if($customer['sex']=='男'):?>checked<?php endif;?>> 男
|
|
</label>
|
|
<label class="radio-inline">
|
|
<input type="radio" name="sex" value="女" <?php if($customer['sex']=='女'):?>checked<?php endif;?>> 女
|
|
</label>
|
|
</div>
|
|
<div class="col-sm-5">
|
|
<span class="help-block">(性别)</span>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="qq" class="col-sm-2 control-label">QQ</label>
|
|
<div class="col-sm-5">
|
|
<input type="text" class="form-control" name="qq" value="<?php echo $customer['qq']; ?>">
|
|
</div>
|
|
<div class="col-sm-5">
|
|
<span class="help-block">(QQ)</span>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="birthday" class="col-sm-2 control-label">生日</label>
|
|
<div class="col-sm-5">
|
|
<input type="date" class="form-control" name="birthday" value="<?php echo $customer['birthday']; ?>">
|
|
</div>
|
|
<div class="col-sm-5">
|
|
<span class="help-block">(生日)</span>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="hangye" class="col-sm-2 control-label">行业</label>
|
|
<div class="col-sm-5">
|
|
<select class="form-control" name="hangye">
|
|
<?php foreach ($hangye as $hy): ?>
|
|
<option value="<?php echo $hy; ?>" <?php if ($hy == $customer['hangye']): ?>selected="selected"<?php endif; ?>><?php echo $hy; ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
<div class="col-sm-5">
|
|
<span class="help-block">(行业)</span>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="zhiye" class="col-sm-2 control-label">职业</label>
|
|
<div class="col-sm-5">
|
|
<select class="form-control" name="zhiye">
|
|
<?php foreach ($zhiye as $zy): ?>
|
|
<option value="<?php echo $zy; ?>" <?php if ($zy == $customer['zhiye']): ?>selected="selected"<?php endif; ?>><?php echo $zy; ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
<div class="col-sm-5">
|
|
<span class="help-block">(职业)</span>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="stat" class="col-sm-2 control-label">状态</label>
|
|
<div class="col-sm-5">
|
|
<label class="radio-inline">
|
|
<input type="radio" name="stat" value="0" <?php if(!$customer['stat']):?>checked<?php endif;?>> 启用
|
|
</label>
|
|
<label class="radio-inline">
|
|
<input type="radio" name="stat" value="1" <?php if($customer['stat']):?>checked<?php endif;?>> 禁用
|
|
</label>
|
|
</div>
|
|
<div class="col-sm-5">
|
|
<span class="help-block">(状态)</span>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="safe" class="col-sm-2 control-label">安全</label>
|
|
<div class="col-sm-5">
|
|
<label class="radio-inline">
|
|
<input type="radio" name="safe" value="1" <?php if($customer['safe']):?>checked<?php endif;?>> 是
|
|
</label>
|
|
<label class="radio-inline">
|
|
<input type="radio" name="safe" value="0" <?php if(!$customer['safe']):?>checked<?php endif;?>> 否
|
|
</label>
|
|
</div>
|
|
<div class="col-sm-5">
|
|
<span class="help-block">(安全)</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="tab-pane" id="tabsecond">
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label">头像</label>
|
|
<div class="col-sm-10">
|
|
<div class="table-responsive">
|
|
<table class="table">
|
|
<tbody>
|
|
<tr>
|
|
<td class="text-left">
|
|
<a href="javascript:void(0);" id="thumb-image" data-toggle="image" data-folder="user" class="img-thumbnail"><img class="img-responsive" src="<?php echo empty($customer['picture'])?'/uploads/nopic.jpg':$customer['picture'];?>"/></a>
|
|
<input type="hidden" name="picture" value="<?php echo $customer['picture'];?>" id="input-image" />
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<!-- <div class="col-sm-5">
|
|
<span class="help-block">(主要图片)</span>
|
|
</div>-->
|
|
</div>
|
|
</div>
|
|
<!-- /.tab-pane -->
|
|
</div>
|
|
<!-- /.tab-content -->
|
|
<div class="nav-footer row">
|
|
<input type="hidden" name="id" value="<?php echo $customer['id'];?>">
|
|
<div class="col-sm-2 col-sm-offset-2">
|
|
<p><button id="reset-btn" type="button" class="btn btn-warning btn-block">重置</button></p>
|
|
</div>
|
|
<div class="col-sm-2">
|
|
<p><button id="submit-btn" type="submit" class="btn btn-danger btn-block">提交</button></p>
|
|
</div>
|
|
<!-- /. row -->
|
|
</div>
|
|
</div>
|
|
<!-- /.nav-tabs-custom -->
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<!-- /.content -->
|
|
</div>
|
|
<!-- /.content-wrapper -->
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
</script>
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
$("form.form-horizontal").submit(function(e) {
|
|
var groupIDObj = document.getElementById('group_id');
|
|
if (isNaN(groupIDObj.value) || parseInt(groupIDObj.value) < 1) {
|
|
alert('组值无效');
|
|
groupIDObj.focus();
|
|
return false;
|
|
}
|
|
var emailObj = document.getElementById('email');
|
|
if (!validEmail(emailObj.value)) {
|
|
alert('电子邮箱格式不正确');
|
|
emailObj.focus();
|
|
return false;
|
|
}
|
|
var telephoneObj = document.getElementById('telephone');
|
|
if (!isTelephone(telephoneObj.value)) {
|
|
alert('电话格式不正确');
|
|
telephoneObj.focus();
|
|
return false;
|
|
}
|
|
var nameObj = document.getElementById('firstname');
|
|
if (isNull(nameObj.value)) {
|
|
alert('名称必须填写');
|
|
nameObj.focus();
|
|
return false;
|
|
}
|
|
var passwordObj = document.getElementById('password');
|
|
if (isNull(passwordObj.value) || passwordObj.value.length < 6) {
|
|
alert('用户密码不能少于6位');
|
|
passwordObj.focus();
|
|
return false;
|
|
}
|
|
var repasswordObj = document.getElementById('repassword');
|
|
if (isNull(repasswordObj.value) || repasswordObj.value.length < 6) {
|
|
alert('确认密码不能少于6位');
|
|
repasswordObj.focus();
|
|
return false;
|
|
}
|
|
if (repasswordObj.value !== passwordObj.value) {
|
|
repasswordObj.focus();
|
|
alert('用户密码和确认密码不相同');
|
|
return false;
|
|
}
|
|
// var agree = $("input[name='agree']", this).prop('checked');
|
|
// if (agree) {
|
|
// //alert("Submitted");
|
|
// //e.preventDefault();
|
|
// } else {
|
|
// e.preventDefault();
|
|
// alert("Submit prevented");
|
|
// }
|
|
});
|
|
});
|
|
</script> |