Browse Source

admin

master
林一峰 7 years ago
parent
commit
16b00e3c9b
  1. 29
      app/Common/function.php
  2. 37
      app/Http/Controllers/Admin/CommonController.php
  3. 80
      app/Http/Controllers/Admin/FriendlinkController.php
  4. 49
      app/Http/Controllers/Admin/GuestbookController.php
  5. 12
      app/Http/Controllers/Admin/IndexController.php
  6. 78
      app/Http/Controllers/Admin/KeywordController.php
  7. 6
      app/Http/Controllers/Admin/LoginController.php
  8. 181
      app/Http/Controllers/Admin/ProductController.php
  9. 115
      app/Http/Controllers/Admin/ProducttypeController.php
  10. 81
      app/Http/Controllers/Admin/SearchController.php
  11. 87
      app/Http/Controllers/Admin/SearchwordController.php
  12. 82
      app/Http/Controllers/Admin/SlideController.php
  13. 107
      app/Http/Controllers/Admin/SysconfigController.php
  14. 149
      app/Http/Controllers/Admin/TagController.php
  15. 49
      app/Http/Controllers/Admin/UserController.php
  16. 188
      composer.lock
  17. 2
      resources/views/admin/common/leftmenu.blade.php
  18. 54
      resources/views/admin/friendlink/add.blade.php
  19. 54
      resources/views/admin/friendlink/edit.blade.php
  20. 28
      resources/views/admin/friendlink/index.blade.php
  21. 60
      resources/views/admin/guestbook/index.blade.php
  22. 1
      resources/views/admin/index/index.blade.php
  23. 54
      resources/views/admin/keyword/add.blade.php
  24. 54
      resources/views/admin/keyword/edit.blade.php
  25. 28
      resources/views/admin/keyword/index.blade.php
  26. 183
      resources/views/admin/product/add.blade.php
  27. 184
      resources/views/admin/product/edit.blade.php
  28. 115
      resources/views/admin/product/index.blade.php
  29. 176
      resources/views/admin/producttype/add.blade.php
  30. 178
      resources/views/admin/producttype/edit.blade.php
  31. 24
      resources/views/admin/producttype/index.blade.php
  32. 126
      resources/views/admin/searchword/add.blade.php
  33. 126
      resources/views/admin/searchword/edit.blade.php
  34. 33
      resources/views/admin/searchword/index.blade.php
  35. 114
      resources/views/admin/slide/add.blade.php
  36. 114
      resources/views/admin/slide/edit.blade.php
  37. 32
      resources/views/admin/slide/index.blade.php
  38. 67
      resources/views/admin/sysconfig/add.blade.php
  39. 67
      resources/views/admin/sysconfig/edit.blade.php
  40. 28
      resources/views/admin/sysconfig/index.blade.php
  41. 137
      resources/views/admin/tag/add.blade.php
  42. 137
      resources/views/admin/tag/edit.blade.php
  43. 34
      resources/views/admin/tag/index.blade.php
  44. 58
      resources/views/admin/user/edit.blade.php
  45. 12
      resources/views/admin/user/index.blade.php
  46. 54
      resources/views/admin/user/register.blade.php
  47. 62
      routes/web.php

29
app/Common/function.php

@ -5,8 +5,27 @@
function dataList($modelname, $where = '', $orderby = '', $field = '*', $size = 15, $page = 1)
{
$model = \DB::table($modelname);
//查询条件
if($where!=''){$model = $model->where($where);}
if($orderby!=''){$model = $model->orderBy($orderby[0], $orderby[1]);}
//排序
if($orderby!='')
{
if(count($orderby) == count($orderby, 1))
{
$model = $model->orderBy($orderby[0], $orderby[1]);
}
else
{
foreach($orderby as $row)
{
$model = $model->orderBy($row[0], $row[1]);
}
}
}
//要返回的字段
if($field!='*'){$model = $model->select(\DB::raw($field));}
$skip = ($page-1)*$size;
@ -473,8 +492,9 @@ function catarcnum($typeid, $modelname='article')
//根据Tag id获取该Tag标签下文章的数量
function tagarcnum($tagid)
{
if(!empty($tagid)){$map['tid']=$tagid;}
return db("taglist")->where($map)->count();
$taglist = \DB::table("taglist");
if(!empty($tagid)){$map['tid']=$tagid; $taglist = $taglist->where($map);}
return $taglist->count();
}
//判断是否是图片格式,是返回true
@ -833,6 +853,8 @@ function dir_delete($dir)
function object_to_array($object, $get=0)
{
$res = '';
if(!empty($object))
{
if($get==0)
{
foreach($object as $key=>$value)
@ -844,6 +866,7 @@ function object_to_array($object, $get=0)
{
$res = (array)$object;
}
}
return $res;
}

37
app/Http/Controllers/Admin/CommonController.php

@ -26,10 +26,10 @@ class CommonController extends Controller
/**
* 获取分页数据及分页导航
* @param string $modelname 模块名与数据库表名对应
* @param array $map 查询条件
* @param array $where 查询条件
* @param string $orderby 查询排序
* @param string $field 要返回数据的字段
* @param int $listRows 每页数量,默认10条
* @param int $listRows 每页数量,默认30条
*
* @return 格式化后输出的数据。内容格式为:
* - "code" (string):代码
@ -42,13 +42,36 @@ class CommonController extends Controller
* - "img_url" (string):车图片url地址
* - "car_name" (string):车名称
*/
public function pageList($modelname, $map = '', $orderby = '', $field = '', $listRows = 15)
public function pageList($modelname, $where = '', $orderby = '', $field = '*', $listRows = 30)
{
$orderby = !empty($orderby) ? $orderby : $orderby = ['id', 'desc'];
$model = \DB::table($modelname);
// 查询满足的数据,并且每页显示15条数据
$voList = DB::table($modelname)->where($map)->orderBy($orderby[0], $orderby[1])->paginate($listRows);
//查询条件
if(!empty($where)){$model = $model->where($where);}
return $voList;
//排序
if($orderby!='')
{
if(count($orderby) == count($orderby, 1))
{
$model = $model->orderBy($orderby[0], $orderby[1]);
}
else
{
foreach($orderby as $row)
{
$model = $model->orderBy($row[0], $row[1]);
}
}
}
else
{
$model = $model->orderBy('id', 'desc');
}
//要返回的字段
if($field!='*'){$model = $model->select(\DB::raw($field));}
return $model->paginate($listRows);
}
}

80
app/Http/Controllers/Admin/FriendlinkController.php

@ -0,0 +1,80 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
class FriendlinkController extends CommonController
{
public function __construct()
{
parent::__construct();
}
public function index()
{
$posts = parent::pageList('friendlink');
$data['posts'] = $posts;
return view('admin.friendlink.index', $data);
}
public function add()
{
return view('admin.friendlink.add');
}
public function doadd()
{
unset($_POST["_token"]);
if(DB::table('friendlink')->insert($_POST))
{
success_jump('添加成功!', route('admin_friendlink'));
}
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('friendlink')->where('id', $id)->first(), 1);
return view('admin.friendlink.edit', $data);
}
public function doedit()
{
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else {$id="";exit;}
unset($_POST["_token"]);
if(DB::table('friendlink')->where('id', $id)->update($_POST))
{
success_jump('修改成功!', route('admin_friendlink'));
}
else
{
error_jump('修改失败!');
}
}
public function del()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{$this->error('删除失败!请重新提交',FLADMIN.'/Friendlink' , 3);} //if(preg_match('/[0-9]*/',$id)){}else{exit;}
if(DB::table('friendlink')->whereIn("id", explode(',', $id))->delete())
{
success_jump('删除成功');
}
else
{
error_jump('删除失败!请重新提交');
}
}
}

49
app/Http/Controllers/Admin/GuestbookController.php

@ -0,0 +1,49 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
class GuestbookController extends CommonController
{
public function __construct()
{
parent::__construct();
}
public function index()
{
$res = '';
$where = function ($query) use ($res) {
if(isset($_REQUEST["keyword"]))
{
$query->where('title', 'like', '%'.$_REQUEST['keyword'].'%');
}
};
$data['posts'] = parent::pageList('guestbook', $where);
return view('admin.guestbook.index', $data);
}
public function edit()
{
$data['post'] = object_to_array(DB::table('guestbook')->where('id', 1)->first());
return view('admin.guestbook.edit', $data);
}
public function del()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump("删除失败!请重新提交");}
if(DB::table("guestbook")->whereIn("id", explode(',', $id))->delete())
{
success_jump("$id ,删除成功");
}
else
{
error_jump("$id ,删除失败!请重新提交");
}
}
}

12
app/Http/Controllers/Admin/IndexController.php

@ -18,18 +18,14 @@ class IndexController extends CommonController
//更新配置
public function upconfig()
{
updateconfig();
cache()->forget('sysconfig'); //删除缓存
success_jump('更新成功!', route('admin_sysconfig'));
}
//更新缓存
public function upcache()
{
}
//页面跳转
public function jump()
{
return view('admin.index.jump');
cache()->forget('sysconfig'); //删除缓存
success_jump('更新成功!', route('admin_sysconfig'));
}
}

78
app/Http/Controllers/Admin/KeywordController.php

@ -0,0 +1,78 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
class KeywordController extends CommonController
{
public function __construct()
{
parent::__construct();
}
public function index()
{
$data['posts'] = parent::pageList('keyword');
return view('admin.keyword.index', $data);
}
public function add()
{
return view('admin.keyword.add');
}
public function doadd()
{
unset($_POST["_token"]);
if(DB::table('keyword')->insert($_POST))
{
success_jump("添加成功!", route('admin_keyword'));
}
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('keyword')->where('id', $id)->first(), 1);
return view('admin.keyword.edit', $data);
}
public function doedit()
{
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else {$id="";exit;}
unset($_POST["_token"]);
if(DB::table('keyword')->where('id', $id)->update($_POST))
{
success_jump('修改成功!', route('admin_keyword'));
}
else
{
error_jump('修改失败!');
}
}
public function del()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');}
if(DB::table("keyword")->whereIn("id", explode(',', $id))->delete())
{
success_jump('删除成功');
}
else
{
error_jump('删除失败!请重新提交');
}
}
}

6
app/Http/Controllers/Admin/LoginController.php

@ -9,6 +9,12 @@ use Log;
class LoginController extends BaseController
{
//页面跳转
public function jump()
{
return view('admin.index.jump');
}
/**
* 登录页面
*/

181
app/Http/Controllers/Admin/ProductController.php

@ -0,0 +1,181 @@
<?php
namespace app\fladmin\controller;
class Product extends Base
{
public function _initialize()
{
parent::_initialize();
}
public function index()
{
$where = array();
if(isset($_REQUEST["keyword"]))
{
$where['title'] = array('like','%'.$_REQUEST['keyword'].'%');
}
if(isset($_REQUEST["typeid"]) && $_REQUEST["typeid"]!=0)
{
$where['typeid'] = $_REQUEST["typeid"];
}
if(isset($_REQUEST["id"]))
{
$where['typeid'] = $_REQUEST["id"];
}
$prolist = parent::pageList('product',$where);
$posts = array();
foreach($prolist as $key=>$value)
{
$info = db('product_type')->field('content',true)->where("id=".$value['typeid'])->find();
$value['typename'] = $info['typename'];
$posts[] = $value;
}
$this->assign('page',$prolist->render());
$this->assign('posts',$posts);
return $this->fetch();
}
public function add()
{
if(!empty($_GET["catid"])){$this->assign('catid',$_GET["catid"]);}else{$this->assign('catid',0);}
return $this->fetch();
}
public function doadd()
{
$litpic="";if(!empty($_POST["litpic"])){$litpic = $_POST["litpic"];}else{$_POST['litpic']="";} //缩略图
if(empty($_POST["description"])){if(!empty($_POST["body"])){$_POST['description']=cut_str($_POST["body"]);}} //description
$_POST['addtime'] = $_POST['pubdate'] = time(); //添加&更新时间
$_POST['user_id'] = session('admin_user_info')['id']; // 发布者id
//关键词
if(!empty($_POST["keywords"]))
{
$_POST['keywords']=str_replace("",",",$_POST["keywords"]);
}
else
{
if(!empty($_POST["title"]))
{
$title=$_POST["title"];
$title=str_replace("","",$title);
$title=str_replace(",","",$title);
$_POST['keywords']=get_keywords($title);//标题分词
}
}
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
if(db('product')->insert($_POST))
{
$this->success('添加成功!', FLADMIN.'/Product' , 1);
}
else
{
$this->error('添加失败!请修改后重新添加', FLADMIN.'/Product/add' , 3);
}
}
public function edit()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else {$id="";}if(preg_match('/[0-9]*/',$id)){}else{exit;}
$this->assign('id',$id);
$this->assign('post',db('product')->where("id=$id")->find());
return $this->fetch();
}
public function doedit()
{
if(!empty($_POST["id"])){$id = $_POST["id"];}else {$id="";exit;}
$litpic="";if(!empty($_POST["litpic"])){$litpic = $_POST["litpic"];}else{$_POST['litpic']="";} //缩略图
if(empty($_POST["description"])){if(!empty($_POST["body"])){$_POST['description']=cut_str($_POST["body"]);}}//description
$_POST['pubdate'] = time();//更新时间
$_POST['user_id'] = session('admin_user_info')['id']; // 修改者id
//关键词
if(!empty($_POST["keywords"]))
{
$_POST['keywords']=str_replace("",",",$_POST["keywords"]);
}
else
{
if(!empty($_POST["title"]))
{
$title=$_POST["title"];
$title=str_replace("","",$title);
$title=str_replace(",","",$title);
$_POST['keywords']=get_keywords($title);//标题分词
}
}
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
if(db('product')->where("id=$id")->update($_POST))
{
$this->success('修改成功!', FLADMIN.'/Product' , 1);
}
else
{
$this->error('修改失败!', FLADMIN.'/Product/edit?id='.$_POST["id"] , 3);
}
}
public function del()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{$this->error('删除失败!请重新提交',FLADMIN.'/Product' , 3);}if(preg_match('/[0-9]*/',$id)){}else{exit;}
if(db('product')->where("id in ($id)")->delete())
{
$this->success("$id ,删除成功", FLADMIN.'/Product' , 1);
}
else
{
$this->error("$id ,删除失败!请重新提交", FLADMIN.'/Product', 3);
}
}
//商品推荐
public function recommendarc()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{$this->error('删除失败!请重新提交',FLADMIN.'/Product' , 3);} //if(preg_match('/[0-9]*/',$id)){}else{exit;}
$data['tuijian'] = 1;
if(db('product')->where("id in ($id)")->update($data))
{
$this->success("$id ,推荐成功", FLADMIN.'/Product', 1);
}
else
{
$this->error("$id ,推荐失败!请重新提交", FLADMIN.'/Product', 3);
}
}
//商品是否存在
public function productexists()
{
if(!empty($_GET["title"]))
{
$map['title'] = $_GET["title"];
}
else
{
$map['title']="";
}
if(!empty($_GET["id"]))
{
$map['id'] = array('NEQ',$_GET["id"]);
}
return db('product')->where($map)->count();
}
}

