林一峰
8 years ago
41 changed files with 2477 additions and 69 deletions
-
1.env.example
-
162app/Common/function.php
-
281app/Http/Controllers/Admin/ArticleController.php
-
123app/Http/Controllers/Admin/CategoryController.php
-
54app/Http/Controllers/Admin/CommonController.php
-
35app/Http/Controllers/Admin/IndexController.php
-
95app/Http/Controllers/Admin/LoginController.php
-
85app/Http/Controllers/Admin/PageController.php
-
44app/Http/Controllers/Controller.php
-
12app/Http/Controllers/Home/CommonController.php
-
33app/Http/Controllers/Home/IndexController.php
-
4app/Http/Controllers/Wap/IndexController.php
-
2app/Http/Kernel.php
-
28app/Http/Middleware/CheckLogin.php
-
41app/Http/Model/Arctype.php
-
61app/Http/Model/Article.php
-
17app/Http/Model/Sysconfig.php
-
27app/Http/Model/User.php
-
25app/Http/Model/UserRole.php
-
7composer.json
-
64composer.lock
-
4config/app.php
-
12config/custom.php
-
2config/database.php
-
2public/index.php
-
164resources/views/admin/article/add.blade.php
-
147resources/views/admin/article/edit.blade.php
-
115resources/views/admin/article/index.blade.php
-
26resources/views/admin/article/repetarc.blade.php
-
145resources/views/admin/category/add.blade.php
-
21resources/views/admin/category/index.blade.php
-
12resources/views/admin/common/header.blade.php
-
26resources/views/admin/common/leftmenu.blade.php
-
18resources/views/admin/index/index.blade.php
-
47resources/views/admin/index/jump.blade.php
-
172resources/views/admin/login/login.blade.php
-
160resources/views/admin/page/add.blade.php
-
156resources/views/admin/page/edit.blade.php
-
33resources/views/admin/page/index.blade.php
-
20resources/views/home/404.blade.php
-
63routes/web.php
@ -0,0 +1,281 @@ |
|||
<?php |
|||
namespace App\Http\Controllers\Admin; |
|||
|
|||
use App\Http\Controllers\Admin\CommonController; |
|||
use DB; |
|||
|
|||
class ArticleController 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'].'%'); |
|||
} |
|||
|
|||
if(isset($_REQUEST["typeid"]) && $_REQUEST["typeid"]!=0) |
|||
{ |
|||
$query->where('typeid', $_REQUEST["typeid"]); |
|||
} |
|||
|
|||
if(isset($_REQUEST["id"])) |
|||
{ |
|||
$query->where('typeid', $_REQUEST["id"]); |
|||
} |
|||
|
|||
if(isset($_REQUEST["ischeck"])) |
|||
{ |
|||
$query->where('ischeck', $_REQUEST["ischeck"]); //未审核过的文章
|
|||
} |
|||
}; |
|||
|
|||
$posts = parent::pageList('article', $where); |
|||
foreach($posts as $key=>$value) |
|||
{ |
|||
$info = DB::table('arctype')->select('typename')->where("id", $value->typeid)->first(); |
|||
$posts[$key]->typename = $info->typename; |
|||
$posts[$key]->body = ''; |
|||
} |
|||
|
|||
$data['posts'] = $posts; |
|||
|
|||
return view('admin.article.index', $data); |
|||
|
|||
//if(!empty($_GET["id"])){$id = $_GET["id"];}else {$id="";}if(preg_match('/[0-9]*/',$id)){}else{exit;}
|
|||
|
|||
/* if(!empty($id)){$map['typeid']=$id;} |
|||
$Article = M("Article")->field('id')->where($map); |
|||
$counts = $Article->count(); |
|||
|
|||
$pagesize =CMS_PAGESIZE;$page =0; |
|||
if($counts % $pagesize){ //取总数据量除以每页数的余数
|
|||
$pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果
|
|||
}else{$pages = $counts/$pagesize;} |
|||
if(!empty($_GET["page"])){$page = $_GET["page"]-1;$nextpage=$_GET["page"]+1;$previouspage=$_GET["page"]-1;}else{$page = 0;$nextpage=2;$previouspage=0;} |
|||
if($counts>0){if($page>$pages-1){exit;}} |
|||
$start = $page*$pagesize; |
|||
$Article = M("Article")->field('id,typeid,title,pubdate,click,litpic,tuijian')->where($map)->order('id desc')->limit($start,$pagesize)->select(); |
|||
|
|||
$this->counts = $counts; |
|||
$this->pages = $pages; |
|||
$this->page = $page; |
|||
$this->nextpage = $nextpage; |
|||
$this->previouspage = $previouspage; |
|||
$this->id = $id; |
|||
$this->posts = $Article; */ |
|||
|
|||
//echo '<pre>';
|
|||
//print_r($Article);
|
|||
//return $this->fetch();
|
|||
} |
|||
|
|||
public function add() |
|||
{ |
|||
$data = ''; |
|||
if(!empty($_REQUEST["catid"])){$data['catid'] = $_REQUEST["catid"];}else{$data['catid'] = 0;} |
|||
|
|||
return view('admin.article.add', $data); |
|||
} |
|||
|
|||
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
|
|||
$content="";if(!empty($_POST["body"])){$content = $_POST["body"];} |
|||
$_POST['pubdate'] = time();//更新时间
|
|||
$_POST['addtime'] = 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["dellink"]) && $_POST["dellink"]==1 && !empty($content)){$content=replacelinks($content,array(sysconfig('CMS_BASEHOST')));} //删除非站内链接
|
|||
$_POST['body']=$content; |
|||
|
|||
//提取第一个图片为缩略图
|
|||
if(isset($_POST["autolitpic"]) && $_POST["autolitpic"] && empty($litpic)) |
|||
{ |
|||
if(getfirstpic($content)) |
|||
{ |
|||
//获取文章内容的第一张图片
|
|||
$imagepath = '.'.getfirstpic($content); |
|||
|
|||
//获取后缀名
|
|||
preg_match_all ("/\/(.+)\.(gif|jpg|jpeg|bmp|png)$/iU",$imagepath,$out, PREG_PATTERN_ORDER); |
|||
|
|||
$saveimage='./uploads/'.date('Y/m',time()).'/'.basename($imagepath,'.'.$out[2][0]).'-lp.'.$out[2][0]; |
|||
|
|||
//生成缩略图,按照原图的比例生成一个最大为240*180的缩略图
|
|||
\Intervention\Image\Facades\Image::make($imagepath)->resize(sysconfig('CMS_IMGWIDTH'), sysconfig('CMS_IMGHEIGHT'))->save($saveimage); |
|||
|
|||
//缩略图路径
|
|||
$_POST['litpic']='/uploads/'.date('Y/m',time()).'/'.basename($imagepath,'.'.$out[2][0]).'-lp.'.$out[2][0]; |
|||
} |
|||
} |
|||
|
|||
unset($_POST["dellink"]); |
|||
unset($_POST["autolitpic"]); |
|||
unset($_POST["_token"]); |
|||
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);} |
|||
if(DB::table('article')->insert($_POST)) |
|||
{ |
|||
success_jump("添加成功!"); |
|||
} |
|||
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('article')->where('id', $id)->first(), 1); |
|||
|
|||
return view('admin.article.edit', $data); |
|||
} |
|||
|
|||
public function doedit() |
|||
{ |
|||
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_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
|
|||
$content="";if(!empty($_POST["body"])){$content = $_POST["body"];} |
|||
$_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["dellink"]) && $_POST["dellink"]==1 && !empty($content)){$content=replacelinks($content,array(CMS_BASEHOST));} //删除非站内链接
|
|||
$_POST['body']=$content; |
|||
|
|||
//提取第一个图片为缩略图
|
|||
if(isset($_POST["autolitpic"]) && $_POST["autolitpic"] && empty($litpic)) |
|||
{ |
|||
if(getfirstpic($content)) |
|||
{ |
|||
//获取文章内容的第一张图片
|
|||
$imagepath = '.'.getfirstpic($content); |
|||
|
|||
//获取后缀名
|
|||
preg_match_all ("/\/(.+)\.(gif|jpg|jpeg|bmp|png)$/iU",$imagepath,$out, PREG_PATTERN_ORDER); |
|||
|
|||
$saveimage='./uploads/'.date('Y/m',time()).'/'.basename($imagepath,'.'.$out[2][0]).'-lp.'.$out[2][0]; |
|||
|
|||
//生成缩略图,按照原图的比例生成一个最大为240*180的缩略图
|
|||
\Intervention\Image\Facades\Image::make($imagepath)->resize(sysconfig('CMS_IMGWIDTH'), sysconfig('CMS_IMGHEIGHT'))->save($saveimage); |
|||
|
|||
//缩略图路径
|
|||
$_POST['litpic']='/uploads/'.date('Y/m',time()).'/'.basename($imagepath,'.'.$out[2][0]).'-lp.'.$out[2][0]; |
|||
} |
|||
} |
|||
|
|||
unset($_POST["dellink"]); |
|||
unset($_POST["autolitpic"]); |
|||
unset($_POST["_token"]); |
|||
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);} |
|||
if(DB::table('article')->where('id', $id)->update($_POST)) |
|||
{ |
|||
success_jump("修改成功!", route('admin_article')); |
|||
} |
|||
else |
|||
{ |
|||
error_jump("修改失败!"); |
|||
} |
|||
} |
|||
|
|||
//删除文章
|
|||
public function del() |
|||
{ |
|||
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump("删除失败!请重新提交");} |
|||
|
|||
if(DB::table("article")->whereIn("id", explode(',', $id))->delete()) |
|||
{ |
|||
success_jump("$id ,删除成功"); |
|||
} |
|||
else |
|||
{ |
|||
error_jump("$id ,删除失败!请重新提交"); |
|||
} |
|||
} |
|||
|
|||
|
|||
//重复文章列表
|
|||
public function repetarc() |
|||
{ |
|||
$data['posts'] = object_to_array(DB::table('article')->select(DB::raw('title,count(*) AS count'))->orderBy('count', 'desc')->groupBy('title')->having('count', '>', 1)->get()); |
|||
|
|||
return view('admin.article.repetarc', $data); |
|||
} |
|||
|
|||
//推荐文章
|
|||
public function recommendarc() |
|||
{ |
|||
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump("您访问的页面不存在或已被删除!");} //if(preg_match('/[0-9]*/',$id)){}else{exit;}
|
|||
|
|||
$data['tuijian'] = 1; |
|||
|
|||
if(DB::table("article")->whereIn("id", explode(',', $id))->update($data)) |
|||
{ |
|||
success_jump("$id ,推荐成功"); |
|||
} |
|||
else |
|||
{ |
|||
error_jump("$id ,推荐失败!请重新提交"); |
|||
} |
|||
} |
|||
|
|||
//检测重复文章数量
|
|||
public function articleexists() |
|||
{ |
|||
$res = ''; |
|||
$where = function ($query) use ($res) { |
|||
if(isset($_REQUEST["title"])) |
|||
{ |
|||
$query->where('title', $_REQUEST["title"]); |
|||
} |
|||
|
|||
if(isset($_REQUEST["id"])) |
|||
{ |
|||
$query->where('id', '<>', $_REQUEST["id"]); |
|||
} |
|||
}; |
|||
|
|||
return DB::table("article")->where($where)->count(); |
|||
} |
|||
} |
@ -0,0 +1,123 @@ |
|||
<?php |
|||
namespace App\Http\Controllers\Admin; |
|||
|
|||
use App\Http\Controllers\Admin\CommonController; |
|||
use DB; |
|||
|
|||
class CategoryController extends CommonController |
|||
{ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
} |
|||
|
|||
public function index() |
|||
{ |
|||
return view('admin.category.index'); |
|||
} |
|||
|
|||
public function add() |
|||
{ |
|||
if(!empty($_GET["reid"])) |
|||
{ |
|||
$id = $_GET["reid"]; |
|||
if(preg_match('/[0-9]*/',$id)){}else{exit;} |
|||
if($id!=0) |
|||
{ |
|||
$data['postone'] = object_to_array(DB::table("arctype")->where('id', $id)->first(), 1); |
|||
} |
|||
|
|||
$data['id'] = $id; |
|||
} |
|||
else |
|||
{ |
|||
$data['id'] = 0; |
|||
} |
|||
|
|||
return view('admin.category.add', $data); |
|||
} |
|||
|
|||
public function doadd() |
|||
{ |
|||
if(!empty($_POST["prid"])){if($_POST["prid"]=="top"){$_POST['reid']=0;}else{$_POST['reid'] = $_POST["prid"];}}//父级栏目id
|
|||
$_POST['addtime'] = time();//添加时间
|
|||
unset($_POST["prid"]); |
|||
unset($_POST["_token"]); |
|||
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);} |
|||
|
|||
if(DB::table('arctype')->insert($_POST)) |
|||
{ |
|||
success_jump('添加成功!'); |
|||
} |
|||
else |
|||
{ |
|||
error_jump('添加失败!请修改后重新添加'); |
|||
} |
|||
} |
|||
|
|||
public function edit() |
|||
{ |
|||
$id = $_GET["id"];if(preg_match('/[0-9]*/',$id)){}else{exit;} |
|||
|
|||
$data['id'] = $id; |
|||
$post = object_to_array(DB::table('arctype')->where('id', $id)->first(), 1); |
|||
$reid = $post['reid']; |
|||
if($reid!=0){$data['postone'] = object_to_array(DB::table('arctype')->where('id', $reid)->first());} |
|||
|
|||
$data['post'] = $post; |
|||
|
|||
return view('admin.category.edit', $data); |
|||
} |
|||
|
|||
public function doedit() |
|||
{ |
|||
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else {$id="";exit;} |
|||
$_POST['addtime'] = time(); //添加时间
|
|||
unset($_POST["_token"]); |
|||
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);} |
|||
|
|||
if(DB::table('arctype')->where('id', $id)->update($_POST)) |
|||
{ |
|||
success_jump('修改成功!', route('admin_category')); |
|||
} |
|||
else |
|||
{ |
|||
error_jump('修改失败!请修改后重新添加'); |
|||
} |
|||
} |
|||
|
|||
public function del() |
|||
{ |
|||
if(!empty($_REQUEST["id"])){$id = $_REQUEST["id"];}else{error_jump('删除失败!请重新提交');} //if(preg_match('/[0-9]*/',$id)){}else{exit;}
|
|||
|
|||
if(DB::table('arctype')->where('reid', $id)->first()) |
|||
{ |
|||
error_jump('删除失败!请先删除子栏目'); |
|||
} |
|||
else |
|||
{ |
|||
if(DB::table('arctype')->where('id', $id)->delete()) |
|||
{ |
|||
if(DB::table("article")->where('typeid', $id)->count()>0) //判断该分类下是否有文章,如果有把该分类下的文章也一起删除
|
|||
{ |
|||
if(DB::table("article")->where('typeid', $id)->delete()) |
|||
{ |
|||
success_jump('删除成功'); |
|||
} |
|||
else |
|||
{ |
|||
error_jump('栏目下的文章删除失败!'); |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
success_jump('删除成功'); |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
error_jump('删除失败!请重新提交'); |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,54 @@ |
|||
<?php |
|||
namespace App\Http\Controllers\Admin; |
|||
|
|||
use App\Http\Controllers\Controller; |
|||
use DB; |
|||
|
|||
class CommonController extends Controller |
|||
{ |
|||
public $user_info; |
|||
|
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
|
|||
if(isset($_SESSION['admin_user_info'])) |
|||
{ |
|||
$this->user_info = $_SESSION['admin_user_info']; |
|||
} |
|||
else |
|||
{ |
|||
header("Location:".route('page404')); |
|||
exit(); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 获取分页数据及分页导航 |
|||
* @param string $modelname 模块名与数据库表名对应 |
|||
* @param array $map 查询条件 |
|||
* @param string $orderby 查询排序 |
|||
* @param string $field 要返回数据的字段 |
|||
* @param int $listRows 每页数量,默认10条 |
|||
* |
|||
* @return 格式化后输出的数据。内容格式为: |
|||
* - "code" (string):代码 |
|||
* - "info" (string):信息提示 |
|||
* |
|||
* - "result" array |
|||
* |
|||
* - "img_list" (array) :图片队列,默认8张 |
|||
* - "img_title" (string):车图名称 |
|||
* - "img_url" (string):车图片url地址 |
|||
* - "car_name" (string):车名称 |
|||
*/ |
|||
public function pageList($modelname, $map = '', $orderby = '', $field = '', $listRows = 15) |
|||
{ |
|||
$orderby = !empty($orderby) ? $orderby : $orderby = ['id', 'desc']; |
|||
|
|||
// 查询满足的数据,并且每页显示15条数据
|
|||
$voList = DB::table($modelname)->where($map)->orderBy($orderby[0], $orderby[1])->paginate($listRows); |
|||
|
|||
return $voList; |
|||
} |
|||
} |
@ -0,0 +1,35 @@ |
|||
<?php |
|||
namespace App\Http\Controllers\Admin; |
|||
|
|||
use App\Http\Controllers\Admin\CommonController; |
|||
|
|||
class IndexController extends CommonController |
|||
{ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
} |
|||
|
|||
public function index() |
|||
{ |
|||
return view('admin.index.index'); |
|||
} |
|||
|
|||
//更新配置
|
|||
public function upconfig() |
|||
{ |
|||
updateconfig(); |
|||
} |
|||
|
|||
//更新缓存
|
|||
public function upcache() |
|||
{ |
|||
|
|||
} |
|||
|
|||
//页面跳转
|
|||
public function jump() |
|||
{ |
|||
return view('admin.index.jump'); |
|||
} |
|||
} |
@ -0,0 +1,95 @@ |
|||
<?php |
|||
namespace App\Http\Controllers\Admin; |
|||
|
|||
use Illuminate\Routing\Controller as BaseController; |
|||
use Illuminate\Http\Request; |
|||
use Illuminate\Support\Facades\DB; |
|||
use App\Http\Model\User; |
|||
use Log; |
|||
|
|||
class LoginController extends BaseController |
|||
{ |
|||
/** |
|||
* 登录页面 |
|||
*/ |
|||
public function login() |
|||
{ |
|||
if(isset($_SESSION['admin_user_info'])) |
|||
{ |
|||
header("Location: ".route('admin')); |
|||
exit; |
|||
} |
|||
|
|||
return view('admin.login.login'); |
|||
} |
|||
|
|||
/** |
|||
* 登录处理页面 |
|||
*/ |
|||
public function dologin() |
|||
{ |
|||
if(!empty($_POST["username"])){$username = $_POST["username"];}else{$username='';exit;}//用户名
|
|||
if(!empty($_POST["pwd"])){$pwd = md5($_POST["pwd"]);}else{$pwd='';exit;}//密码
|
|||
|
|||
$User = User::where(['username' => $username, 'pwd' => $pwd])->orWhere(['email' => $username, 'pwd' => $pwd])->first(); |
|||
|
|||
if($User) |
|||
{ |
|||
$admin_user_info = $User->toArray(); |
|||
$admin_user_info['rolename'] = $User->userrole->rolename; |
|||
|
|||
$_SESSION['admin_user_info'] = $admin_user_info; |
|||
|
|||
$User->logintime = time(); |
|||
$User->save(); |
|||
|
|||
return redirect()->route('admin'); |
|||
} |
|||
else |
|||
{ |
|||
return redirect()->route('admin_login'); |
|||
} |
|||
} |
|||
|
|||
//退出登录
|
|||
public function logout() |
|||
{ |
|||
session_unset(); |
|||
session_destroy();// 退出登录,清除session
|
|||
success_jump('退出成功!', route('home')); |
|||
} |
|||
|
|||
//密码恢复
|
|||
public function recoverpwd() |
|||
{ |
|||
$data["username"] = "admin888"; |
|||
$data["pwd"] = "21232f297a57a5a743894a0e4a801fc3"; |
|||
|
|||
if(DB::table('user')->where('id', 1)->update($data)) |
|||
{ |
|||
success_jump('密码恢复成功!', route('admin_login')); |
|||
} |
|||
else |
|||
{ |
|||
error_jump('密码恢复失败!', route('home')); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 判断用户名是否存在 |
|||
*/ |
|||
public function userexists() |
|||
{ |
|||
$map['username'] = ""; |
|||
if(isset($_POST["username"]) && !empty($_POST["username"])) |
|||
{ |
|||
$map['username'] = $_POST["username"]; |
|||
} |
|||
else |
|||
{ |
|||
return 0; |
|||
} |
|||
|
|||
return DB::table("user")->where($map)->count(); |
|||
} |
|||
} |
@ -0,0 +1,85 @@ |
|||
<?php |
|||
namespace App\Http\Controllers\Admin; |
|||
|
|||
use App\Http\Controllers\Admin\CommonController; |
|||
use DB; |
|||
|
|||
class PageController extends CommonController |
|||
{ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
} |
|||
|
|||
public function index() |
|||
{ |
|||
$data['posts'] = object_to_array(DB::table("page")->orderBy('id', 'desc')->get()); |
|||
return view('admin.page.index', $data); |
|||
} |
|||
|
|||
public function doadd() |
|||
{ |
|||
$_POST['pubdate'] = time();//更新时间
|
|||
$_POST['click'] = rand(200,500);//点击
|
|||
|
|||
unset($_POST["_token"]); |
|||
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);} |
|||
|
|||
if(DB::table("page")->insert($_POST)) |
|||
{ |
|||
success_jump('添加成功!'); |
|||
} |
|||
else |
|||
{ |
|||
error_jump('添加失败!请修改后重新添加'); |
|||
} |
|||
} |
|||
|
|||
public function add() |
|||
{ |
|||
return view('admin.page.add'); |
|||
} |
|||
|
|||
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('page')->where('id', $id)->first(), 1); |
|||
|
|||
return view('admin.page.edit', $data); |
|||
} |
|||
|
|||
public function doedit() |
|||
{ |
|||
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else {$id="";exit;} |
|||
$_POST['pubdate'] = time();//更新时间
|
|||
|
|||
unset($_POST["_token"]); |
|||
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);} |
|||
|
|||
if(DB::table('page')->where('id', $id)->update($_POST)) |
|||
{ |
|||
success_jump('修改成功!', route('admin_page')); |
|||
} |
|||
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('page')->whereIn("id", explode(',', $id))->delete()) |
|||
{ |
|||
success_jump('删除成功'); |
|||
} |
|||
else |
|||
{ |
|||
error_jump("删除失败!请重新提交"); |
|||
} |
|||
} |
|||
} |
@ -1,13 +1,47 @@ |
|||
<?php |
|||
|
|||
namespace App\Http\Controllers; |
|||
|
|||
use Illuminate\Foundation\Bus\DispatchesJobs; |
|||
use Illuminate\Routing\Controller as BaseController; |
|||
use Illuminate\Foundation\Validation\ValidatesRequests; |
|||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests; |
|||
use Illuminate\Support\Facades\DB; |
|||
use Log; |
|||
|
|||
class Controller extends BaseController |
|||
{ |
|||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests; |
|||
public function __construct() |
|||
{ |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 获取当前控制器名 |
|||
* |
|||
* @return string |
|||
*/ |
|||
public function getCurrentControllerName() |
|||
{ |
|||
return self::getCurrentAction()['controller']; |
|||
} |
|||
|
|||
/** |
|||
* 获取当前方法名 |
|||
* |
|||
* @return string |
|||
*/ |
|||
public function getCurrentMethodName() |
|||
{ |
|||
return self::getCurrentAction()['method']; |
|||
} |
|||
|
|||
/** |
|||
* 获取当前控制器与方法 |
|||
* |
|||
* @return array |
|||
*/ |
|||
public function getCurrentAction() |
|||
{ |
|||
$action = \Route::current()->getActionName(); |
|||
list($class, $method) = explode('@', $action); |
|||
|
|||
return ['controller' => $class, 'method' => $method]; |
|||
} |
|||
} |
@ -0,0 +1,12 @@ |
|||
<?php |
|||
namespace App\Http\Controllers\Home; |
|||
|
|||
use App\Http\Controllers\Controller; |
|||
|
|||
class CommonController extends Controller |
|||
{ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
} |
|||
} |
@ -1,23 +1,36 @@ |
|||
<?php |
|||
|
|||
namespace App\Http\Controllers\Home; |
|||
|
|||
use App\Http\Controllers\Controller; |
|||
use App\Http\Controllers\Home\CommonController; |
|||
use App\Http\Model\Article; |
|||
use App\Http\Model\Arctype; |
|||
use Illuminate\Support\Facades\DB; |
|||
|
|||
class IndexController extends Controller |
|||
class IndexController extends CommonController |
|||
{ |
|||
/** |
|||
* Create a new controller instance. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function __construct() |
|||
{ |
|||
//$this->middleware('guest')->except('logout');
|
|||
parent::__construct(); |
|||
} |
|||
|
|||
public function index() |
|||
{ |
|||
dd('home/index'); |
|||
$user = DB::table('article')->where('id', '1')->first(); |
|||
echo $user->title; |
|||
|
|||
//$Article = Article::find(1)->arctype;
|
|||
//$Article = Article::find(1);
|
|||
//$Article = Arctype::find(1)->article()->get()->toArray();
|
|||
|
|||
//$comment = Article::find(1)->arctype()->first()->toArray();
|
|||
//echo $comment->arctype->typename;
|
|||
//print_r($comment);
|
|||
|
|||
//dd($comment);
|
|||
} |
|||
|
|||
public function page404() |
|||
{ |
|||
return view('home.404'); |
|||
} |
|||
} |
@ -0,0 +1,28 @@ |
|||
<?php |
|||
namespace App\Http\Middleware; |
|||
|
|||
use Closure; |
|||
|
|||
class CheckLogin |
|||
{ |
|||
/** |
|||
* Handle an incoming request. |
|||
* |
|||
* @param \Illuminate\Http\Request $request |
|||
* @param \Closure $next |
|||
* @return mixed |
|||
*/ |
|||
public function handle($request, Closure $next) |
|||
{ |
|||
if(!session()->has('admin_user_info')) |
|||
{ |
|||
redirect()->route('admin_login'); |
|||
} |
|||
else |
|||
{ |
|||
|
|||
} |
|||
|
|||
return $next($request); |
|||
} |
|||
} |
@ -0,0 +1,41 @@ |
|||
<?php |
|||
namespace App\Http\Model; |
|||
|
|||
use Illuminate\Database\Eloquent\Model; |
|||
|
|||
class Arctype extends Model |
|||
{ |
|||
//文章分类模型
|
|||
|
|||
/** |
|||
* 关联到模型的数据表 |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $table = 'arctype'; |
|||
public $timestamps = false; |
|||
|
|||
/** |
|||
* 表明模型是否应该被打上时间戳 |
|||
* 默认情况下,Eloquent 期望 created_at 和updated_at 已经存在于数据表中,如果你不想要这些 Laravel 自动管理的数据列,在模型类中设置 $timestamps 属性为 false |
|||
* |
|||
* @var bool |
|||
*/ |
|||
public $timestamps = false; |
|||
|
|||
/** |
|||
* The connection name for the model. |
|||
* 默认情况下,所有的 Eloquent 模型使用应用配置中的默认数据库连接,如果你想要为模型指定不同的连接,可以通过 $connection 属性来设置 |
|||
* @var string |
|||
*/ |
|||
//protected $connection = 'connection-name';
|
|||
|
|||
/** |
|||
* 获取分类对应的文章 |
|||
*/ |
|||
public function article() |
|||
{ |
|||
return $this->hasMany(Article::class, 'typeid', 'id'); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,61 @@ |
|||
<?php |
|||
namespace App\Http\Model; |
|||
|
|||
use Illuminate\Database\Eloquent\Model; |
|||
|
|||
class Article extends Model |
|||
{ |
|||
//文章模型
|
|||
|
|||
/** |
|||
* 关联到模型的数据表 |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $table = 'article'; |
|||
|
|||
/** |
|||
* 表明模型是否应该被打上时间戳 |
|||
* 默认情况下,Eloquent 期望 created_at 和updated_at 已经存在于数据表中,如果你不想要这些 Laravel 自动管理的数据列,在模型类中设置 $timestamps 属性为 false |
|||
* |
|||
* @var bool |
|||
*/ |
|||
public $timestamps = false; |
|||
|
|||
//protected $guarded = []; //$guarded包含你不想被赋值的字段数组。
|
|||
//protected $fillable = ['name']; //定义哪些字段是可以进行赋值的,与$guarded相反
|
|||
|
|||
/** |
|||
* The connection name for the model. |
|||
* 默认情况下,所有的 Eloquent 模型使用应用配置中的默认数据库连接,如果你想要为模型指定不同的连接,可以通过 $connection 属性来设置 |
|||
* @var string |
|||
*/ |
|||
//protected $connection = 'connection-name';
|
|||
|
|||
/** |
|||
* 文件上传 |
|||
* @param $field |
|||
* @return string |
|||
*/ |
|||
public static function uploadImg($field) |
|||
{ |
|||
if (Request::hasFile($field)) { |
|||
$pic = Request::file($field); |
|||
if ($pic->isValid()) { |
|||
$newName = md5(rand(1, 1000) . $pic->getClientOriginalName()) . "." . $pic->getClientOriginalExtension(); |
|||
$pic->move('uploads', $newName); |
|||
return $newName; |
|||
} |
|||
} |
|||
return ''; |
|||
} |
|||
|
|||
/** |
|||
* 获取关联到文章的分类 |
|||
*/ |
|||
public function arctype() |
|||
{ |
|||
return $this->belongsTo(Arctype::class, 'typeid', 'id'); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
<?php |
|||
namespace App\Http\Model; |
|||
|
|||
use Illuminate\Database\Eloquent\Model; |
|||
|
|||
class Sysconfig extends Model |
|||
{ |
|||
protected $table = 'sysconfig'; |
|||
public $timestamps = false; |
|||
|
|||
/** |
|||
* 不能被批量赋值的属性 |
|||
* |
|||
* @var array |
|||
*/ |
|||
protected $guarded = []; |
|||
} |
@ -0,0 +1,25 @@ |
|||
<?php |
|||
namespace App\Http\Model; |
|||
|
|||
use Illuminate\Database\Eloquent\Model; |
|||
|
|||
class UserRole extends Model |
|||
{ |
|||
protected $table = 'user_role'; |
|||
public $timestamps = false; |
|||
|
|||
/** |
|||
* 不能被批量赋值的属性 |
|||
* |
|||
* @var array |
|||
*/ |
|||
protected $guarded = []; |
|||
|
|||
/** |
|||
* 获取角色对应的用户 |
|||
*/ |
|||
public function user() |
|||
{ |
|||
return $this->hasMany(User::class, 'role_id', 'id'); |
|||
} |
|||
} |
@ -0,0 +1,12 @@ |
|||
<?php |
|||
//自定义配置
|
|||
return [ |
|||
//等级推荐
|
|||
"tuijian" => [ |
|||
"0"=>"不推荐", |
|||
"1"=>"一级推荐", |
|||
"2"=>"二级推荐", |
|||
"3"=>"三级推荐", |
|||
"4"=>"四级推荐" |
|||
], |
|||
]; |
@ -0,0 +1,164 @@ |
|||
<!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/article">文章列表</a> > 发布文章</h5> |
|||
|
|||
<form id="addarc" method="post" action="/fladmin/article/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:60%" placeholder="在此输入标题"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">是否审核:</td> |
|||
<td> |
|||
<input type="radio" value='0' name="ischeck" checked /> 是 |
|||
<input type="radio" value='1' name="ischeck" /> 否 |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">推荐:</td> |
|||
<td> |
|||
<select name="tuijian" id="tuijian"> |
|||
<?php $tuijian = config('custom.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 colspan="2"><input name="source" type="text" id="source" style="width:160px" value="" size="16"> 作者:<input name="writer" type="text" id="writer" style="width:100px" value=""> 浏览次数:<input type="text" name="click" id="click" value="<?php echo rand(200,500); ?>" style="width:80px;"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">文章栏目:</td> |
|||
<td> |
|||
<select name="typeid" id="typeid"> |
|||
<?php $catlist = category_tree(get_category('arctype',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:80%;height:70px;vertical-align:middle;"></textarea></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">附加选项:</td> |
|||
<td> |
|||
<input name="dellink" type="checkbox" class="np" id="dellink" value="1"> |
|||
删除非站内链接 |
|||
<input name="autolitpic" type="checkbox" class="np" id="autolitpic" value="1" checked="1"> |
|||
提取第一个图片为缩略图 |
|||
</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 |
|||
{ |
|||
var title = $("#title").val(); |
|||
$.ajax({ |
|||
url: <?php echo route('admin_article_articleexists'); ?>,
|
|||
type: "GET", |
|||
cache: false, |
|||
data: { |
|||
"title":title |
|||
}, |
|||
success: function(data){ |
|||
if(data>0) |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">已经存在</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,147 @@ |
|||
<!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/article">文章列表</a> > 修改文章</h5> |
|||
|
|||
<form id="addarc" method="post" action="/fladmin/article/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:60%" placeholder="在此输入标题"><input style="display:none;" name="id" type="text" 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> |
|||
<select name="tuijian" id="tuijian"> |
|||
<?php $tuijian = config('custom.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="<?php echo $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="<?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 colspan="2"><input name="source" type="text" id="source" style="width:160px" value="<?php echo $post["source"]; ?>" size="16"> 作者:<input name="writer" type="text" id="writer" style="width:100px" value="<?php echo $post["writer"]; ?>"> 浏览次数:<input type="text" name="click" id="click" value="<?php echo rand(200,500); ?>" style="width:80px;"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">文章栏目:</td> |
|||
<td> |
|||
<select name="typeid" id="typeid"> |
|||
<?php $catlist = category_tree(get_category('arctype',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="<?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 align="right">附加选项:</td> |
|||
<td> |
|||
<input name="dellink" type="checkbox" class="np" id="dellink" value="1"> |
|||
删除非站内链接 |
|||
<input name="autolitpic" type="checkbox" class="np" id="autolitpic" value="1" checked> |
|||
提取第一个图片为缩略图 |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2"><strong>文章内容:</strong></td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2"> |
|||
<!-- 加载编辑器的容器 --><script id="container" name="body" type="text/plain"><?php echo $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;} |
|||
}); |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -0,0 +1,115 @@ |
|||
<!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"><h5 class="sub-header"><a href="/fladmin/category">栏目管理</a> > <a href="/fladmin/article">文章列表</a> [ <a href="/fladmin/article/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/article/edit?id=<?php echo $row->id; ?>"><?php echo $row->title; ?></a> <?php if(!empty($row->litpic)){echo "<small style='color:red'>[图]</small>";}if($row->tuijian==1){echo "<small style='color:#22ac38'>[荐]</small>";} ?> </td>
|
|||
<td><?php echo date('Y-m-d',$row->pubdate); ?></td>
|
|||
<td><a href="/fladmin/article?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/article/edit?id=<?php echo $row->id; ?>">修改</a> <a onclick="delconfirm('/fladmin/article/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><!-- 表格结束 --> |
|||
|
|||
<form id="searcharc" class="navbar-form" action="/fladmin/article" 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 = category_tree(get_category('arctype', 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">{{ $posts->links() }}</div> |
|||
|
|||
<script> |
|||
//推荐文章
|
|||
function tjArc(aid) |
|||
{ |
|||
var checkvalue=getItems(); |
|||
|
|||
if(checkvalue=='') |
|||
{ |
|||
alert('必须选择一个或多个文档!'); |
|||
return; |
|||
} |
|||
|
|||
if(confirm("确定要推荐吗")) |
|||
{ |
|||
location="/fladmin/article/recommendarc?id="+checkvalue; |
|||
} |
|||
else |
|||
{ |
|||
|
|||
} |
|||
} |
|||
|
|||
//批量删除文章
|
|||
function delArc(aid) |
|||
{ |
|||
var checkvalue=getItems(); |
|||
|
|||
if(checkvalue=='') |
|||
{ |
|||
alert('必须选择一个或多个文档!'); |
|||
return; |
|||
} |
|||
|
|||
if(confirm("确定删除吗")) |
|||
{ |
|||
location="/fladmin/article/del?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,26 @@ |
|||
<!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/article">文章列表</a> ] [ <a href="/fladmin/article/add">发布文章</a> ]<br><br> |
|||
|
|||
<form name="listarc"> |
|||
<div class="table-responsive"><table class="table table-striped table-hover"> |
|||
<thead><tr> |
|||
<th>文档标题</th> |
|||
<th>重复数量</th> |
|||
</tr></thead> |
|||
<tbody> |
|||
<?php if($posts){ foreach ($posts as $row) { ?>
|
|||
<tr> |
|||
<td><a href="/fladmin/article/index?typeid=0&keyword=<?php echo $row["title"]; ?>"><?php echo $row["title"]; ?></a></td>
|
|||
<td><?php echo $row["count"]; ?></td>
|
|||
</tr> |
|||
<?php }} ?>
|
|||
</tbody> |
|||
</table></div><!-- 表格结束 --></form><!-- 表单结束 --> |
|||
|
|||
</div></div><!-- 右边结束 --></div></div> |
|||
</body></html> |
@ -0,0 +1,145 @@ |
|||
<!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/category">栏目管理</a> > 栏目添加</h5> |
|||
|
|||
<form method="post" action="/fladmin/category/doadd" role="form" id="addcat" class="table-responsive">{{ csrf_field() }} |
|||
<table class="table table-striped table-bordered"> |
|||
<tbody> |
|||
<tr> |
|||
<td align="right">栏目名称:</td> |
|||
<td><input name="typename" type="text" 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" 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="category" class="required" style="width:300px"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">文章模板:</td> |
|||
<td><input name="temparticle" id="temparticle" type="text" value="detail" class="required" style="width:300px"></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">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; |
|||
} |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -0,0 +1,21 @@ |
|||
<!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/category/add">增加顶级栏目</a> ] [ <a href="/fladmin/article/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 $catlist = category_tree(get_category('arctype',0));foreach($catlist as $row){ ?>
|
|||
<tr id="cat-<?php echo $row["id"]; ?>"> |
|||
<td><?php echo $row["id"]; ?></td>
|
|||
<td><a href="/fladmin/article?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"],'article'); ?></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/article/add?catid=<?php echo $row["id"]; ?>">发布文章</a> | <a href="/fladmin/category/add?reid=<?php echo $row["id"]; ?>">增加子类</a> | <a href="/fladmin/category/edit?id=<?php echo $row["id"]; ?>">更改</a> | <a onclick="delconfirm('/fladmin/category/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,12 @@ |
|||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1"> |
|||
<link rel="stylesheet" href="<?php echo route('home'); ?>/css/bootstrap.min.css"><link rel="stylesheet" href="<?php echo route('home'); ?>/css/admin.css"> |
|||
<script src="<?php echo route('home'); ?>/js/jquery.min.js"></script><script src="/js/ad.js"></script><script src="<?php echo route('home'); ?>/js/bootstrap.min.js"></script><script type="text/javascript" src="<?php echo route('home'); ?>/js/jquery.uploadify.min.js"></script></head><body> |
|||
|
|||
<div class="blog-masthead clearfix"><nav class="blog-nav"> |
|||
<a class="blog-nav-item active" href="<?php echo route('admin'); ?>"><span class="glyphicon glyphicon-star"></span> <strong>后台管理中心</strong> <span class="glyphicon glyphicon-star-empty"></span></a> |
|||
<a class="blog-nav-item" href="<?php echo route('home'); ?>" target="_blank"><span class="glyphicon glyphicon-home"></span> 网站主页</a> |
|||
<a class="blog-nav-item" href="<?php echo route('admin'); ?>/index/upcache"><span class="glyphicon glyphicon-refresh"></span> 更新缓存</a> |
|||
<a class="blog-nav-item" id="navexit" href="<?php echo route('admin_logout'); ?>"><span class="glyphicon glyphicon-off"></span> 注销</a> |
|||
<a class="blog-nav-item pull-right" href="javascript:;"><small>您好:<span class="glyphicon glyphicon-user"></span> <?php if(isset($_SESSION['admin_user_info'])){echo $_SESSION['admin_user_info']['username'].' ['.$_SESSION['admin_user_info']['rolename'].']';} ?></small></a>
|
|||
</nav></div> |
@ -0,0 +1,26 @@ |
|||
<dl class="lnav"> |
|||
<dt>常用操作</dt> |
|||
<dd><a href="<?php echo route('admin'); ?>/category"><span class="glyphicon glyphicon-th-list"></span> 网站栏目管理</a></dd> |
|||
<dd><a href="<?php echo route('admin'); ?>/article"><span class="glyphicon glyphicon-pencil"></span> 文章列表</a></dd> |
|||
<dd><a href="<?php echo route('admin'); ?>/article?ischeck=1"><span class="glyphicon glyphicon-pencil"></span> 未审核的文章</a></dd> |
|||
<dd><a href="<?php echo route('admin'); ?>/article/add"><span class="glyphicon glyphicon-file"></span> 发布文章</a></dd> |
|||
<dd><a href="<?php echo route('admin'); ?>/page"><span class="glyphicon glyphicon-equalizer"></span> 单页文档管理</a></dd> |
|||
<dt>商品管理</dt> |
|||
<dd><a href="<?php echo route('admin'); ?>/product"><span class="glyphicon glyphicon-pencil"></span> 商品列表</a></dd> |
|||
<dd><a href="<?php echo route('admin'); ?>/product/add"><span class="glyphicon glyphicon-file"></span> 添加商品</a></dd> |
|||
<dd><a href="<?php echo route('admin'); ?>/productType"><span class="glyphicon glyphicon-th-list"></span> 商品分类</a></dd> |
|||
<dt>批量维护</dt> |
|||
<dd><a href="<?php echo route('admin'); ?>/tag"><span class="glyphicon glyphicon-tag"></span> TAG标签管理</a></dd> |
|||
<dd><a href="<?php echo route('admin'); ?>/search"><span class="glyphicon glyphicon-fire"></span> 关键词管理</a></dd> |
|||
<dd><a href="<?php echo route('admin'); ?>/keyword"><span class="glyphicon glyphicon-fire"></span> 內链关键词维护</a></dd> |
|||
<dd><a href="<?php echo route('admin'); ?>/friendlink"><span class="glyphicon glyphicon-leaf"></span> 友情链接</a></dd> |
|||
<dd><a href="<?php echo route('admin'); ?>/slide"><span class="glyphicon glyphicon-leaf"></span> 轮播图</a></dd> |
|||
<dd><a href="<?php echo route('admin'); ?>/user"><span class="glyphicon glyphicon-user"></span> 用户管理</a></dd> |
|||
<dd><a href="<?php echo route('admin'); ?>/article/repetarc"><span class="glyphicon glyphicon-cog"></span> 重复文档检测</a></dd> |
|||
<dt>系统设置</dt> |
|||
<dd><a href="<?php echo route('admin'); ?>/sysconfig"><span class="glyphicon glyphicon-wrench"></span> 系统基本参数</a></dd> |
|||
<dd><a href="<?php echo route('admin'); ?>/index/upcache"><span class="glyphicon glyphicon-refresh"></span> 更新缓存</a></dd> |
|||
<dd><a href="<?php echo route('admin'); ?>/guestbook"><span class="glyphicon glyphicon-wrench"></span> 在线留言</a></dd> |
|||
<dd><a href="<?php echo route('admin'); ?>/sysconfig" target="_blank"><span class="glyphicon glyphicon-book"></span> 参考文档</a></dd> |
|||
<dd><a href="<?php echo route('admin'); ?>/sysconfig" target="_blank"><span class="glyphicon glyphicon-envelope"></span> 意见反馈/官方交流</a></dd> |
|||
</dl> |
@ -0,0 +1,18 @@ |
|||
<!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"> |
|||
<h2 class="sub-header">LQYCMS管理中心</h2> |
|||
<p>· 欢迎使用专业的PHP网站管理系统,轻松建站的首选利器,完全免费、开源、无授权限制。<br> |
|||
· LQYCMS采用PHP+Mysql架构,符合企业网站SEO优化理念、功能全面、安全稳定。</p> |
|||
<h3>网站基本信息</h3> |
|||
域名/IP:<?php echo $_SERVER["SERVER_NAME"]; ?> | <?php echo $_SERVER["REMOTE_ADDR"]; ?><br>
|
|||
运行环境:<?php echo @apache_get_version().' Mysql/'.@mysql_get_server_info(); ?>
|
|||
<h3>开发人员</h3> |
|||
FLi、当代范蠡<br><br> |
|||
我们的联系方式:374861669@qq.com<br><br> |
|||
© LQYCMS 版权所有 |
|||
</div></div><!-- 右边结束 --></div></div> |
|||
</body></html> |
@ -0,0 +1,47 @@ |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|||
<title>跳转提示</title> |
|||
<style type="text/css"> |
|||
*{ padding: 0; margin: 0; } |
|||
body{ background: #fff; font-family: '微软雅黑'; color: #333; font-size: 16px; }
|
|||
.system-message{padding: 24px 48px;margin:5% auto 0 auto;width:600px;} |
|||
.system-message h1{ font-size: 100px; font-weight: normal; line-height: 120px; margin-bottom: 12px; } |
|||
.system-message .jump{ padding-top: 10px} |
|||
.system-message .jump a{ color: #333;}
|
|||
.system-message .success,.system-message .error{ line-height: 1.8em; font-size: 36px } |
|||
.system-message .detail{ font-size: 12px; line-height: 20px; margin-top: 12px; display:none} |
|||
</style> |
|||
</head><body> |
|||
<?php |
|||
/** 参数说明 |
|||
* $_REQUEST['message']; //成功提示
|
|||
* $_REQUEST['error']; //失败提示
|
|||
* $_REQUEST['url']; //要跳转到哪里
|
|||
* $_REQUEST['time']; //几秒后跳转
|
|||
*/ |
|||
?>
|
|||
<div class="system-message"> |
|||
<?php if(isset($_REQUEST['message'])) { ?>
|
|||
<h1>:)</h1> |
|||
<p class="success"><?php echo $_REQUEST['message']; ?></p>
|
|||
<?php }elseif(isset($_REQUEST['error'])){ ?>
|
|||
<h1>:(</h1> |
|||
<p class="error"><?php echo $_REQUEST['error']; ?></p>
|
|||
<?php } ?>
|
|||
<p class="detail"></p> |
|||
<p class="jump">页面自动 <a id="href" href="<?php if(isset($_REQUEST['url'])){ echo $_REQUEST['url']; } ?>">跳转</a> 等待时间: <b id="wait"><?php if(isset($_REQUEST['time'])){ echo $_REQUEST['time']; } ?></b></p>
|
|||
</div> |
|||
<script type="text/javascript"> |
|||
(function(){ |
|||
var wait = document.getElementById('wait'),href = document.getElementById('href').href; |
|||
var interval = setInterval(function(){ |
|||
var time = --wait.innerHTML; |
|||
if(time <= 0) |
|||
{ |
|||
location.href = href; |
|||
clearInterval(interval); |
|||
}; |
|||
}, 1000); |
|||
})(); |
|||
</script> |
|||
</body></html> |
@ -0,0 +1,172 @@ |
|||
<!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> |
|||
<style> |
|||
body { |
|||
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; |
|||
font-size: 16px; |
|||
color: #888;
|
|||
line-height: 30px; |
|||
text-align: center; |
|||
background-color: #000;
|
|||
} |
|||
.form-box { |
|||
margin-top: 35px; |
|||
} |
|||
.form-top { |
|||
overflow: hidden; |
|||
padding: 0 25px 15px 25px; |
|||
background: #fff;
|
|||
-moz-border-radius: 4px 4px 0 0; -webkit-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; |
|||
text-align: left; |
|||
} |
|||
|
|||
.form-top-left { |
|||
float: left; |
|||
width: 75%; |
|||
padding-top: 25px; |
|||
} |
|||
|
|||
.form-top-left h3 { margin-top: 0; |
|||
font-size: 22px; |
|||
font-weight: 300; |
|||
color: #555;
|
|||
line-height: 30px;} |
|||
|
|||
.form-top-right { |
|||
float: left; |
|||
width: 25%; |
|||
padding-top: 5px;margin-top:15px; |
|||
font-size: 66px; |
|||
color: #ddd;
|
|||
text-align: right; |
|||
} |
|||
|
|||
.form-bottom { |
|||
padding: 25px 25px 30px 25px; |
|||
background: #eee;
|
|||
-moz-border-radius: 0 0 4px 4px; -webkit-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; |
|||
text-align: left; |
|||
} |
|||
|
|||
.form-bottom form textarea { |
|||
height: 100px; |
|||
} |
|||
|
|||
.form-bottom form button.btn { |
|||
width: 100%; |
|||
} |
|||
|
|||
.form-bottom form .input-error { |
|||
border-color: #4aaf51;
|
|||
} |
|||
|
|||
.social-login { |
|||
margin-top: 35px; |
|||
} |
|||
|
|||
.social-login h3 { |
|||
color: #fff;
|
|||
} |
|||
|
|||
.social-login-buttons { |
|||
margin-top: 25px; |
|||
} |
|||
input[type="text"], input[type="password"], textarea, textarea.form-control { |
|||
height: 50px; |
|||
margin: 0; |
|||
padding: 0 20px; |
|||
vertical-align: middle; |
|||
background: #f8f8f8;
|
|||
border: 3px solid #ddd;
|
|||
font-family: 'Roboto', sans-serif; |
|||
font-size: 16px; |
|||
font-weight: 300; |
|||
line-height: 50px; |
|||
color: #888;
|
|||
-moz-border-radius: 4px; |
|||
-webkit-border-radius: 4px; |
|||
border-radius: 4px; |
|||
-moz-box-shadow: none; |
|||
-webkit-box-shadow: none; |
|||
box-shadow: none; |
|||
-o-transition: all .3s; |
|||
-moz-transition: all .3s; |
|||
-webkit-transition: all .3s; |
|||
-ms-transition: all .3s; |
|||
transition: all .3s; |
|||
} |
|||
button.btn { |
|||
height: 50px; |
|||
margin: 0; |
|||
padding: 0 20px; |
|||
vertical-align: middle; |
|||
background: #4aaf51;
|
|||
border: 0; |
|||
font-family: 'Roboto', sans-serif; |
|||
font-size: 16px; |
|||
font-weight: 300; |
|||
line-height: 50px; |
|||
color: #fff;
|
|||
-moz-border-radius: 4px; |
|||
-webkit-border-radius: 4px; |
|||
border-radius: 4px; |
|||
text-shadow: none; |
|||
-moz-box-shadow: none; |
|||
-webkit-box-shadow: none; |
|||
box-shadow: none; |
|||
-o-transition: all .3s; |
|||
-moz-transition: all .3s; |
|||
-webkit-transition: all .3s; |
|||
-ms-transition: all .3s; |
|||
transition: all .3s; |
|||
} |
|||
button.btn:hover { opacity: 0.6; color: #fff; }
|
|||
</style> |
|||
<div class="container-fluid"> |
|||
<div class="row"> |
|||
<div class="col-sm-6 col-sm-offset-3 form-box"> |
|||
<div class="form-top"> |
|||
<div class="form-top-left"> |
|||
<h3>后台登录</h3> |
|||
<p>请输入您的用户名、密码:</p> |
|||
</div> |
|||
<div class="form-top-right"> |
|||
<i class="glyphicon glyphicon-user"></i> |
|||
</div> |
|||
</div> |
|||
<div class="form-bottom"> |
|||
<form method="post" action="/fladmin/dologin" class="login-form" role="form"> |
|||
{{ csrf_field() }} |
|||
<div class="form-group"> |
|||
<label class="sr-only" for="form-username">Username</label> |
|||
<input type="text" id="username" name="username" placeholder="用户名/邮箱/手机号..." class="form-username form-control"> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="sr-only" for="form-password">Password</label> |
|||
<input type="password" id="pwd" name="pwd" placeholder="输入密码..." class="form-password form-control"> |
|||
</div> |
|||
<button type="submit" class="btn">立即登录</button> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$('.login-form input[type="text"], .login-form input[type="password"], .login-form textarea').on('focus', function() { |
|||
$(this).removeClass('input-error'); |
|||
}); |
|||
|
|||
$('.login-form').on('submit', function(e) { |
|||
$(this).find('input[type="text"], input[type="password"], textarea').each(function(){ |
|||
if( $(this).val() == "" ) { |
|||
e.preventDefault(); |
|||
$(this).addClass('input-error'); |
|||
} |
|||
else { |
|||
$(this).removeClass('input-error'); |
|||
} |
|||
}); |
|||
}); |
|||
</script> |
|||
<script src="/js/bootstrap.min.js"></script></body></html> |
@ -0,0 +1,160 @@ |
|||
<!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/page">页面列表</a> > 新建页面</h5> |
|||
|
|||
<form id="addarc" method="post" action="/fladmin/page/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:60%" placeholder="在此输入标题"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">别名:</td> |
|||
<td><input name="filename" type="text" id="filename" class="required" value="" size="30"> </td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">模板文件名:</td> |
|||
<td><input name="template" type="text" id="template" value="page" size="30"></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><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="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 |
|||
{ |
|||
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;} |
|||
|
|||
//$("#contents").val = ue.getContent();
|
|||
//var datas = $('#addarc').serialize();//#form要在form里面
|
|||
|
|||
//var content = ue.getContent();
|
|||
|
|||
/* $.ajax({ |
|||
url: "/fladmin/page/doadd", |
|||
type: "POST", |
|||
dataType: "json", |
|||
cache: false, |
|||
data: { |
|||
"template":$("#template").val(), |
|||
"filename":$("#filename").val(), |
|||
"litpic":$("#litpic").val(), |
|||
"title":$("#title").val(), |
|||
"seotitle":$("#seotitle").val(), |
|||
"keywords":$("#keywords").val(), |
|||
"description":$("#description").val(), |
|||
"content":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/page"); |
|||
} |
|||
} |
|||
}); */ |
|||
}); |
|||
}); |
|||
</script> |
|||
</body></html> |
@ -0,0 +1,156 @@ |
|||
<!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/page">页面列表</a> > 新建页面</h5> |
|||
|
|||
<form id="addarc" method="post" action="/fladmin/page/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:60%" 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="30"> </td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">模板文件名:</td> |
|||
<td><input name="template" type="text" id="template" value="<?php echo $post["template"]; ?>" size="30"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">seoTitle:</td> |
|||
<td><input name="seotitle" type="text" id="seotitle" value="<?php echo $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="<?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="body" type="text/plain"><?php echo $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 |
|||
{ |
|||
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;} |
|||
|
|||
//$("#contents").val = ue.getContent();
|
|||
//var datas = $('#addarc').serialize();//#form要在form里面
|
|||
|
|||
//var content = ue.getContent();
|
|||
|
|||
/* $.ajax({ |
|||
url: "/fladmin/page/doedit", |
|||
type: "POST", |
|||
cache: false, |
|||
dataType: "json", |
|||
data: { |
|||
"id":$("#id").val(), |
|||
"template":$("#template").val(), |
|||
"filename":$("#filename").val(), |
|||
"litpic":$("#litpic").val(), |
|||
"title":$("#title").val(), |
|||
"seotitle":$("#seotitle").val(), |
|||
"keywords":$("#keywords").val(), |
|||
"description":$("#description").val(), |
|||
"content":content |
|||
}, |
|||
success: function(data){ |
|||
if(data.code==200) |
|||
{ |
|||
//alert(data.info);
|
|||
window.location.replace("/fladmin/page"); |
|||
} |
|||
} |
|||
}); */ |
|||
}); |
|||
}); |
|||
</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/page/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> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<?php if($posts){foreach($posts as $row){ ?>
|
|||
<tr> |
|||
<td><?php echo $row["id"]; ?></td>
|
|||
<td><a href="/fladmin/page/edit?id=<?php echo $row["id"]; ?>"><?php echo $row["title"]; ?></a></td>
|
|||
<td><?php echo $row["filename"]; ?></td>
|
|||
<td><?php echo date('Y-m-d',$row["pubdate"]); ?></td>
|
|||
<td><a target="_blank" href="<?php echo get_front_url(array("type"=>"page","pagename"=>$row["filename"])); ?>">预览</a> <a href="/fladmin/page/edit?id=<?php echo $row["id"]; ?>">修改</a> <a onclick="delconfirm('/fladmin/page/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,20 @@ |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> |
|||
<title>您访问的页面不存在或已被删除!</title> |
|||
<style type="text/css"> |
|||
*{padding:0;margin:0;} |
|||
body{background:#fff;font-family:'微软雅黑';color:#333;font-size:16px;}
|
|||
.system-message{padding:24px 48px;margin:5% auto 0 auto;width:600px;} |
|||
.system-message h1{font-size:100px;font-weight:normal;line-height:120px;margin-bottom:12px;} |
|||
.system-message .jump{padding-top:10px} |
|||
.system-message .jump a{color:#333;}
|
|||
.system-message .success,.system-message .error{line-height:1.8em;font-size:36px} |
|||
.system-message .detail{font-size:14px;line-height:20px;margin-top:12px;} |
|||
</style> |
|||
</head><body> |
|||
<div class="system-message"> |
|||
<h1>:(</h1> |
|||
<p class="error">您访问的页面不存在或已被删除!</p> |
|||
<p class="detail"><a href="<?php echo route('home');?>">返回首页</a></p> |
|||
</div> |
|||
</body></html> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue