87 lines
2.3 KiB
PHP
87 lines
2.3 KiB
PHP
<?php
|
|
$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;
|
|
}
|
|
|
|
isset($_REQUEST['p']) ? $p=$_REQUEST['p'] : $p=0 ;
|
|
|
|
//TODO: Supprimer les caractères accentués
|
|
|
|
//Affichage
|
|
?>
|
|
<div id="center">
|
|
<?php
|
|
if($histo!='on')
|
|
{
|
|
$ra = array();
|
|
$ra['dateAnnee'] = $annee;
|
|
$ra['numParution'] = $nparution;
|
|
if($source=='bodacc')
|
|
{
|
|
$ra['source'] = strtoupper('bod'.$bodacc);
|
|
$ra['numAnnonce'] = $nannonce;
|
|
}
|
|
elseif($source=='balo')
|
|
{
|
|
$ra['source'] = strtoupper($source);
|
|
$ra['numAnnonce'] = $naffaire;
|
|
}
|
|
elseif($source=='asso')
|
|
{
|
|
$ra['source'] = strtoupper($source);
|
|
$ra['numAnnonce'] = $nannonce;
|
|
}
|
|
$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);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
require_once 'i18n/cleanchar.php';
|
|
//Suppression des caractères accentués
|
|
$txt = cleanstring($txt);
|
|
//Remplacement du caractère § par ~
|
|
$txt = str_replace('$', '~', $txt);
|
|
// Recherche siren tenant compte des anomalies d'OCR
|
|
$txt = preg_replace('/([0-9]{3})([0-9]{3})([0-9]{3})/',
|
|
'"$1$2$3"|"$1 $2$3"|"$1$2 $3"|"$1 $2 $3"', $txt);
|
|
$firephp->log($txt, 'txt');
|
|
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';
|
|
}
|
|
?>
|
|
</div>
|