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');
+?>
+
+
+
+= $this->partial('down/left.phtml'); ?>
+
+
+msg or $this->messages) :?>
+
+msg) : ?>
+
msg; ?>
+messages): foreach($this->messages as $msg): ?>
+
+
+
+
+
+
+
+
+
+资料名称 |
+下载次数 |
+操作 |
+
+paginator)): ?>
+
+paginator as $item): ?>
+
+>
+ |
+ |
+
+'>查看详细
+ |
+
+
+
+
+
+= $this->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 @@
= $this->partial('down/left.phtml'); ?>
-
-= $this->paginator; ?>
msg or $this->messages) :?>
msg) : ?>
@@ -23,31 +21,38 @@
-
共有 t['total'];?> 条在线下载记录
+
+
+
+
共有 t['total'];?> 条在线下载记录
+
+
+姓名 |
+单位 |
+数据 |
+用途 |
+下载时间 |
+操作 |
+
paginator)): ?>
-
-
+
+
+
+= $this->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');
+?>
+
+
+
+= $this->partial('down/left.phtml'); ?>
+
+
+msg or $this->messages) :?>
+
+msg) : ?>
+
msg; ?>
+messages): foreach($this->messages as $msg): ?>
+
+
+
+
+
+
+
+
+记录ID | infos['id'];?> |
+用户名 | infos['uname'];?> > 察看用户 |
+姓名 | infos['username'];?> |
+单位 | infos['unit'];?> |
+电话 | infos['phone'];?> |
+地址 | infos['address'];?> |
+邮编 | infos['postcode'];?> |
+电话 | infos['phone'];?> |
+Email | infos['email'];?> |
+项目 | |
+下载时间 | infos['ts_created']));?> |
+项目名称 | infos['title'];?> > 查看项目 |
+
+
+= $this->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');
+?>
+
+
+
+= $this->partial('down/left.phtml'); ?>
+
+
+msg or $this->messages) :?>
+
+msg) : ?>
+
msg; ?>
+messages): foreach($this->messages as $msg): ?>
+
+
+
+
+
+
+
+
“infos['title']; ?>” 的下载记录
+
+
+= $this->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');
+?>
+
+
+
+= $this->partial('down/left.phtml'); ?>
+
+
+msg or $this->messages) :?>
+
+msg) : ?>
+
msg; ?>
+messages): foreach($this->messages as $msg): ?>
+
+
+
+
+
+
+
+
用户 “infos['username']; ?>” 的下载记录
+
+
+= $this->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');
+?>
+
+
+
+= $this->partial('down/left.phtml'); ?>
+
+
+msg or $this->messages) :?>
+
+msg) : ?>
+
msg; ?>
+messages): foreach($this->messages as $msg): ?>
+
+
+
+
+
+
+
+
+
+姓名 |
+下载次数 |
+操作 |
+
+paginator)): ?>
+
+paginator as $item): ?>
+
+>
+ |
+ |
+
+'>查看详细
+ |
+
+
+
+
+
+= $this->paginator; ?>
+
+
\ No newline at end of file