115
app/Http/Controllers/Admin/ProducttypeController.php

@ -0,0 +1,115 @@
<?php
namespace app\fladmin\controller;
class Producttype extends Base
{
public function _initialize()
{
parent::_initialize();
}
public function index()
{
$this->assign('catlist',tree(get_category('product_type',0)));
return $this->fetch();
}
public function add()
{
if(!empty($_GET["reid"]))
{
$id = $_GET["reid"];
if(preg_match('/[0-9]*/',$id)){}else{exit;}
if($id!=0)
{
$this->assign('postone',db("product_type")->field('content',true)->where("id=$id")->find());
}
$this->assign('id',$id);
}
else
{
$this->assign('id',0);
}
return $this->fetch();
}
public function doadd()
{
if(isset($_POST["prid"])){if($_POST["prid"]=="top"){$_POST['reid']=0;}else{$_POST['reid'] = $_POST["prid"];}unset($_POST["prid"]);}//父级栏目id
$_POST['addtime'] = time();//添加时间
if(db("product_type")->insert($_POST))
{
$this->success('添加成功!', FLADMIN.'/Producttype' , 1);
}
else
{
$this->error('添加失败!请修改后重新添加', FLADMIN.'/Producttype' , 3);
}
}
public function edit()
{
$id = $_GET["id"];if(preg_match('/[0-9]*/',$id)){}else{exit;}
$this->assign('id',$id);
$post = db("product_type")->where("id=$id")->find();
$reid = $post['reid'];
if($reid!=0){$this->assign('postone',db("product_type")->where("id=$reid")->find());}
$this->assign('post',$post);
return $this->fetch();
}
public function doedit()
{
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else{$id="";exit;}
$_POST['addtime'] = time();//添加时间
if(db("product_type")->where("id=$id")->update($_POST))
{
$this->success('修改成功!', FLADMIN.'/Producttype' , 1);
}
else
{
$this->error('修改失败!请修改后重新添加', FLADMIN.'/Producttype/edit?id='.$_POST["id"] , 3);
}
}
public function del()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{$this->error('删除失败!请重新提交',FLADMIN.'/Producttype' , 3);}
if(db("product_type")->where("reid=$id")->find())
{
$this->error('删除失败!请先删除子分类', FLADMIN.'/Producttype', 3);
}
else
{
if(db("product_type")->where("id=$id")->delete())
{
if(db("product")->where("typeid=$id")->count()>0) //判断该分类下是否有商品,如果有把该分类下的商品也一起删除
{
if(db("product")->where("typeid=$id")->delete())
{
$this->success('删除成功', FLADMIN.'/Producttype' , 1);
}
else
{
$this->error('分类下的商品删除失败!', FLADMIN.'/Producttype', 3);
}
}
else
{
$this->success('删除成功', FLADMIN.'/Producttype' , 1);
}
}
else
{
$this->error('删除失败!请重新提交', FLADMIN.'/Producttype', 3);
}
}
}
}

81
app/Http/Controllers/Admin/SearchController.php

@ -0,0 +1,81 @@
<?php
namespace app\fladmin\controller;
class Search extends Base
{
public function _initialize()
{
parent::_initialize();
}
public function index()
{
$list = parent::pageList('search');
$this->assign('page',$list->render());
$this->assign('posts',$list);
return $this->fetch();
}
public function doadd()
{
$_POST['pubdate'] = time();//更新时间
$_POST['click'] = rand(200,500);//点击
if(db('search')->insert($_POST))
{
$this->success('添加成功!', FLADMIN.'/Search' , 1);
}
else
{
$this->error('添加失败!请修改后重新添加', FLADMIN.'/Search/add' , 3);
}
}
public function add()
{
return $this->fetch();
}
public function edit()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{$id="";}
if(preg_match('/[0-9]*/',$id)){}else{exit;}
$this->assign('id',$id);
$this->assign('row',db('search')->where("id=$id")->find());
return $this->fetch();
}
public function doedit()
{
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else{$id="";exit;}
if(!empty($_POST["keywords"])){$_POST['keywords']=str_replace("",",",$_POST["keywords"]);}else{$_POST['keywords']="";}//关键词
$_POST['pubdate'] = time();//更新时间
if(db('search')->where("id=$id")->update($_POST))
{
$this->success('修改成功!', FLADMIN.'/Search' , 1);
}
else
{
$this->error('修改失败!', FLADMIN.'/Search/edit?id='.$_POST["id"] , 3);
}
}
public function del()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{$this->error('删除失败!请重新提交',FLADMIN.'/Search' , 3);} //if(preg_match('/[0-9]*/',$id)){}else{exit;}
if(db("search")->where("id in ($id)")->delete())
{
$this->success('删除成功', FLADMIN.'/Search' , 1);
}
else
{
$this->error('删除失败!请重新提交', FLADMIN.'/Search', 3);
}
}
}

87
app/Http/Controllers/Admin/SearchwordController.php

@ -0,0 +1,87 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
class SearchwordController extends CommonController
{
public function __construct()
{
parent::__construct();
}
public function index()
{
$data['posts'] = parent::pageList('searchword');
return view('admin.searchword.index', $data);
}
public function add()
{
return view('admin.searchword.add');
}
public function doadd()
{
$_POST['pubdate'] = time();//更新时间
$_POST['click'] = rand(200,500);//点击
unset($_POST["_token"]);
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
if($insertId = DB::table('searchword')->insertGetId($_POST))
{
success_jump('添加成功!', route('admin_searchword'));
}
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('searchword')->where('id',$id)->first(), 1);
return view('admin.searchword.edit', $data);
}
public function doedit()
{
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else{$id="";exit;}
if(!empty($_POST["keywords"])){$_POST['keywords']=str_replace("",",",$_POST["keywords"]);}else{$_POST['keywords']="";}//关键词
$_POST['pubdate'] = time();//更新时间
unset($_POST["_token"]);
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
if(DB::table('searchword')->where('id', $id)->update($_POST))
{
success_jump('修改成功!', route('admin_searchword'));
}
else
{
error_jump('修改失败!');
}
}
public function del()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');}
if(DB::table("searchword")->whereIn("id", explode(',', $id))->delete())
{
success_jump('删除成功');
}
else
{
error_jump('删除失败!请重新提交');
}
}
}

82
app/Http/Controllers/Admin/SlideController.php

@ -0,0 +1,82 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
class SlideController extends CommonController
{
public function __construct()
{
parent::__construct();
}
public function index()
{
$data['posts'] = parent::pageList('slide', '', [['is_show', 'asc'], ['rank', 'desc']]);
return view('admin.slide.index', $data);
}
public function add()
{
return view('admin.slide.add');
}
public function doadd()
{
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
unset($_POST["_token"]);
if(DB::table('slide')->insert($_POST))
{
success_jump('添加成功!', route('admin_slide'));
}
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('slide')->where('id', $id)->first(), 1);
return view('admin.slide.edit', $data);
}
public function doedit()
{
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else{$id="";exit;}
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
unset($_POST["_token"]);
if(DB::table('slide')->where('id', $id)->update($_POST))
{
success_jump('修改成功!', route('admin_slide'));
}
else
{
error_jump('修改失败!');
}
}
public function del()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');}
if(DB::table('slide')->whereIn("id", explode(',', $id))->delete())
{
success_jump('删除成功');
}
else
{
error_jump('删除失败!请重新提交');
}
}
}

107
app/Http/Controllers/Admin/SysconfigController.php

@ -0,0 +1,107 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
class SysconfigController extends CommonController
{
public function __construct()
{
parent::__construct();
}
public function index()
{
$data['posts'] = parent::pageList('sysconfig', '', ['id', 'desc']);
return view('admin.sysconfig.index', $data);
}
//添加参数,视图
public function add()
{
return view('admin.sysconfig.add');
}
public function doadd()
{
//参数名称
if(!empty($_POST["varname"]))
{
if(!preg_match("/^CMS_[a-z]+$/i", $_POST["varname"]))
{
error_jump('添加失败!参数名称不正确');exit;
}
}
else
{
error_jump('添加失败!参数名称不能为空');exit;
}
unset($_POST["_token"]);
if($_POST['varname']!="" && DB::table('sysconfig')->insert($_POST))
{
cache()->forget('sysconfig'); //删除缓存
success_jump('添加成功!', route('admin_sysconfig'));
}
else
{
error_jump('添加失败!请修改后重新添加');
}
}
//修改参数,视图
public function edit()
{
if(!empty($_REQUEST["id"])){$id = $_REQUEST["id"];}else{$id="";}
if(preg_match('/[0-9]*/',$id)){}else{exit;}
$data['id'] = $id;
$data['post'] = object_to_array(DB::table('sysconfig')->where('id', $id)->first(), 1);
return view('admin.sysconfig.edit', $data);
}
public function doedit()
{
if(isset($_POST["id"]) && !empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else{$id="";exit;}
//参数名称
if(!empty($_POST["varname"]))
{
if(!preg_match("/^CMS_[a-z]+$/i", $_POST["varname"]))
{
error_jump('更新失败!参数名称不正确');exit;
}
}
else
{
error_jump('更新失败!参数名称不能为空');exit;
}
unset($_POST["_token"]);
if(DB::table('sysconfig')->where('id', $id)->update($_POST))
{
cache()->forget('sysconfig'); //删除缓存
success_jump('更新成功!', route('admin_sysconfig'));
}
else
{
error_jump('更新失败!请修改后重新提交');
}
}
public function del()
{
if(!empty($_REQUEST["id"])){$id = $_REQUEST["id"];}else{error_jump('删除失败!请重新提交');}
if(DB::table("sysconfig")->whereIn("id", explode(',', $id))->delete())
{
success_jump('删除成功');
}
else
{
error_jump('删除失败!请重新提交');
}
}
}

149
app/Http/Controllers/Admin/TagController.php

@ -0,0 +1,149 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
class TagController extends CommonController
{
public function __construct()
{
parent::__construct();
}
public function index()
{
$data['posts'] = parent::pageList('tagindex');
return view('admin.tag.index', $data);
}
public function add()
{
return view('admin.tag.add');
}
public function doadd()
{
$tagarc = "";
if(!empty($_POST["tagarc"])){$tagarc = str_replace("",",",$_POST["tagarc"]);if(!preg_match("/^\d*$/",str_replace(",","",$tagarc))){$tagarc="";}} //Tag文章列表
$_POST['pubdate'] = time();//更新时间
$_POST['click'] = rand(200,500);//点击
unset($_POST["tagarc"]);
unset($_POST["_token"]);
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
if($insertId = DB::table('tagindex')->insertGetId($_POST))
{
if($tagarc!="")
{
$arr=explode(",",$tagarc);
foreach($arr as $row)
{
$data2['tid'] = $insertId;
$data2['aid'] = $row;
DB::table("taglist")->insert($data2);
}
}
success_jump('添加成功!', route('admin_tag'));
}
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('tagindex')->where('id',$id)->first(), 1);
//获取该标签下的文章id
$posts = object_to_array(DB::table('taglist')->select('aid')->where('tid', $id)->get());
$aidlist = "";
if(!empty($posts))
{
foreach($posts as $row)
{
$aidlist = $aidlist.','.$row['aid'];
}
}
$data['aidlist'] = ltrim($aidlist, ",");
return view('admin.tag.edit', $data);
}
public function doedit()
{
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else{$id="";exit;}
if(!empty($_POST["keywords"])){$_POST['keywords']=str_replace("",",",$_POST["keywords"]);}else{$_POST['keywords']="";}//关键词
$_POST['pubdate'] = time();//更新时间
$tagarc="";
if(!empty($_POST["tagarc"])){$tagarc = str_replace("",",",$_POST["tagarc"]);if(!preg_match("/^\d*$/",str_replace(",","",$tagarc))){$tagarc="";}} //Tag文章列表
unset($_POST["tagarc"]);
unset($_POST["_token"]);
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
if(DB::table('tagindex')->where('id', $id)->update($_POST))
{
//获取该标签下的文章id
$posts = object_to_array(DB::table("taglist")->select('aid')->where('tid', $id)->get());
$aidlist = "";
if(!empty($posts))
{
foreach($posts as $row)
{
$aidlist = $aidlist.','.$row['aid'];
}
}
$aidlist = ltrim($aidlist, ",");
if($tagarc!="" && $tagarc!=$aidlist)
{
DB::table("taglist")->where('tid', $id)->delete();
$arr=explode(",",$tagarc);
foreach($arr as $row)
{
$data2['tid'] = $id;
$data2['aid'] = $row;
DB::table("taglist")->insert($data2);
}
}
elseif($tagarc=="")
{
DB::table("taglist")->where('tid', $id)->delete();
}
success_jump('修改成功!', route('admin_tag'));
}
else
{
error_jump('修改失败!');
}
}
public function del()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');} //if(preg_match('/[0-9]*/',$id)){}else{exit;}
if(DB::table("tagindex")->whereIn("id", explode(',', $id))->delete())
{
success_jump('删除成功');
}
else
{
error_jump('删除失败!请重新提交');
}
}
}

49
app/Http/Controllers/Admin/UserController.php

@ -0,0 +1,49 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
class UserController extends CommonController
{
public function __construct()
{
parent::__construct();
}
public function index()
{
return view('admin.user.index');
}
public function edit()
{
$data['post'] = object_to_array(DB::table('user')->where('id', 1)->first(), 1);
return view('admin.user.edit', $data);
}
public function doedit()
{
if(!empty($_POST["username"])){$data['username'] = $map['username'] = $_POST["username"];}else{error_jump('用户名不能为空');exit;}//用户名
if(!empty($_POST["oldpwd"])){$map['pwd'] = md5($_POST["oldpwd"]);}else{error_jump('旧密码错误');exit;}
if($_POST["newpwd"]==$_POST["newpwd2"]){$data['pwd'] = md5($_POST["newpwd"]);}else{error_jump('密码错误');exit;}
if($_POST["oldpwd"]==$_POST["newpwd"]){error_jump('新旧密码不能一致!');exit;}
$User = object_to_array(DB::table("user")->where($map)->first(), 1);
if($User)
{
if(DB::table('user')->where('id', 1)->update($data))
{
session_unset();
session_destroy();
success_jump('修改成功,请重新登录', route('admin_login'), 3);
}
}
else
{
error_jump('修改失败!旧用户名或密码错误');
}
}
}

188
composer.lock

@ -605,16 +605,16 @@
},
{
"name": "laravel/framework",
"version": "v5.4.23",
"version": "v5.4.24",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "ad82327705658dbf5f0ce72805caa950dfbe150d"
"reference": "ec8548db26c1b147570f661128649e98f3ac0f29"
},
"dist": {
"type": "zip",
"url": "https://files.phpcomposer.com/files/laravel/framework/ad82327705658dbf5f0ce72805caa950dfbe150d.zip",
"reference": "ad82327705658dbf5f0ce72805caa950dfbe150d",
"url": "https://files.phpcomposer.com/files/laravel/framework/ec8548db26c1b147570f661128649e98f3ac0f29.zip",
"reference": "ec8548db26c1b147570f661128649e98f3ac0f29",
"shasum": ""
},
"require": {
@ -730,7 +730,7 @@
"framework",
"laravel"
],
"time": "2017-05-11T20:10:35+00:00"
"time": "2017-05-30T12:44:32+00:00"
},
{
"name": "laravel/tinker",
@ -1776,16 +1776,16 @@
},
{
"name": "symfony/console",
"version": "v3.2.8",
"version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "a7a17e0c6c3c4d70a211f80782e4b90ddadeaa38"
"reference": "c80e63f3f5e3a331bfc25e6e9332b10422eb9b05"
},
"dist": {
"type": "zip",
"url": "https://files.phpcomposer.com/files/symfony/console/a7a17e0c6c3c4d70a211f80782e4b90ddadeaa38.zip",
"reference": "a7a17e0c6c3c4d70a211f80782e4b90ddadeaa38",
"url": "https://files.phpcomposer.com/files/symfony/console/c80e63f3f5e3a331bfc25e6e9332b10422eb9b05.zip",
"reference": "c80e63f3f5e3a331bfc25e6e9332b10422eb9b05",
"shasum": ""
},
"require": {
@ -1793,10 +1793,15 @@
"symfony/debug": "~2.8|~3.0",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
"symfony/dependency-injection": "<3.3"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/dependency-injection": "~3.3",
"symfony/event-dispatcher": "~2.8|~3.0",
"symfony/filesystem": "~2.8|~3.0",
"symfony/http-kernel": "~2.8|~3.0",
"symfony/process": "~2.8|~3.0"
},
"suggest": {
@ -1808,7 +1813,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.2-dev"
"dev-master": "3.3-dev"
}
},
"autoload": {
@ -1835,20 +1840,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2017-04-26T01:39:17+00:00"
"time": "2017-05-28T14:08:56+00:00"
},
{
"name": "symfony/css-selector",
"version": "v3.2.8",
"version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
"reference": "02983c144038e697c959e6b06ef6666de759ccbc"
"reference": "4d882dced7b995d5274293039370148e291808f2"
},
"dist": {
"type": "zip",
"url": "https://files.phpcomposer.com/files/symfony/css-selector/02983c144038e697c959e6b06ef6666de759ccbc.zip",
"reference": "02983c144038e697c959e6b06ef6666de759ccbc",
"url": "https://files.phpcomposer.com/files/symfony/css-selector/4d882dced7b995d5274293039370148e291808f2.zip",
"reference": "4d882dced7b995d5274293039370148e291808f2",
"shasum": ""
},
"require": {
@ -1857,7 +1862,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.2-dev"
"dev-master": "3.3-dev"
}
},
"autoload": {
@ -1888,20 +1893,20 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
"time": "2017-05-01T14:55:58+00:00"
"time": "2017-05-01T15:01:29+00:00"
},
{
"name": "symfony/debug",
"version": "v3.2.8",
"version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
"reference": "fd6eeee656a5a7b384d56f1072243fe1c0e81686"
"reference": "ef5f19a7a68075a0bd05969a329ead3b0776fb7a"
},
"dist": {
"type": "zip",
"url": "https://files.phpcomposer.com/files/symfony/debug/fd6eeee656a5a7b384d56f1072243fe1c0e81686.zip",
"reference": "fd6eeee656a5a7b384d56f1072243fe1c0e81686",
"url": "https://files.phpcomposer.com/files/symfony/debug/ef5f19a7a68075a0bd05969a329ead3b0776fb7a.zip",
"reference": "ef5f19a7a68075a0bd05969a329ead3b0776fb7a",
"shasum": ""
},
"require": {
@ -1912,13 +1917,12 @@
"symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
},
"require-dev": {
"symfony/class-loader": "~2.8|~3.0",
"symfony/http-kernel": "~2.8|~3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.2-dev"
"dev-master": "3.3-dev"
}
},
"autoload": {
@ -1945,29 +1949,32 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
"time": "2017-04-19T20:17:50+00:00"
"time": "2017-05-27T16:02:27+00:00"
},
{
"name": "symfony/event-dispatcher",
"version": "v3.2.8",
"version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "b8a401f733b43251e1d088c589368b2a94155e40"
"reference": "a9f8b02b0ef07302eca92cd4bba73200b7980e9c"
},
"dist": {
"type": "zip",
"url": "https://files.phpcomposer.com/files/symfony/event-dispatcher/b8a401f733b43251e1d088c589368b2a94155e40.zip",
"reference": "b8a401f733b43251e1d088c589368b2a94155e40",
"url": "https://files.phpcomposer.com/files/symfony/event-dispatcher/a9f8b02b0ef07302eca92cd4bba73200b7980e9c.zip",
"reference": "a9f8b02b0ef07302eca92cd4bba73200b7980e9c",
"shasum": ""
},
"require": {
"php": ">=5.5.9"
},
"conflict": {
"symfony/dependency-injection": "<3.3"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~2.8|~3.0",
"symfony/dependency-injection": "~2.8|~3.0",
"symfony/dependency-injection": "~3.3",
"symfony/expression-language": "~2.8|~3.0",
"symfony/stopwatch": "~2.8|~3.0"
},
@ -1978,7 +1985,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.2-dev"
"dev-master": "3.3-dev"
}
},
"autoload": {
@ -2005,20 +2012,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2017-05-01T14:58:48+00:00"
"time": "2017-05-04T12:23:07+00:00"
},
{
"name": "symfony/finder",
"version": "v3.2.8",
"version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "9cf076f8f492f4b1ffac40aae9c2d287b4ca6930"
"reference": "30cb2a2c09627823a7243638dd456de4e2748fed"
},
"dist": {
"type": "zip",
"url": "https://files.phpcomposer.com/files/symfony/finder/9cf076f8f492f4b1ffac40aae9c2d287b4ca6930.zip",
"reference": "9cf076f8f492f4b1ffac40aae9c2d287b4ca6930",
"url": "https://files.phpcomposer.com/files/symfony/finder/30cb2a2c09627823a7243638dd456de4e2748fed.zip",
"reference": "30cb2a2c09627823a7243638dd456de4e2748fed",
"shasum": ""
},
"require": {
@ -2027,7 +2034,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.2-dev"
"dev-master": "3.3-dev"
}
},
"autoload": {
@ -2054,20 +2061,20 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
"time": "2017-04-12T14:13:17+00:00"
"time": "2017-05-25T23:10:31+00:00"
},
{
"name": "symfony/http-foundation",
"version": "v3.2.8",
"version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "9de6add7f731e5af7f5b2e9c0da365e43383ebef"
"reference": "a3272c06d538bd48261e7d83308e7f84992d4ec8"
},
"dist": {
"type": "zip",
"url": "https://files.phpcomposer.com/files/symfony/http-foundation/9de6add7f731e5af7f5b2e9c0da365e43383ebef.zip",
"reference": "9de6add7f731e5af7f5b2e9c0da365e43383ebef",
"url": "https://files.phpcomposer.com/files/symfony/http-foundation/a3272c06d538bd48261e7d83308e7f84992d4ec8.zip",
"reference": "a3272c06d538bd48261e7d83308e7f84992d4ec8",
"shasum": ""
},
"require": {
@ -2080,7 +2087,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.2-dev"
"dev-master": "3.3-dev"
}
},
"autoload": {
@ -2107,20 +2114,20 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
"time": "2017-05-01T14:55:58+00:00"
"time": "2017-05-25T13:39:26+00:00"
},
{
"name": "symfony/http-kernel",
"version": "v3.2.8",
"version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "46e8b209abab55c072c47d72d5cd1d62c0585e05"
"reference": "4ad34a0d20a5848c0fcbf6ff6a2ff1cd9cf4b9ed"
},
"dist": {
"type": "zip",
"url": "https://files.phpcomposer.com/files/symfony/http-kernel/46e8b209abab55c072c47d72d5cd1d62c0585e05.zip",
"reference": "46e8b209abab55c072c47d72d5cd1d62c0585e05",
"url": "https://files.phpcomposer.com/files/symfony/http-kernel/4ad34a0d20a5848c0fcbf6ff6a2ff1cd9cf4b9ed.zip",
"reference": "4ad34a0d20a5848c0fcbf6ff6a2ff1cd9cf4b9ed",
"shasum": ""
},
"require": {
@ -2128,18 +2135,21 @@
"psr/log": "~1.0",
"symfony/debug": "~2.8|~3.0",
"symfony/event-dispatcher": "~2.8|~3.0",
"symfony/http-foundation": "~2.8.13|~3.1.6|~3.2"
"symfony/http-foundation": "~3.3"
},
"conflict": {
"symfony/config": "<2.8"
"symfony/config": "<2.8",
"symfony/dependency-injection": "<3.3",
"symfony/var-dumper": "<3.3"
},
"require-dev": {
"psr/cache": "~1.0",
"symfony/browser-kit": "~2.8|~3.0",
"symfony/class-loader": "~2.8|~3.0",
"symfony/config": "~2.8|~3.0",
"symfony/console": "~2.8|~3.0",
"symfony/css-selector": "~2.8|~3.0",
"symfony/dependency-injection": "~2.8|~3.0",
"symfony/dependency-injection": "~3.3",
"symfony/dom-crawler": "~2.8|~3.0",
"symfony/expression-language": "~2.8|~3.0",
"symfony/finder": "~2.8|~3.0",
@ -2148,7 +2158,7 @@
"symfony/stopwatch": "~2.8|~3.0",
"symfony/templating": "~2.8|~3.0",
"symfony/translation": "~2.8|~3.0",
"symfony/var-dumper": "~3.2"
"symfony/var-dumper": "~3.3"
},
"suggest": {
"symfony/browser-kit": "",
@ -2162,7 +2172,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.2-dev"
"dev-master": "3.3-dev"
}
},
"autoload": {
@ -2189,7 +2199,7 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com",
"time": "2017-05-01T17:46:48+00:00"
"time": "2017-05-29T21:02:12+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@ -2360,16 +2370,16 @@
},
{
"name": "symfony/process",
"version": "v3.2.8",
"version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "999c2cf5061e627e6cd551dc9ebf90dd1d11d9f0"
"reference": "8e30690c67aafb6c7992d6d8eb0d707807dd3eaf"
},
"dist": {
"type": "zip",
"url": "https://files.phpcomposer.com/files/symfony/process/999c2cf5061e627e6cd551dc9ebf90dd1d11d9f0.zip",
"reference": "999c2cf5061e627e6cd551dc9ebf90dd1d11d9f0",
"url": "https://files.phpcomposer.com/files/symfony/process/8e30690c67aafb6c7992d6d8eb0d707807dd3eaf.zip",
"reference": "8e30690c67aafb6c7992d6d8eb0d707807dd3eaf",
"shasum": ""
},
"require": {
@ -2378,7 +2388,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.2-dev"
"dev-master": "3.3-dev"
}
},
"autoload": {
@ -2405,7 +2415,7 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2017-04-12T14:13:17+00:00"
"time": "2017-05-22T12:32:03+00:00"
},
{
"name": "symfony/psr-http-message-bridge",
@ -2469,32 +2479,35 @@
},
{
"name": "symfony/routing",
"version": "v3.2.8",
"version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
"reference": "5029745d6d463585e8b487dbc83d6333f408853a"
"reference": "3aa0c7d759a2c88f4dff47c3d6776e7380bb2c9a"
},
"dist": {
"type": "zip",
"url": "https://files.phpcomposer.com/files/symfony/routing/5029745d6d463585e8b487dbc83d6333f408853a.zip",
"reference": "5029745d6d463585e8b487dbc83d6333f408853a",
"url": "https://files.phpcomposer.com/files/symfony/routing/3aa0c7d759a2c88f4dff47c3d6776e7380bb2c9a.zip",
"reference": "3aa0c7d759a2c88f4dff47c3d6776e7380bb2c9a",
"shasum": ""
},
"require": {
"php": ">=5.5.9"
},
"conflict": {
"symfony/config": "<2.8"
"symfony/config": "<2.8",
"symfony/dependency-injection": "<3.3",
"symfony/yaml": "<3.3"
},
"require-dev": {
"doctrine/annotations": "~1.0",
"doctrine/common": "~2.2",
"psr/log": "~1.0",
"symfony/config": "~2.8|~3.0",
"symfony/dependency-injection": "~3.3",
"symfony/expression-language": "~2.8|~3.0",
"symfony/http-foundation": "~2.8|~3.0",
"symfony/yaml": "~2.8|~3.0"
"symfony/yaml": "~3.3"
},
"suggest": {
"doctrine/annotations": "For using the annotation loader",
@ -2507,7 +2520,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.2-dev"
"dev-master": "3.3-dev"
}
},
"autoload": {
@ -2540,20 +2553,20 @@
"uri",
"url"
],
"time": "2017-04-12T14:13:17+00:00"
"time": "2017-05-24T11:35:23+00:00"
},
{
"name": "symfony/translation",
"version": "v3.2.8",
"version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
"reference": "f4a04d2df710f81515df576b2de06bdeee518b83"
"reference": "dc3b2a0c6cfff60327ba1c043a82092735397543"
},
"dist": {
"type": "zip",
"url": "https://files.phpcomposer.com/files/symfony/translation/f4a04d2df710f81515df576b2de06bdeee518b83.zip",
"reference": "f4a04d2df710f81515df576b2de06bdeee518b83",
"url": "https://files.phpcomposer.com/files/symfony/translation/dc3b2a0c6cfff60327ba1c043a82092735397543.zip",
"reference": "dc3b2a0c6cfff60327ba1c043a82092735397543",
"shasum": ""
},
"require": {
@ -2561,13 +2574,14 @@
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
"symfony/config": "<2.8"
"symfony/config": "<2.8",
"symfony/yaml": "<3.3"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~2.8|~3.0",
"symfony/intl": "^2.8.18|^3.2.5",
"symfony/yaml": "~2.8|~3.0"
"symfony/yaml": "~3.3"
},
"suggest": {
"psr/log": "To use logging capability in translator",
@ -2577,7 +2591,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.2-dev"
"dev-master": "3.3-dev"
}
},
"autoload": {
@ -2604,20 +2618,20 @@
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
"time": "2017-04-12T14:13:17+00:00"
"time": "2017-05-22T07:42:36+00:00"
},
{
"name": "symfony/var-dumper",
"version": "v3.2.8",
"version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "fa47963ac7979ddbd42b2d646d1b056bddbf7bb8"
"reference": "568ce40d88b14f6b42aa48f50572cc4427be9757"
},
"dist": {
"type": "zip",
"url": "https://files.phpcomposer.com/files/symfony/var-dumper/fa47963ac7979ddbd42b2d646d1b056bddbf7bb8.zip",
"reference": "fa47963ac7979ddbd42b2d646d1b056bddbf7bb8",
"url": "https://files.phpcomposer.com/files/symfony/var-dumper/568ce40d88b14f6b42aa48f50572cc4427be9757.zip",
"reference": "568ce40d88b14f6b42aa48f50572cc4427be9757",
"shasum": ""
},
"require": {
@ -2638,7 +2652,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.2-dev"
"dev-master": "3.3-dev"
}
},
"autoload": {
@ -2672,7 +2686,7 @@
"debug",
"dump"
],
"time": "2017-05-01T14:55:58+00:00"
"time": "2017-05-22T17:32:12+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",
@ -4141,16 +4155,16 @@
},
{
"name": "symfony/yaml",
"version": "v3.2.8",
"version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "acec26fcf7f3031e094e910b94b002fa53d4e4d6"
"reference": "885db865f6b2b918404a1fae28f9ac640f71f994"
},
"dist": {
"type": "zip",
"url": "https://files.phpcomposer.com/files/symfony/yaml/acec26fcf7f3031e094e910b94b002fa53d4e4d6.zip",
"reference": "acec26fcf7f3031e094e910b94b002fa53d4e4d6",
"url": "https://files.phpcomposer.com/files/symfony/yaml/885db865f6b2b918404a1fae28f9ac640f71f994.zip",
"reference": "885db865f6b2b918404a1fae28f9ac640f71f994",
"shasum": ""
},
"require": {
@ -4165,7 +4179,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.2-dev"
"dev-master": "3.3-dev"
}
},
"autoload": {
@ -4192,7 +4206,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2017-05-01T14:55:58+00:00"
"time": "2017-05-28T10:56:20+00:00"
},
{
"name": "webmozart/assert",

2
resources/views/admin/common/leftmenu.blade.php

@ -11,7 +11,7 @@
<dd><a href="<?php echo route('admin'); ?>/productType"><span class="glyphicon glyphicon-th-list"></span> 商品分类</a></dd>
<dt>批量维护</dt>
<dd><a href="<?php echo route('admin'); ?>/tag"><span class="glyphicon glyphicon-tag"></span> TAG标签管理</a></dd>
<dd><a href="<?php echo route('admin'); ?>/search"><span class="glyphicon glyphicon-fire"></span> 关键词管理</a></dd>
<dd><a href="<?php echo route('admin'); ?>/searchword"><span class="glyphicon glyphicon-fire"></span> 关键词管理</a></dd>
<dd><a href="<?php echo route('admin'); ?>/keyword"><span class="glyphicon glyphicon-fire"></span> 內链关键词维护</a></dd>
<dd><a href="<?php echo route('admin'); ?>/friendlink"><span class="glyphicon glyphicon-leaf"></span> 友情链接</a></dd>
<dd><a href="<?php echo route('admin'); ?>/slide"><span class="glyphicon glyphicon-leaf"></span> 轮播图</a></dd>

54
resources/views/admin/friendlink/add.blade.php

@ -0,0 +1,54 @@
<!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/friendlink">友情链接列表</a> > 添加友情链接</h5>
<form id="addarc" method="post" action="/fladmin/friendlink/doadd" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td>链接名称:</td>
<td><input name="webname" type="text" id="webname" value="" class="required" style="width:30%" placeholder="在此输入链接名称"></td>
</tr>
<tr>
<td>链接网址:</td>
<td><input name="url" type="text" id="url" value="http://" style="width:60%" class="required"> (请用绝对地址)</td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<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>

54
resources/views/admin/friendlink/edit.blade.php

@ -0,0 +1,54 @@
<!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/friendlink">友情链接列表</a> > 友情链接修改</h5>
<form id="addarc" method="post" action="/fladmin/friendlink/doedit" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td>链接名称:</td>
<td><input name="webname" type="text" id="webname" value="<?php echo $post["webname"]; ?>" class="required" style="width:30%" placeholder="在此输入关键词"><input style="display:none;" name="id" type="text" id="id" value="<?php echo $id; ?>"></td>
</tr>
<tr>
<td>链接网址:</td>
<td><input name="url" type="text" id="rpurl" value="<?php echo $post["url"]; ?>" style="width:60%" class="required"> (请用绝对地址)</td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<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>

28
resources/views/admin/friendlink/index.blade.php

@ -0,0 +1,28 @@
<!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/friendlink/add">添加友情链接</a> ]<br><br>
<form name="listarc"><div class="table-responsive"><table class="table table-striped table-hover">
<thead><tr>
<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->webname; ?></td>
<td><?php echo $row->url; ?></td>
<td><a href="/fladmin/friendlink/edit?id=<?php echo $row->id; ?>">修改</a> | <a onclick="delconfirm('/fladmin/friendlink/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a></td>
</tr><?php } ?>
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 -->
<div class="backpages">{{ $posts->links() }}</div>
</div></div><!-- 右边结束 --></div></div>
</body></html>

