init
This commit is contained in:
198
app/admin/view/user/add.html
Executable file
198
app/admin/view/user/add.html
Executable file
@@ -0,0 +1,198 @@
|
||||
<!-- 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/lists');?>"> 用户列表</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 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/create');?>" 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" required>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(用户名)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="col-sm-2 control-label">用户密码</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control" name="password" id="password" 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="text" 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">
|
||||
<label for="email" class="col-sm-2 control-label">电子邮箱</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control" name="email">
|
||||
</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" checked> 启用
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="stat" value="-1"> 禁用
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(状态)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="role_id" class="col-sm-2 control-label">角色</label>
|
||||
<div class="col-sm-5">
|
||||
<select class="form-control" name="role_id" id="role_id">
|
||||
<option value="0" selected="">默认值</option>
|
||||
<?php echo $roleOption;?>
|
||||
</select>
|
||||
</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="admin">
|
||||
</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 src="/backend/adminlte/images/tool-160x160.jpg" />
|
||||
</a>
|
||||
<input type="hidden" name="picture" value="" 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">
|
||||
<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">
|
||||
<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>
|
||||
<!-- /.tab-content -->
|
||||
</div>
|
||||
<!-- /.nav-tabs-custom -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<!-- /.content-wrapper -->
|
||||
|
||||
<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 roleIDObj = document.getElementById('role_id');
|
||||
if (isNaN(roleIDObj.value) || !parseInt(roleIDObj.value)) {
|
||||
alert('角色值无效');
|
||||
roleIDObj.focus();
|
||||
return false;
|
||||
}
|
||||
var passwordObj = document.getElementById('password');
|
||||
if (isNull(passwordObj.value) || passwordObj.value.length < 6) {
|
||||
alert('新密码不能少于6位');
|
||||
passwordObj.focus();
|
||||
return false;
|
||||
}
|
||||
if (!(passwordObj.value.match(/\d/) && passwordObj.value.match(/[a-zA-Z_-]/))) {
|
||||
alert("您输入的密码至少包含有数字和字母!");
|
||||
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("请勾选确认");
|
||||
// }
|
||||
});
|
||||
});
|
||||
</script>
|
||||
258
app/admin/view/user/edit.html
Executable file
258
app/admin/view/user/edit.html
Executable file
@@ -0,0 +1,258 @@
|
||||
<!-- 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/lists');?>"> 用户列表</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/update');?>" 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" required 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 for="stat" class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-5">
|
||||
<label class="radio-inline">
|
||||
<input name="stat" type="radio" value="0" <?php if($user['stat']==0):?>checked="checked"<?php endif;?>> 启用
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input name="stat" type="radio" value="-1" <?php if($user['stat']==-1):?>checked="checked"<?php endif;?>> 禁用
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(状态)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="role_id" class="col-sm-2 control-label">角色</label>
|
||||
<div class="col-sm-5">
|
||||
<select class="form-control" name="role_id" id="role_id">
|
||||
<option value="0" selected="">默认值</option>
|
||||
<?php echo $roleOption;?>
|
||||
</select>
|
||||
</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">
|
||||
<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">
|
||||
<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>
|
||||
|
||||
<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 roleIDObj = document.getElementById('role_id');
|
||||
if (isNaN(roleIDObj.value) || !parseInt(roleIDObj.value)) {
|
||||
alert('角色值无效');
|
||||
roleIDObj.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>
|
||||
111
app/admin/view/user/lists.html
Executable file
111
app/admin/view/user/lists.html
Executable file
@@ -0,0 +1,111 @@
|
||||
<!-- Content Wrapper. Contains page content -->
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
用户管理
|
||||
<small>用户列表</small>
|
||||
</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/lists');?>"> 用户</a></li>
|
||||
<li class="active"> 用户列表</li>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">用户列表</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" class="form-control pull-right" id="list-search-in" placeholder="Search Name" value="<?php echo $search['skeyword'];?>">
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" id="list-search-btn"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-tools -->
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body no-padding">
|
||||
<?php if(!empty($list)):?>
|
||||
<div class="table-responsive lists-table">
|
||||
<table class="table table-hover table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th width="35rem"> </th>
|
||||
<th>ID</th>
|
||||
<th>用户名</th>
|
||||
<th>最后登录时间</th>
|
||||
<th>最后登录IP</th>
|
||||
<th class="text-center">状态</th>
|
||||
<th class="text-center">角色</th>
|
||||
<th class="text-center">邮箱</th>
|
||||
<th class="text-center">更新时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
<?php foreach($list as $k=>$user):?>
|
||||
<tr>
|
||||
<td class="center hidden-480"><input type="checkbox" name="ids[]" value="<?php echo $user['id'];?>"></td>
|
||||
<td><?php echo $user['id'];?></td>
|
||||
<td><a href="<?php echo url('/admin/user/edit',['id'=>$user['id']]);?>"><?php echo $user['username'];?></a></td>
|
||||
<td><?php echo date('Y-m-d H:i:s',$user['last_login_time']);?></td>
|
||||
<td><?php echo $user['last_login_ip'];?></td>
|
||||
<td class="text-center"><?php echo array_switch(array('-2' => '<label style="color:red;">删除</label>', '-1' => '<label style="color:blue;">禁用</label>', '0' => '<label style="color:green;">启用</label>','1' => '未审核'),$user['stat']);?></td>
|
||||
<td class="text-center"><?php echo $user['role'];?></td>
|
||||
<td class="text-center"><?php echo $user['email'];?></td>
|
||||
<td class="text-center"><?php echo date('Y-m-d H:i:s',$user['last_update_time']);?></td>
|
||||
<td>
|
||||
<a class="btn btn-xs btn-info" href="<?php echo url('/admin/user/edit',['id'=>$user['id']]);?>">编辑</a>
|
||||
<a class="btn btn-xs btn-info" data-id="<?php echo $user['id'];?>" data-url="<?php echo url('/admin/user/delete');?>" data-cod="dowarn">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- /.table -->
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<!-- /.lists-table -->
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
<div class="box-footer no-padding">
|
||||
<div class="mailbox-controls row">
|
||||
<div class="col-sm-6">
|
||||
<button type="button" class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></button>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default btn-sm" data-url="<?php echo url('/admin/user/deletes');?>" data-cod="batch">删除</button>
|
||||
<button type="button" class="btn btn-default btn-sm" data-cod="refresh">刷新</button>
|
||||
</div>
|
||||
<!-- /.btn-group -->
|
||||
<a href="<?php echo url('/admin/user/add');?>" class="btn btn-default btn-sm">添加</a>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="pull-right">
|
||||
<?php if($page):?>
|
||||
<?php echo $page;?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<!-- /.pull-right -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<!-- /.content-wrapper -->
|
||||
<!--<style>
|
||||
.table-responsive .table tbody > tr > th,.table-responsive .table thead > tr > td, .table-responsive .table tbody > tr > td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>-->
|
||||
<!-- Page Script -->
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
|
||||
});
|
||||
</script>
|
||||
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