diff --git a/application/admin/controllers/DownController.php b/application/admin/controllers/DownController.php index ea806ce5..ca900c90 100644 --- a/application/admin/controllers/DownController.php +++ b/application/admin/controllers/DownController.php @@ -237,21 +237,146 @@ class Admin_DownController extends Zend_Controller_Action //在线数据下载情况,仅针对onlineapp表,自2011-9-8开始记录。 function onlineAction() { - $select=$this->db->select(); - $select->from('onlineapp as o',array('id','userid','unit','username','ts_created','project')) - ->join('metadata as m', 'o.uuid = m.uuid', array('title','uuid')) - ->order('o.id desc'); - $paginator = Zend_Paginator::factory($select); - $paginator->setCurrentPageNumber($this->_getParam('page')); - $paginator->setItemCountPerPage($this->view->config->page->max); - $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); - $this->view->paginator=$paginator; + $ac=$this->_getParam('ac'); + $id=(int)$this->_getParam('id'); + if(empty($ac) || empty($id)) + { + $select=$this->db->select(); + $select->from('onlineapp as o',array('id','userid','unit','username','ts_created','project')) + ->join('metadata as m', 'o.uuid = m.uuid', array('title','uuid')) + ->order('o.id desc'); + $paginator = Zend_Paginator::factory($select); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage($this->view->config->page->max); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); + $this->view->paginator=$paginator; + + $count="select count(id) as total from onlineapp"; + $re=$this->db->query($count); + $t=$re->fetch(); + $this->view->t=$t; + }//列表 - $count="select count(id) as total from onlineapp"; - $re=$this->db->query($count); - $t=$re->fetch(); - $this->view->t=$t; - } + if($ac=='delete' && !empty($id)) + { + $sql="delete from onlineapp where id=?"; + try { + $this->db->query($sql,array($id)); + $this->messenger->addMessage('该记录已删除'); + } catch (Exception $e) { + $this->messenger->addMessage($e->getMessage()); + } + $this->_redirect("/admin/down/online/"); + }//删除 + + if($ac=='show' && !empty($id)) + { + $sql ="select o.*,u.username as uname,u.id as uid,m.title,m.uuid + from onlineapp as o + left join users as u on u.id = o.userid + left join metadata as m on o.uuid = m.uuid + where o.id=?"; + $result =$this->db->query($sql,$id); + $rows = $result->fetch(); + $this->view->infos=$rows; + + $this->_helper->viewRenderer('onlineshow'); + }//查看详细 + }//onlineAction + + function userAction() + { + $ac=$this->_getParam('ac'); + $id=(int)$this->_getParam('id'); + + if(empty($ac)|| empty($id)) + { + $select=$this->db->select(); + $select->from('onlineapp as o','count(o.id) as num') + ->join('users as u', 'u.id = o.userid', array('realname','id as uid')) + ->where('o.userid = u.id') + ->group('uid') + ->group('realname') + ->order('num desc'); + $paginator = Zend_Paginator::factory($select); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(30); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); + $this->view->paginator=$paginator; + }//列表 + + if($ac=='show' && !empty($id)) + { + $select=$this->db->select(); + $select->from('onlineapp as o',array('id','username','ts_created')) + ->join('metadata as m', 'o.uuid = m.uuid', array('title','uuid')) + ->where('o.userid = ?', $id) + ->order('o.id desc'); + $paginator = Zend_Paginator::factory($select); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(30); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); + $this->view->paginator=$paginator; + + $sql="select username,realname from users where id='$id'"; + $re=$this->db->query($sql); + $t=$re->fetch(); + $this->view->infos=$t; + + $this->_helper->viewRenderer('showuser'); + }//查看单个用户的下载记录 + + }//userAction 用户下载情况 + + function dataAction() + { + $ac=$this->_getParam('ac'); + $uuid = $this->_request->getParam('uuid'); + + if(empty($ac) || $ac=='list') + { + $select=$this->db->select(); + $select->from('onlineapp as o','count(o.id) as num') + ->join('metadata as m', 'o.uuid = m.uuid', array('title','uuid')) + ->where('o.uuid = m.uuid') + ->group('m.title') + ->group('m.uuid') + ->order('num desc'); + $paginator = Zend_Paginator::factory($select); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(30); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); + $this->view->paginator=$paginator; + }//数据下载情况列表 + + + if($ac=='show' && !empty($uuid)) + { + $select=$this->db->select(); + $select->from('onlineapp as o',array('id','username','ts_created')) + ->join('metadata as m', 'o.uuid = m.uuid', array('title','uuid')) + ->where('m.uuid = ?', $uuid) + ->order('o.id desc'); + $paginator = Zend_Paginator::factory($select); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(30); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); + $this->view->paginator=$paginator; + + $sql="select title from metadata where uuid='$uuid'"; + $re=$this->db->query($sql); + $t=$re->fetch(); + $this->view->infos=$t; + + $this->_helper->viewRenderer('showdata'); + }//查看单个数据下载情况 + + }//dataAction 数据下载情况 + } diff --git a/application/admin/views/scripts/down/data.phtml b/application/admin/views/scripts/down/data.phtml new file mode 100755 index 00000000..5912a8dd --- /dev/null +++ b/application/admin/views/scripts/down/data.phtml @@ -0,0 +1,53 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->headLink()->appendStylesheet('/css/admin.css'); + $this->breadcrumb('首页'); + $this->breadcrumb('后台管理首页'); + $this->breadcrumb('在线下载记录'); + $this->breadcrumb()->setSeparator(' > '); + $this->headScript()->appendFile('/js/prototype.js'); +?> +
+ +
+partial('down/left.phtml'); ?> +
+ +msg or $this->messages) :?> +
+msg) : ?> +

