123 lines
2.2 KiB
PHP
123 lines
2.2 KiB
PHP
<?php
|
|
function AdvencedSearch($siret)
|
|
{
|
|
if (!empty($siret))
|
|
return ($siret);
|
|
return (false);
|
|
}
|
|
|
|
function IssetObject($var)
|
|
{
|
|
if (isset($var))
|
|
return ($var);
|
|
}
|
|
|
|
function InformationChecked($information, $object)
|
|
{
|
|
switch($information)
|
|
{
|
|
case 'VatNumber':
|
|
IssetObject($object);
|
|
break;
|
|
case 'IssetStreet':
|
|
return IssetObject($object);
|
|
break;
|
|
case 'PostCode':
|
|
return(IssetObject($object));
|
|
break;
|
|
case 'City' :
|
|
return (IssetObject($object));
|
|
break;
|
|
default:
|
|
return(FALSE);
|
|
}
|
|
}
|
|
|
|
function setPosition($position)
|
|
{
|
|
if (isset($position) == true) {
|
|
return ($position);
|
|
} else {
|
|
return (0);
|
|
}
|
|
}
|
|
|
|
function SerialForm($formulaire)
|
|
{
|
|
if(is_array($formulaire))
|
|
{
|
|
$CpVille = explode(' ',$formulaire['cpVille']);
|
|
$query = $formulaire['raisonSociale'] .' '.
|
|
$formulaire['numVoie'] . ' '.
|
|
$formulaire['voie'] . ' '.
|
|
$CpVille[0] . ' '.
|
|
$CpVille[1];
|
|
}
|
|
return ($query);
|
|
}
|
|
/**
|
|
*
|
|
* @param $pays retourne le bon code pays.
|
|
*/
|
|
function getProviderId($pays)
|
|
{
|
|
switch ($pays)
|
|
{
|
|
case 'BE':
|
|
return '001';
|
|
case 'NL':
|
|
return '003';
|
|
default:
|
|
echo 'Erreur sur le CODE pays';
|
|
exit (EXIT_SUCCESS);
|
|
}
|
|
}
|
|
|
|
function envoieCourriel($sujet, $texte)
|
|
{
|
|
// Desactivation de l'envoi de mail pour les tests.
|
|
/*require_once 'sendmail/mail.php';
|
|
sendMail("[Giant] ".$sujet , $texte,
|
|
// From
|
|
array('email' => CONF_MEL_FROM,
|
|
'name' => 'Client Giant'),
|
|
// To
|
|
array(0 => array('email' => CONF_MEL_TO,
|
|
'name' => 'Support')));*/
|
|
}
|
|
|
|
function checkTypeFormatRapport($object)
|
|
{
|
|
switch($object)
|
|
{
|
|
case 'Full':
|
|
return ('Rapport Complet');
|
|
break;
|
|
case 'Compact':
|
|
return ('Rapport Semi-Complet');
|
|
break;
|
|
case 'CreditRecommendation' :
|
|
return ('Solvabilité');
|
|
break;
|
|
default:
|
|
return (TRUE);
|
|
}
|
|
}
|
|
|
|
function checkTypeUrgenceRapport($object)
|
|
{
|
|
switch($object)
|
|
{
|
|
case 'Normal':
|
|
return ('green');
|
|
break;
|
|
case 'Urgent':
|
|
return ('red');
|
|
break;
|
|
case 'Flash' :
|
|
return ('purple');
|
|
break;
|
|
default:
|
|
return (TRUE);
|
|
}
|
|
} |