From 1954ce79ac796af65202695950407426584bc311 Mon Sep 17 00:00:00 2001 From: wlx Date: Fri, 30 Nov 2012 18:16:06 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=87=E6=A1=A3=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E3=80=81=E4=B8=93=E5=88=A9=E4=B8=8E=E8=91=97=E4=BD=9C?= =?UTF-8?q?=E6=9D=83=E6=94=AF=E6=8C=81=EF=BC=9Barchive=E7=B1=BB=E4=B8=AD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=8E=B7=E5=8F=96=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/AboutController.php | 21 +++++----- .../default/views/scripts/about/patent.phtml | 41 +++++++++++++++++++ .../default/views/scripts/about/report.phtml | 41 +++++++++++++++++++ application/models/Archive.php | 11 ++++- 4 files changed, 102 insertions(+), 12 deletions(-) create mode 100644 application/default/views/scripts/about/patent.phtml create mode 100644 application/default/views/scripts/about/report.phtml diff --git a/application/default/controllers/AboutController.php b/application/default/controllers/AboutController.php index e7e5efa7..ae92127e 100755 --- a/application/default/controllers/AboutController.php +++ b/application/default/controllers/AboutController.php @@ -75,15 +75,16 @@ class AboutController extends Zend_Controller_Action $sth = $this->db->prepare($sql); $sth->execute(array($siteid)); $rows = $sth->fetchAll(); - - $paginator = Zend_Paginator::factory($rows); - $paginator->setCurrentPageNumber($this->_getParam('page')); - $paginator->setItemCountPerPage(10); - $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); - $this->view->paginator=$paginator; - } - - + } elseif ($ac=='patent' || $ac=='report') { + $archives=new Archive($this->db); + $rows=$archives->getArchive($ac); + $this->_helper->viewRenderer($ac); + } + $paginator = Zend_Paginator::factory($rows); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(10); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; } } \ No newline at end of file diff --git a/application/default/views/scripts/about/patent.phtml b/application/default/views/scripts/about/patent.phtml new file mode 100644 index 00000000..01d8e9df --- /dev/null +++ b/application/default/views/scripts/about/patent.phtml @@ -0,0 +1,41 @@ +headTitle($this->config->title->site); +$this->headTitle('成果发表'); +$this->headTitle()->setSeparator(' - '); +$this->headLink()->appendStylesheet('/css/about.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('关于本站'); +$this->breadcrumb('成果发表'); +$this->breadcrumb('专利与著作权'); +$this->breadcrumb()->setSeparator(' > '); +?> + +
+

成果发表

+ +
+ paginator)): ?> +
    + paginator as $item): ?> +
  • + link)) : + echo ' 下载'; + endif; + ?> +
  • + +
+ + +
+
\ No newline at end of file diff --git a/application/default/views/scripts/about/report.phtml b/application/default/views/scripts/about/report.phtml new file mode 100644 index 00000000..432e947e --- /dev/null +++ b/application/default/views/scripts/about/report.phtml @@ -0,0 +1,41 @@ +headTitle($this->config->title->site); +$this->headTitle('成果发表'); +$this->headTitle()->setSeparator(' - '); +$this->headLink()->appendStylesheet('/css/about.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('关于本站'); +$this->breadcrumb('成果发表'); +$this->breadcrumb('文档报告'); +$this->breadcrumb()->setSeparator(' > '); +?> + +
+

成果发表

+ +
+ paginator)): ?> +
    + paginator as $item): ?> +
  • + link)) : + echo ' 下载'; + endif; + ?> +
  • + +
+ + +
+
\ No newline at end of file diff --git a/application/models/Archive.php b/application/models/Archive.php index fb16094a..bcd732df 100644 --- a/application/models/Archive.php +++ b/application/models/Archive.php @@ -219,6 +219,13 @@ class Archive $sql = "DELETE FROM ".$this->tbl_tag." WHERE id=$aid"; @$this->db->exec($sql); return true; - }//DeleteTags - + }//DeleteTags + + function getArchive($code='') + { + $sql="select * from ".$this->tbl_archives; + if (!empty($code)) $sql.=" where code='".$code."'"; + $rs=$this->db->query($sql); + $rows=$rs->fetchAll(); + } }