msg; ?>

+messages): foreach($this->messages as $msg): ?> +

+ +
+ + + +
+ + + + + + +paginator)): ?> + +paginator as $item): ?> + +> + + + + + + +
资料名称下载次数操作
+'>查看详细 +
+
+paginator; ?> +
+
\ No newline at end of file diff --git a/application/admin/views/scripts/down/online.phtml b/application/admin/views/scripts/down/online.phtml index 98c6eace..d272d031 100644 --- a/application/admin/views/scripts/down/online.phtml +++ b/application/admin/views/scripts/down/online.phtml @@ -12,8 +12,6 @@
partial('down/left.phtml'); ?>
-
-paginator; ?> msg or $this->messages) :?>
msg) : ?> @@ -23,31 +21,38 @@
-
共有 t['total'];?> 条在线下载记录
+ + +
+
共有 t['total'];?> 条在线下载记录
+ + + + + + + + +paginator)): ?> -
姓名单位数据用途下载时间操作
- - - - - - - - - +paginator as $item): ?> - - - - - - - > + + + + + + - + -
姓名单位数据用途时间操作
- 查看 - 删除 + +
+'>查看详细 +/' onclick="return confirm('确定将此记录删除?')">删除
- + + +
+paginator; ?> +
\ No newline at end of file diff --git a/application/admin/views/scripts/down/onlineshow.phtml b/application/admin/views/scripts/down/onlineshow.phtml new file mode 100755 index 00000000..2b844e6a --- /dev/null +++ b/application/admin/views/scripts/down/onlineshow.phtml @@ -0,0 +1,47 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->headLink()->appendStylesheet('/css/admin.css'); + $this->breadcrumb('首页'); + $this->breadcrumb('后台管理首页'); + $this->breadcrumb('详细信息'); + $this->breadcrumb()->setSeparator(' > '); + $this->headScript()->appendFile('/js/prototype.js'); +?> +
+ +
+partial('down/left.phtml'); ?> +
+ +msg or $this->messages) :?> +
+msg) : ?> +

msg; ?>

+messages): foreach($this->messages as $msg): ?> +