60
resources/views/admin/guestbook/index.blade.php

@ -0,0 +1,60 @@
<!DOCTYPE html><html><head><title>留言列表_<?php echo sysconfig('CMS_WEBNAME'); ?>后台管理</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">
<form id="searcharc" class="navbar-form" action="/fladmin/guestbook" method="get">
<div class="form-group"><input type="text" name="keyword" id="keyword" class="form-control required" placeholder="搜索关键词..."></div>
<button type="submit" class="btn btn-info" value="Submit">搜索一下</button></form>
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>ID</th>
<th width=25%>标题</th>
<th>留言时间</th>
<th width=45%>内容</th><th>操作</th>
</tr>
</thead>
<tbody>
<?php if($posts){foreach($posts as $row){ ?>
<tr>
<td><?php echo $row->id; ?></td>
<td><?php echo $row->title; ?></td>
<td><?php echo date('Y-m-d H:i:s',$row->addtime); ?></td>
<td><?php echo $row->msg; ?></td><td>&nbsp;<a onclick="delconfirm('/fladmin/guestbook/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a></td>
</tr>
<?php }} ?>
</tbody>
</table>
</div><!-- 表格结束 -->
<div class="backpages">{{ $posts->links() }}</div>
<script>
$(function(){
$('.required').on('focus', function() {
$(this).removeClass('input-error');
});
$("#searcharc").submit(function(e){
$(this).find('.required').each(function(){
if( $(this).val() == "" )
{
e.preventDefault();
$(this).addClass('input-error');
}
else
{
$(this).removeClass('input-error');
}
});
});
});
</script>
</div></div><!-- 右边结束 --></div></div>
</body></html>

1
resources/views/admin/index/index.blade.php

@ -9,7 +9,6 @@
· LQYCMS采用PHP+Mysql架构,符合企业网站SEO优化理念、功能全面、安全稳定。</p>
<h3>网站基本信息</h3>
域名/IP:<?php echo $_SERVER["SERVER_NAME"]; ?> | <?php echo $_SERVER["REMOTE_ADDR"]; ?><br>
运行环境:<?php echo @apache_get_version().' Mysql/'.@mysql_get_server_info(); ?>
<h3>开发人员</h3>
FLi、当代范蠡<br><br>
我们的联系方式:374861669@qq.com<br><br>

54
resources/views/admin/keyword/add.blade.php

@ -0,0 +1,54 @@
<!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/keyword">关键词列表</a> > 添加关键词</h5>
<form id="addarc" method="post" action="/fladmin/keyword/doadd" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td>关键词:</td>
<td><input name="keyword" type="text" id="keyword" value="" class="required" style="width:30%" placeholder="在此输入关键词"></td>
</tr>
<tr>
<td>链接网址:</td>
<td><input name="rpurl" type="text" id="rpurl" value="http://" style="width:60%" class="required"> (请用绝对地址)</td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<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>

54
resources/views/admin/keyword/edit.blade.php

@ -0,0 +1,54 @@
<!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/keyword">关键词列表</a> > 关键词修改</h5>
<form id="addarc" method="post" action="/fladmin/keyword/doedit" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td>关键词:</td>
<td><input name="keyword" type="text" id="keyword" value="<?php echo $post["keyword"]; ?>" class="required" style="width:30%" placeholder="在此输入关键词"><input style="display:none;" name="id" type="text" id="id" value="<?php echo $id; ?>"></td>
</tr>
<tr>
<td>链接网址:</td>
<td><input name="rpurl" type="text" id="rpurl" value="<?php echo $post["rpurl"]; ?>" style="width:60%" class="required"> (请用绝对地址)</td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<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>

28
resources/views/admin/keyword/index.blade.php

@ -0,0 +1,28 @@
<!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/keyword/add">添加关键词</a> ]<br><br>
<form name="listarc"><div class="table-responsive"><table class="table table-striped table-hover">
<thead><tr>
<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->keyword; ?></td>
<td><?php echo $row->rpurl; ?></td>
<td><a href="/fladmin/keyword/edit?id=<?php echo $row->id; ?>">修改</a> | <a onclick="delconfirm('/fladmin/keyword/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a></td>
</tr><?php } ?>
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 -->
<div class="backpages">{{ $posts->links() }}</div>
</div></div><!-- 右边结束 --></div></div>
</body></html>

183
resources/views/admin/product/add.blade.php

@ -0,0 +1,183 @@
<!DOCTYPE html><html><head><title>添加商品信息_后台管理</title>{include file="common/header"/}
<div class="container-fluid">
<div class="row">
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">{include file="common/leftmenu"/}</div><!-- 左边结束 -->
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox">
<h5 class="sub-header"><a href="/fladmin/Product">商品列表</a> > 添加商品</h5>
<form id="addarc" method="post" action="/fladmin/Product/doadd" role="form" enctype="multipart/form-data" class="table-responsive">
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right">商品标题:</td>
<td><input name="title" type="text" id="title" value="" class="required" style="width:60%" placeholder="在此输入标题"></td>
</tr>
<tr>
<td align="right">货号:</td>
<td colspan="2"><input name="serial_no" type="text" id="serial_no" style="width:180px" value="">&nbsp;&nbsp; 运费:<input name="delivery_fee" type="text" id="delivery_fee" style="width:100px" value="">&nbsp;&nbsp; 销量:<input name="sales" type="text" id="sales" style="width:60px" value=""></td>
</tr>
<tr>
<td align="right">商品价格:</td>
<td colspan="2"><input name="price" type="text" id="price" style="width:100px" value="">&nbsp;&nbsp; 原价:<input name="origin_price" type="text" id="origin_price" style="width:100px" value="">&nbsp;&nbsp; 库存:<input name="inventory" type="text" id="inventory" style="width:60px" value="">&nbsp;&nbsp; 浏览次数:<input type="text" name="click" id="click" value="" style="width:60px;"></td>
</tr>
<tr>
<td align="right">上架:</td>
<td>
<input type="radio" value='0' name="status" checked />&nbsp;&nbsp;&nbsp;
<input type="radio" value='1' name="status" />&nbsp;
</td>
</tr>
<tr>
<td align="right">推荐:</td>
<td>
<select name="tuijian" id="tuijian">
<?php $tuijian = config('tuijian');
for($i=0;$i<count($tuijian);$i++){ ?><option value="<?php echo $i; ?>"><?php echo $tuijian[$i]; ?></option><?php } ?>
</select>
</td>
</tr>
<tr>
<td align="right">seoTitle:</td>
<td><input name="seotitle" type="text" id="seotitle" value="" style="width:60%"></td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">缩略图:</td>
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="litpic" type="text" id="litpic" value="" style="width:40%"> <img style="margin-left:20px;display:none;" src="" width="120" height="80" id="picview"></td>
</tr>
<script type="text/javascript">
var _editor;
$(function() {
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
_editor = UE.getEditor('ueditorimg');
_editor.ready(function () {
//设置编辑器不可用
_editor.setDisabled('insertimage');
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
_editor.hide();
//侦听图片上传
_editor.addListener('beforeInsertImage', function (t, arg) {
//将地址赋值给相应的input,只取第一张图片的路径
$('#litpic').val(arg[0].src);
//图片预览
$('#picview').attr("src",arg[0].src).css("display","inline-block");
})
});
});
//弹出图片上传的对话框
function upImage()
{
var myImage = _editor.getDialog("insertimage");
myImage.render();
myImage.open();
}
</script>
<script type="text/plain" id="ueditorimg"></script>
<tr>
<td align="right">商品类目:</td>
<td>
<select name="typeid" id="typeid">
<?php $catlist = tree(get_category('product_type',0));foreach($catlist as $row){
if($row["id"]==$catid){ ?>
<option selected="selected" value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "";}echo $row["typename"]; ?></option>
<?php }else{ ?>
<option value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "";}echo $row["typename"]; ?></option>
<?php }} ?>
</select>
</td>
</tr>
<tr>
<td align="right">关键词:</td>
<td><input type="text" name="keywords" id="keywords" style="width:50%" value=""> (多个用","分开)</td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">内容摘要:</td>
<td><textarea name="description" rows="5" id="description" style="width:60%;height:70px;vertical-align:middle;"></textarea></td>
</tr>
<tr>
<td colspan="2"><strong>图文描述:</strong></td>
</tr>
<tr>
<td colspan="2">
<!-- 加载编辑器的容器 --><script id="container" name="body" type="text/plain"></script>
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 --><script type="text/javascript">var ue = UE.getEditor('container',{maximumWords:100000,initialFrameHeight:320,enableAutoSave:false});</script></td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<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;}
//$("#contents").val = ue.getContent();
//var datas = $('#addarc').serialize();//#form要在form里面
//var content = ue.getContent();
//var title = $("#title").val();
//var seotitle = $("#seotitle").val();
//var keywords = $("#keywords").val();
//var description = $("#description").val();
/*$.ajax({
url: "/fladmin/Product/doedit",
type: "POST",
dataType: "json",
cache: false,
data: {
"id":$("#id").val(),
"typeid":$("#typeid").val(),
"tuijian":$("#tuijian").val(),
"click":$("#click").val(),
"writer":$("#writer").val(),
"source":$("#source").val(),
"litpic":$("#litpic").val(),
"title":$("#title").val(),
"seotitle":$("#seotitle").val(),
"keywords":$("#keywords").val(),
"description":$("#description").val(),
"contents":content
//"title":title.replace("'", "&#039;"),
//"seotitle":seotitle.replace("'", "&#039;"),
//"keywords":keywords.replace("'", "&#039;"),
//"description":description.replace("'", "&#039;"),
//"contents":content.replace("'", "&#039;")
},
success: function(data){
if(data.code==200)
{
//alert(data.info);
window.location.replace("/fladmin/Product");
}
}
}); */
});
});
</script>
</body></html>

