From 49d6c6e3c1664311fbd441f0704d36e1f4873c16 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Mon, 17 Oct 2011 10:20:19 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9ajax=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/ReviewController.php | 16 ++++++----- .../scripts/review/pagination_ajax.phtml | 26 ++++++++++++++++++ .../default/views/scripts/review/review.phtml | 27 +++++++------------ 3 files changed, 46 insertions(+), 23 deletions(-) create mode 100644 application/default/views/scripts/review/pagination_ajax.phtml diff --git a/application/default/controllers/ReviewController.php b/application/default/controllers/ReviewController.php index 6a098113..7c7df588 100644 --- a/application/default/controllers/ReviewController.php +++ b/application/default/controllers/ReviewController.php @@ -453,11 +453,11 @@ class ReviewController extends Zend_Controller_Action function allreviewAction(){ - $this->_helper->layout->disableLayout(); - $this->_helper->viewRenderer->setNoRender(); - + $page = $this->_getParam('page'); $uuid = $this->_request->getParam('uuid'); + $offset = 5; + $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'"; @@ -467,9 +467,9 @@ class ReviewController extends Zend_Controller_Action $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'); + //$paginator->setItemCountPerPage(5); + //$paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('review/pagination_ajax.phtml'); $list = ""; foreach($rows as $k=>$v) @@ -486,6 +486,10 @@ class ReviewController extends Zend_Controller_Action $stringbuffer = ""; + + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + echo $stringbuffer.'
'.$paginator.'
'; } diff --git a/application/default/views/scripts/review/pagination_ajax.phtml b/application/default/views/scripts/review/pagination_ajax.phtml new file mode 100644 index 00000000..7fe6fee2 --- /dev/null +++ b/application/default/views/scripts/review/pagination_ajax.phtml @@ -0,0 +1,26 @@ +pageCount): ?> +
+ +previous)): ?> + < Previous + + < Previous + + + +pagesInRange as $page): ?> + current): ?> + + + + + + + +next)): ?> + Next > + + Next > + +
+ \ No newline at end of file diff --git a/application/default/views/scripts/review/review.phtml b/application/default/views/scripts/review/review.phtml index 6378e725..e253db8b 100755 --- a/application/default/views/scripts/review/review.phtml +++ b/application/default/views/scripts/review/review.phtml @@ -104,24 +104,17 @@