From 482a3c880121dcdf8a0feeb61d37c7920cf15370 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Fri, 23 Sep 2011 03:49:10 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=96=B0=E9=97=BB?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E7=9A=84=E6=8E=A7=E5=88=B6=E5=99=A8=E5=8F=8A?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=20=EF=BC=8C=E9=87=87=E7=94=A8=E6=96=B0UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/NewsController.php | 113 +++++++++ .../views/scripts/administryfooter.phtml | 35 +++ .../views/scripts/administryheader.phtml | 81 +++++++ .../admin/views/scripts/stat/index.phtml | 226 ++++++++---------- .../admin/views/scripts/stat/left.phtml | 40 +++- 5 files changed, 365 insertions(+), 130 deletions(-) create mode 100644 application/admin/controllers/NewsController.php create mode 100644 application/admin/views/scripts/administryfooter.phtml create mode 100644 application/admin/views/scripts/administryheader.phtml diff --git a/application/admin/controllers/NewsController.php b/application/admin/controllers/NewsController.php new file mode 100644 index 00000000..512feefa --- /dev/null +++ b/application/admin/controllers/NewsController.php @@ -0,0 +1,113 @@ +db=Zend_Registry::get('db'); + $this->view->config = Zend_Registry::get('config'); + $this->messenger=$this->_helper->getHelper('FlashMessenger'); + $this->view->messages = $this->messenger->getMessages(); + $this->_helper->layout->setLayout('administry');//新UI + } + function postDispatch() + { + $this->view->messages = $this->messenger->getMessages(); + } + function indexAction() + { + + + + + + + + }//indexAction 首页 + + + function catlogAction() + { + $add = $this->_request->getParam('add'); + $submit = $this->_request->getParam('submit'); + + $delete = $this->_request->getParam('delete'); + + $edit = $this->_request->getParam('edit'); + + if($add) + { + if(empty($submit)) + $this->_helper->viewRenderer('catlogadd'); + else{ + $title = $this->_request->getParam('ctitle'); + $keyword = $this->_request->getParam('keyword'); + $discript = $this->_request->getParam('discript'); + + $sql="insert into news_catlog (title,keyword,discript) values ('$title','$keyword','$discript')"; + if($this->db->exec($sql) > 0) + { + $this->messenger->addMessage('提示信息:栏目添加成功!'); + $this->_redirect('/admin/news/catlog'); + } + + } + + }//栏目添加 + if($delete>0) + { + $sql = "delete from news_catlog where id='$delete'"; + if($this->db->exec($sql)>0) + { + $this->messenger->addMessage('提示信息:栏目删除成功!'); + $this->_redirect('/admin/news/catlog'); + } + + }//栏目删除 + if($edit>0) + { + $title = $this->_request->getParam('ctitle'); + $keyword = $this->_request->getParam('keyword'); + $discript = $this->_request->getParam('discript'); + $orders = $this->_request->getParam('orders'); + + $sql="update news_catlog set title='$title',keyword='$keyword',discript='$discript',orders='$orders' where id='$edit'"; + if($this->db->exec($sql)>0) + { + $this->messenger->addMessage('提示信息:栏目编辑成功!'); + $this->_redirect('/admin/news/catlog'); + } + }//栏目编辑 + else + { + + $sql="select * from news_catlog order by orders desc"; + $re=$this->db->query($sql); + $catlogs=$re->fetchAll(); + + $this->view->catlogs=$catlogs; + + }//栏目列表 + + + }//栏目管理 + + + function newsaddAction() + { + + $sql="select * from news_catlog order by orders"; + $re = $this->db->query($sql); + $types = $re->fetchAll(); + + $this->view->types=$types; + + + + + + }//newsadd 新闻添加 + + + +} + diff --git a/application/admin/views/scripts/administryfooter.phtml b/application/admin/views/scripts/administryfooter.phtml new file mode 100644 index 00000000..5f3c4efd --- /dev/null +++ b/application/admin/views/scripts/administryfooter.phtml @@ -0,0 +1,35 @@ + + + + + + + + + + ^ scroll to top \ No newline at end of file diff --git a/application/admin/views/scripts/administryheader.phtml b/application/admin/views/scripts/administryheader.phtml new file mode 100644 index 00000000..dcc3b9d8 --- /dev/null +++ b/application/admin/views/scripts/administryheader.phtml @@ -0,0 +1,81 @@ +hasIdentity()) + { + $user = $auth->getIdentity(); + $uname=$user->username; + } +?> + +
+ +
+ diff --git a/application/admin/views/scripts/stat/index.phtml b/application/admin/views/scripts/stat/index.phtml index 62dce9a9..59b281df 100644 --- a/application/admin/views/scripts/stat/index.phtml +++ b/application/admin/views/scripts/stat/index.phtml @@ -2,130 +2,112 @@ $this->headTitle($this->config->title->site); $this->headTitle('后台管理'); $this->headTitle()->setSeparator(' - '); - $this->headLink()->appendStylesheet('/css/admin.css'); - $this->breadcrumb('首页'); - $this->breadcrumb('后台首页'); - $this->breadcrumb()->setSeparator(' > '); - $this->headScript()->appendFile('/js/jquery-1.6.4.min.js'); - $this->headScript()->appendFile('/js/jquery.masonry.min.js'); ?> - -
-
-partial('stat/left.phtml'); ?> -
-
- -
-
概况
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
keyvalue
用户总数alluser['num'];?> 位
metadata数据总数alldata['num'];?> 条
数据下载总次数alldown['num'];?> 次
已通过的离线申请allpass['num'];?> 个
未通过的离线申请nopass['num'];?> 个
在线下载申请次数onlinedown['num'];?> 次
-
- -
-
数据下载量概况
- - - - - - - - - - - - - - - - + +
+
+

新闻中心

+ +
+
+
+ -
单位:GB
总下载数据量allsize['num'],2);?>
离线下载数据量offlinesize['num'],2);?>
在线下载数据量onlinesize['num'],2);?>
-
+ +
+ +
+ + + + + + +
+ +

最新发布的新闻

+
+ + + + +
 
+ +
+ + + + +
+ +
+ + + -
-
各单位离线下载情况
- - - - - - - - unitoffline as $k=>$v) - { - echo ' - - - '; - } - ?> -
单位名称离线下载次数
'.$v['unit'].''.$v['num'].'
-
- -
-
各单位在线下载情况
- - - - - - - - unitonline as $k=>$v) - { - echo ' - - - '; - } - ?> -
单位名称在线下载次数
'.$v['unit'].''.$v['num'].'
-
- - - -
-
- \ No newline at end of file diff --git a/application/admin/views/scripts/stat/left.phtml b/application/admin/views/scripts/stat/left.phtml index b440a3e7..b69b0dc7 100644 --- a/application/admin/views/scripts/stat/left.phtml +++ b/application/admin/views/scripts/stat/left.phtml @@ -1,8 +1,32 @@ - \ No newline at end of file +
+
+

新闻中心管理

+
+
+ +
+
栏目管理
+
创建、编辑、删除栏目
+ +
+
新闻管理
+
查看、编辑、搜索、删除新闻
+ +
+
发布新闻
+
为网站发布一篇新闻
+
+
+
+
+

Tips

+
+
+
+
在栏目编辑中,再次点击“编辑”按钮可以关闭栏目编辑窗口
+
去试试
+
新闻添加中可以直接上传图片
+
去试试
+
+
+
\ No newline at end of file