443be869a0
V1.2
53 lines
1.6 KiB
PHP
53 lines
1.6 KiB
PHP
<?php
|
|
/**
|
|
* Controller pour la recherche
|
|
* Permet de préparer les données pour le Template
|
|
*
|
|
*/
|
|
require_once 'giant/Config.php';
|
|
require_once 'giant/Client.php';
|
|
|
|
if(isset($formR['raisonSociale']) or isset($formR['siret']))
|
|
{
|
|
if(!empty($formR['raisonSociale']) or !empty($formR['siret']))
|
|
{
|
|
$pays = IssetObject($formR['pays']);
|
|
$AdvencedSearch = AdvencedSearch($formR['siret']);
|
|
|
|
$soap_client = getClient($pays, 'Search');
|
|
|
|
$Search = new SearchPortType();
|
|
$params = $Search->Search();
|
|
$params->Search->IncludePhoneticMatches = false;
|
|
$params->Search->IncludeSuggestions = false;
|
|
$params->Search->NumRows = (isset($_SESSION['nbReponses']))?$_SESSION['nbReponses']:10;
|
|
$params->Search->StartRows = setPosition($position);
|
|
|
|
if ($AdvencedSearch == true)
|
|
{
|
|
$params->Search->Query = new AdvancedSearch($formR);
|
|
$service = 'AdvancedSearch';
|
|
}
|
|
else {
|
|
$query = new SimpleSearch($formR);
|
|
$params->Search->Query = $query->Query;
|
|
$service = 'Search';
|
|
}
|
|
|
|
$informations = SwitchWSDLFunction($service, $params->Search, $soap_client);
|
|
|
|
if ($informations->Results->Company == true)
|
|
{
|
|
// Dans le cas ou nous avont plusieurs reponses (foreach).
|
|
if(is_array($informations->Results->Company))
|
|
$manyResponses = true;
|
|
require_once 'giant/templates/NbOfHits.tpl.php';
|
|
require_once 'giant/templates/Search.tpl.php';
|
|
require_once 'giant/templates/Pagination.tpl.php';
|
|
}
|
|
else
|
|
echo 'Aucun résultat.';
|
|
} else
|
|
echo 'Vous devez au moin rensseigner Siret ou le nom de la company';
|
|
}
|
|
?>
|