From 77d114725d5422797df83ae2c2236a88c342be74 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Thu, 31 May 2012 03:17:19 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BD=9C=E8=80=85=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/DataController.php | 69 +++++++++++- .../views/scripts/data/author-edit.phtml | 101 ++++++++++++++++++ 2 files changed, 165 insertions(+), 5 deletions(-) create mode 100644 application/admin/views/scripts/data/author-edit.phtml diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index 83914058..2ea8591c 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -2291,14 +2291,73 @@ class Admin_DataController extends Zend_Controller_Action { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer('author-edit'); + + $uuid = $this->_getParam('uuid'); + + $sql = "SELECT a.*,md.title,u.realname,u.username FROM mdauthor a + LEFT JOIN metadata md ON a.uuid=md.uuid + LEFT JOIN users u ON a.userid=u.id + WHERE md.uuid=? + ORDER BY a.id DESC + "; + + $sth = $this->db->prepare($sql); + $sth->execute(array($uuid)); + $rows = $sth->fetchAll(); + + $this->view->authors = $rows; + }// 作者管理弹窗 + if($ac == "del") + { + + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $id = $this->_getParam('id'); + + $sql = "DELETE FROM mdauthor WHERE id=?"; + $sth = $this->db->prepare($sql); + $ds = $sth->execute(array($id)); + if($ds) + { + $data = array("deleted"=>$id); + $this->jsonexit($data); + return true; + }else{ + $data = array("error"=>"处理中出现错误"); + $this->jsonexit($data); + return true; + } + + + }//移除作者 - - - - - + if($ac == 'update') + { + + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $id = $this->_getParam('id'); + + $sql = "UPDATE mdauthor SET status=1 WHERE id=?"; + $sth = $this->db->prepare($sql); + $ds = $sth->execute(array($id)); + if($ds) + { + $data = array("updated"=>$id,'msg'=>'认证成功!'); + $this->jsonexit($data); + return true; + }else{ + $data = array("error"=>"处理中出现错误"); + $this->jsonexit($data); + return true; + } + + + }//认证作者 }//authorAction() 数据作者管理 diff --git a/application/admin/views/scripts/data/author-edit.phtml b/application/admin/views/scripts/data/author-edit.phtml new file mode 100644 index 00000000..9a4a76d0 --- /dev/null +++ b/application/admin/views/scripts/data/author-edit.phtml @@ -0,0 +1,101 @@ + + + + +作者管理 + + + + + + + + + + + +
+
+
+
+
+ + + + + \ No newline at end of file