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