From ad53a49073568f9ccc2136d16fa43701b160ddcd Mon Sep 17 00:00:00 2001 From: wlx Date: Thu, 1 Jul 2010 08:48:35 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=90=8E=E5=8F=B0=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E5=B7=A5=E5=85=B7=EF=BC=8C=E6=9A=82=E6=97=B6=E5=8F=AA?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=96=87=E7=8C=AE=E9=93=BE=E6=8E=A5=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/TestController.php | 43 +++++++++++++++++++ .../admin/views/scripts/test/index.phtml | 19 ++++++++ .../admin/views/scripts/test/left.phtml | 13 ++++++ .../admin/views/scripts/test/reftest.phtml | 38 ++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 application/admin/controllers/TestController.php create mode 100644 application/admin/views/scripts/test/index.phtml create mode 100644 application/admin/views/scripts/test/left.phtml create mode 100644 application/admin/views/scripts/test/reftest.phtml diff --git a/application/admin/controllers/TestController.php b/application/admin/controllers/TestController.php new file mode 100644 index 00000000..3aff2c36 --- /dev/null +++ b/application/admin/controllers/TestController.php @@ -0,0 +1,43 @@ +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->wdb=Zend_Db::factory('Pdo_Pgsql', array('host'=> '210.77.68.252','username' => 'wlz','password' => 'glacier','dbname'=> 'new_geonetwork')); + } + function postDispatch() + { + $this->view->messages = $this->messenger->getMessages(); + } + function indexAction() + { + //其他连接 + } + + + //测试文献的下载链接是否正确 + function reftestAction() + { + $sql="select * from reference where link<>''"; + $rows=$this->db->query($sql); + foreach($rows as $row) + { + if (substr($row['link'],0,1)=='/') + { + if (!file_exists("http://westdc.westgis.ac.cn".$row['link'])) + { + $ref[]=$row; + } + } elseif (!file_exists($row['link'])) { + $ref[]=$row; + } + } + $this->view->ref=$ref; + } + +} + diff --git a/application/admin/views/scripts/test/index.phtml b/application/admin/views/scripts/test/index.phtml new file mode 100644 index 00000000..48d8f31c --- /dev/null +++ b/application/admin/views/scripts/test/index.phtml @@ -0,0 +1,19 @@ +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(' > '); +?> +
+
+partial('test/left.phtml'); ?> +
+
+

此页面的所有功能测试数据的链接是否存在!

+

请小心使用!

+
+
\ No newline at end of file diff --git a/application/admin/views/scripts/test/left.phtml b/application/admin/views/scripts/test/left.phtml new file mode 100644 index 00000000..1995a603 --- /dev/null +++ b/application/admin/views/scripts/test/left.phtml @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/application/admin/views/scripts/test/reftest.phtml b/application/admin/views/scripts/test/reftest.phtml new file mode 100644 index 00000000..14679b84 --- /dev/null +++ b/application/admin/views/scripts/test/reftest.phtml @@ -0,0 +1,38 @@ +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(' > '); +?> +
+partial('test/left.phtml'); ?> +
+
+msg or $this->messages) :?> +
+msg) : ?> +

msg; ?>

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

+ +
+ + +ref) : ?> +
+有错误数据: +ref as $ref): ?> +
    +
  • +
  • 编辑
  • +
  • 错误地址:
  • +
+ +
+ +
\ No newline at end of file