Recherche histo en alpha avec texte
This commit is contained in:
parent
2706db6c47
commit
1cd47fe73c
@ -5,7 +5,10 @@ if(isset($_REQUEST['submit']))
|
||||
$firephp->log($_REQUEST, 'REQUEST');
|
||||
if( isset($_REQUEST['formA']['annee']) ) { $annee = $_REQUEST['formA']['annee']; }
|
||||
if( !isset($annee) && isset($_REQUEST['formA']['dateparution']) ) { $annee = $_REQUEST['formA']['dateparution']; }
|
||||
if( isset($_REQUEST['formA']['txt']) ) { $txt = $_REQUEST['formA']['txt']; }
|
||||
if( isset($_REQUEST['formA']['txt']) )
|
||||
{
|
||||
$txt = urlencode($_REQUEST['formA']['txt']);
|
||||
}
|
||||
header("Location: ./index.php?page=recherche&vue=annoncelist&recherche=$txt&annee=$annee");
|
||||
exit;
|
||||
}
|
||||
|
@ -3,21 +3,25 @@
|
||||
$recherche = $_REQUEST['recherche'];
|
||||
$annee = $_REQUEST['annee'];
|
||||
|
||||
(!isset($p)) ? $p=0 : $p=$_REQUEST['p'];
|
||||
$deb =0;
|
||||
isset($bodacc)? $bodacc=$_REQUEST['bodacc'] : $bodacc='';
|
||||
isset($_REQUEST['p']) ? $p=$_REQUEST['p'] : $p=0 ;
|
||||
|
||||
try {
|
||||
$O = $client->rechercheHisto($recherche, $annee, $deb);
|
||||
$O = $client->rechercheHisto($recherche, $annee, $bodacc, $p, $_SESSION['tabInfo']['nbReponses']);
|
||||
} catch (SoapFault $fault) {
|
||||
require_once 'soaperror.php';
|
||||
processSoapFault($client,$fault,$tabInfo);
|
||||
}
|
||||
|
||||
|
||||
$parametres = array('recherche', 'annee', 'bodacc');
|
||||
$params = array();
|
||||
foreach( $parametres as $parametre){ $params[$parametre] = $parametre.'='.${$parametre}; }
|
||||
?>
|
||||
<style type="text/css">
|
||||
ol li { margin-bottom:10px; }
|
||||
</style>
|
||||
<div id="center">
|
||||
|
||||
|
||||
<?php
|
||||
if ( $O['nbReponses']==0)
|
||||
{
|
||||
@ -29,10 +33,14 @@ else
|
||||
$reponses = $O['reponses'];
|
||||
|
||||
echo '<p class="StyleInfoLib">';
|
||||
if ($O['nbReponses']<$O['nbReponsesTotal']) {
|
||||
if ($O['nbReponses']<$O['nbReponsesTotal'])
|
||||
{
|
||||
$totPage = ceil($O['nbReponsesTotal']/$O['nbReponses']);
|
||||
$curPage = ceil($p/$O['nbReponses'])+1;
|
||||
echo $O['nbReponsesTotal'].' réponses résultats affichés. Page '.$curPage.'/'.$totPage.'.';
|
||||
echo $O['nbReponsesTotal'].' réponses. '.$_SESSION['tabInfo']['nbReponses'].' résultats affichés. Page '.$curPage.'/'.$totPage.'.';
|
||||
$prec = $p-$_SESSION['tabInfo']['nbReponses'];
|
||||
$suiv = $p+$_SESSION['tabInfo']['nbReponses'];
|
||||
|
||||
} else {
|
||||
$totPage = $curPage = 1;
|
||||
echo $O['nbReponsesTotal'].' réponses';
|
||||
@ -41,10 +49,19 @@ else
|
||||
?>
|
||||
<ol>
|
||||
<?php
|
||||
$indice;
|
||||
foreach( $reponses as $reponse )
|
||||
{
|
||||
$indice++;
|
||||
?>
|
||||
|
||||
<li type="1" value="<?=$p+$indice?>">
|
||||
<?php
|
||||
$texte = str_replace($recherche, '<b>'.$recherche.'</b>', $reponse['Texte']);
|
||||
//$texte = $reponse['texte'];
|
||||
print '... '.$texte.' ...<br/>Année : '.$reponse['Annee'];
|
||||
print '<br/><a href="'.$reponse['Fichier'].'">Fichier</a>';
|
||||
?>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
@ -53,23 +70,22 @@ else
|
||||
//Page précédentes
|
||||
if($curPage>1)
|
||||
{
|
||||
|
||||
print '<a href="./index.php?page=recherche&vue=annoncelist&'.implode('&', $params).'&p="'.$prec.'">Page précé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
|
||||
}
|
||||
|
||||
print "<pre>";
|
||||
print_r($O);
|
||||
print "</pre>";
|
||||
$firephp->log($O, 'reponses');
|
||||
?>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user