184
resources/views/admin/product/edit.blade.php

@ -0,0 +1,184 @@
<!DOCTYPE html><html><head><title>修改商品信息_后台管理</title>{include file="common/header"/}
<div class="container-fluid">
<div class="row">
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">{include file="common/leftmenu"/}</div><!-- 左边结束 -->
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox">
<h5 class="sub-header"><a href="/fladmin/Product">商品列表</a> > 修改商品</h5>
<form id="addarc" method="post" action="/fladmin/Product/doedit" role="form" enctype="multipart/form-data" class="table-responsive">
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right">商品标题:</td>
<td><input name="title" type="text" id="title" value="{$post["title"]}" class="required" style="width:60%" placeholder="在此输入标题"><input style="display:none;" type="text" name="id" id="id" value="{$id}"></td>
</tr>
<tr>
<td align="right">货号:</td>
<td colspan="2"><input name="serial_no" type="text" id="serial_no" style="width:180px" value="{$post["serial_no"]}">&nbsp;&nbsp; 运费:<input name="delivery_fee" type="text" id="delivery_fee" style="width:100px" value="{$post["delivery_fee"]}">&nbsp;&nbsp; 销量:<input name="sales" type="text" id="sales" style="width:60px" value="{$post["sales"]}"></td>
</tr>
<tr>
<td align="right">商品价格:</td>
<td colspan="2"><input name="price" type="text" id="price" style="width:100px" value="{$post["price"]}">&nbsp;&nbsp; 原价:<input name="origin_price" type="text" id="origin_price" style="width:100px" value="{$post["origin_price"]}">&nbsp;&nbsp; 库存:<input name="inventory" type="text" id="inventory" style="width:60px" value="{$post["inventory"]}">&nbsp;&nbsp; 浏览次数:<input type="text" name="click" id="click" value="{$post["click"]}" style="width:60px;"></td>
</tr>
<tr>
<td align="right">上架:</td>
<td>
<input type="radio" value='0' name="status" {if condition="$post['status']==0"}checked{/if} />&nbsp;&nbsp;&nbsp;
<input type="radio" value='1' name="status" {if condition="$post['status']==1"}checked{/if} />&nbsp;
</td>
</tr>
<tr>
<td align="right">推荐:</td>
<td>
<select name="tuijian" id="tuijian">
<?php $tuijian = config('tuijian');
for($i=0;$i<count($tuijian);$i++){if($i==$post["tuijian"]){?><option selected="selected" value="<?php echo $i; ?>"><?php echo $tuijian[$i]; ?></option>
<?php }else{?><option value="<?php echo $i; ?>"><?php echo $tuijian[$i]; ?></option><?php }} ?>
</select>
</td>
</tr>
<tr>
<td align="right">seoTitle:</td>
<td><input name="seotitle" type="text" id="seotitle" value="{$post["seotitle"]}" style="width:60%"></td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">缩略图:</td>
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="litpic" type="text" id="litpic" value="{$post["litpic"]}" style="width:40%"> <img style="margin-left:20px;<?php if(empty($post["litpic"]) || !imgmatch($post["litpic"])){ echo "display:none;"; } ?>" src="<?php if(imgmatch($post["litpic"])){echo $post["litpic"];} ?>" width="120" height="80" id="picview" name="picview"></td>
</tr>
<script type="text/javascript">
var _editor;
$(function() {
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
_editor = UE.getEditor('ueditorimg');
_editor.ready(function () {
//设置编辑器不可用
_editor.setDisabled('insertimage');
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
_editor.hide();
//侦听图片上传
_editor.addListener('beforeInsertImage', function (t, arg) {
//将地址赋值给相应的input,只取第一张图片的路径
$('#litpic').val(arg[0].src);
//图片预览
$('#picview').attr("src",arg[0].src).css("display","inline-block");
})
});
});
//弹出图片上传的对话框
function upImage()
{
var myImage = _editor.getDialog("insertimage");
myImage.render();
myImage.open();
}
</script>
<script type="text/plain" id="ueditorimg"></script>
<tr>
<td align="right">商品类目:</td>
<td>
<select name="typeid" id="typeid">
<?php $catlist = tree(get_category('product_type',0));foreach($catlist as $row){
if($row["id"]==$post["typeid"]){ ?>
<option selected="selected" value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "";}echo $row["typename"]; ?></option>
<?php }else{ ?>
<option value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "";}echo $row["typename"]; ?></option>
<?php }} ?>
</select>
</td>
</tr>
<tr>
<td align="right">关键词:</td>
<td><input type="text" name="keywords" id="keywords" style="width:50%" value="{$post["keywords"]}"> (多个用","分开)</td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">内容摘要:</td>
<td><textarea name="description" rows="5" id="description" style="width:60%;height:70px;vertical-align:middle;">{$post["description"]}</textarea></td>
</tr>
<tr>
<td colspan="2"><strong>图文描述:</strong></td>
</tr>
<tr>
<td colspan="2">
<!-- 加载编辑器的容器 --><script id="container" name="body" type="text/plain">{$post["body"]}</script>
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 --><script type="text/javascript">var ue = UE.getEditor('container',{maximumWords:100000,initialFrameHeight:320,enableAutoSave:false});</script></td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<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;}
//$("#contents").val = ue.getContent();
//var datas = $('#addarc').serialize();//#form要在form里面
//var content = ue.getContent();
//var title = $("#title").val();
//var seotitle = $("#seotitle").val();
//var keywords = $("#keywords").val();
//var description = $("#description").val();
/*$.ajax({
url: "/fladmin/Product/doedit",
type: "POST",
dataType: "json",
cache: false,
data: {
"id":$("#id").val(),
"typeid":$("#typeid").val(),
"tuijian":$("#tuijian").val(),
"click":$("#click").val(),
"writer":$("#writer").val(),
"source":$("#source").val(),
"litpic":$("#litpic").val(),
"title":$("#title").val(),
"seotitle":$("#seotitle").val(),
"keywords":$("#keywords").val(),
"description":$("#description").val(),
"contents":content
//"title":title.replace("'", "&#039;"),
//"seotitle":seotitle.replace("'", "&#039;"),
//"keywords":keywords.replace("'", "&#039;"),
//"description":description.replace("'", "&#039;"),
//"contents":content.replace("'", "&#039;")
},
success: function(data){
if(data.code==200)
{
//alert(data.info);
window.location.replace("/fladmin/Product");
}
}
}); */
});
});
</script>
</body></html>

115
resources/views/admin/product/index.blade.php

@ -0,0 +1,115 @@
<!DOCTYPE html><html><head><title>商品列表_<?php echo CMS_WEBNAME; ?>后台管理</title>{include file="common/header"/}
<div class="container-fluid">
<div class="row">
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">{include file="common/leftmenu"/}</div><!-- 左边结束 -->
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox"><h5 class="sub-header"><a href="/fladmin/ProductType">商品分类</a> > <a href="/fladmin/Product">商品列表</a> [ <a href="/fladmin/Product/add<?php if(!empty($_GET["id"])){echo '?catid='.$_GET["id"];}?>">发布商品</a> ]</h5>
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>ID</th>
<th>选择</th>
<th>商品标题</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><input name="arcID" type="checkbox" value="<?php echo $row["id"]; ?>" class="np"></td>
<td><a href="/fladmin/Product/edit?id=<?php echo $row["id"]; ?>"><?php echo $row["title"]; ?></a> <?php if(!empty($row["litpic"])){echo "<small style='color:red'>[图]</small>";} ?> </td>
<td><?php echo date('Y-m-d',$row["pubdate"]); ?></td>
<td><a href="/fladmin/Product?id=<?php echo $row["typeid"]; ?>"><?php echo $row["typename"]; ?></a></td><td><?php echo $row["click"]; ?></td><td><a target="_blank" href="<?php echo get_front_url(array("type"=>"content","catid"=>$row["typeid"],"id"=>$row["id"])); ?>">预览</a>&nbsp;<a href="/fladmin/Product/edit?id=<?php echo $row["id"]; ?>">修改</a>&nbsp;<a onclick="delconfirm('/fladmin/Product/del?id=<?php echo $row["id"]; ?>')" href="javascript:;">删除</a></td>
</tr>
<?php } ?>
<tr>
<td colspan="8">
<a href="javascript:selAll('arcID')" class="coolbg">反选</a>&nbsp;
<a href="javascript:delArc()" class="coolbg">删除</a>&nbsp;
<a href="javascript:tjArc()" class="coolbg">特荐</a>
</td>
</tr>
</tbody>
</table>
</div><!-- 表格结束 -->
<div>
<form id="searcharc" class="navbar-form" action="/fladmin/Product/index" method="get">
<select name="typeid" id="typeid" style="padding:6px 5px;vertical-align:middle;border:1px solid #DBDBDB;border-radius:4px;">
<option value="0">选择栏目...</option>
<?php $catlist = tree(get_category('product_type',0));foreach($catlist as $row){ ?><option value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "—";}echo $row["typename"]; ?></option><?php } ?>
</select>
<div class="form-group"><input type="text" name="keyword" id="keyword" class="form-control required" placeholder="搜索关键词..."></div>
<button type="submit" class="btn btn-info" value="Submit">搜索一下</button></form>
<div class="backpages">{$page}</div>
<script>
//批量删除商品
function delArc(aid)
{
var checkvalue=getItems();
if(checkvalue=='')
{
alert('必须选择一个或多个文档!');
return;
}
if(confirm("确定删除吗"))
{
location="/fladmin/Product/del?id="+checkvalue;
}
else
{
}
}
//推荐商品
function tjArc(aid)
{
var checkvalue=getItems();
if(checkvalue=='')
{
alert('必须选择一个或多个文档!');
return;
}
if(confirm("确定要推荐吗"))
{
location="/fladmin/Product/recommendarc?id="+checkvalue;
}
else
{
}
}
$(function(){
$('.required').on('focus', function() {
$(this).removeClass('input-error');
});
$("#searcharc").submit(function(e){
$(this).find('.required').each(function(){
if( $(this).val() == "" )
{
e.preventDefault();
$(this).addClass('input-error');
}
else
{
$(this).removeClass('input-error');
}
});
});
});
</script>
</div></div><!-- 右边结束 --></div></div>
</body></html>

176
resources/views/admin/producttype/add.blade.php

