林一峰
8 years ago
47 changed files with 3617 additions and 125 deletions
-
43app/Common/function.php
-
39app/Http/Controllers/Admin/CommonController.php
-
80app/Http/Controllers/Admin/FriendlinkController.php
-
49app/Http/Controllers/Admin/GuestbookController.php
-
12app/Http/Controllers/Admin/IndexController.php
-
78app/Http/Controllers/Admin/KeywordController.php
-
6app/Http/Controllers/Admin/LoginController.php
-
181app/Http/Controllers/Admin/ProductController.php
-
115app/Http/Controllers/Admin/ProducttypeController.php
-
81app/Http/Controllers/Admin/SearchController.php
-
87app/Http/Controllers/Admin/SearchwordController.php
-
82app/Http/Controllers/Admin/SlideController.php
-
107app/Http/Controllers/Admin/SysconfigController.php
-
149app/Http/Controllers/Admin/TagController.php
-
49app/Http/Controllers/Admin/UserController.php
-
188composer.lock
-
2resources/views/admin/common/leftmenu.blade.php
-
54resources/views/admin/friendlink/add.blade.php
-
54resources/views/admin/friendlink/edit.blade.php
-
28resources/views/admin/friendlink/index.blade.php
-
60resources/views/admin/guestbook/index.blade.php
-
1resources/views/admin/index/index.blade.php
-
54resources/views/admin/keyword/add.blade.php
-
54resources/views/admin/keyword/edit.blade.php
-
28resources/views/admin/keyword/index.blade.php
-
183resources/views/admin/product/add.blade.php
-
184resources/views/admin/product/edit.blade.php
-
115resources/views/admin/product/index.blade.php
-
176resources/views/admin/producttype/add.blade.php
-
178resources/views/admin/producttype/edit.blade.php
-
24resources/views/admin/producttype/index.blade.php
-
126resources/views/admin/searchword/add.blade.php
-
126resources/views/admin/searchword/edit.blade.php
-
33resources/views/admin/searchword/index.blade.php
-
114resources/views/admin/slide/add.blade.php
-
114resources/views/admin/slide/edit.blade.php
-
32resources/views/admin/slide/index.blade.php
-
67resources/views/admin/sysconfig/add.blade.php
-
67resources/views/admin/sysconfig/edit.blade.php
-
28resources/views/admin/sysconfig/index.blade.php
-
137resources/views/admin/tag/add.blade.php
-
137resources/views/admin/tag/edit.blade.php
-
34resources/views/admin/tag/index.blade.php
-
58resources/views/admin/user/edit.blade.php
-
12resources/views/admin/user/index.blade.php
-
54resources/views/admin/user/register.blade.php
-
62routes/web.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('删除失败!请重新提交'); |
|||
} |
|||
} |
|||
} |
@ -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 ,删除失败!请重新提交"); |
|||
} |
|||
} |
|||
} |
@ -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('删除失败!请重新提交'); |
|||
} |
|||
} |
|||
} |
@ -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(); |
|||
} |
|||
} |
@ -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); |
|||
} |
|||
} |
|||
} |
|||
} |
@ -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); |
|||
} |
|||
} |
|||
} |
@ -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('删除失败!请重新提交'); |
|||
} |
|||
} |
|||
} |
@ -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('删除失败!请重新提交'); |
|||
} |
|||
} |
|||
} |
@ -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('删除失败!请重新提交'); |
|||
} |
|||
} |
|||
} |
@ -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('删除失败!请重新提交'); |
|||
} |
|||
} |
|||
} |
@ -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('修改失败!旧用户名或密码错误'); |
|||
} |
|||
} |
|||
} |
@ -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> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
</div></div><!-- 右边结束 --></div></div> |
|||
|
|||
<script> |
|||
$(function(){ |
|||
$(".required").blur(function(){ |
|||
var $parent = $(this).parent(); |
|||
$parent.find(".formtips").remove(); |
|||
if(this.value=="") |
|||
{ |
|||
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>'); |
|||
} |
|||
else |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>'); |
|||
} |
|||
}); |
|||
|
|||
//重置
|
|||
$('#addarc input[type="reset"]').click(function(){ |
|||
$(".formtips").remove(); |
|||
}); |
|||
|
|||
$("#addarc").submit(function(){ |
|||
$(".required").trigger('blur'); |
|||
var numError = $('#addarc .onError').length; |
|||
|
|||
if(numError){return false;} |
|||
}); |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -0,0 +1,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> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
</div></div><!-- 右边结束 --></div></div> |
|||
|
|||
<script> |
|||
$(function(){ |
|||
$(".required").blur(function(){ |
|||
var $parent = $(this).parent(); |
|||
$parent.find(".formtips").remove(); |
|||
if(this.value=="") |
|||
{ |
|||
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>'); |
|||
} |
|||
else |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>'); |
|||
} |
|||
}); |
|||
|
|||
//重置
|
|||
$('#addarc input[type="reset"]').click(function(){ |
|||
$(".formtips").remove(); |
|||
}); |
|||
|
|||
$("#addarc").submit(function(){ |
|||
$(".required").trigger('blur'); |
|||
var numError = $('#addarc .onError').length; |
|||
|
|||
if(numError){return false;} |
|||
}); |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -0,0 +1,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> |
@ -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> <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> |
@ -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> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
</div></div><!-- 右边结束 --></div></div> |
|||
|
|||
<script> |
|||
$(function(){ |
|||
$(".required").blur(function(){ |
|||
var $parent = $(this).parent(); |
|||
$parent.find(".formtips").remove(); |
|||
if(this.value=="") |
|||
{ |
|||
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>'); |
|||
} |
|||
else |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>'); |
|||
} |
|||
}); |
|||
|
|||
//重置
|
|||
$('#addarc input[type="reset"]').click(function(){ |
|||
$(".formtips").remove(); |
|||
}); |
|||
|
|||
$("#addarc").submit(function(){ |
|||
$(".required").trigger('blur'); |
|||
var numError = $('#addarc .onError').length; |
|||
|
|||
if(numError){return false;} |
|||
}); |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -0,0 +1,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> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
</div></div><!-- 右边结束 --></div></div> |
|||
|
|||
<script> |
|||
$(function(){ |
|||
$(".required").blur(function(){ |
|||
var $parent = $(this).parent(); |
|||
$parent.find(".formtips").remove(); |
|||
if(this.value=="") |
|||
{ |
|||
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>'); |
|||
} |
|||
else |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>'); |
|||
} |
|||
}); |
|||
|
|||
//重置
|
|||
$('#addarc input[type="reset"]').click(function(){ |
|||
$(".formtips").remove(); |
|||
}); |
|||
|
|||
$("#addarc").submit(function(){ |
|||
$(".required").trigger('blur'); |
|||
var numError = $('#addarc .onError').length; |
|||
|
|||
if(numError){return false;} |
|||
}); |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -0,0 +1,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> |
@ -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=""> 运费:<input name="delivery_fee" type="text" id="delivery_fee" style="width:100px" value=""> 销量:<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=""> 原价:<input name="origin_price" type="text" id="origin_price" style="width:100px" value=""> 库存:<input name="inventory" type="text" id="inventory" style="width:60px" value=""> 浏览次数:<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 /> 是 |
|||
<input type="radio" value='1' name="status" /> 否 |
|||
</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> <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("'", "'"),
|
|||
//"seotitle":seotitle.replace("'", "'"),
|
|||
//"keywords":keywords.replace("'", "'"),
|
|||
//"description":description.replace("'", "'"),
|
|||
//"contents":content.replace("'", "'")
|
|||
}, |
|||
success: function(data){ |
|||
if(data.code==200) |
|||
{ |
|||
//alert(data.info);
|
|||
window.location.replace("/fladmin/Product"); |
|||
} |
|||
} |
|||
}); */ |
|||
}); |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -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"]}"> 运费:<input name="delivery_fee" type="text" id="delivery_fee" style="width:100px" value="{$post["delivery_fee"]}"> 销量:<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"]}"> 原价:<input name="origin_price" type="text" id="origin_price" style="width:100px" value="{$post["origin_price"]}"> 库存:<input name="inventory" type="text" id="inventory" style="width:60px" value="{$post["inventory"]}"> 浏览次数:<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} /> 是 |
|||
<input type="radio" value='1' name="status" {if condition="$post['status']==1"}checked{/if} /> 否 |
|||
</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> <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("'", "'"),
|
|||
//"seotitle":seotitle.replace("'", "'"),
|
|||
//"keywords":keywords.replace("'", "'"),
|
|||
//"description":description.replace("'", "'"),
|
|||
//"contents":content.replace("'", "'")
|
|||
}, |
|||
success: function(data){ |
|||
if(data.code==200) |
|||
{ |
|||
//alert(data.info);
|
|||
window.location.replace("/fladmin/Product"); |
|||
} |
|||
} |
|||
}); */ |
|||
}); |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -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> <a href="/fladmin/Product/edit?id=<?php echo $row["id"]; ?>">修改</a> <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> |
|||
<a href="javascript:delArc()" class="coolbg">删除</a> |
|||
<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> |
@ -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)"> <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("'", "'"),
|
|||
//"keywords":keywords.replace("'", "'"),
|
|||
//"description":description.replace("'", "'"),
|
|||
//"contents":content.replace("'", "'")
|
|||
}, |
|||
success: function(data){ |
|||
if(data.code==200) |
|||
{ |
|||
//alert(data.info);
|
|||
window.location.replace("/fladmin/Producttype"); |
|||
} |
|||
} |
|||
}); */ |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -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)"> <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("'", "'"),
|
|||
//"keywords":keywords.replace("'", "'"),
|
|||
//"description":description.replace("'", "'"),
|
|||
//"contents":content.replace("'", "'")
|
|||
}, |
|||
success: function(data){ |
|||
if(data.code==200) |
|||
{ |
|||
//alert(data.info);
|
|||
window.location.replace("/fladmin/Producttype"); |
|||
} |
|||
} |
|||
}); */ |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -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> |
@ -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> <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> |
@ -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> <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> |
@ -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> <a href="/fladmin/searchword/edit?id=<?php echo $row->id; ?>">修改</a> <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> |
@ -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 /> _blank |
|||
<input type="radio" value='1' name="target" /> _self |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">是否显示:</td> |
|||
<td> |
|||
<input type="radio" value='0' name="is_show" checked /> 是 |
|||
<input type="radio" value='1' name="is_show" /> 否 |
|||
</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> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
</div></div><!-- 右边结束 --></div></div> |
|||
|
|||
<script> |
|||
$(function(){ |
|||
$(".required").blur(function(){ |
|||
var $parent = $(this).parent(); |
|||
$parent.find(".formtips").remove(); |
|||
if(this.value=="") |
|||
{ |
|||
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>'); |
|||
} |
|||
else |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>'); |
|||
} |
|||
}); |
|||
|
|||
//重置
|
|||
$('#addarc input[type="reset"]').click(function(){ |
|||
$(".formtips").remove(); |
|||
}); |
|||
|
|||
$("#addarc").submit(function(){ |
|||
$(".required").trigger('blur'); |
|||
var numError = $('#addarc .onError').length; |
|||
|
|||
if(numError){return false;} |
|||
}); |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -0,0 +1,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';} ?> /> _blank
|
|||
<input type="radio" value='1' name="target" <?php if(isset($post['target']) && $post['target']==1){echo 'checked';} ?> /> _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';} ?> /> 是
|
|||
<input type="radio" value='1' name="is_show" <?php if(isset($post['is_show']) && $post['is_show']==1){echo 'checked';} ?> /> 否
|
|||
</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> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
</div></div><!-- 右边结束 --></div></div> |
|||
|
|||
<script> |
|||
$(function(){ |
|||
$(".required").blur(function(){ |
|||
var $parent = $(this).parent(); |
|||
$parent.find(".formtips").remove(); |
|||
if(this.value=="") |
|||
{ |
|||
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>'); |
|||
} |
|||
else |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>'); |
|||
} |
|||
}); |
|||
|
|||
//重置
|
|||
$('#addarc input[type="reset"]').click(function(){ |
|||
$(".formtips").remove(); |
|||
}); |
|||
|
|||
$("#addarc").submit(function(){ |
|||
$(".required").trigger('blur'); |
|||
var numError = $('#addarc .onError').length; |
|||
|
|||
if(numError){return false;} |
|||
}); |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -0,0 +1,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> |
@ -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> <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> |
@ -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> <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> |
@ -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> |
@ -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 /> 是 |
|||
<input type="radio" value='0' name="ischeck" /> 否 |
|||
</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> <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> |
@ -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';} ?> /> 是
|
|||
<input type="radio" value='1' name="ischeck" <?php if($post['ischeck']==1){echo 'checked';} ?> /> 否
|
|||
</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> <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> |
@ -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> <a href="/fladmin/tag/edit?id=<?php echo $row->id; ?>">修改</a> <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> |
@ -0,0 +1,58 @@ |
|||
<!DOCTYPE html><html><head><title>密码修改_后台管理</title>@include('admin.common.header') |
|||
<div class="container-fluid"> |
|||
<div class="row"> |
|||
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 --> |
|||
<style>.input-error{background-color:#ffe7e7;}</style>
|
|||
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox"> |
|||
<h2 class="sub-header">密码修改</h2> |
|||
<form id="addarc" method="post" action="/fladmin/user/doedit" class="table-responsive" role="form">{{ csrf_field() }} |
|||
<table class="table table-striped table-bordered"> |
|||
<tbody> |
|||
<tr> |
|||
<td align="right">用户名:</td> |
|||
<td><input name="username" type="text" class="" id="username" value="<?php echo $post["username"]; ?>" style="width:30%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">旧密码:</td> |
|||
<td><input name="oldpwd" type="password" class="" id="oldpwd" value="" style="width:30%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">新密码:</td> |
|||
<td><input name="newpwd" type="password" class="" id="newpwd" value="" style="width:30%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">确认密码:</td> |
|||
<td><input name="newpwd2" type="password" class="" id="newpwd2" value="" style="width:30%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
</div></div><!-- 右边结束 --></div></div> |
|||
<script> |
|||
$('#addarc input[type="text"], #addarc input[type="password"]').on('focus', function() { |
|||
$(this).removeClass('input-error'); |
|||
}); |
|||
$('#addarc').on('submit', function(e) { |
|||
$(this).find('input[type="text"], input[type="password"]').each(function(){ |
|||
if( $(this).val() == "" ) { |
|||
e.preventDefault(); |
|||
$(this).addClass('input-error'); |
|||
} |
|||
else { |
|||
$(this).removeClass('input-error'); |
|||
} |
|||
}); |
|||
if($('#newpwd').val()!=$('#newpwd2').val() || $('#newpwd').val()=='') |
|||
{ |
|||
e.preventDefault(); |
|||
$('#newpwd').addClass('input-error'); |
|||
$('#newpwd2').addClass('input-error'); |
|||
} |
|||
else { |
|||
$('#newpwd').removeClass('input-error'); |
|||
$('#newpwd2').removeClass('input-error'); |
|||
} |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -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> |
@ -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> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue