2009-10-05 12:29:19 +00:00
< ? php
2009-10-09 08:13:41 +00:00
$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' ]);
2009-10-09 08:13:41 +00:00
$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 : 10 px ; }
</ style >
2009-10-05 12:29:19 +00:00
< div id = " center " >
< ? php
2009-10-09 08:13:41 +00:00
$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 ] . ' ' ;
}
}
2009-10-05 12:29:19 +00:00
if ( $O [ 'nbReponses' ] == 0 )
{
2009-10-09 09:53:07 +00:00
?>
< 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-09 09:53:07 +00:00
2009-10-05 12:29:19 +00:00
echo '<p class="StyleInfoLib">' ;
2009-10-09 09:53:07 +00:00
echo $O [ 'nbReponsesTotal' ] . ' ré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 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-09 08:13:41 +00:00
echo $_SESSION [ 'tabInfo' ][ 'nbReponses' ] . ' résultats affiché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 '</p>' ;
2009-10-09 09:53:07 +00:00
if ( $p >= 200 )
2009-10-05 12:29:19 +00:00
{
2009-10-09 09:53:07 +00:00
?>
< p > Merci d ' affiner votre recherche .</ p >
2009-10-05 14:24:03 +00:00
< ? php
2009-10-09 09:53:07 +00:00
}
else
{
?>
< ol >
< ? php
$indice ;
foreach ( $reponses as $reponse )
2009-10-09 08:13:41 +00:00
{
2009-10-09 09:53:07 +00:00
$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 );}
if ( substr ( $reponse [ 'Code' ], 0 , 3 ) == 'BOD' )
{
print '<u>BODACC :</u> ' . substr ( $reponse [ 'Code' ], 3 , 1 );
}
print ' ' ;
print '<u>Ann<6E> e :</u> ' . $reponse [ 'Annee' ];
print '<br/>' ;
print '... ' . $texte . ' ...' ;
print '<br/>' ;
print '<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&p=' . $prec . '">Page pr<70> c<EFBFBD> dente</a>' ;
2009-10-09 08:13:41 +00:00
}
2009-10-05 14:24:03 +00:00
?>
2009-10-09 09:53:07 +00:00
<< Page : < ? = $curPage . '/' . $totPage ?> >>
< ? php
//Page suivante
if ( $curPage < $totPage )
{
print '<a href="./index.php?page=recherche&vue=annoncelist&p=' . $suiv . '">Page suivante</a>' ;
}
?>
< ? php
2009-10-05 12:29:19 +00:00
}
}
?>
</ div >