extranet/includes/recherche/recherche_annonceslist.php

91 lines
2.4 KiB
PHP
Raw Normal View History

2009-10-05 12:29:19 +00:00
<?php
2009-10-05 17:11:23 +00:00
$txt = $_REQUEST['txt'];
2009-10-05 12:29:19 +00:00
$annee = $_REQUEST['annee'];
2009-10-05 14:24:03 +00:00
isset($bodacc)? $bodacc=$_REQUEST['bodacc'] : $bodacc='';
isset($_REQUEST['p']) ? $p=$_REQUEST['p'] : $p=0 ;
2009-10-05 12:29:19 +00:00
try {
2009-10-05 17:11:23 +00:00
$O = $client->rechercheHisto($txt, $annee, $bodacc, $p, $_SESSION['tabInfo']['nbReponses']);
2009-10-05 12:29:19 +00:00
} catch (SoapFault $fault) {
require_once 'soaperror.php';
2009-10-05 17:11:23 +00:00
processSoapFault($client,$fault,$tabInfo, true);
2009-10-05 12:29:19 +00:00
}
2009-10-05 17:11:23 +00:00
$parametres = array('txt', 'annee', 'bodacc');
2009-10-05 14:24:03 +00:00
$params = array();
2009-10-05 17:11:23 +00:00
foreach( $parametres as $parametre){ $params[$parametre] = $parametre.'='.urlencode(${$parametre}); }
2009-10-05 12:29:19 +00:00
?>
2009-10-05 14:24:03 +00:00
<style type="text/css">
ol li { margin-bottom:10px; }
</style>
2009-10-05 12:29:19 +00:00
<div id="center">
<?php
if ( $O['nbReponses']==0)
{
if( !isset($tvaIntra) )
echo '<p class="StyleInfoLib">Pas de r&eacute;sultat affich&eacute; avec le(s) crit&egrave;re(s) suivants : .</p>';
}
else
{
$reponses = $O['reponses'];
2009-10-05 17:11:23 +00:00
$mots = $O['mots'];
2009-10-05 12:29:19 +00:00
echo '<p class="StyleInfoLib">';
2009-10-05 14:24:03 +00:00
if ($O['nbReponses']<$O['nbReponsesTotal'])
{
2009-10-05 12:29:19 +00:00
$totPage = ceil($O['nbReponsesTotal']/$O['nbReponses']);
$curPage = ceil($p/$O['nbReponses'])+1;
2009-10-05 14:24:03 +00:00
echo $O['nbReponsesTotal'].' r&eacute;ponses. '.$_SESSION['tabInfo']['nbReponses'].' r&eacute;sultats affich&eacute;s. Page '.$curPage.'/'.$totPage.'.';
2009-10-05 17:11:23 +00:00
echo '<br/><a href="./index.php?page=recherche&vue=annonce&'.implode('&', $params).'">Retour au formulaire de recherche</a>';
2009-10-05 14:24:03 +00:00
$prec = $p-$_SESSION['tabInfo']['nbReponses'];
$suiv = $p+$_SESSION['tabInfo']['nbReponses'];
2009-10-05 12:29:19 +00:00
} else {
$totPage = $curPage = 1;
echo $O['nbReponsesTotal'].' r&eacute;ponses';
}
echo '</p>';
2009-10-06 08:04:00 +00:00
$firephp->log($prec, 'prec');
2009-10-05 12:29:19 +00:00
?>
<ol>
<?php
2009-10-05 14:24:03 +00:00
$indice;
2009-10-05 12:29:19 +00:00
foreach( $reponses as $reponse )
{
2009-10-05 14:24:03 +00:00
$indice++;
2009-10-05 12:29:19 +00:00
?>
2009-10-05 14:24:03 +00:00
<li type="1" value="<?=$p+$indice?>">
<?php
2009-10-05 17:11:23 +00:00
$texte = $reponse['Texte'];
foreach( $mots as $mot ){ $texte = preg_replace('/'.$mot.'/i', '<b>'.strtoupper($mot).'</b>', $texte);}
2009-10-05 14:24:03 +00:00
print '...&nbsp;'.$texte.'&nbsp;...<br/>Ann<6E>e : '.$reponse['Annee'];
2009-10-05 15:19:38 +00:00
print '<br/><a href="'.$reponse['Fichier'].'" target="_blank">T<>l<EFBFBD>charger la page en PDF</a>';
2009-10-05 14:24:03 +00:00
?>
</li>
2009-10-05 12:29:19 +00:00
<?php
}
?>
</ol>
<?php
//Page pr<70>c<EFBFBD>dentes
if($curPage>1)
{
2009-10-06 08:04:00 +00:00
print '<a href="./index.php?page=recherche&vue=annoncelist&'.implode('&', $params).'&p='.$prec.'">Page pr<70>c<EFBFBD>dente</a>';
2009-10-05 12:29:19 +00:00
}
?>
2009-10-06 08:04:00 +00:00
<< Page : <?=$curPage.'/'.$totPage?> >>
2009-10-05 12:29:19 +00:00
<?php
//Page suivante
if ($curPage<$totPage)
{
2009-10-05 14:24:03 +00:00
print '<a href="./index.php?page=recherche&vue=annoncelist&'.implode('&', $params).'&p='.$suiv.'">Page suivante</a>';
2009-10-05 12:29:19 +00:00
}
?>
<?php
}
?>
</div>