2011-06-27 16:34:26 +00:00
|
|
|
<?php
|
|
|
|
Class GiantFunctionController
|
|
|
|
{
|
2011-06-29 14:39:30 +00:00
|
|
|
protected function getNumRows()
|
|
|
|
{
|
|
|
|
$user = new Utilisateur();
|
|
|
|
return ($user->getNbRep());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function selectTypeSearch($form)
|
|
|
|
{
|
|
|
|
$type = array('siret','raisonSociale', 'numero', 'voie', 'cpVille', 'telFax', 'naf');
|
|
|
|
$i = 0;
|
|
|
|
|
|
|
|
foreach ($type as $key => $element) {
|
|
|
|
if($key == 'siret')
|
|
|
|
return (false);
|
|
|
|
if(!empty($form[$element]))
|
|
|
|
$i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (($i == 1)?true:false);
|
|
|
|
}
|
|
|
|
|
2011-06-28 15:28:45 +00:00
|
|
|
public function getQueryLink($parametres)
|
|
|
|
{
|
|
|
|
$url = '/recherche/entreprise/siret/'.$parametres['siret'].
|
|
|
|
'/raisonSociale/'.$parametres['raisonSociale'].
|
|
|
|
'/numero/'.$parametres['numero'].
|
|
|
|
'/voie/'.$parametres['voie'].
|
|
|
|
'/cpVille/'.$parametres['cpVille'].
|
|
|
|
'/telFax/'.$parametres['telFax'].
|
|
|
|
'/naf/'.$parametres['naf'].
|
|
|
|
'/pays/'.$parametres['pays'];
|
|
|
|
return ($url);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function replaceAcronyme($result)
|
|
|
|
{
|
|
|
|
$type = array('AV' => 'Avenue', 'RUE' => 'Rue', 'BD' => 'Boulevard', ' R ' => 'Rue', 'RTE' => 'Route');
|
|
|
|
|
|
|
|
foreach($result->Results->Company as $societe) {
|
|
|
|
foreach ($type as $element => $val) {
|
|
|
|
$societe->Address->Street = str_replace($element, $val, $societe->Address->Street);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ($result);
|
|
|
|
}
|
|
|
|
|
2011-06-27 16:34:26 +00:00
|
|
|
protected function setCountryCode($CountryCode, $listeAutorized)
|
|
|
|
{
|
|
|
|
if (array_key_exists($CountryCode, $listeAutorized)) {
|
|
|
|
return ($this->listAutorized[$CountryCode]);
|
|
|
|
}
|
|
|
|
return (false);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getPays($code)
|
|
|
|
{
|
|
|
|
return ($this->listAutorized[$code]);
|
|
|
|
}
|
|
|
|
}
|