extranet/includes/recherche/recherche_annonceslist.php

85 lines
2.1 KiB
PHP
Raw Normal View History

2009-10-06 08:31:48 +00:00
<?php
2009-10-14 10:06:17 +00:00
$parametres = array( 'source', 'bodacc', 'histo', 'annee', 'dateparution', 'nparution', 'bpage', 'nannonce', 'naffaire', 'txt');
foreach($parametres as $param)
{
isset($_SESSION['recherchehisto'][$param])? ${$param}=$_SESSION['recherchehisto'][$param] : ${$param}='';
}
if( !isset($annee) && isset($dateparution) )
{
$dateparution = str_replace('/', '', $dateparution);
$jj = substring($annee, 0, 2);
$mm = substring($annee, 2, 2);
$aa = substring($annee, 4, 4);
$dateparution = $aa.$mm.$jj;
}
2009-10-06 08:31:48 +00:00
isset($_REQUEST['p']) ? $p=$_REQUEST['p'] : $p=0 ;
2009-10-09 16:04:17 +00:00
//TODO: Supprimer les caract<63>res accentu<74>s
2009-10-14 10:06:17 +00:00
//Affichage
2009-10-06 08:31:48 +00:00
?>
<div id="center">
<?php
2009-10-14 10:06:17 +00:00
if($histo!='on')
2009-10-09 13:26:57 +00:00
{
2009-10-14 10:06:17 +00:00
$ra = array();
$ra['dateAnnee'] = $annee;
$ra['numParution'] = $nparution;
if($source=='bodacc')
2009-10-09 13:26:57 +00:00
{
2009-10-14 10:06:17 +00:00
$ra['source'] = strtoupper('bod'.$bodacc);
$ra['numAnnonce'] = $nannonce;
2009-10-09 13:26:57 +00:00
}
2009-10-14 10:06:17 +00:00
elseif($source=='balo')
2009-10-06 08:31:48 +00:00
{
2009-10-14 10:06:17 +00:00
$ra['source'] = strtoupper($source);
$ra['numAnnonce'] = $naffaire;
2009-10-06 08:31:48 +00:00
}
2009-10-14 10:06:17 +00:00
elseif($source=='asso')
2009-10-06 08:31:48 +00:00
{
2009-10-14 10:06:17 +00:00
$ra['source'] = strtoupper($source);
$ra['numAnnonce'] = $nannonce;
2009-10-06 08:31:48 +00:00
}
2009-10-14 10:06:17 +00:00
$firephp->log($ra,'REQUETE');
try {
/*
$source IN ('BODA', 'BODB', 'BODC', 'ASSO', 'BALO')
$dateAnnee 1999 ou 1999-11-23
$numParution entre 1 et YYYYY
$numAnnonce entre 1 et XXXXX
*/
$O = $client->rechercheAnnonce($ra['source'], $ra['dateAnnee'], $ra['numParution'], $ra['numAnnonce']);
$firephp->log($O,'result');
} catch (SoapFault $fault) {
require_once 'soaperror.php';
processSoapFault($client,$fault,$tabInfo);
2009-10-06 08:31:48 +00:00
}
}
2009-10-14 10:06:17 +00:00
else
{
require_once 'i18n/cleanchar.php';
//Suppression des caract<63>res accentu<74>s
$txt = cleanstring($txt);
//Remplacement du caract<63>re <20> par ~
$txt = str_replace('$', '~', $txt);
$firephp->log($txt, 'txt');
2009-10-14 10:06:17 +00:00
try {
$O = $client->rechercheHisto($txt, $annee, $bodacc, $p, $_SESSION['tabInfo']['nbReponses']);
$firephp->log($O,'result');
} catch (SoapFault $fault) {
require_once 'soaperror.php';
processSoapFault($client,$fault,$tabInfo);
}
}
if($histo!='on')
{
require_once realpath(dirname(__FILE__)).'/recherche_vueannonce.php';
}else{
require_once realpath(dirname(__FILE__)).'/recherche_vuehisto.php';
}
2009-10-06 08:31:48 +00:00
?>
</div>