Correction gestion des pages
This commit is contained in:
parent
05c5af5b1e
commit
cd54fa78fb
@ -308,10 +308,7 @@ class RechercheController extends Zend_Controller_Action
|
||||
$type = $recherche['type'];
|
||||
$params = $recherche['params'];
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info($type);
|
||||
Zend_Registry::get('firebug')->info($params);
|
||||
|
||||
|
||||
//Giant
|
||||
if( !empty($params['pays']) && $type == 'ent' ){
|
||||
Zend_Registry::get('firebug')->info('RECHERCHE GIANT');
|
||||
@ -319,12 +316,17 @@ class RechercheController extends Zend_Controller_Action
|
||||
//Recherche
|
||||
} else {
|
||||
|
||||
require_once 'Scores/Utilisateur.php';
|
||||
$user = new Utilisateur();
|
||||
|
||||
$page = $request->getParam('page', 1);
|
||||
if ($page==0) $page = 1;
|
||||
$page = $page-1;
|
||||
$position = $page*$user->getNbRep();
|
||||
|
||||
require_once 'Scores/WsScores.php';
|
||||
$ws = new WsScores();
|
||||
$position = $page-1;
|
||||
|
||||
|
||||
//Criteres recherche entreprise
|
||||
if ($type=='ent'){
|
||||
@ -364,9 +366,7 @@ class RechercheController extends Zend_Controller_Action
|
||||
$criteres['naf'] = $naf;
|
||||
$criteres['siege'] = false;
|
||||
$criteres['actif'] = false;
|
||||
if(empty($params['pays']))
|
||||
$reponse = $ws->searchEntreprise($criteres, $position);
|
||||
Zend_Registry::get('firebug')->info($reponse);
|
||||
$reponse = $ws->searchEntreprise($criteres, $position);
|
||||
|
||||
//Criteres recherche dirigeants
|
||||
} else if ($type=='dir') {
|
||||
@ -421,9 +421,6 @@ class RechercheController extends Zend_Controller_Action
|
||||
$reponse = $ws->searchAct($actNomRs, $cpVille, $siret, $pays, $pctMin, $pctMax, $position);
|
||||
Zend_Registry::get('firebug')->info($reponse);
|
||||
}
|
||||
|
||||
require_once 'Scores/Utilisateur.php';
|
||||
$user = new Utilisateur();
|
||||
|
||||
if (is_object($reponse) && $reponse !== false)
|
||||
{
|
||||
@ -445,8 +442,8 @@ class RechercheController extends Zend_Controller_Action
|
||||
$nbReponses = $reponse->nbReponses;
|
||||
$nbReponsesTotal = $reponse->nbReponsesTotal;
|
||||
if ($nbReponses < $nbReponsesTotal) {
|
||||
$totPage = ceil($nbReponsesTotal/$nbReponses);
|
||||
$curPage = $position+1;
|
||||
$totPage = ceil($nbReponsesTotal/$user->getNbRep());
|
||||
$curPage = $page+1;
|
||||
} else {
|
||||
$totPage = $curPage = 1;
|
||||
}
|
||||
@ -454,9 +451,8 @@ class RechercheController extends Zend_Controller_Action
|
||||
$liste = array();
|
||||
if (count($etabs)>0) {
|
||||
foreach($etabs as $i => $etab) {
|
||||
Zend_Registry::get('firebug')->info($etabs);
|
||||
$item = array();
|
||||
$item['position'] = ($position*$nbReponses)+$i+1;
|
||||
$item['position'] = ($position)+$i+1;
|
||||
$item['id'] = $etab->id;
|
||||
$item['siren'] = $etab->Siren;
|
||||
$item['siret'] = $etab->Siren.$etab->Nic;
|
||||
|
Loading…
x
Reference in New Issue
Block a user