@ -0,0 +1,176 @@
<!DOCTYPE html><html><head><title>添加分类_后台管理</title>{include file="common/header"/}
<div class="container-fluid">
<div class="row">
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">{include file="common/leftmenu"/}</div><!-- 左边结束 -->
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox">
<h5 class="sub-header"><a href="/fladmin/Producttype">商品分类管理</a> > 添加分类</h5>
<form method="post" action="/fladmin/Producttype/doadd" role="form" id="addcat" class="table-responsive">
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right">分类名称:</td>
<td><input name="typename" type="text" value="" id="typename" size="30" class="required"></td>
</tr>
<tr>
<td align="right">上级目录:</td>
<td><?php if($id==0){echo "顶级栏目";}else{echo $postone["typename"];} ?><input style="display:none;" type="text" name="prid" id="prid" value="<?php if($id==0){echo "top";}else{echo $id;} ?>"></td>
</tr>
<tr>
<td align="right">别名:</td>
<td><input name="typedir" type="text" value="" id="typedir" class="required" style="width:30%"> <small>(包含字母或数字,字母开头)</small></td>
</tr>
<tr>
<td align="right">列表模板:</td>
<td><input name="templist" id="templist" type="text" value="productcategory.html" class="required" size="20"></td>
</tr>
<tr>
<td align="right">文章模板:</td>
<td><input name="temparticle" id="temparticle" type="text" value="productdetail.html" class="required" size="20"></td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">缩略图:</td>
<td style="vertical-align:middle;"><input id="file_upload" value="选择文件" name="file_upload" type="file" multiple="true"> <input name="litpic" type="text" id="litpic" value="" style="width:40%"> <img style="margin-left:20px;display:none;" src="" width="120" height="80" id="picview"></td>
</tr>
<style>.uploadify{display:inline-block;}.uploadify-queue{display:none;}</style>
<script type="text/javascript">
<?php $timestamp = time();?>
bidtype="选择文件";
$(function() {
$('#file_upload').uploadify({
'buttonText': bidtype,//按钮文字
'auto':true,//选择完图片以后是否自动上传
'multi': false,//是否开启一次性上传多个文件
'fileTypeExts': "*.jpg;*.png;*.gif;*.jpeg;",//允许的文件类型
'width': 60,//buttonImg的大小
'height': 26,
'formData' : {
'timestamp' : '<?php echo $timestamp;?>',
'token' : '<?php echo md5('unique_salt' . $timestamp);?>'
},
'swf' : '/other/uploadify/uploadify.swf',//路径要正确
'uploader' : '/uploadImage.php',//路径要正确
'onUploadSuccess': function (file, data, response) { //一个文件上传成功后的响应事件处理
$('#litpic').val(data);
$('#picview').attr("src",data).css("display","inline-block");
}
});
});
</script>
<tr>
<td align="right">SEO标题:</td>
<td><input name="seotitle" type="text" style="width:70%" id="seotitle" class="alltxt" value=""></td>
</tr>
<tr>
<td align="right">关键字:</td>
<td><input name="keywords" type="text" style="width:50%" id="keywords" class="alltxt" value=""> (","分开)</td>
</tr>
<tr>
<td align="right">SEO关键字:</td>
<td><input name="seokeyword" type="text" style="width:50%" id="seokeyword" class="alltxt" value=""> (","分开)</td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">分类描述:</td>
<td><textarea name="description" cols="70" style="height:70px;vertical-align:middle;width:70%" rows="3" id="description" class="alltxt"></textarea></td>
</tr>
<tr>
<td colspan="2"><strong>分类内容:</strong></td>
</tr>
<tr>
<td colspan="2">
<!-- 加载编辑器的容器 --><script id="container" name="content" type="text/plain"></script>
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 --><script type="text/javascript">var ue = UE.getEditor('container',{maximumWords:100000,initialFrameHeight:320,enableAutoSave:false});</script>
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" class="btn btn-success" value="保存(Submit)">&nbsp;&nbsp;<input type="reset" class="btn btn-default" value="重置(Reset)"></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
{
if( $(this).is('#typedir') ){
var reg = /^[a-zA-Z]+[0-9]*[a-zA-Z0-9]*$/;//验证是否为字母、数字
if(!reg.test($("#typedir").val()))
{
$parent.append(' <small class="formtips onError"><font color="red">格式不正确!</font></small>');
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
}
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
}
}
});
//重置
$('#addcat input[type="reset"]').click(function(){
$(".formtips").remove();
});
});
$('#addcat input[type="submit"]').click(function(){
$(".required").trigger('blur');
var numError = $('#addcat .onError').length;
if(numError){
return false;
}
//$("#contents").val = ue.getContent();
//var datas = $('#addcat').serialize();//#form要在form里面
//var content = ue.getContent();
/* $.ajax({
url: "/fladmin/Producttype/doedit",
type: "POST",
dataType: "json",
data: {
"id":$("#id").val(),
"typename":$("#typename").val(),
"typedir":$("#typedir").val(),
"templist":$("#templist").val(),
"temparticle":$("#temparticle").val(),
"litpic":$("#litpic").val(),
"seotitle":$("#seotitle").val(),
"keywords":$("#keywords").val(),
"seokeyword":$("#seokeyword").val(),
"description":$("#description").val(),
"content":content
//"seotitle":seotitle.replace("'", "&#039;"),
//"keywords":keywords.replace("'", "&#039;"),
//"description":description.replace("'", "&#039;"),
//"contents":content.replace("'", "&#039;")
},
success: function(data){
if(data.code==200)
{
//alert(data.info);
window.location.replace("/fladmin/Producttype");
}
}
}); */
});
</script>
</body></html>

178
resources/views/admin/producttype/edit.blade.php

@ -0,0 +1,178 @@
<!DOCTYPE html><html><head><title>修改分类_后台管理</title>{include file="common/header"/}
<div class="container-fluid">
<div class="row">
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">{include file="common/leftmenu"/}</div><!-- 左边结束 -->
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox">
<h5 class="sub-header"><a href="/fladmin/Producttype">商品分类管理</a> > 修改分类</h5>
<form method="post" action="/fladmin/Producttype/doedit" role="form" id="addcat" class="table-responsive">
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right">分类名称:</td>
<td><input name="typename" type="text" value="{$post["typename"]}" id="typename" size="30" class="required"><if condition="$action_name=='edit'"><input style="display:none;" type="text" name="id" id="id" value="{$id}"></if></td>
</tr>
<?php if($action_name=='add'){ ?>
<tr>
<td align="right">上级目录:</td>
<td><?php if($id==0){echo "顶级栏目";}else{echo $postone["typename"];} ?><input style="display:none;" type="text" name="prid" id="prid" value="<?php if($id==0){echo "top";}else{echo $id;} ?>"></td>
</tr>
<?php } ?>
<tr>
<td align="right">别名:</td>
<td><input name="typedir" type="text" value="{$post["typedir"]}" id="typedir" class="required" style="width:30%"> <small>(包含字母或数字,字母开头)</small></td>
</tr>
<tr>
<td align="right">列表模板:</td>
<td><input name="templist" id="templist" type="text" value="{$post["templist"]}" class="required" size="20"></td>
</tr>
<tr>
<td align="right">文章模板:</td>
<td><input name="temparticle" id="temparticle" type="text" value="{$post["temparticle"]}" class="required" size="20"></td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">缩略图:</td>
<td style="vertical-align:middle;"><input id="file_upload" value="选择文件" name="file_upload" type="file" multiple="true"> <input name="litpic" type="text" id="litpic" value="{$post["litpic"]}" style="width:40%"> <img style="margin-left:20px;<?php if(empty($post["litpic"]) || !imgmatch($post["litpic"])){ echo "display:none;"; } ?>" src="<?php if(imgmatch($post["litpic"])){echo $post["litpic"];} ?>" width="120" height="80" id="picview" name="picview"></td>
</tr>
<style>.uploadify{display:inline-block;}.uploadify-queue{display:none;}</style>
<script type="text/javascript">
<?php $timestamp = time();?>
bidtype="选择文件";
$(function() {
$('#file_upload').uploadify({
'buttonText': bidtype,//按钮文字
'auto':true,//选择完图片以后是否自动上传
'multi': false,//是否开启一次性上传多个文件
'fileTypeExts': "*.jpg;*.png;*.gif;*.jpeg;",//允许的文件类型
'width': 60,//buttonImg的大小
'height': 26,
'formData' : {
'timestamp' : '<?php echo $timestamp;?>',
'token' : '<?php echo md5('unique_salt' . $timestamp);?>'
},
'swf' : '/other/uploadify/uploadify.swf',//路径要正确
'uploader' : '/uploadImage.php',//路径要正确
'onUploadSuccess': function (file, data, response) { //一个文件上传成功后的响应事件处理
$('#litpic').val(data);
$('#picview').attr("src",data).css("display","inline-block");
}
});
});
</script>
<tr>
<td align="right">SEO标题:</td>
<td><input name="seotitle" type="text" style="width:70%" id="seotitle" class="alltxt" value="{$post["seotitle"]}"></td>
</tr>
<tr>
<td align="right">关键字:</td>
<td><input name="keywords" type="text" style="width:50%" id="keywords" class="alltxt" value="{$post["keywords"]}"> (","分开)</td>
</tr>
<tr>
<td align="right">SEO关键字:</td>
<td><input name="seokeyword" type="text" style="width:50%" id="seokeyword" class="alltxt" value="{$post["seokeyword"]}"> (","分开)</td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">分类描述:</td>
<td><textarea name="description" cols="70" style="height:70px;vertical-align:middle;width:70%" rows="3" id="description" class="alltxt">{$post["description"]}</textarea></td>
</tr>
<tr>
<td colspan="2"><strong>分类内容:</strong></td>
</tr>
<tr>
<td colspan="2">
<!-- 加载编辑器的容器 --><script id="container" name="content" type="text/plain">{$post["content"]}</script>
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 --><script type="text/javascript">var ue = UE.getEditor('container',{maximumWords:100000,initialFrameHeight:320,enableAutoSave:false});</script>
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" class="btn btn-success" value="保存(Submit)">&nbsp;&nbsp;<input type="reset" class="btn btn-default" value="重置(Reset)"></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
{
if( $(this).is('#typedir') ){
var reg = /^[a-zA-Z]+[0-9]*[a-zA-Z0-9]*$/;//验证是否为字母、数字
if(!reg.test($("#typedir").val()))
{
$parent.append(' <small class="formtips onError"><font color="red">格式不正确!</font></small>');
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
}
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
}
}
});
//重置
$('#addcat input[type="reset"]').click(function(){
$(".formtips").remove();
});
});
$('#addcat input[type="submit"]').click(function(){
$(".required").trigger('blur');
var numError = $('#addcat .onError').length;
if(numError){
return false;
}
//$("#contents").val = ue.getContent();
//var datas = $('#addcat').serialize();//#form要在form里面
//var content = ue.getContent();
/* $.ajax({
url: "/fladmin/Producttype/doedit",
type: "POST",
dataType: "json",
data: {
"id":$("#id").val(),
"typename":$("#typename").val(),
"typedir":$("#typedir").val(),
"templist":$("#templist").val(),
"temparticle":$("#temparticle").val(),
"litpic":$("#litpic").val(),
"seotitle":$("#seotitle").val(),
"keywords":$("#keywords").val(),
"seokeyword":$("#seokeyword").val(),
"description":$("#description").val(),
"content":content
//"seotitle":seotitle.replace("'", "&#039;"),
//"keywords":keywords.replace("'", "&#039;"),
//"description":description.replace("'", "&#039;"),
//"contents":content.replace("'", "&#039;")
},
success: function(data){
if(data.code==200)
{
//alert(data.info);
window.location.replace("/fladmin/Producttype");
}
}
}); */
});
</script>
</body></html>

24
resources/views/admin/producttype/index.blade.php

