From e350283132facaac25f2ec0227d6641793c4a6c2 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Mon, 17 Oct 2011 08:10:25 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86ajax=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E8=AF=84=E5=AE=A1=E6=84=8F=E8=A7=81=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=20=E4=BF=AE=E6=94=B9=E4=BA=86=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E8=AF=84=E5=AE=A1=E6=84=8F=E8=A7=81=E7=9A=84=E5=8A=A8=E4=BD=9C?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E4=BA=86=E8=A7=86=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/ReviewController.php | 58 +++++++++++++++++-- .../default/views/scripts/review/review.phtml | 38 +++++++++--- 2 files changed, 83 insertions(+), 13 deletions(-) diff --git a/application/default/controllers/ReviewController.php b/application/default/controllers/ReviewController.php index f6880634..bf71e349 100644 --- a/application/default/controllers/ReviewController.php +++ b/application/default/controllers/ReviewController.php @@ -271,6 +271,16 @@ class ReviewController extends Zend_Controller_Action $uuid = $this->_request->getParam('uuid'); $sql=$this->db->quoteInto("select m.id,m.uuid,m.title,m.description,m.title_en from metadata m where m.uuid=?",$uuid); $this->view->metadata=$this->db->fetchRow($sql); + $auth = Zend_Auth::getInstance(); + if($auth->hasIdentity()) + { + $user = $auth->getIdentity(); + $userid = $user->id; + $sql = "select id from mdreview where userid='$userid' and uuid='$uuid'"; + $rs = $this->db->query($sql); + $row = $rs->fetch(); + $this->view->pms = $row['id']; + } $submit = $this->_request->getParam('submit'); @@ -288,7 +298,7 @@ class ReviewController extends Zend_Controller_Action { $user = $auth->getIdentity(); $userid = $user->id; - $sql = "select id,userid from mdreview where userid='$userid'"; + $sql = "select id,userid from mdreview where userid='$userid' and uuid='$uuid'"; $rs = $this->db->query($sql); $row = $rs->fetch(); if($row['id']!='') @@ -299,7 +309,7 @@ class ReviewController extends Zend_Controller_Action }else{ $this->messenger->addMessage('读取用户信息失败,请刷新页面后重试 :('); $this->_redirect($redirectlink); - } + } if(empty($conclusion)) { @@ -319,7 +329,7 @@ class ReviewController extends Zend_Controller_Action if(!empty($_FILES['Filedata']['name'])) { $files=new files(); - $msg = $files -> upload(Zend_Registry::get('upload'),$_FILES['Filedata'],$_POST['dir']); + $msg = $files -> upload(Zend_Registry::get('upload'),$_FILES['Filedata'],'reviewatt'); if(empty($msg['error'])) { @@ -328,7 +338,7 @@ class ReviewController extends Zend_Controller_Action $filedesc = $this->_request->getParam('filedesc'); $filetype = $this->_request->getParam('dir'); - $sql = "insert into attachments (filename,filetype,filedesc,userid,filesize) values ('$filename','$filetype','$filedesc','$userid','$filesize') RETURNING id"; + $sql = "insert into attachments (filename,filetype,filedesc,userid,filesize) values ('$filename','reviewatt','$filedesc','$userid','$filesize') RETURNING id"; $sth = $this->db->prepare($sql); $sth->execute(); $att = $sth->fetch(PDO::FETCH_ASSOC); @@ -394,11 +404,47 @@ class ReviewController extends Zend_Controller_Action $this->_redirect($redirectlink); } - - } }//reviewAction() + function allreviewAction(){ + + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $uuid = $this->_request->getParam('uuid'); + + $sql = "select r.uuid,r.userid,r.ts_created,u.realname,r.mdcomment,r.conclusion from mdreview r + left join users u on u.id=r.userid + where r.uuid='$uuid'"; + + $rs = $this->db->query($sql); + $rows = $rs->fetchAll(); + + $paginator = Zend_Paginator::factory($rows); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(5); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + + $list = ""; + foreach($rows as $k=>$v) + { + $list.=' +
  • +
    +
    评审人:'.$v['realname'].'
    评审时间:'.date("Y-m-d H:i",strtotime($v['ts_created'])).'
    +

    '.str_replace(array("\r\n", "\n", "\r"),'

    ',$v['mdcomment']).'

    +
    +
  • + '; + } + + $stringbuffer = ""; + + echo $stringbuffer.'
    '.$paginator.'
    '; + + } } diff --git a/application/default/views/scripts/review/review.phtml b/application/default/views/scripts/review/review.phtml index 2b0d28d5..672d35ac 100755 --- a/application/default/views/scripts/review/review.phtml +++ b/application/default/views/scripts/review/review.phtml @@ -3,7 +3,6 @@ $this->headTitle($this->config->title->review); $this->headTitle('数据查看'); $this->headTitle()->setSeparator(' - '); - $this->headLink()->appendStylesheet('/css/mdview.css'); $this->headLink()->appendStylesheet('/css/mdreview.css'); $this->headScript()->appendFile('/js/jquery-1.6.4.min.js'); $this->breadcrumb('首页'); @@ -21,9 +20,9 @@ '.$this->escape($md['title_en']);?>
    -

    +

    ',$md['description']);?>

    @@ -35,6 +34,8 @@ hasIdentity()) { + if(empty($this->pms)) + { ?>
    @@ -59,11 +60,6 @@

    评审附件:
    -

    @@ -71,6 +67,10 @@

    登录'; } @@ -98,6 +98,30 @@
    + +

    Cannot find the metadata.

    没有找到对应的元数据。