issue #0001772 : Pagination
This commit is contained in:
parent
32bac23c79
commit
72886462ca
@ -1293,6 +1293,38 @@ class FinanceController extends Zend_Controller_Action
|
||||
} elseif (is_string($infos)) {
|
||||
$this->view->assign('msg', $infos);
|
||||
} else {
|
||||
|
||||
$p = $request->getParam('p', 1);
|
||||
$this->view->assign('p', $p);
|
||||
|
||||
$nbMax = 100;
|
||||
$nbReponses = $infos->nbReponses;
|
||||
$nbPages = ceil($nbReponses/$nbMax);
|
||||
|
||||
if ( $p <= 1 ) {
|
||||
$lienPagePrecedente = false;
|
||||
} else {
|
||||
$lienPagePrecedente = $this->view->url(array(
|
||||
'controller' => 'finance',
|
||||
'action' => 'subventions',
|
||||
'p' => $p-1
|
||||
));
|
||||
}
|
||||
|
||||
if ( $p+1 > $nbPages ) {
|
||||
$lienPageSuivante = false;
|
||||
} else {
|
||||
$lienPageSuivante = $this->view->url(array(
|
||||
'controller' => 'finance',
|
||||
'action' => 'subventions',
|
||||
'p' => $p+1
|
||||
));
|
||||
}
|
||||
|
||||
$this->view->assign('nbPages',$nbPages);
|
||||
$this->view->assign('lienPagePrecedente',$lienPagePrecedente);
|
||||
$this->view->assign('lienPageSuivante',$lienPageSuivante);
|
||||
|
||||
$this->view->assign('Millesime',$infos->Millesime);
|
||||
$this->view->assign('Budget',$infos->Budget);
|
||||
$this->view->assign('AssoSiren',$infos->AssoSiren);
|
||||
|
@ -61,7 +61,15 @@ Aucune subvention.
|
||||
</div>
|
||||
|
||||
<div class="paragraph">
|
||||
Pagination
|
||||
<?php if ($this->lienPagePrecedente) { ?>
|
||||
<a href="<?=$this->lienPagePrecedente?>" title="Page précédente..."><<</a>
|
||||
<?php }?>
|
||||
<?php if ($this->nbPages>1) { ?>
|
||||
<span>Page <?=$this->p?>/<?=$this->nbPages?></span>
|
||||
<?php } ?>
|
||||
<?php if ($this->lienPageSuivante) {?>
|
||||
<a href="<?=$this->lienPageSuivante?>" title="Page suivante...">>></a>
|
||||
<?php }?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user