@ -0,0 +1,24 @@
<!DOCTYPE html><html><head><title>商品分类_后台管理</title>{include file="common/header"/}
<div class="container-fluid">
<div class="row">
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">{include file="common/leftmenu"/}</div><!-- 左边结束 -->
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox">
<h2 class="sub-header">商品分类管理</h2>[ <a href="/fladmin/Producttype/add">增加顶级分类</a> ] [ <a href="/fladmin/Product/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><th>操作</th></tr></thead>
<tbody id="cat-list">
<?php foreach($catlist as $row){ ?>
<tr id="cat-<?php echo $row["id"]; ?>">
<td><?php echo $row["id"]; ?></td>
<td><a href="/fladmin/Product?id=<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "";}echo $row["typename"]; ?></a></td>
<td><?php echo catarcnum($row["id"].'Product'); ?></td>
<td><?php echo $row["typedir"]; ?></td>
<td><?php echo date('Y-m-d',$row["addtime"]); ?></td>
<td><a href="<?php echo get_front_url(array("type"=>"list","catid"=>$row["id"])); ?>" target="_blank">预览</a> | <a href="/fladmin/Product/add?catid=<?php echo $row["id"]; ?>">发布商品</a> | <a href="/fladmin/Producttype/add?reid=<?php echo $row["id"]; ?>">增加子类</a> | <a href="/fladmin/Producttype/edit?id=<?php echo $row["id"]; ?>">更改</a> | <a onclick="delconfirm('/fladmin/Producttype/del?id=<?php echo $row["id"]; ?>')" href="javascript:;">删除</a></td>
</tr><?php } ?>
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 -->
</div></div><!-- 右边结束 --></div></div>
</body></html>

126
resources/views/admin/searchword/add.blade.php

@ -0,0 +1,126 @@
<!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/searchword">搜索关键词列表</a> > 添加关键词</h5>
<form id="addarc" method="post" action="/fladmin/searchword/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="filename" type="text" id="filename" class="required" value="" size="20"> </td>
</tr>
<tr>
<td align="right">标题:</td>
<td><input name="title" type="text" id="title" value="" style="width:60%"></td>
</tr>
<tr>
<td align="right">模板名称:</td>
<td><input name="template" type="text" id="template" value="tag" size="20"></td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">缩略图:</td>
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="litpic" type="text" id="litpic" value="" style="width:40%"> <img style="margin-left:20px;display:none;" src="" width="120" height="80" id="picview"></td>
</tr>
<script type="text/javascript">
var _editor;
$(function() {
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
_editor = UE.getEditor('ueditorimg');
_editor.ready(function () {
//设置编辑器不可用
_editor.setDisabled('insertimage');
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
_editor.hide();
//侦听图片上传
_editor.addListener('beforeInsertImage', function (t, arg) {
//将地址赋值给相应的input,只取第一张图片的路径
$('#litpic').val(arg[0].src);
//图片预览
$('#picview').attr("src",arg[0].src).css("display","inline-block");
})
});
});
//弹出图片上传的对话框
function upImage()
{
var myImage = _editor.getDialog("insertimage");
myImage.render();
myImage.open();
}
</script>
<script type="text/plain" id="ueditorimg"></script>
<tr>
<td align="right">关键字:</td>
<td><input type="text" name="keywords" id="keywords" style="width:50%" value=""> (,分开)</td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">摘要信息:</td>
<td><textarea name="description" rows="5" id="description" style="width:80%;height:70px;vertical-align:middle;"></textarea></td>
</tr>
<tr>
<td colspan="2"><strong>内容:</strong></td>
</tr>
<tr>
<td colspan="2">
<!-- 加载编辑器的容器 --><script id="container" name="content" type="text/plain"></script>
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 --><script type="text/javascript">var ue = UE.getEditor('container',{maximumWords:100000,initialFrameHeight:320,enableAutoSave:false});</script></td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<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
{
if( $(this).is('#filename') ){
var reg = /^[a-zA-Z]+[0-9]*[a-zA-Z0-9]*$/;//验证是否为字母、数字
if(!reg.test($("#filename").val()))
{
$parent.append(' <small class="formtips onError"><font color="red">格式不正确!</font></small>');
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</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>

126
resources/views/admin/searchword/edit.blade.php

@ -0,0 +1,126 @@
<!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/searchword">搜索关键词列表</a> > 修改关键词</h5>
<form id="addarc" method="post" action="/fladmin/searchword/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;" type="text" name="id" id="id" value="<?php echo $id; ?>"></td>
</tr>
<tr>
<td align="right">别名:</td>
<td><input name="filename" type="text" id="filename" class="required" value="<?php echo $post["filename"]; ?>" size="20"> </td>
</tr>
<tr>
<td align="right">标题:</td>
<td><input name="title" type="text" id="title" value="<?php echo $post["title"]; ?>" style="width:60%"></td>
</tr>
<tr>
<td align="right">模板名称:</td>
<td><input name="template" type="text" id="template" value="<?php echo $post["template"]; ?>" size="20"></td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">缩略图:</td>
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="litpic" type="text" id="litpic" value="<?php echo $post["litpic"]; ?>" style="width:40%"> <img style="margin-left:20px;<?php if(empty($post["litpic"]) || !imgmatch($post["litpic"])){ echo "display:none;"; } ?>" src="<?php if(imgmatch($post["litpic"])){echo $post["litpic"];} ?>" width="120" height="80" id="picview" name="picview"></td>
</tr>
<script type="text/javascript">
var _editor;
$(function() {
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
_editor = UE.getEditor('ueditorimg');
_editor.ready(function () {
//设置编辑器不可用
_editor.setDisabled('insertimage');
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
_editor.hide();
//侦听图片上传
_editor.addListener('beforeInsertImage', function (t, arg) {
//将地址赋值给相应的input,只取第一张图片的路径
$('#litpic').val(arg[0].src);
//图片预览
$('#picview').attr("src",arg[0].src).css("display","inline-block");
})
});
});
//弹出图片上传的对话框
function upImage()
{
var myImage = _editor.getDialog("insertimage");
myImage.render();
myImage.open();
}
</script>
<script type="text/plain" id="ueditorimg"></script>
<tr>
<td align="right">关键字:</td>
<td><input type="text" name="keywords" id="keywords" style="width:50%" value="<?php echo $post["keywords"]; ?>"> (,分开)</td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">摘要信息:</td>
<td><textarea name="description" rows="5" id="description" style="width:80%;height:70px;vertical-align:middle;"><?php echo $post["description"]; ?></textarea></td>
</tr>
<tr>
<td colspan="2"><strong>内容:</strong></td>
</tr>
<tr>
<td colspan="2">
<!-- 加载编辑器的容器 --><script id="container" name="content" type="text/plain"><?php echo $post["content"]; ?></script>
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 --><script type="text/javascript">var ue = UE.getEditor('container',{maximumWords:100000,initialFrameHeight:320,enableAutoSave:false});</script></td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<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
{
if( $(this).is('#filename') ){
var reg = /^[a-zA-Z]+[0-9]*[a-zA-Z0-9]*$/;//验证是否为字母、数字
if(!reg.test($("#filename").val()))
{
$parent.append(' <small class="formtips onError"><font color="red">格式不正确!</font></small>');
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</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>

33
resources/views/admin/searchword/index.blade.php

@ -0,0 +1,33 @@
<!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/searchword/add">增加关键词</a> ]<br><br>
<form name="listarc"><div class="table-responsive"><table class="table table-striped table-hover">
<thead>
<tr>
<th>编号</th>
<th>名称</th>
<th>更新时间</th>
<th>管理</th>
</tr>
</thead>
<tbody>
<?php foreach($posts as $row){ ?>
<tr>
<td><?php echo $row->id; ?></td>
<td><a href="/fladmin/searchword/edit?id=<?php echo $row->id; ?>"><?php echo $row->name; ?></a></td>
<td><?php echo date('Y-m-d',$row->pubdate); ?></td>
<td><a target="_blank" href="<?php echo get_front_url(array("type"=>"tags","tagid"=>$row->id)); ?>">预览</a>&nbsp;<a href="/fladmin/searchword/edit?id=<?php echo $row->id; ?>">修改</a>&nbsp;<a onclick="delconfirm('/fladmin/searchword/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a></td>
</tr>
<?php } ?>
</tbody>
</table></div><!-- 表格结束 --></form><!-- 表单结束 -->
<div class="backpages">{{ $posts->links() }}</div>
</div></div><!-- 右边结束 --></div></div>
</body></html>

114
resources/views/admin/slide/add.blade.php

@ -0,0 +1,114 @@
<!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/slide">轮播图列表</a> > 添加轮播图</h5>
<form id="addarc" method="post" action="/fladmin/slide/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="title" type="text" id="title" value="" class="required" style="width:30%" placeholder="在此输入关键词"></td>
</tr>
<tr>
<td align="right">链接网址:</td>
<td><input name="url" type="text" id="url" value="http://" style="width:60%" class="required"> (请用绝对地址)</td>
</tr>
<tr>
<td align="right">跳转方式:</td>
<td>
<input type="radio" value='0' name="target" checked />&nbsp;_blank&nbsp;&nbsp;
<input type="radio" value='1' name="target" />&nbsp;_self
</td>
</tr>
<tr>
<td align="right">是否显示:</td>
<td>
<input type="radio" value='0' name="is_show" checked />&nbsp;&nbsp;&nbsp;
<input type="radio" value='1' name="is_show" />&nbsp;
</td>
</tr>
<tr>
<td align="right">排序:</td>
<td>
<input name="rank" type="text" id="rank" value="" size="3" />
</td>
</tr>
<tr>
<td align="right">所属的组:</td>
<td>
<input name="group_id" type="text" id="group_id" value="" size="3" />
</td>
</tr>
<tr>
<td style="vertical-align:middle;" align="right">图片:</td>
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="pic" type="text" id="pic" value="" style="width:40%"> <img style="margin-left:20px;display:none;" src="" width="120" height="80" id="picview"></td>
</tr>
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
<script type="text/javascript">
var _editor;
$(function() {
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
_editor = UE.getEditor('ueditorimg');
_editor.ready(function () {
//设置编辑器不可用
_editor.setDisabled('insertimage');
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
_editor.hide();
//侦听图片上传
_editor.addListener('beforeInsertImage', function (t, arg) {
//将地址赋值给相应的input,只取第一张图片的路径
$('#pic').val(arg[0].src);
//图片预览
$('#picview').attr("src",arg[0].src).css("display","inline-block");
})
});
});
//弹出图片上传的对话框
function upImage()
{
var myImage = _editor.getDialog("insertimage");
myImage.render();
myImage.open();
}
</script>
<script type="text/plain" id="ueditorimg"></script>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<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>

114
resources/views/admin/slide/edit.blade.php

@ -0,0 +1,114 @@
<!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/slide">轮播图列表</a> > 轮播图修改</h5>
<form id="addarc" method="post" action="/fladmin/slide/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="title" type="text" id="title" value="<?php echo $post['title']; ?>" 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="url" type="text" id="url" value="<?php echo $post['url']; ?>" style="width:60%" class="required"> (请用绝对地址)</td>
</tr>
<tr>
<td align="right">跳转方式:</td>
<td>
<input type="radio" value='0' name="target" <?php if(isset($post['target']) && $post['target']==0){echo 'checked';} ?> />&nbsp;_blank&nbsp;&nbsp;
<input type="radio" value='1' name="target" <?php if(isset($post['target']) && $post['target']==1){echo 'checked';} ?> />&nbsp;_self
</td>
</tr>
<tr>
<td align="right">是否显示:</td>
<td>
<input type="radio" value='0' name="is_show" <?php if(isset($post['is_show']) && $post['is_show']==0){echo 'checked';} ?> />&nbsp;是&nbsp;&nbsp;
<input type="radio" value='1' name="is_show" <?php if(isset($post['is_show']) && $post['is_show']==1){echo 'checked';} ?> />&nbsp;否
</td>
</tr>
<tr>
<td align="right">排序:</td>
<td>
<input name="rank" type="text" id="rank" value="<?php echo $post['rank']; ?>" size="3" />
</td>
</tr>
<tr>
<td align="right">所属的组:</td>
<td>
<input name="group_id" type="text" id="group_id" value="<?php echo $post['group_id']; ?>" size="3" />
</td>
</tr>
<tr>
<td style="vertical-align:middle;" align="right">图片:</td>
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="pic" type="text" id="pic" value="<?php echo $post['pic']; ?>" style="width:40%"> <img style="margin-left:20px;<?php if(empty($post["pic"]) || !imgmatch($post["pic"])){ echo "display:none;"; } ?>" src="<?php if(imgmatch($post["pic"])){echo $post["pic"];} ?>" width="120" height="80" id="picview"></td>
</tr>
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
<script type="text/javascript">
var _editor;
$(function() {
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
_editor = UE.getEditor('ueditorimg');
_editor.ready(function () {
//设置编辑器不可用
_editor.setDisabled('insertimage');
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
_editor.hide();
//侦听图片上传
_editor.addListener('beforeInsertImage', function (t, arg) {
//将地址赋值给相应的input,只取第一张图片的路径
$('#pic').val(arg[0].src);
//图片预览
$('#picview').attr("src",arg[0].src).css("display","inline-block");
})
});
});
//弹出图片上传的对话框
function upImage()
{
var myImage = _editor.getDialog("insertimage");
myImage.render();
myImage.open();
}
</script>
<script type="text/plain" id="ueditorimg"></script>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<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>

32
resources/views/admin/slide/index.blade.php

@ -0,0 +1,32 @@
<!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/slide/add">添加轮播图</a> ]<br><br>
<form name="listarc"><div class="table-responsive"><table class="table table-striped table-hover">
<thead><tr>
<th>图片</th>
<th>标题</th>
<th>链接网址</th>
<th>排序</th>
<th>是否显示</th>
<th>管理</th>
</tr></thead>
<tbody>
<?php if($posts){foreach($posts as $row){ ?><tr>
<td><img style="<?php if(empty($row->pic) || !imgmatch($row->pic)){ echo "display:none;"; } ?>" src="<?php if(imgmatch($row->pic)){echo $row->pic;} ?>" width="90" height="60"></td>
<td><?php echo $row->title; ?></td>
<td><?php echo $row->url; ?></td>
<td><?php echo $row->rank; ?></td>
<td><?php if($row->is_show==0){echo "";}else{echo "<font color=red>否</font>";} ?></td>
<td><a href="/fladmin/slide/edit?id=<?php echo $row->id; ?>">修改</a> | <a onclick="delconfirm('/fladmin/slide/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a></td>
</tr><?php }} ?>
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 -->
<div class="backpages">{{ $posts->links() }}</div>
</div></div><!-- 右边结束 --></div></div>
</body></html>

67
resources/views/admin/sysconfig/add.blade.php

@ -0,0 +1,67 @@
<!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/sysconfig">系统配置参数</a> > 添加参数</h5>
<form id="addarc" method="post" action="/fladmin/sysconfig/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="varname" type="text" id="varname" value="CMS_" class="required" style="width:30%" placeholder="在此输入参数变量">(必须是字母)</td>
</tr>
<tr>
<td align="right">参数说明:</td>
<td><input name="info" type="text" id="info" value="" style="width:60%"></td>
</tr>
<tr>
<td align="right">参数值:</td>
<td><textarea name="value" rows="5" id="value" style="width:80%;height:70px;vertical-align:middle;"></textarea></td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<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(){
var bempty = true;
$("#varname").blur(function(){
var reg = /^CMS_[a-z]+$/i; // 创建正则表达式模式
var str = this.value;
if(!str.match(reg)){bempty=false;alert('输入错误,请重新输入!');}else{bempty=true}
});
$(".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
{
if(bempty)
{
$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>

67
resources/views/admin/sysconfig/edit.blade.php

@ -0,0 +1,67 @@
<!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/sysconfig">系统配置参数</a> > 参数修改</h5>
<form id="addarc" method="post" action="/fladmin/sysconfig/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="varname" type="text" id="varname" value="<?php echo $post["varname"]; ?>" 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="info" type="text" id="info" value="<?php echo $post["info"]; ?>" style="width:60%"></td>
</tr>
<tr>
<td align="right">参数值:</td>
<td><textarea name="value" rows="5" id="value" style="width:80%;height:70px;vertical-align:middle;"><?php echo $post["value"]; ?></textarea></td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<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(){
var bempty = true;
$("#varname").blur(function(){
var reg = /^cms_[a-z]+$/i; // 创建正则表达式模式
var str = this.value;
if(!str.match(reg)){bempty=false;alert('输入错误,请重新输入!');}else{bempty=true}
});
$(".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
{
if(bempty)
{
$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>

28
resources/views/admin/sysconfig/index.blade.php

@ -0,0 +1,28 @@
<!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/sysconfig/add">添加参数</a> ] [ <a href="<?php echo route('admin_index_upconfig'); ?>">更新配置缓存</a> ]<br><br>
<form name="listarc"><div class="table-responsive"><table class="table table-striped table-hover">
<thead><tr>
<th>编号</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->info; ?></td>
<td><?php echo mb_strcut($row->value,0,80,'utf-8'); ?></td>
<td><?php echo $row->varname; ?></td>
<td><a href="/fladmin/sysconfig/edit?id=<?php echo $row->id; ?>">修改</a> | <a onclick="delconfirm('/fladmin/sysconfig/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a></td>
</tr><?php } ?>
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 -->
</div></div><!-- 右边结束 --></div></div>
</body></html>

137
resources/views/admin/tag/add.blade.php

@ -0,0 +1,137 @@
<!DOCTYPE html><html><head><title>添加Tag_后台管理</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/tag">Tag列表</a> > 添加Tag</h5>
<form id="addarc" method="post" action="/fladmin/tag/doadd" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right">Tag名称:</td>
<td><input name="tag" type="text" id="tag" value="" class="required" style="width:30%" placeholder="在此输入名称"></td>
</tr>
<tr>
<td align="right">是否审核:</td>
<td>
<input type="radio" value='1' name="ischeck" checked />&nbsp;&nbsp;&nbsp;
<input type="radio" value='0' name="ischeck" />&nbsp;
</td>
</tr>
<tr>
<td align="right">别名:</td>
<td><input name="filename" type="text" id="filename" class="required" value="" size="20"> </td>
</tr>
<tr>
<td align="right">Tag标题:</td>
<td><input name="title" type="text" id="title" value="" style="width:60%"></td>
</tr>
<tr>
<td align="right">模板名称:</td>
<td><input name="template" type="text" id="template" value="tag" size="20"></td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">缩略图:</td>
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="litpic" type="text" id="litpic" value="" style="width:40%"> <img style="margin-left:20px;display:none;" src="" width="120" height="80" id="picview"></td>
</tr>
<script type="text/javascript">
var _editor;
$(function() {
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
_editor = UE.getEditor('ueditorimg');
_editor.ready(function () {
//设置编辑器不可用
_editor.setDisabled('insertimage');
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
_editor.hide();
//侦听图片上传
_editor.addListener('beforeInsertImage', function (t, arg) {
//将地址赋值给相应的input,只取第一张图片的路径
$('#litpic').val(arg[0].src);
//图片预览
$('#picview').attr("src",arg[0].src).css("display","inline-block");
})
});
});
//弹出图片上传的对话框
function upImage()
{
var myImage = _editor.getDialog("insertimage");
myImage.render();
myImage.open();
}
</script>
<script type="text/plain" id="ueditorimg"></script>
<tr>
<td align="right">Tag关键字:</td>
<td><input type="text" name="keywords" id="keywords" style="width:50%" value=""> (,分开)</td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">Tag摘要信息:</td>
<td><textarea name="description" rows="5" id="description" style="width:80%;height:70px;vertical-align:middle;"></textarea></td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">Tag文章列表:</td>
<td><textarea name="tagarc" rows="5" id="tagarc" style="width:80%;height:70px;vertical-align:middle;"></textarea> (,分开)</td>
</tr>
<tr>
<td colspan="2"><strong>Tag内容:</strong></td>
</tr>
<tr>
<td colspan="2">
<!-- 加载编辑器的容器 --><script id="container" name="content" type="text/plain"></script>
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 --><script type="text/javascript">var ue = UE.getEditor('container',{maximumWords:100000,initialFrameHeight:320,enableAutoSave:false});</script></td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<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
{
if( $(this).is('#filename') ){
var reg = /^[a-zA-Z]+[0-9]*[a-zA-Z0-9]*$/;//验证是否为字母、数字
if(!reg.test($("#filename").val()))
{
$parent.append(' <small class="formtips onError"><font color="red">格式不正确!</font></small>');
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</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>

137
resources/views/admin/tag/edit.blade.php

@ -0,0 +1,137 @@
<!DOCTYPE html><html><head><title>修改Tag_后台管理</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/tag">Tag列表</a> > 修改Tag</h5>
<form id="addarc" method="post" action="/fladmin/tag/doedit" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right">Tag名称:</td>
<td><input name="tag" type="text" id="tag" value="<?php echo $post["tag"]; ?>" 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 type="radio" value='0' name="ischeck" <?php if($post['ischeck']==0){echo 'checked';} ?> />&nbsp;是&nbsp;&nbsp;
<input type="radio" value='1' name="ischeck" <?php if($post['ischeck']==1){echo 'checked';} ?> />&nbsp;否
</td>
</tr>
<tr>
<td align="right">别名:</td>
<td><input name="filename" type="text" id="filename" class="required" value="<?php echo $post["filename"]; ?>" size="20"> </td>
</tr>
<tr>
<td align="right">Tag标题:</td>
<td><input name="title" type="text" id="title" value="<?php echo $post["title"]; ?>" style="width:60%"></td>
</tr>
<tr>
<td align="right">模板名称:</td>
<td><input name="template" type="text" id="template" value="<?php echo $post["template"]; ?>" size="20"></td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">缩略图:</td>
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="litpic" type="text" id="litpic" value="<?php echo $post["litpic"]; ?>" style="width:40%"> <img style="margin-left:20px;<?php if(empty($post["litpic"]) || !imgmatch($post["litpic"])){ echo "display:none;"; } ?>" src="<?php if(imgmatch($post["litpic"])){echo $post["litpic"];} ?>" width="120" height="80" id="picview" name="picview"></td>
</tr>
<script type="text/javascript">
var _editor;
$(function() {
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
_editor = UE.getEditor('ueditorimg');
_editor.ready(function () {
//设置编辑器不可用
_editor.setDisabled('insertimage');
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
_editor.hide();
//侦听图片上传
_editor.addListener('beforeInsertImage', function (t, arg) {
//将地址赋值给相应的input,只取第一张图片的路径
$('#litpic').val(arg[0].src);
//图片预览
$('#picview').attr("src",arg[0].src).css("display","inline-block");
})
});
});
//弹出图片上传的对话框
function upImage()
{
var myImage = _editor.getDialog("insertimage");
myImage.render();
myImage.open();
}
</script>
<script type="text/plain" id="ueditorimg"></script>
<tr>
<td align="right">Tag关键字:</td>
<td><input type="text" name="keywords" id="keywords" style="width:50%" value="<?php echo $post["keywords"]; ?>"> (,分开)</td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">Tag摘要信息:</td>
<td><textarea name="description" rows="5" id="description" style="width:80%;height:70px;vertical-align:middle;"><?php echo $post["description"]; ?></textarea></td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">Tag文章列表:</td>
<td><textarea name="tagarc" rows="5" id="tagarc" style="width:80%;height:70px;vertical-align:middle;"><?php echo $aidlist; ?></textarea> (用,分开)</td>
</tr>
<tr>
<td colspan="2"><strong>Tag内容:</strong></td>
</tr>
<tr>
<td colspan="2">
<!-- 加载编辑器的容器 --><script id="container" name="content" type="text/plain"><?php echo $post["content"]; ?></script>
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 --><script type="text/javascript">var ue = UE.getEditor('container',{maximumWords:100000,initialFrameHeight:320,enableAutoSave:false});</script></td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<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
{
if( $(this).is('#filename') ){
var reg = /^[a-zA-Z]+[0-9]*[a-zA-Z0-9]*$/;//验证是否为字母、数字
if(!reg.test($("#filename").val()))
{
$parent.append(' <small class="formtips onError"><font color="red">格式不正确!</font></small>');
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</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>

34
resources/views/admin/tag/index.blade.php

@ -0,0 +1,34 @@
<!DOCTYPE html><html><head><title>Tag列表_后台管理</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">Tag管理</h2>[ <a href="/fladmin/tag/add">增加Tag标签</a> ]<br><br>
<form name="listarc"><div class="table-responsive"><table class="table table-striped table-hover">
<thead>
<tr>
<th>编号</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><a href="/fladmin/tag/edit?id=<?php echo $row->id; ?>"><?php echo $row->tag; ?></a></td><td><?php echo tagarcnum($row->id); ?></td>
<td><?php echo date('Y-m-d',$row->pubdate); ?></td>
<td><a target="_blank" href="<?php echo get_front_url(array("type"=>"tags","tagid"=>$row->id)); ?>">预览</a>&nbsp;<a href="/fladmin/tag/edit?id=<?php echo $row->id; ?>">修改</a>&nbsp;<a onclick="delconfirm('/fladmin/tag/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a></td>
</tr>
<?php } ?>
</tbody>
</table></div><!-- 表格结束 --></form><!-- 表单结束 -->
<div class="backpages">{{ $posts->links() }}</div>
</div></div><!-- 右边结束 --></div></div>
</body></html>

58
resources/views/admin/user/edit.blade.php

@ -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>&nbsp;&nbsp;<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>

12
resources/views/admin/user/index.blade.php

@ -0,0 +1,12 @@
<!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/user/edit" class="btn btn-success">修改密码</a>
</div></div><!-- 右边结束 --></div></div>
</body></html>

54
resources/views/admin/user/register.blade.php

@ -0,0 +1,54 @@
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1">
<title>注册</title>
<link rel="stylesheet" href="/css/bootstrap.min.css"><link rel="stylesheet" href="/css/admin.css"><script src="/js/jquery.min.js"></script><script src="/js/ad.js"></script></head><body>
<div style="margin:100px auto;width:300px;">
<h1 style="text-align:center;">注册</h1>
<form id="reg">
<div class="form-group"><input type="text" class="form-control required" name="username" id="username" placeholder="用户名"></div>
<div class="form-group"><input type="password" class="form-control required" name="pwd" id="pwd" placeholder="密码"></div>
<button type="submit" class="btn btn-success" value="Submit">注册</button>
</form>
</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>');
}
});
$("#reg").submit(function(){
$(".required").trigger('blur');
var numError = $('#reg .onError').length;
if(numError){return false;}
$.ajax({
url: "/Fladmin/User/doregister",
type: "POST",
dataType: "json",
cache: false,
data: {
"username":$("#username").val(),
"pwd":$("#pwd").val()
},
success: function(data){
if(data.code==200)
{
//alert(data.info);
window.location.replace("/Fladmin/User");
}
}
});
});
});
</script>
<script src="/js/bootstrap.min.js"></script></body></html>

62
routes/web.php

@ -50,6 +50,8 @@ Route::group(['namespace' => 'Home'], function () {
//后台路由
Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['web']], function () {
Route::get('/', 'IndexController@index')->name('admin');
Route::get('/index/upconfig', 'IndexController@upconfig')->name('admin_index_upconfig');
//文章
Route::get('/article', 'ArticleController@index')->name('admin_article');
Route::get('/article/add', 'ArticleController@add')->name('admin_article_add');
@ -74,31 +76,71 @@ Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['w
Route::get('/page/edit', 'PageController@edit')->name('admin_page_edit');
Route::post('/page/doedit', 'PageController@doedit')->name('admin_page_doedit');
Route::get('/page/del', 'PageController@del')->name('admin_page_del');
//友情链接
Route::get('/friendlink', 'FriendlinkController@index')->name('admin_friendlink');
Route::get('/friendlink/add', 'FriendlinkController@add')->name('admin_friendlink_add');
Route::post('/friendlink/doadd', 'FriendlinkController@doadd')->name('admin_friendlink_doadd');
Route::get('/friendlink/edit', 'FriendlinkController@edit')->name('admin_friendlink_edit');
Route::post('/friendlink/doedit', 'FriendlinkController@doedit')->name('admin_friendlink_doedit');
Route::get('/friendlink/del', 'FriendlinkController@del')->name('admin_friendlink_del');
//在线留言管理
Route::get('/guestbook', 'GuestbookController@index')->name('admin_guestbook');
Route::get('/guestbook/del', 'GuestbookController@del')->name('admin_guestbook_del');
//关键词管理
Route::get('/keyword', 'KeywordController@index')->name('admin_keyword');
Route::get('/keyword/add', 'KeywordController@add')->name('admin_keyword_add');
Route::post('/keyword/doadd', 'KeywordController@doadd')->name('admin_keyword_doadd');
Route::get('/keyword/edit', 'KeywordController@edit')->name('admin_keyword_edit');
Route::post('/keyword/doedit', 'KeywordController@doedit')->name('admin_keyword_doedit');
Route::get('/keyword/del', 'KeywordController@del')->name('admin_keyword_del');
//产品
Route::get('/product', 'ProductController@index')->name('admin_product');
Route::get('/search', 'SearchController@index')->name('admin_search');
Route::get('/product/add', 'ProductController@add')->name('admin_product_add');
Route::post('/product/doadd', 'ProductController@doadd')->name('admin_product_doadd');
Route::get('/product/edit', 'ProductController@edit')->name('admin_product_edit');
Route::post('/product/doedit', 'ProductController@doedit')->name('admin_product_doedit');
Route::get('/product/del', 'ProductController@del')->name('admin_product_del');
//搜索关键词
Route::get('/searchword', 'SearchwordController@index')->name('admin_searchword');
Route::get('/searchword/add', 'SearchwordController@add')->name('admin_searchword_add');
Route::post('/searchword/doadd', 'SearchwordController@doadd')->name('admin_searchword_doadd');
Route::get('/searchword/edit', 'SearchwordController@edit')->name('admin_searchword_edit');
Route::post('/searchword/doedit', 'SearchwordController@doedit')->name('admin_searchword_doedit');
Route::get('/searchword/del', 'SearchwordController@del')->name('admin_searchword_del');
//幻灯片
Route::get('/slide', 'SlideController@index')->name('admin_slide');
Route::get('/slide/add', 'SlideController@add')->name('admin_slide_add');
Route::post('/slide/doadd', 'SlideController@doadd')->name('admin_slide_doadd');
Route::get('/slide/edit', 'SlideController@edit')->name('admin_slide_edit');
Route::post('/slide/doedit', 'SlideController@doedit')->name('admin_slide_doedit');
Route::get('/slide/del', 'SlideController@del')->name('admin_slide_del');
//标签
Route::get('/tag', 'TagController@index')->name('admin_tag');
Route::get('/tag/add', 'TagController@add')->name('admin_tag_add');
Route::post('/tag/doadd', 'TagController@doadd')->name('admin_tag_doadd');
Route::get('/tag/edit', 'TagController@edit')->name('admin_tag_edit');
Route::post('/tag/doedit', 'TagController@doedit')->name('admin_tag_doedit');
Route::get('/tag/del', 'TagController@del')->name('admin_tag_del');
//系统参数配置
Route::get('/sysconfig', 'SysconfigController@index')->name('admin_sysconfig');
Route::get('/sysconfig/add', 'SysconfigController@add')->name('admin_sysconfig_add');
Route::post('/sysconfig/doadd', 'SysconfigController@doadd')->name('admin_sysconfig_doadd');
Route::get('/sysconfig/edit', 'SysconfigController@edit')->name('admin_sysconfig_edit');
Route::post('/sysconfig/doedit', 'SysconfigController@doedit')->name('admin_sysconfig_doedit');
Route::get('/sysconfig/del', 'SysconfigController@del')->name('admin_sysconfig_del');
//用户
Route::get('/user', 'UserController@index')->name('admin_user');
Route::get('/user/edit', 'UserController@edit')->name('admin_user_edit');
Route::post('/user/doedit', 'UserController@doedit')->name('admin_user_doedit');
//后台登录注销
Route::get('/login', 'LoginController@login')->name('admin_login');
Route::post('/dologin', 'LoginController@dologin');
Route::get('/logout', 'LoginController@logout')->name('admin_logout');
Route::get('/recoverpwd', 'LoginController@recoverpwd')->name('admin_recoverpwd');
Route::get('/jump', 'LoginController@jump')->name('admin_jump');
});
Route::get('/fladmin/jump', 'Admin\IndexController@jump')->name('admin_jump');
//Route::get('/fladmin', 'Admin\IndexController@index')->name('admin');
//Route::get('/fladmin/login', 'Admin\LoginController@login')->name('admin_login');
//Route::post('/fladmin/dologin', 'Admin\LoginController@dologin');
//Route::get('/fladmin/logout', 'Admin\LoginController@logout');
//接口路由
Route::group(['prefix' => 'Api'], function () {
Route::get('/ccc', function () {

Loading…
Cancel
Save