init
This commit is contained in:
215
app/admin/view/user/setting.html
Executable file
215
app/admin/view/user/setting.html
Executable file
@@ -0,0 +1,215 @@
|
||||
<!-- 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/index/index');?>"><i class="fa fa-dashboard"></i> 首页</a></li>
|
||||
<li><a href="<?php echo url('/admin/user/setting');?>"> 个人设置</a></li>
|
||||
<li class="active"> 用户</li>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<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>
|
||||
<li class="pull-right"><a href="" class="text-muted"><i class="fa fa-refresh"></i></a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<!-- /.tab-pane -->
|
||||
<div class="tab-pane active" id="tabfirst">
|
||||
<form class="form-horizontal" action="<?php echo url('/admin/user/setting');?>" method="post">
|
||||
<div class="form-group">
|
||||
<label for="username" class="col-sm-2 control-label">用户名</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control" name="username" id="username" disabled value="<?php echo $user['username'];?>">
|
||||
</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" value="<?php echo $user['email'];?>">
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(电子邮箱)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">头像</label>
|
||||
<div class="col-sm-5">
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-left">
|
||||
<a href="javascript:void(0);" id="thumb-image" data-toggle="image" class="img-thumbnail"><img class="img-responsive" src="<?php echo empty($user['picture'])?'/backend/adminlte/images/tool-160x160.jpg':$user['picture'];?>" /></a>
|
||||
<input type="hidden" name="picture" value="<?php echo $user['picture'];?>" id="input-image" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(头像)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="position" class="col-sm-2 control-label">用户定位</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control" name="position" value="<?php echo $user['position'];?>">
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(用户定位模块)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="reset" class="btn btn-warning">重置</button>
|
||||
<button type="submit" class="btn btn-danger">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane" id="tabsecond">
|
||||
<form class="form-horizontal" method="post" action="<?php echo url('/admin/user/updatepassword');?>">
|
||||
<?php if(!$administrator):?>
|
||||
<div class="form-group">
|
||||
<label for="oldpassword" class="col-sm-2 control-label">原密码</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="password" class="form-control" name="oldpassword" id="oldpassword" required>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(用户密码不能少于6位)</span>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class="form-group">
|
||||
<label for="newpassword" class="col-sm-2 control-label">新密码</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="password" class="form-control" name="newpassword" id="newpassword" required>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(用户密码不能少于6位)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="repassword" class="col-sm-2 control-label">确认密码</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="password" class="form-control" name="repassword" id="repassword" required>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(用户密码不能少于6位)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="agree"> 确认更新
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" name="id" value="<?php echo $user['id'];?>"/>
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="reset" class="btn btn-warning">重置</button>
|
||||
<button type="submit" class="btn btn-danger">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
</div>
|
||||
<!-- /.tab-content -->
|
||||
</div>
|
||||
<!-- /.nav-tabs-custom -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<!-- /.content-wrapper -->
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#tabfirst form.form-horizontal").submit(function(e) {
|
||||
var nameObj = document.getElementById('username');
|
||||
if (isNull(nameObj.value)) {
|
||||
alert('名称必须填写');
|
||||
nameObj.focus();
|
||||
return false;
|
||||
}
|
||||
// var agree = $("input[name='agree']", this).prop('checked');
|
||||
// if (agree) {
|
||||
// //alert("Submitted");
|
||||
// //e.preventDefault();
|
||||
// } else {
|
||||
// e.preventDefault();
|
||||
// alert("请勾选确认");
|
||||
// }
|
||||
});
|
||||
$("#tabsecond form.form-horizontal").submit(function(e) {
|
||||
//<?php if(!$administrator):?>
|
||||
//
|
||||
var oldpasswordObj = document.getElementById('oldpassword');
|
||||
if (isNull(oldpasswordObj.value) || oldpasswordObj.value.length < 6) {
|
||||
alert('用户密码不能少于6位');
|
||||
oldpasswordObj.focus();
|
||||
return false;
|
||||
}
|
||||
//<?php endif;?>
|
||||
//
|
||||
var newpasswordObj = document.getElementById('newpassword');
|
||||
if (isNull(newpasswordObj.value) || newpasswordObj.value.length < 6) {
|
||||
alert('新密码不能少于6位');
|
||||
newpasswordObj.focus();
|
||||
return false;
|
||||
}
|
||||
if (!(newpasswordObj.value.match(/\d/) && newpasswordObj.value.match(/[a-zA-Z]/))) {
|
||||
alert("您输入的密码至少包含有数字和字母!");
|
||||
newpasswordObj.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 !== newpasswordObj.value) {
|
||||
repasswordObj.focus();
|
||||
alert('新密码和确认密码不相同');
|
||||
return false;
|
||||
}
|
||||
var agree = $("input[name='agree']", this).prop('checked');
|
||||
if (agree) {
|
||||
//alert("Submitted");
|
||||
//e.preventDefault();
|
||||
} else {
|
||||
e.preventDefault();
|
||||
alert("请勾选确认");
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user