林一峰
8 years ago
57 changed files with 421 additions and 716 deletions
-
9app/Common/function.php
-
17app/Http/Controllers/Admin/IndexController.php
-
12app/Http/Controllers/Admin/LoginController.php
-
8app/Http/Controllers/Admin/MenuController.php
-
2app/Http/Controllers/Admin/ProducttypeController.php
-
63app/Http/Model/Menu.php
-
98public/css/admin.css
-
12resources/views/admin/article/add.blade.php
-
12resources/views/admin/article/edit.blade.php
-
13resources/views/admin/article/index.blade.php
-
12resources/views/admin/article/repetarc.blade.php
-
12resources/views/admin/category/add.blade.php
-
12resources/views/admin/category/edit.blade.php
-
11resources/views/admin/category/index.blade.php
-
135resources/views/admin/common/leftmenu.blade.php
-
12resources/views/admin/friendlink/add.blade.php
-
12resources/views/admin/friendlink/edit.blade.php
-
12resources/views/admin/friendlink/index.blade.php
-
14resources/views/admin/guestbook/index.blade.php
-
82resources/views/admin/index/index.blade.php
-
14resources/views/admin/index/welcome.blade.php
-
12resources/views/admin/keyword/add.blade.php
-
12resources/views/admin/keyword/edit.blade.php
-
12resources/views/admin/keyword/index.blade.php
-
5resources/views/admin/layouts/app.blade.php
-
12resources/views/admin/menu/add.blade.php
-
12resources/views/admin/menu/edit.blade.php
-
12resources/views/admin/menu/index.blade.php
-
46resources/views/admin/page/add.blade.php
-
42resources/views/admin/page/edit.blade.php
-
12resources/views/admin/page/index.blade.php
-
54resources/views/admin/product/add.blade.php
-
54resources/views/admin/product/edit.blade.php
-
13resources/views/admin/product/index.blade.php
-
12resources/views/admin/producttype/add.blade.php
-
12resources/views/admin/producttype/edit.blade.php
-
11resources/views/admin/producttype/index.blade.php
-
12resources/views/admin/searchword/add.blade.php
-
12resources/views/admin/searchword/edit.blade.php
-
12resources/views/admin/searchword/index.blade.php
-
12resources/views/admin/slide/add.blade.php
-
12resources/views/admin/slide/edit.blade.php
-
12resources/views/admin/slide/index.blade.php
-
12resources/views/admin/sysconfig/add.blade.php
-
12resources/views/admin/sysconfig/edit.blade.php
-
12resources/views/admin/sysconfig/index.blade.php
-
12resources/views/admin/tag/add.blade.php
-
12resources/views/admin/tag/edit.blade.php
-
12resources/views/admin/tag/index.blade.php
-
12resources/views/admin/user/add.blade.php
-
12resources/views/admin/user/edit.blade.php
-
12resources/views/admin/user/index.blade.php
-
12resources/views/admin/userrole/add.blade.php
-
12resources/views/admin/userrole/edit.blade.php
-
12resources/views/admin/userrole/index.blade.php
-
11resources/views/admin/userrole/permissions.blade.php
-
3routes/web.php
@ -0,0 +1,63 @@ |
|||
<?php |
|||
namespace App\Http\Model; |
|||
|
|||
use Illuminate\Database\Eloquent\Model; |
|||
|
|||
class Menu extends Model |
|||
{ |
|||
protected $table = 'menu'; |
|||
public $timestamps = false; |
|||
protected $guarded = []; //$guarded包含你不想被赋值的字段数组。
|
|||
|
|||
/** |
|||
* 文件上传 |
|||
* @param $field |
|||
* @return string |
|||
*/ |
|||
public function uploadImg($field) |
|||
{ |
|||
if (Request::hasFile($field)) { |
|||
$pic = Request::file($field); |
|||
if ($pic->isValid()) { |
|||
$newName = md5(rand(1, 1000) . $pic->getClientOriginalName()) . "." . $pic->getClientOriginalExtension(); |
|||
$pic->move('uploads', $newName); |
|||
return $newName; |
|||
} |
|||
} |
|||
return ''; |
|||
} |
|||
|
|||
//获取后台管理员所具有权限的菜单列表
|
|||
public static function getPermissionsMenu($role_id, $pid=0, $pad=0) |
|||
{ |
|||
$res = []; |
|||
|
|||
$where['access.role_id'] = $role_id; |
|||
$where['menu.pid'] = $pid; |
|||
$where["menu.status"] = 1; |
|||
|
|||
$menu = object_to_array(\DB::table('menu') |
|||
->join('access', 'access.menu_id', '=', 'menu.id') |
|||
->select('menu.*', 'access.role_id') |
|||
->where($where) |
|||
->orderBy('listorder', 'asc') |
|||
->get()); |
|||
|
|||
if($menu) |
|||
{ |
|||
foreach($menu as $row) |
|||
{ |
|||
$row['deep'] = $pad; |
|||
|
|||
if($PermissionsMenu = self::getPermissionsMenu($role_id, $row['id'], $pad+1)) |
|||
{ |
|||
$row['child'] = $PermissionsMenu; |
|||
} |
|||
|
|||
$res[] = $row; |
|||
} |
|||
} |
|||
|
|||
return $res; |
|||
} |
|||
} |
@ -1,17 +1,77 @@ |
|||
<!DOCTYPE html><html><head><title><?php echo sysconfig('CMS_WEBNAME'); ?>后台管理</title>@include('admin.common.header')
|
|||
<!DOCTYPE html><html><head><title><?php echo sysconfig('CMS_WEBNAME'); ?>后台管理</title>
|
|||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1"> |
|||
<link rel="stylesheet" href="<?php echo route('home'); ?>/css/bootstrap.min.css"><link rel="stylesheet" href="<?php echo route('home'); ?>/css/admin.css"> |
|||
<script src="<?php echo route('home'); ?>/js/jquery.min.js"></script><script src="<?php echo route('home'); ?>/js/ad.js"></script><script src="<?php echo route('home'); ?>/js/bootstrap.min.js"></script><script type="text/javascript" src="<?php echo route('home'); ?>/js/jquery.uploadify.min.js"></script></head><body> |
|||
|
|||
<div class="blog-masthead clearfix"><nav class="blog-nav"> |
|||
<a class="blog-nav-item active" href="<?php echo route('admin'); ?>"><span class="glyphicon glyphicon-star"></span> <strong>后台管理中心</strong> <span class="glyphicon glyphicon-star-empty"></span></a> |
|||
<a class="blog-nav-item" href="<?php echo route('home'); ?>" target="_blank"><span class="glyphicon glyphicon-home"></span> 网站主页</a> |
|||
<a class="blog-nav-item" href="<?php echo route('admin'); ?>/index/upcache"><span class="glyphicon glyphicon-refresh"></span> 更新缓存</a> |
|||
<a class="blog-nav-item" id="navexit" href="<?php echo route('admin_logout'); ?>"><span class="glyphicon glyphicon-off"></span> 注销</a> |
|||
<a class="blog-nav-item pull-right" href="javascript:;"><small>您好:<span class="glyphicon glyphicon-user"></span> <?php if(isset($_SESSION['admin_user_info'])){echo $_SESSION['admin_user_info']['username'].' ['.$_SESSION['admin_user_info']['rolename'].']';} ?></small></a>
|
|||
</nav></div> |
|||
<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-3 col-md-2 sidebar"> |
|||
<script type="text/javascript"> |
|||
$(document).ready(function(){ |
|||
$('.inactive').click(function(){ |
|||
var className=$(this).parents('li').parents().attr('class'); |
|||
|
|||
if($(this).siblings('ul').css('display')=='none') |
|||
{ |
|||
if(className=="leftmenu") |
|||
{ |
|||
$(this).parents('li').siblings('li').children('ul').parent('li').children('a').removeClass('active'); |
|||
$(this).parents('li').siblings('li').children('ul').slideUp(100); |
|||
$(this).parents('li').children('ul').children('li').children('ul').parent('li').children('a').removeClass('active'); |
|||
$(this).parents('li').children('ul').children('li').children('ul').slideUp(100); |
|||
} |
|||
|
|||
$(this).addClass('active'); |
|||
$(this).siblings('ul').slideDown(100); |
|||
} |
|||
else |
|||
{ |
|||
$(this).removeClass('active'); |
|||
$(this).siblings('ul').slideUp(100); |
|||
} |
|||
}); |
|||
|
|||
$('.active').trigger("click"); |
|||
}); |
|||
</script> |
|||
<div class="menu"> |
|||
<ul class="leftmenu"> |
|||
<?php if($menus){ foreach($menus as $k=>$first){ ?>
|
|||
<!-- 一级菜单 --> |
|||
<li><a href="<?php if(isset($first['child'])){echo 'javascript:;';}else{echo route($first['action']);} ?>" class="<?php if(isset($first['child'])){echo 'inactive ';} if($k==0){echo 'active ';} ?>"><?php if($first['icon']){echo '<small class="'.$first['icon'].'"></small>';} ?> <?php echo $first['name']; ?></a>
|
|||
<!-- 二级菜单 --> |
|||
<?php if(isset($first['child'])){ ?>
|
|||
<ul style="display: none"> |
|||
<?php foreach($first['child'] as $second){ ?>
|
|||
<li><a target="appiframe" href="<?php if(isset($second['child'])){echo 'javascript:;';}else{echo route($second['action']);} ?>" class="<?php if(isset($second['child'])){echo 'inactive ';} ?>"><small class="glyphicon glyphicon-triangle-right"></small> <?php echo $second['name']; ?></a>
|
|||
<!-- 三级菜单 --> |
|||
<?php if(isset($second['child'])){ ?>
|
|||
<ul><?php foreach($second['child'] as $third){ ?>
|
|||
<li><a target="appiframe" href="{{ route($third['action']) }}"><small class="glyphicon glyphicon-menu-right"></small> <?php echo $third['name']; ?></a></li><?php } ?>
|
|||
</ul><?php } ?>
|
|||
</li> |
|||
<?php } ?>
|
|||
</ul><?php } ?>
|
|||
</li> |
|||
<?php }} ?>
|
|||
</ul> |
|||
</div> |
|||
</div><!-- 左边结束 --> |
|||
|
|||
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox"> |
|||
<h2 class="sub-header">LQYCMS管理中心</h2> |
|||
<p>· 欢迎使用专业的PHP网站管理系统,轻松建站的首选利器,完全免费、开源、无授权限制。<br> |
|||
· LQYCMS采用PHP+Mysql架构,符合企业网站SEO优化理念、功能全面、安全稳定。</p> |
|||
<h3>网站基本信息</h3> |
|||
域名/IP:<?php echo $_SERVER["SERVER_NAME"]; ?> | <?php echo $_SERVER["REMOTE_ADDR"]; ?><br>
|
|||
<h3>开发人员</h3> |
|||
FLi、当代范蠡<br><br> |
|||
我们的联系方式:374861669@qq.com<br><br> |
|||
© LQYCMS 版权所有 |
|||
<script type="text/javascript"> |
|||
var viewH = document.documentElement.clientHeight; |
|||
var mainbox = document.getElementById("mainbox"); |
|||
mainbox.style.height = (viewH - 75)+"px"; |
|||
</script> |
|||
<iframe src="<?php echo route('admin_welcome'); ?>" frameborder="0" scrolling="yes" width="100%" height="100%" allowtransparency="true" id="appiframe" name="appiframe"></iframe> |
|||
</div></div><!-- 右边结束 --></div></div> |
|||
</body></html> |
@ -0,0 +1,14 @@ |
|||
@extends('admin.layouts.app') |
|||
@section('title', '首页') |
|||
|
|||
@section('content') |
|||
<h2 class="sub-header">LQYCMS管理中心</h2> |
|||
<p>· 欢迎使用专业的PHP网站管理系统,轻松建站的首选利器,完全免费、开源、无授权限制。<br> |
|||
· LQYCMS采用PHP+Mysql架构,符合企业网站SEO优化理念、功能全面、安全稳定。</p> |
|||
<h3>网站基本信息</h3> |
|||
域名/IP:<?php echo $_SERVER["SERVER_NAME"]; ?> | <?php echo $_SERVER["REMOTE_ADDR"]; ?><br>
|
|||
<h3>开发人员</h3> |
|||
FLi、当代范蠡<br><br> |
|||
我们的联系方式:374861669@qq.com<br><br> |
|||
© LQYCMS 版权所有 |
|||
@endsection |
@ -0,0 +1,5 @@ |
|||
<!DOCTYPE html><html><head><title>@yield('title')_后台管理</title><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1"> |
|||
<link rel="stylesheet" href="<?php echo route('home'); ?>/css/bootstrap.min.css"><link rel="stylesheet" href="<?php echo route('home'); ?>/css/admin.css"> |
|||
<script src="<?php echo route('home'); ?>/js/jquery.min.js"></script><script src="<?php echo route('home'); ?>/js/ad.js"></script><script src="<?php echo route('home'); ?>/js/bootstrap.min.js"></script><script type="text/javascript" src="<?php echo route('home'); ?>/js/jquery.uploadify.min.js"></script></head><body> |
|||
@yield('content') |
|||
</body></html> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue