From 8a19e26ad5046aa491000c3eb9edfd1635708cc5 Mon Sep 17 00:00:00 2001 From: wlx Date: Sun, 25 Sep 2011 10:20:11 +0000 Subject: [PATCH] add initial version of ReviewController --- .../default/controllers/ReviewController.php | 45 +++++++++++++++++++ .../default/views/scripts/review/browse.phtml | 25 +++++++++++ .../default/views/scripts/review/index.phtml | 44 ++++++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 application/default/controllers/ReviewController.php create mode 100755 application/default/views/scripts/review/browse.phtml create mode 100755 application/default/views/scripts/review/index.phtml diff --git a/application/default/controllers/ReviewController.php b/application/default/controllers/ReviewController.php new file mode 100644 index 00000000..6d1f31d2 --- /dev/null +++ b/application/default/controllers/ReviewController.php @@ -0,0 +1,45 @@ +view->config = Zend_Registry::get('config'); + $this->db=Zend_Registry::get('db'); + } + function indexAction() + { + //最新10个收稿 + $sql="select m.uuid,m.title,s.ts_created from mdstatus s left join metadata m on m.uuid=s.uuid where s.status=0 order by s.ts_created desc limit 10"; + $this->view->mdreceived = $this->db->fetchAll($sql); + //最新10个接收 + $sql="select m.uuid,m.title,s.ts_accepted from mdstatus s left join metadata m on m.uuid=s.uuid where s.status=1 order by s.ts_created desc limit 10"; + $this->view->mdaccepted = $this->db->fetchAll($sql); + //最新10个送审 + $sql="select m.uuid,m.title,s.ts_accepted from mdstatus s left join metadata m on m.uuid=s.uuid where s.status in (2,3,4) order by s.ts_created desc limit 10"; + $this->view->mdinreview = $this->db->fetchAll($sql); + //最新10个已审 + $sql="select m.uuid,m.title,s.ts_accepted from mdstatus s left join metadata m on m.uuid=s.uuid where s.status=5 order by s.ts_created desc limit 10"; + $this->view->mdreviewed = $this->db->fetchAll($sql); + } + /* + * 数据浏览 + */ + function browseAction() + { + $md=new MetadataTable(); + $db=$md->getAdapter(); + $page=(int)$this->_request->getParam('page'); + if (empty($page)) $page=1; + $limit=10; + $offset=$limit*($page-1); + $state=$db->query('select count(*) from metadata'); + $row=$state->fetchAll(); + $sum=$row[0]['count']; + $select=$db->select(); + $select->from('metadata','*')->order('id desc')->limitPage($page,$limit); + $this->view->metadata = $db->fetchAll($select); + $this->view->page=new Pagination($sum,$page,$limit); + } + +} + diff --git a/application/default/views/scripts/review/browse.phtml b/application/default/views/scripts/review/browse.phtml new file mode 100755 index 00000000..cce63ea7 --- /dev/null +++ b/application/default/views/scripts/review/browse.phtml @@ -0,0 +1,25 @@ +headTitle($this->config->title->site); +$this->headTitle($this->config->title->metadata); +$this->headTitle('全部浏览'); +$this->headTitle()->setSeparator(' - '); +$this->headLink()->appendStylesheet('/css/metadata.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('元数据评审'); +$this->breadcrumb('浏览'); +$this->breadcrumb()->setSeparator(' > '); +?> +page->getNavigation(); ?> +metadata as $md) : ?> +
+
+
+

escape($md['title']);?> + + + + +

+
',mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']));?>
+
+ diff --git a/application/default/views/scripts/review/index.phtml b/application/default/views/scripts/review/index.phtml new file mode 100755 index 00000000..8477aefb --- /dev/null +++ b/application/default/views/scripts/review/index.phtml @@ -0,0 +1,44 @@ +headTitle($config->title->site); +$this->headTitle($config->title->mdreview); +$this->headTitle()->setSeparator(' - '); +$this->headLink()->appendStylesheet('/css/mdreview.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('元数据评审'); +$this->breadcrumb()->setSeparator(' > '); +?> +
+ + + + + + + + +
\ No newline at end of file