+ +
+ + + +
+ + + + + + + + + + + + + +
记录IDinfos['id'];?>
用户名infos['uname'];?> > 察看用户
姓名infos['username'];?>
单位infos['unit'];?>
电话infos['phone'];?>
地址infos['address'];?>
邮编infos['postcode'];?>
电话infos['phone'];?>
Emailinfos['email'];?>
项目
下载时间infos['ts_created']));?>
项目名称infos['title'];?> > 查看项目
+
+paginator; ?> +
+
\ No newline at end of file diff --git a/application/admin/views/scripts/down/showdata.phtml b/application/admin/views/scripts/down/showdata.phtml new file mode 100755 index 00000000..99c78a3b --- /dev/null +++ b/application/admin/views/scripts/down/showdata.phtml @@ -0,0 +1,60 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->headLink()->appendStylesheet('/css/admin.css'); + $this->breadcrumb('首页'); + $this->breadcrumb('后台管理首页'); + $this->breadcrumb('统计'); + $this->breadcrumb('在线下载记录'); + $this->breadcrumb()->setSeparator(' > '); + $this->headScript()->appendFile('/js/prototype.js'); +?> +
+ +
+partial('down/left.phtml'); ?> +
+ +msg or $this->messages) :?> +
+msg) : ?> +

msg; ?>

+messages): foreach($this->messages as $msg): ?> +

+ +
+ + + +
+
infos['title']; ?>” 的下载记录
+ + + + + + + + +paginator)): ?> + +paginator as $item): ?> + +> + + + + + + + + +
id姓名资料名称下载时间操作
+'>查看详细 +/' onclick="return confirm('确定将此记录删除?')">删除 +
+
+paginator; ?> +
+
\ No newline at end of file diff --git a/application/admin/views/scripts/down/showuser.phtml b/application/admin/views/scripts/down/showuser.phtml new file mode 100755 index 00000000..b0ea9533 --- /dev/null +++ b/application/admin/views/scripts/down/showuser.phtml @@ -0,0 +1,60 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->headLink()->appendStylesheet('/css/admin.css'); + $this->breadcrumb('首页'); + $this->breadcrumb('后台管理首页'); + $this->breadcrumb('统计'); + $this->breadcrumb('在线下载记录'); + $this->breadcrumb()->setSeparator(' > '); + $this->headScript()->appendFile('/js/prototype.js'); +?> +
+ +
+partial('down/left.phtml'); ?> +
+ +msg or $this->messages) :?> +
+msg) : ?> +

msg; ?>

+messages): foreach($this->messages as $msg): ?> +

+ +
+ + + +
+
用户 “infos['username']; ?>” 的下载记录
+ + + + + + + + +paginator)): ?> + +paginator as $item): ?> + +> + + + + + + + + +
id姓名资料名称下载时间操作
+'>查看详细 +/' onclick="return confirm('确定将此记录删除?')">删除 +
+
+paginator; ?> +
+
\ No newline at end of file diff --git a/application/admin/views/scripts/down/user.phtml b/application/admin/views/scripts/down/user.phtml new file mode 100755 index 00000000..3dca2ff8 --- /dev/null +++ b/application/admin/views/scripts/down/user.phtml @@ -0,0 +1,53 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->headLink()->appendStylesheet('/css/admin.css'); + $this->breadcrumb('首页'); + $this->breadcrumb('后台管理首页'); + $this->breadcrumb('在线下载记录'); + $this->breadcrumb()->setSeparator(' > '); + $this->headScript()->appendFile('/js/prototype.js'); +?> +
+ +
+partial('down/left.phtml'); ?> +
+ +msg or $this->messages) :?> +
+msg) : ?> +

msg; ?>

+messages): foreach($this->messages as $msg): ?> +

+ +
+ + + +
+ + + + + + +paginator)): ?> + +paginator as $item): ?> + +> + + + + + + +
姓名下载次数操作
+'>查看详细 +
+
+paginator; ?> +
+
\ No newline at end of file