林一峰
8 years ago
46 changed files with 921 additions and 114 deletions
-
6app/Common/function.php
-
4app/Http/Controllers/Admin/ArticleController.php
-
19app/Http/Controllers/Admin/CategoryController.php
-
2app/Http/Controllers/Admin/FriendlinkController.php
-
83app/Http/Controllers/Admin/MenuController.php
-
4app/Http/Controllers/Admin/ProductController.php
-
20app/Http/Controllers/Admin/ProducttypeController.php
-
72app/Http/Controllers/Admin/UserController.php
-
80app/Http/Controllers/Admin/UserRoleController.php
-
8app/Http/Controllers/Home/IndexController.php
-
4resources/views/admin/article/add.blade.php
-
4resources/views/admin/article/edit.blade.php
-
6resources/views/admin/article/index.blade.php
-
4resources/views/admin/category/add.blade.php
-
2resources/views/admin/category/edit.blade.php
-
4resources/views/admin/category/index.blade.php
-
7resources/views/admin/common/leftmenu.blade.php
-
2resources/views/admin/friendlink/index.blade.php
-
2resources/views/admin/guestbook/index.blade.php
-
2resources/views/admin/keyword/index.blade.php
-
91resources/views/admin/menu/add.blade.php
-
95resources/views/admin/menu/edit.blade.php
-
30resources/views/admin/menu/index.blade.php
-
4resources/views/admin/product/add.blade.php
-
8resources/views/admin/product/edit.blade.php
-
6resources/views/admin/product/index.blade.php
-
4resources/views/admin/producttype/add.blade.php
-
2resources/views/admin/producttype/edit.blade.php
-
2resources/views/admin/producttype/index.blade.php
-
2resources/views/admin/searchword/index.blade.php
-
2resources/views/admin/slide/index.blade.php
-
2resources/views/admin/sysconfig/index.blade.php
-
2resources/views/admin/tag/index.blade.php
-
68resources/views/admin/user/add.blade.php
-
83resources/views/admin/user/edit.blade.php
-
58resources/views/admin/user/edit222.blade.php
-
24resources/views/admin/user/index.blade.php
-
65resources/views/admin/userrole/add.blade.php
-
65resources/views/admin/userrole/edit.blade.php
-
30resources/views/admin/userrole/index.blade.php
-
4resources/views/home/common/header.blade.php
-
2resources/views/home/index/category.blade.php
-
4resources/views/home3/common/header.blade.php
-
4resources/views/home3/index/product.blade.php
-
6resources/views/home3/index/productcat.blade.php
-
37routes/web.php
@ -0,0 +1,83 @@ |
|||
<?php |
|||
namespace App\Http\Controllers\Admin; |
|||
|
|||
use App\Http\Controllers\Admin\CommonController; |
|||
use DB; |
|||
|
|||
class MenuController extends CommonController |
|||
{ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
} |
|||
|
|||
public function index() |
|||
{ |
|||
$posts = parent::pageList('menu'); |
|||
|
|||
$data['posts'] = $posts; |
|||
|
|||
return view('admin.menu.index', $data); |
|||
} |
|||
|
|||
public function add() |
|||
{ |
|||
$data['menu'] = category_tree(get_category('menu',0)); |
|||
|
|||
return view('admin.menu.add', $data); |
|||
} |
|||
|
|||
public function doadd() |
|||
{ |
|||
unset($_POST["_token"]); |
|||
if(DB::table('menu')->insert($_POST)) |
|||
{ |
|||
success_jump('添加成功!', route('admin_menu')); |
|||
} |
|||
else |
|||
{ |
|||
error_jump('添加失败!请修改后重新添加'); |
|||
} |
|||
} |
|||
|
|||
public function edit() |
|||
{ |
|||
if(!empty($_GET["id"])){$id = $_GET["id"];}else{$id="";} |
|||
if(preg_match('/[0-9]*/',$id)){}else{exit;} |
|||
|
|||
$data['id'] = $id; |
|||
$data['post'] = object_to_array(DB::table('menu')->where('id', $id)->first(), 1); |
|||
$data['menu'] = category_tree(get_category('menu',0)); |
|||
|
|||
return view('admin.menu.edit', $data); |
|||
} |
|||
|
|||
public function doedit() |
|||
{ |
|||
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else {$id="";exit;} |
|||
|
|||
unset($_POST["_token"]); |
|||
if(DB::table('menu')->where('id', $id)->update($_POST)) |
|||
{ |
|||
success_jump('修改成功!', route('admin_menu')); |
|||
} |
|||
else |
|||
{ |
|||
error_jump('修改失败!'); |
|||
} |
|||
} |
|||
|
|||
public function del() |
|||
{ |
|||
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');} |
|||
|
|||
if(DB::table('menu')->whereIn("id", explode(',', $id))->delete()) |
|||
{ |
|||
success_jump('删除成功'); |
|||
} |
|||
else |
|||
{ |
|||
error_jump('删除失败!请重新提交'); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,80 @@ |
|||
<?php |
|||
namespace App\Http\Controllers\Admin; |
|||
|
|||
use App\Http\Controllers\Admin\CommonController; |
|||
use DB; |
|||
|
|||
class UserRoleController extends CommonController |
|||
{ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
} |
|||
|
|||
public function index() |
|||
{ |
|||
$posts = parent::pageList('user_role', '', ['listorder','desc']); |
|||
|
|||
$data['posts'] = $posts; |
|||
|
|||
return view('admin.userrole.index', $data); |
|||
} |
|||
|
|||
public function add() |
|||
{ |
|||
return view('admin.userrole.add'); |
|||
} |
|||
|
|||
public function doadd() |
|||
{ |
|||
unset($_POST["_token"]); |
|||
if(DB::table('user_role')->insert($_POST)) |
|||
{ |
|||
success_jump('添加成功!', route('admin_userrole')); |
|||
} |
|||
else |
|||
{ |
|||
error_jump('添加失败!请修改后重新添加'); |
|||
} |
|||
} |
|||
|
|||
public function edit() |
|||
{ |
|||
if(!empty($_GET["id"])){$id = $_GET["id"];}else{$id="";} |
|||
if(preg_match('/[0-9]*/',$id)){}else{exit;} |
|||
|
|||
$data['id'] = $id; |
|||
$data['post'] = object_to_array(DB::table('user_role')->where('id', $id)->first(), 1); |
|||
|
|||
return view('admin.userrole.edit', $data); |
|||
} |
|||
|
|||
public function doedit() |
|||
{ |
|||
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else {$id="";exit;} |
|||
|
|||
unset($_POST["_token"]); |
|||
if(DB::table('user_role')->where('id', $id)->update($_POST)) |
|||
{ |
|||
success_jump('修改成功!', route('admin_userrole')); |
|||
} |
|||
else |
|||
{ |
|||
error_jump('修改失败!'); |
|||
} |
|||
} |
|||
|
|||
public function del() |
|||
{ |
|||
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');} |
|||
|
|||
if(DB::table('user_role')->whereIn("id", explode(',', $id))->delete()) |
|||
{ |
|||
success_jump('删除成功'); |
|||
} |
|||
else |
|||
{ |
|||
error_jump('删除失败!请重新提交'); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,91 @@ |
|||
<!DOCTYPE html><html><head><title>菜单添加_后台管理</title>@include('admin.common.header') |
|||
<div class="container-fluid"> |
|||
<div class="row"> |
|||
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 --> |
|||
|
|||
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox"> |
|||
<h5 class="sub-header"><a href="/fladmin/menu">菜单列表</a> > 菜单添加</h5> |
|||
|
|||
<form id="addarc" method="post" action="/fladmin/menu/doadd" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }} |
|||
<table class="table table-striped table-bordered"> |
|||
<tbody> |
|||
<tr> |
|||
<td align="right">上级:</td> |
|||
<td> |
|||
<select name="pid" id="pid"> |
|||
<option value="0">顶级菜单</option> |
|||
<?php if($menu){foreach($menu as $row){ ?>
|
|||
<option value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "—";}echo $row["name"]; ?></option>
|
|||
<?php }} ?>
|
|||
</select> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">名称:</td> |
|||
<td><input name="name" type="text" id="name" value="" class="required" style="width:30%" placeholder="在此输入菜单名称"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">操作方法:</td> |
|||
<td><input name="action" type="text" id="action" value="" class="required" style="width:30%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">参数:</td> |
|||
<td><input name="data" type="text" id="data" value="" style="width:30%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">图标:</td> |
|||
<td><input name="icon" type="text" id="icon" value="" style="width:30%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">备注:</td> |
|||
<td><input name="des" type="text" id="des" value="" style="width:50%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">状态:</td> |
|||
<td> |
|||
<input type="radio" value='1' name="status" checked /> 显示 |
|||
<input type="radio" value='0' name="status" /> 隐藏 |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">状态:</td> |
|||
<td> |
|||
<input type="radio" value='1' name="type" checked /> 权限认证+菜单 |
|||
<input type="radio" value='0' name="type" /> 只作为菜单<br><small style="color:#999">注意:“权限认证+菜单”表示加入后台权限管理,纯碎是菜单项请不要选择此项。</small> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
</div></div><!-- 右边结束 --></div></div> |
|||
|
|||
<script> |
|||
$(function(){ |
|||
$(".required").blur(function(){ |
|||
var $parent = $(this).parent(); |
|||
$parent.find(".formtips").remove(); |
|||
if(this.value=="") |
|||
{ |
|||
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>'); |
|||
} |
|||
else |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>'); |
|||
} |
|||
}); |
|||
|
|||
//重置
|
|||
$('#addarc input[type="reset"]').click(function(){ |
|||
$(".formtips").remove(); |
|||
}); |
|||
|
|||
$("#addarc").submit(function(){ |
|||
$(".required").trigger('blur'); |
|||
var numError = $('#addarc .onError').length; |
|||
|
|||
if(numError){return false;} |
|||
}); |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -0,0 +1,95 @@ |
|||
<!DOCTYPE html><html><head><title>菜单修改_后台管理</title>@include('admin.common.header') |
|||
<div class="container-fluid"> |
|||
<div class="row"> |
|||
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 --> |
|||
|
|||
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox"> |
|||
<h5 class="sub-header"><a href="/fladmin/menu">菜单列表</a> > 菜单修改</h5> |
|||
|
|||
<form id="addarc" method="post" action="/fladmin/menu/doedit" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }} |
|||
<table class="table table-striped table-bordered"> |
|||
<tbody> |
|||
<tr> |
|||
<td align="right">上级:</td> |
|||
<td> |
|||
<select name="pid" id="pid"> |
|||
<option value="0">顶级菜单</option> |
|||
<?php if($menu){foreach($menu as $row){ ?>
|
|||
<?php if($row["id"]==$post["pid"]){ ?>
|
|||
<option selected value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "—";}echo $row["name"]; ?></option>
|
|||
<?php }else{ ?>
|
|||
<option value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "—";}echo $row["name"]; ?></option>
|
|||
<?php }}} ?>
|
|||
</select> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">名称:</td> |
|||
<td><input name="name" type="text" id="name" value="<?php echo $post["name"]; ?>" class="required" style="width:30%" placeholder="在此输入菜单名称"><input style="display:none;" name="id" type="text" id="id" value="<?php echo $id; ?>"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">操作方法:</td> |
|||
<td><input name="action" type="text" id="action" value="<?php echo $post["action"]; ?>" class="required" style="width:30%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">参数:</td> |
|||
<td><input name="data" type="text" id="data" value="<?php echo $post["data"]; ?>" style="width:30%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">图标:</td> |
|||
<td><input name="icon" type="text" id="icon" value="<?php echo $post["icon"]; ?>" style="width:30%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">备注:</td> |
|||
<td><input name="des" type="text" id="des" value="<?php echo $post["des"]; ?>" style="width:50%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">状态:</td> |
|||
<td> |
|||
<input type="radio" value='1' name="status" <?php if($post['status']==1){echo 'checked';} ?> /> 显示
|
|||
<input type="radio" value='0' name="status" <?php if($post['status']==0){echo 'checked';} ?> /> 隐藏
|
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">状态:</td> |
|||
<td> |
|||
<input type="radio" value='1' name="type" <?php if($post['type']==1){echo 'checked';} ?> /> 权限认证+菜单
|
|||
<input type="radio" value='0' name="type" <?php if($post['type']==0){echo 'checked';} ?> /> 只作为菜单
|
|||
<br><small style="color:#999">注意:“权限认证+菜单”表示加入后台权限管理,纯碎是菜单项请不要选择此项。</small> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
</div></div><!-- 右边结束 --></div></div> |
|||
|
|||
<script> |
|||
$(function(){ |
|||
$(".required").blur(function(){ |
|||
var $parent = $(this).parent(); |
|||
$parent.find(".formtips").remove(); |
|||
if(this.value=="") |
|||
{ |
|||
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>'); |
|||
} |
|||
else |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>'); |
|||
} |
|||
}); |
|||
|
|||
//重置
|
|||
$('#addarc input[type="reset"]').click(function(){ |
|||
$(".formtips").remove(); |
|||
}); |
|||
|
|||
$("#addarc").submit(function(){ |
|||
$(".required").trigger('blur'); |
|||
var numError = $('#addarc .onError').length; |
|||
|
|||
if(numError){return false;} |
|||
}); |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -0,0 +1,30 @@ |
|||
<!DOCTYPE html><html><head><title>菜单管理_后台管理</title>@include('admin.common.header') |
|||
<div class="container-fluid"> |
|||
<div class="row"> |
|||
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 --> |
|||
|
|||
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox"> |
|||
<h2 class="sub-header">菜单管理</h2>[ <a href="/fladmin/menu/add">菜单添加</a> ]<br><br> |
|||
|
|||
<form name="listarc"><div class="table-responsive"><table class="table table-striped table-hover"> |
|||
<thead><tr> |
|||
<th>ID</th> |
|||
<th>菜单名称</th> |
|||
<th>操作方法</th> |
|||
<th>状态</th> |
|||
<th>管理</th> |
|||
</tr></thead> |
|||
<tbody> |
|||
<?php foreach($posts as $row){ ?><tr>
|
|||
<td><?php echo $row->id; ?></td>
|
|||
<td><?php echo $row->name; ?></td>
|
|||
<td><?php echo $row->action; ?></td>
|
|||
<td><?php if($row->status==1){echo '显示';}else{echo '隐藏';} ?></td>
|
|||
<td><a href="/fladmin/menu/edit?id=<?php echo $row->id; ?>">修改</a> | <a onclick="delconfirm('/fladmin/menu/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a></td> |
|||
</tr><?php } ?>
|
|||
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 --> |
|||
|
|||
<nav aria-label="Page navigation">{{ $posts->links() }}</nav> |
|||
|
|||
</div></div><!-- 右边结束 --></div></div> |
|||
</body></html> |
@ -0,0 +1,68 @@ |
|||
<!DOCTYPE html><html><head><title>管理员添加_后台管理</title>@include('admin.common.header') |
|||
<div class="container-fluid"> |
|||
<div class="row"> |
|||
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 --> |
|||
|
|||
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox"> |
|||
<h5 class="sub-header"><a href="/fladmin/user">管理员列表</a> > 管理员添加</h5> |
|||
|
|||
<form id="addarc" method="post" action="/fladmin/user/doadd" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }} |
|||
<table class="table table-striped table-bordered"> |
|||
<tbody> |
|||
<tr> |
|||
<td align="right">用户名:</td> |
|||
<td><input name="username" type="text" id="username" value="" class="required" style="width:30%" placeholder="在此输入用户名"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">密码:</td> |
|||
<td><input name="pwd" type="password" id="pwd" value="" class="required" style="width:60%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">邮箱:</td> |
|||
<td><input name="email" type="text" id="email" value="" style="width:60%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">角色:</td> |
|||
<td> |
|||
<select name="role_id" id="role_id"> |
|||
<?php if($rolelist){foreach($rolelist as $row){ ?>
|
|||
<option value="<?php echo $row["id"]; ?>"><?php echo $row["name"]; ?></option>
|
|||
<?php }} ?>
|
|||
</select> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
</div></div><!-- 右边结束 --></div></div> |
|||
|
|||
<script> |
|||
$(function(){ |
|||
$(".required").blur(function(){ |
|||
var $parent = $(this).parent(); |
|||
$parent.find(".formtips").remove(); |
|||
if(this.value=="") |
|||
{ |
|||
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>'); |
|||
} |
|||
else |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>'); |
|||
} |
|||
}); |
|||
|
|||
//重置
|
|||
$('#addarc input[type="reset"]').click(function(){ |
|||
$(".formtips").remove(); |
|||
}); |
|||
|
|||
$("#addarc").submit(function(){ |
|||
$(".required").trigger('blur'); |
|||
var numError = $('#addarc .onError').length; |
|||
|
|||
if(numError){return false;} |
|||
}); |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -1,58 +1,71 @@ |
|||
<!DOCTYPE html><html><head><title>密码修改_后台管理</title>@include('admin.common.header') |
|||
<!DOCTYPE html><html><head><title>管理员修改_后台管理</title>@include('admin.common.header') |
|||
<div class="container-fluid"> |
|||
<div class="row"> |
|||
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 --> |
|||
<style>.input-error{background-color:#ffe7e7;}</style>
|
|||
|
|||
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox"> |
|||
<h2 class="sub-header">密码修改</h2> |
|||
<form id="addarc" method="post" action="/fladmin/user/doedit" class="table-responsive" role="form">{{ csrf_field() }} |
|||
<h5 class="sub-header"><a href="/fladmin/user">管理员列表</a> > 管理员修改</h5> |
|||
|
|||
<form id="addarc" method="post" action="/fladmin/user/doedit" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }} |
|||
<table class="table table-striped table-bordered"> |
|||
<tbody> |
|||
<tr> |
|||
<td align="right">用户名:</td> |
|||
<td><input name="username" type="text" class="" id="username" value="<?php echo $post["username"]; ?>" style="width:30%"></td> |
|||
<td><input name="username" type="text" id="username" value="<?php echo $post["username"]; ?>" class="required" style="width:30%" placeholder="在此输入用户名"><input style="display:none;" type="text" name="id" id="id" value="<?php echo $id; ?>"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">旧密码:</td> |
|||
<td><input name="oldpwd" type="password" class="" id="oldpwd" value="" style="width:30%"></td> |
|||
<td align="right">密码:</td> |
|||
<td><input name="pwd" type="password" id="pwd" value="" class="required" style="width:30%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">新密码:</td> |
|||
<td><input name="newpwd" type="password" class="" id="newpwd" value="" style="width:30%"></td> |
|||
<td align="right">邮箱:</td> |
|||
<td><input name="email" type="text" id="email" value="<?php echo $post["email"]; ?>" style="width:30%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">确认密码:</td> |
|||
<td><input name="newpwd2" type="password" class="" id="newpwd2" value="" style="width:30%"></td> |
|||
<td align="right">角色:</td> |
|||
<td> |
|||
<select name="role_id" id="role_id"> |
|||
<?php if($rolelist){foreach($rolelist as $row){ ?>
|
|||
<?php if($post["role_id"]==$row["id"]){ ?>
|
|||
<option selected value="<?php echo $row["id"]; ?>"><?php echo $row["name"]; ?></option>
|
|||
<?php }else{ ?>
|
|||
<option value="<?php echo $row["id"]; ?>"><?php echo $row["name"]; ?></option>
|
|||
<?php }}} ?>
|
|||
</select> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td> |
|||
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
</div></div><!-- 右边结束 --></div></div> |
|||
|
|||
<script> |
|||
$('#addarc input[type="text"], #addarc input[type="password"]').on('focus', function() { |
|||
$(this).removeClass('input-error'); |
|||
}); |
|||
$('#addarc').on('submit', function(e) { |
|||
$(this).find('input[type="text"], input[type="password"]').each(function(){ |
|||
if( $(this).val() == "" ) { |
|||
e.preventDefault(); |
|||
$(this).addClass('input-error'); |
|||
} |
|||
else { |
|||
$(this).removeClass('input-error'); |
|||
} |
|||
}); |
|||
if($('#newpwd').val()!=$('#newpwd2').val() || $('#newpwd').val()=='') |
|||
{ |
|||
e.preventDefault(); |
|||
$('#newpwd').addClass('input-error'); |
|||
$('#newpwd2').addClass('input-error'); |
|||
} |
|||
else { |
|||
$('#newpwd').removeClass('input-error'); |
|||
$('#newpwd2').removeClass('input-error'); |
|||
} |
|||
$(function(){ |
|||
$(".required").blur(function(){ |
|||
var $parent = $(this).parent(); |
|||
$parent.find(".formtips").remove(); |
|||
if(this.value=="") |
|||
{ |
|||
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>'); |
|||
} |
|||
else |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>'); |
|||
} |
|||
}); |
|||
|
|||
//重置
|
|||
$('#addarc input[type="reset"]').click(function(){ |
|||
$(".formtips").remove(); |
|||
}); |
|||
|
|||
$("#addarc").submit(function(){ |
|||
$(".required").trigger('blur'); |
|||
var numError = $('#addarc .onError').length; |
|||
|
|||
if(numError){return false;} |
|||
}); |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -0,0 +1,58 @@ |
|||
<!DOCTYPE html><html><head><title>密码修改_后台管理</title>@include('admin.common.header') |
|||
<div class="container-fluid"> |
|||
<div class="row"> |
|||
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 --> |
|||
<style>.input-error{background-color:#ffe7e7;}</style>
|
|||
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox"> |
|||
<h2 class="sub-header">密码修改</h2> |
|||
<form id="addarc" method="post" action="/fladmin/user/doedit" class="table-responsive" role="form">{{ csrf_field() }} |
|||
<table class="table table-striped table-bordered"> |
|||
<tbody> |
|||
<tr> |
|||
<td align="right">用户名:</td> |
|||
<td><input name="username" type="text" class="" id="username" value="<?php echo $post["username"]; ?>" style="width:30%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">旧密码:</td> |
|||
<td><input name="oldpwd" type="password" class="" id="oldpwd" value="" style="width:30%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">新密码:</td> |
|||
<td><input name="newpwd" type="password" class="" id="newpwd" value="" style="width:30%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">确认密码:</td> |
|||
<td><input name="newpwd2" type="password" class="" id="newpwd2" value="" style="width:30%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
</div></div><!-- 右边结束 --></div></div> |
|||
<script> |
|||
$('#addarc input[type="text"], #addarc input[type="password"]').on('focus', function() { |
|||
$(this).removeClass('input-error'); |
|||
}); |
|||
$('#addarc').on('submit', function(e) { |
|||
$(this).find('input[type="text"], input[type="password"]').each(function(){ |
|||
if( $(this).val() == "" ) { |
|||
e.preventDefault(); |
|||
$(this).addClass('input-error'); |
|||
} |
|||
else { |
|||
$(this).removeClass('input-error'); |
|||
} |
|||
}); |
|||
if($('#newpwd').val()!=$('#newpwd2').val() || $('#newpwd').val()=='') |
|||
{ |
|||
e.preventDefault(); |
|||
$('#newpwd').addClass('input-error'); |
|||
$('#newpwd2').addClass('input-error'); |
|||
} |
|||
else { |
|||
$('#newpwd').removeClass('input-error'); |
|||
$('#newpwd2').removeClass('input-error'); |
|||
} |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -1,12 +1,30 @@ |
|||
<!DOCTYPE html><html><head><title>用户列表_后台管理</title>@include('admin.common.header') |
|||
<!DOCTYPE html><html><head><title>管理员列表_后台管理</title>@include('admin.common.header') |
|||
<div class="container-fluid"> |
|||
<div class="row"> |
|||
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 --> |
|||
|
|||
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox"> |
|||
<h2 class="sub-header">用户管理</h2> |
|||
<h2 class="sub-header">管理员列表</h2>[ <a href="/fladmin/user/add">添加管理员</a> ]<br><br> |
|||
|
|||
<a href="/fladmin/user/edit" class="btn btn-success">修改密码</a> |
|||
<form name="listarc"><div class="table-responsive"><table class="table table-striped table-hover"> |
|||
<thead><tr> |
|||
<th>ID</th> |
|||
<th>用户名</th> |
|||
<th>邮箱</th> |
|||
<th>状态</th> |
|||
<th>管理</th> |
|||
</tr></thead> |
|||
<tbody> |
|||
<?php foreach($posts as $row){ ?><tr>
|
|||
<td><?php echo $row->id; ?></td>
|
|||
<td><?php echo $row->username; ?></td>
|
|||
<td><?php echo $row->email; ?></td>
|
|||
<td><?php if($row->status==0){echo '正常';}elseif($row->status==1){echo '禁用';}elseif($row->status==2){echo '禁用';} ?></td>
|
|||
<td><a href="/fladmin/user/edit?id=<?php echo $row->id; ?>">权限设置</a> | <a href="/fladmin/user/edit?id=<?php echo $row->id; ?>">修改</a> | <a onclick="delconfirm('/fladmin/user/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a></td> |
|||
</tr><?php } ?>
|
|||
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 --> |
|||
|
|||
<nav aria-label="Page navigation">{{ $posts->links() }}</nav> |
|||
|
|||
</div></div><!-- 右边结束 --></div></div> |
|||
</body></html> |
@ -0,0 +1,65 @@ |
|||
<!DOCTYPE html><html><head><title>添加角色_后台管理</title>@include('admin.common.header') |
|||
<div class="container-fluid"> |
|||
<div class="row"> |
|||
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 --> |
|||
|
|||
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox"> |
|||
<h5 class="sub-header"><a href="/fladmin/userrole">角色列表</a> > 添加角色</h5> |
|||
|
|||
<form id="addarc" method="post" action="/fladmin/userrole/doadd" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }} |
|||
<table class="table table-striped table-bordered"> |
|||
<tbody> |
|||
<tr> |
|||
<td align="right">角色名称:</td> |
|||
<td><input name="name" type="text" id="name" value="" class="required" style="width:30%" placeholder="在此输入角色名称"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">角色描述:</td> |
|||
<td><input name="des" type="text" id="des" value="" style="width:60%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">状态:</td> |
|||
<td> |
|||
<input type="radio" value='0' name="status" checked /> 是 |
|||
<input type="radio" value='1' name="status" /> 否 |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">排序:</td> |
|||
<td><input name="listorder" type="text" id="listorder" value="0" style="width:60%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
</div></div><!-- 右边结束 --></div></div> |
|||
|
|||
<script> |
|||
$(function(){ |
|||
$(".required").blur(function(){ |
|||
var $parent = $(this).parent(); |
|||
$parent.find(".formtips").remove(); |
|||
if(this.value=="") |
|||
{ |
|||
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>'); |
|||
} |
|||
else |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>'); |
|||
} |
|||
}); |
|||
|
|||
//重置
|
|||
$('#addarc input[type="reset"]').click(function(){ |
|||
$(".formtips").remove(); |
|||
}); |
|||
|
|||
$("#addarc").submit(function(){ |
|||
$(".required").trigger('blur'); |
|||
var numError = $('#addarc .onError').length; |
|||
|
|||
if(numError){return false;} |
|||
}); |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -0,0 +1,65 @@ |
|||
<!DOCTYPE html><html><head><title>角色修改_后台管理</title>@include('admin.common.header') |
|||
<div class="container-fluid"> |
|||
<div class="row"> |
|||
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 --> |
|||
|
|||
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox"> |
|||
<h5 class="sub-header"><a href="/fladmin/userrole">角色列表</a> > 角色修改</h5> |
|||
|
|||
<form id="addarc" method="post" action="/fladmin/userrole/doedit" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }} |
|||
<table class="table table-striped table-bordered"> |
|||
<tbody> |
|||
<tr> |
|||
<td align="right">角色名称:</td> |
|||
<td><input name="name" type="text" id="name" value="<?php echo $post["name"]; ?>" class="required" style="width:30%" placeholder="在此输入角色名称"><input style="display:none;" name="id" type="text" id="id" value="<?php echo $id; ?>"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">角色描述:</td> |
|||
<td><input name="des" type="text" id="des" value="<?php echo $post["des"]; ?>" style="width:60%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">状态:</td> |
|||
<td> |
|||
<input type="radio" value='0' name="status" <?php if($post['status']==0){echo 'checked';} ?> /> 启用
|
|||
<input type="radio" value='1' name="status" <?php if($post['status']==1){echo 'checked';} ?> /> 禁用
|
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">排序:</td> |
|||
<td><input name="listorder" type="text" id="listorder" value="<?php echo $post["listorder"]; ?>" style="width:60%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
</div></div><!-- 右边结束 --></div></div> |
|||
|
|||
<script> |
|||
$(function(){ |
|||
$(".required").blur(function(){ |
|||
var $parent = $(this).parent(); |
|||
$parent.find(".formtips").remove(); |
|||
if(this.value=="") |
|||
{ |
|||
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>'); |
|||
} |
|||
else |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>'); |
|||
} |
|||
}); |
|||
|
|||
//重置
|
|||
$('#addarc input[type="reset"]').click(function(){ |
|||
$(".formtips").remove(); |
|||
}); |
|||
|
|||
$("#addarc").submit(function(){ |
|||
$(".required").trigger('blur'); |
|||
var numError = $('#addarc .onError').length; |
|||
|
|||
if(numError){return false;} |
|||
}); |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -0,0 +1,30 @@ |
|||
<!DOCTYPE html><html><head><title>角色管理_后台管理</title>@include('admin.common.header') |
|||
<div class="container-fluid"> |
|||
<div class="row"> |
|||
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 --> |
|||
|
|||
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox"> |
|||
<h2 class="sub-header">角色管理</h2>[ <a href="/fladmin/userrole/add">添加角色</a> ]<br><br> |
|||
|
|||
<form name="listarc"><div class="table-responsive"><table class="table table-striped table-hover"> |
|||
<thead><tr> |
|||
<th>ID</th> |
|||
<th>角色名称</th> |
|||
<th>角色描述</th> |
|||
<th>状态</th> |
|||
<th>管理</th> |
|||
</tr></thead> |
|||
<tbody> |
|||
<?php foreach($posts as $row){ ?><tr>
|
|||
<td><?php echo $row->id; ?></td>
|
|||
<td><?php echo $row->name; ?></td>
|
|||
<td><?php echo $row->des; ?></td>
|
|||
<td><?php if($row->status==0){echo '启用';}else{echo '禁用';} ?></td>
|
|||
<td><a href="/fladmin/userrole/edit?id=<?php echo $row->id; ?>">权限设置</a> | <a href="/fladmin/userrole/edit?id=<?php echo $row->id; ?>">修改</a> | <a onclick="delconfirm('/fladmin/userrole/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a></td> |
|||
</tr><?php } ?>
|
|||
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 --> |
|||
|
|||
<nav aria-label="Page navigation">{{ $posts->links() }}</nav> |
|||
|
|||
</div></div><!-- 右边结束 --></div></div> |
|||
</body></html> |
@ -1,5 +1,5 @@ |
|||
<div id="header"><div id="navlink" class="box"><a class="webname" href="<?php echo sysconfig('CMS_BASEHOST'); ?>/"><?php echo sysconfig('CMS_WEBNAME'); ?></a><span class="nav">
|
|||
<?php $posts = dataList('arctype', ['expression'=>[['reid','=',0]], 'orderby'=>['sortrank', 'desc']]); if($posts){foreach ($posts as $row) { ?>
|
|||
<a href="<?php echo get_front_url(array('catid'=>$row['id'],'type'=>'list')); ?>"><?php echo $row['typename']; ?></a>
|
|||
<?php $posts = dataList('arctype', ['expression'=>[['pid','=',0]], 'orderby'=>['sortrank', 'desc']]); if($posts){foreach ($posts as $row) { ?>
|
|||
<a href="<?php echo get_front_url(array('catid'=>$row['id'],'type'=>'list')); ?>"><?php echo $row['name']; ?></a>
|
|||
<?php }} ?>
|
|||
<script>navjs();</script></span><form method="get" target="_blank" class="m-sch fr" name="formsearch" action="<?php echo sysconfig('CMS_BASEHOST'); ?>/plus/search.php"><input class="sch-txt" name="q" type="text" value="搜索 按Enter键" onfocus="if(value=='搜索 按Enter键') {value=''}" onblur="if(value=='') {value='搜索 按Enter键'}"></form><div class="cl"></div></div></div> |
@ -1,5 +1,5 @@ |
|||
<div id="header"><div id="navlink" class="box"><a class="webname" href="<?php echo sysconfig('CMS_BASEHOST'); ?>/"><?php echo sysconfig('CMS_WEBNAME'); ?></a><span class="nav">
|
|||
<?php $posts = dataList('arctype', ['expression'=>[['reid','=',0]], 'orderby'=>['sortrank', 'desc']]); if($posts){foreach ($posts as $row) { ?>
|
|||
<a href="<?php echo get_front_url(array('catid'=>$row['id'],'type'=>'list')); ?>"><?php echo $row['typename']; ?></a>
|
|||
<?php $posts = dataList('arctype', ['expression'=>[['pid','=',0]], 'orderby'=>['sortrank', 'desc']]); if($posts){foreach ($posts as $row) { ?>
|
|||
<a href="<?php echo get_front_url(array('catid'=>$row['id'],'type'=>'list')); ?>"><?php echo $row['name']; ?></a>
|
|||
<?php }} ?>
|
|||
<script>navjs();</script></span><form method="get" target="_blank" class="m-sch fr" name="formsearch" action="<?php echo sysconfig('CMS_BASEHOST'); ?>/plus/search.php"><input class="sch-txt" name="q" type="text" value="搜索 按Enter键" onfocus="if(value=='搜索 按Enter键') {value=''}" onblur="if(value=='') {value='搜索 按Enter键'}"></form><div class="cl"></div></div></div> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue