SRCMS(轻响应)企业应急响应中心开发框架
This commit is contained in:
martinzhou2015
2015-07-28 19:00:39 +08:00
parent 0a95303932
commit e6ef253b86
13 changed files with 46 additions and 62 deletions

View File

@@ -90,8 +90,9 @@ class CategoryController extends BaseController
* @param [type] $id [description] * @param [type] $id [description]
* @return [type] [description] * @return [type] [description]
*/ */
public function delete($id) public function delete()
{ {
$id = I('get.id',0,'intval');
$model = M('category'); $model = M('category');
//查询属于这个分类的文章 //查询属于这个分类的文章
$posts = M('post')->where('cate_id='.$id)->select(); $posts = M('post')->where('cate_id='.$id)->select();

View File

@@ -60,8 +60,9 @@ class LinksController extends BaseController
* @param [type] $id [链接ID] * @param [type] $id [链接ID]
* @return [type] [description] * @return [type] [description]
*/ */
public function update($id) public function update()
{ {
$id = I('get.id',0,'intval');
//默认显示添加表单 //默认显示添加表单
if (!IS_POST) { if (!IS_POST) {
$model = M('links')->where('id='.$id)->find(); $model = M('links')->where('id='.$id)->find();
@@ -86,8 +87,9 @@ class LinksController extends BaseController
* @param [type] $id [description] * @param [type] $id [description]
* @return [type] [description] * @return [type] [description]
*/ */
public function delete($id) public function delete()
{ {
$id = I('get.id',0,'intval');
$model = M('links'); $model = M('links');
$result = $model->delete($id); $result = $model->delete($id);
if($result){ if($result){

View File

@@ -97,8 +97,9 @@ class MemberController extends BaseController
* @param [type] $id [description] * @param [type] $id [description]
* @return [type] [description] * @return [type] [description]
*/ */
public function delete($id) public function delete()
{ {
$id = I('get.id',0,'intval');
if(C('SUPER_ADMIN_ID') == $id) $this->error("超级管理员不可禁用!"); if(C('SUPER_ADMIN_ID') == $id) $this->error("超级管理员不可禁用!");
$model = M('member'); $model = M('member');
//查询status字段值 //查询status字段值

View File

@@ -60,9 +60,10 @@ class PageController extends BaseController
* @param [type] $id [单页ID] * @param [type] $id [单页ID]
* @return [type] [description] * @return [type] [description]
*/ */
public function update($id) public function update()
{ {
//默认显示添加表单 $id = I('get.id',0,'intval');
//默认显示添加表单
if (!IS_POST) { if (!IS_POST) {
$model = M('page')->where('id='.$id)->find(); $model = M('page')->where('id='.$id)->find();
$this->assign('page',$model); $this->assign('page',$model);
@@ -86,8 +87,9 @@ class PageController extends BaseController
* @param [type] $id [description] * @param [type] $id [description]
* @return [type] [description] * @return [type] [description]
*/ */
public function delete($id) public function delete()
{ {
$id = I('get.id',0,'intval');
$model = M('page'); $model = M('page');
$result = $model->where("id=".$id)->delete(); $result = $model->where("id=".$id)->delete();
if($result){ if($result){

View File

@@ -67,8 +67,9 @@ class PostController extends BaseController
* @param [type] $id [文章ID] * @param [type] $id [文章ID]
* @return [type] [description] * @return [type] [description]
*/ */
public function update($id) public function update()
{ {
$id = I('get.id',0,'intval');
//默认显示添加表单 //默认显示添加表单
if (!IS_POST) { if (!IS_POST) {
$model = M('post')->where('id='.$id)->find(); $model = M('post')->where('id='.$id)->find();
@@ -94,8 +95,9 @@ class PostController extends BaseController
* @param [type] $id [description] * @param [type] $id [description]
* @return [type] [description] * @return [type] [description]
*/ */
public function delete($id) public function delete()
{ {
$id = I('get.id',0,'intval');
$model = M('post'); $model = M('post');
$result = $model->where("id=".$id)->delete(); $result = $model->where("id=".$id)->delete();
if($result){ if($result){
@@ -112,8 +114,8 @@ class PostController extends BaseController
*/ */
public function jifen() public function jifen()
{ {
$user_id = I('post.user_id'); $user_id = I('post.user_id',0,'intval');
$amount = I('post.amount'); $amount = I('post.amount',0,'intval');
$model = M('member'); $model = M('member');
$result = $model->where('id='.$user_id)->setInc('jifen',$amount); $result = $model->where('id='.$user_id)->setInc('jifen',$amount);
if($result){ if($result){

View File

@@ -91,7 +91,7 @@ class SettingController extends BaseController
public function delete($id) public function delete($id)
{ {
$model = M('setting'); $model = M('setting');
//验证通过 //验证通过
$result = $model->delete($id); $result = $model->delete($id);
if($result){ if($result){

View File

@@ -34,7 +34,8 @@ class PageController extends Controller{
} }
public function view($id){ public function view(){
$id = I('get.id',0,'intval'); //对传入数字参数做整数校验规避SQLinjection漏洞
$model = M('page')->where('id='.$id)->find(); $model = M('page')->where('id='.$id)->find();
$this->assign('model',$model); $this->assign('model',$model);
$this->display(); $this->display();

View File

@@ -23,47 +23,7 @@
</div> </div>
</div> </div>
<!--<div class="featurette" id="sec2"> <div class="callout" id="sec2">
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
<h1>Amazing Features</h1>
</div>
</div>
<div class="row">
<div class="col-md-2 col-md-offset-2 text-center">
<div class="featurette-item">
<i class="icon-rocket"></i>
<h4>Rocket</h4>
<p>Up-up-and-away with this starter template.</p>
</div>
</div>
<div class="col-md-2 text-center">
<div class="featurette-item">
<i class="icon-magnet"></i>
<h4>Magnet</h4>
<p>For you are a magnet and I am steel.</p>
</div>
</div>
<div class="col-md-2 text-center">
<div class="featurette-item">
<i class="icon-shield"></i>
<h4>Shield</h4>
<p>Protect yourself. Don't design like it's 1999.</p>
</div>
</div>
<div class="col-md-2 text-center">
<div class="featurette-item">
<i class="icon-pencil"></i>
<h4>Scholar</h4>
<p>Because lead pencils are pretty smart looking.</p>
</div>
</div>
</div>
</div>
</div>-->
<div class="callout" id="sec3">
<div class="vert"> <div class="vert">
<div class="col-md-12 text-center"><h2><strong>贡献榜</strong></h2></div> <div class="col-md-12 text-center"><h2><strong>贡献榜</strong></h2></div>
<div class="col-md-12 text-center">&nbsp;</div> <div class="col-md-12 text-center">&nbsp;</div>
@@ -90,7 +50,6 @@
<p class="lead"><a href="__ROOT__/index.php?m=&c=page&a=view&id={$v.id}">{$v.title}</a></p> <p class="lead"><a href="__ROOT__/index.php?m=&c=page&a=view&id={$v.id}">{$v.title}</a></p>
</tr> </tr>
</foreach> </foreach>
<!--<a href="http://bootply.com/templates" target="ext">More Bootstrap Templates</a></p>-->
</div> </div>
</div> </div>
</div> </div>

View File

@@ -2,7 +2,6 @@
<block name="main"> <block name="main">
<!-- 公告列表 --> <!-- 公告列表 -->
<!-- 公告详情 -->
<div class="gallery"> <div class="gallery">
<div class="container"> <div class="container">
<div class="col-md-6 col-md-offset-3"> <div class="col-md-6 col-md-offset-3">

View File

@@ -1,5 +1,5 @@
<footer> <footer>
<div class="container"> <div class="container" id="sec3">
<div class="row"> <div class="row">
<div class="col-md-6 col-md-offset-3 text-center"> <div class="col-md-6 col-md-offset-3 text-center">
<ul class="list-inline"> <ul class="list-inline">
@@ -18,7 +18,7 @@
</footer> </footer>
<ul class="nav pull-right scroll-down"> <ul class="nav pull-right scroll-down">
<li><a href="#" title="Scroll down"><i class="icon-chevron-down icon-3x"></i></a></li> <li><a href="#sec3" title="Scroll down"><i class="icon-chevron-down icon-3x"></i></a></li>
</ul> </ul>
<ul class="nav pull-right scroll-top"> <ul class="nav pull-right scroll-top">
<li><a href="#" title="Scroll to top"><i class="icon-chevron-up icon-3x"></i></a></li> <li><a href="#" title="Scroll to top"><i class="icon-chevron-up icon-3x"></i></a></li>

View File

@@ -0,0 +1,19 @@
<?php
namespace User\Controller;
use Think\Controller;
/**
* @author Zhou Yuyang <1009465756@qq.com> 2015-07-27
* @copyright ©2105-2018 SRCMS
* @homepage http://www.src.pw
* @version 1.0
*/
class GiftController extends BaseController{
public function index(){
$gift = M('links')->select();
$this->assign('gift',$gift);
$this->display();
}
}

View File

@@ -30,9 +30,7 @@
<li><a href="{:U('index/index')}">个人中心</a></li> <li><a href="{:U('index/index')}">个人中心</a></li>
<li><a href="{:U('post/index')}">漏洞列表</a></li> <li><a href="{:U('post/index')}">漏洞列表</a></li>
<li><a href="{:U('post/add')}">报告漏洞</a></li> <li><a href="{:U('post/add')}">报告漏洞</a></li>
<!--<li><a href="__ROOT__/index.php?m=&c=page&a=index">公告</a></li> <!--<li><a href="{:U('gift/index')}">礼品库</a></li>-->
<li><a href="__ROOT__/index.php?m=&c=hall&a=index">贡献榜</a></li>
<li><a href="__ROOT__/index.php?m=&c=gift&a=index">礼品库</a></li>-->
</ul> </ul>
</div> </div>
</div> </div>

View File

@@ -3,7 +3,7 @@
-- http://www.phpmyadmin.net -- http://www.phpmyadmin.net
-- --
-- 主机: localhost -- 主机: localhost
-- 生成日期: 2015 年 07 月 28 日 15:49 -- 生成日期: 2015 年 07 月 28 日 16:42
-- 服务器版本: 5.5.40 -- 服务器版本: 5.5.40
-- PHP 版本: 5.3.29 -- PHP 版本: 5.3.29