extranet/includes/recherche/recherche_annonceslist.php

129 lines
4.1 KiB
PHP
Raw Normal View History

2009-10-05 12:29:19 +00:00
<?php
$firephp->log($_SESSION, 'SESSION');
isset($_SESSION['recherchehisto']['source'])? $source = $_SESSION['recherchehisto']['source'] : $source='';
isset($_SESSION['recherchehisto']['bodacc'])? $bodacc = $_SESSION['recherchehisto']['bodacc'] : $bodacc='';
isset($_SESSION['recherchehisto']['histo'])? $histo = $_SESSION['recherchehisto']['histo'] : $histo='';
isset($_SESSION['recherchehisto']['annee'])? $annee = $_SESSION['recherchehisto']['annee'] : $annee='';
isset($_SESSION['recherchehisto']['dateparution'])? $dateparution = $_SESSION['recherchehisto']['dateparution'] : $dateparution='';
isset($_SESSION['recherchehisto']['nparution'])? $nparution = $_SESSION['recherchehisto']['nparution'] : $nparution='';
isset($_SESSION['recherchehisto']['bpage'])? $bpage = $_SESSION['recherchehisto']['bpage'] : $bpage = '';
isset($_SESSION['recherchehisto']['nannonce'])? $nannonce = $_SESSION['recherchehisto']['nannonce'] : $nannonce = '';
isset($_SESSION['recherchehisto']['naffaire'])? $naffaire = $_SESSION['recherchehisto']['naffaire'] : $naffaire = '' ;
isset($_SESSION['recherchehisto']['txt'])? $txt = $_SESSION['recherchehisto']['txt'] : $txt = '';
2009-10-05 12:29:19 +00:00
2009-10-05 14:24:03 +00:00
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']);
$firephp->log($O,'result');
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 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
$parametres = array(
'source'=>'Source',
'bodacc'=>'Type',
'histo'=>'',
'annee'=>'Ann<6E>e',
'dateparution'=>'Date de parution',
'nparution'=>'Num<75>ro de parution',
'bpage'=>'Page',
'nannonce'=>'Num<75>ro d\'annonce',
'naffaire'=>'Num<75>ro d\'affaire',
'txt'=>'Recherche');
$strCriteres = '';
foreach ($parametres as $key => $param)
{
if($_SESSION['recherchehisto'][$key]!='' && $param!='')
{
$strCriteres.= $param.' : '.$_SESSION['recherchehisto'][$key].'&nbsp;';
}
}
2009-10-05 12:29:19 +00:00
if ( $O['nbReponses']==0)
{
?>
<p class="StyleInfoLib">
Pas de r&eacute;sultat affich&eacute; avec le(s) crit&egrave;re(s) <a title="Retour au formulaire de recherche" href="./index.php?page=recherche&vue=annonce"><?=$strCriteres?></a>
</p>
<?php
2009-10-05 12:29:19 +00:00
}
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;
echo $O['nbReponsesTotal'].' r&eacute;ponses. avec les crit<69>res <a title="Retour au formulaire de recherche" href="./index.php?page=recherche&vue=annonce">'.$strCriteres.'</a>';
echo $_SESSION['tabInfo']['nbReponses'].' r&eacute;sultats affich&eacute;s.';
echo 'Page '.$curPage.'/'.$totPage.'.';
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. avec les crit<69>res <a title="Retour au formulaire de recherche" href="./index.php?page=recherche&vue=annonce">'.$strCriteres.'</a>';
2009-10-05 12:29:19 +00:00
}
echo '</p>';
?>
<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);}
if( substr($reponse['Code'],0,3)=='BOD' )
{
print '<u>BODACC :</u> '.substr($reponse['Code'],3,1);
}
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<u>Ann<6E>e :</u> '.$reponse['Annee'];
print '<br/>';
print '...&nbsp;'.$texte.'&nbsp;...';
print '<br/>';
print '<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)
{
print '<a href="./index.php?page=recherche&vue=annoncelist&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)
{
print '<a href="./index.php?page=recherche&vue=annoncelist&p='.$suiv.'">Page suivante</a>';
2009-10-05 12:29:19 +00:00
}
?>
<?php
}
?>
</div>