Formattage
This commit is contained in:
parent
2a0af60fd9
commit
c5bbe9ddf2
@ -6704,13 +6704,12 @@ class MInsee
|
||||
if ($nic=='' || $nic*1==0 || $nic>99999)
|
||||
$strNic=" AND nic=nicSiege";
|
||||
else $strNic=" AND nic=$nic";
|
||||
$tabTmp=$this->iDb->select('insee.insee_avis', 'raiSoc, dateMaj, siren, nic, etatEt, dateEtatEt, typeEtab, adresseEt0, adresseEt1, adresseEt2, adresseEt3, fj, fjLib, nafEt, nafEtLib, effEtPeriode, effEtTr, erreurs, adresseEn0, adresseEn1, adresseEn2, adresseEn3, nafEn, nafEnLib, effEnPeriode, effEnTr, fjEn, fjEnLib, employes, etatEn, dateEtatEn, nicSiege, nbEtabActifs, dateInsert, dateUpdate, DATE(IF(dateUpdate>dateInsert, dateUpdate, dateInsert))*1 AS dateMajSD',
|
||||
"siren=$siren $strNic",
|
||||
false, MYSQL_ASSOC);
|
||||
$tabTmp=$this->iDb->select('insee.insee_avis',
|
||||
'raiSoc, dateMaj, siren, nic, etatEt, dateEtatEt, typeEtab, adresseEt0, adresseEt1, adresseEt2, adresseEt3, fj, fjLib, nafEt, nafEtLib, effEtPeriode, effEtTr, erreurs, adresseEn0, adresseEn1, adresseEn2, adresseEn3, nafEn, nafEnLib, effEnPeriode, effEnTr, fjEn, fjEnLib, employes, etatEn, dateEtatEn, nicSiege, nbEtabActifs, dateInsert, dateUpdate, DATE(IF(dateUpdate>dateInsert, dateUpdate, dateInsert))*1 AS dateMajSD',
|
||||
"siren=$siren $strNic", false, MYSQL_ASSOC);
|
||||
$tabInfos=@$tabTmp[0];
|
||||
if ($tabInfos['dateMajSD']==date('Ymd')) {
|
||||
$tabInfos['enCache']=true;
|
||||
// sendMail('production@scores-decisions.com', 'ylenaour@scores-decisions.com', "classMInsee::getAvisInsee... en cache sur $siren", print_r($tabInfos, true));
|
||||
return $tabInfos;
|
||||
}
|
||||
|
||||
@ -6720,22 +6719,16 @@ class MInsee
|
||||
$page = getUrl($url, $cookie, '', $referer, false, 'avis-situation-sirene.insee.fr', '', 5);
|
||||
//Code en 4xx ou 5xx signifie une erreur du serveur
|
||||
$codeN = floor($page['code']/100);
|
||||
if($codeN==4 || $codeN==5)
|
||||
{
|
||||
if($codeN==4 || $codeN==5) {
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$tabInfos=array();
|
||||
$referer = $url;
|
||||
$body = $page['body'];
|
||||
$serviceDispo = true;
|
||||
|
||||
if (preg_match("/<form name=\"demForm\" method=\"post\" action=\"\/avisitu\/IdentificationListeSiret.do/Uis", $body, $matches))
|
||||
{
|
||||
/*$fp = @fopen($fichier, "a");
|
||||
@fwrite($fp, $body);
|
||||
@fclose($fp);*/
|
||||
if (preg_match("/<form name=\"demForm\" method=\"post\" action=\"\/avisitu\/IdentificationListeSiret.do/Uis", $body, $matches)) {
|
||||
$cookie = $page['header']['Set-Cookie'];
|
||||
usleep(round(rand(500000,2000000)));
|
||||
|
||||
@ -6760,9 +6753,6 @@ class MInsee
|
||||
$page = getUrl($url, $cookie, $post, $referer, false, 'avis-situation-sirene.insee.fr', '', 5);
|
||||
$referer=$url;
|
||||
$body = $page['body'];
|
||||
/* $fp=@fopen($fichier, "a");
|
||||
@fwrite($fp, $body);
|
||||
@fclose($fp);*/
|
||||
|
||||
if (preg_match("/<h3>Fiche établissement<\/h3>/Uis", $body, $matches))//<li class="ongletActif">établissement</li>
|
||||
$tabInfos['fiche']='etab';
|
||||
@ -6815,17 +6805,6 @@ class MInsee
|
||||
$tabInfos['effEtTr']=trim($matches[2]);
|
||||
}
|
||||
|
||||
/* $strCsv=$siren.';'.$nic.';'.$tabInfos['fiche'].';'.$tabInfos['dateMaj'].';'.
|
||||
$tabInfos['siren'].';'.$tabInfos['nic'].';'.$tabInfos['raiSoc'].';'.
|
||||
$tabInfos['etat'].';'.$tabInfos['dateEtat'].';'.$tabInfos['fjCod'].';'.$tabInfos['fjLib'].';'.
|
||||
$tabInfos['nafCod'].';'.$tabInfos['nafLib'].';'.$tabInfos['effPeriode'].';'.
|
||||
$tabInfos['effTranche'].';'.
|
||||
$tabInfos['typeEtab'].';'.@implode(';',@$tabAdresse).
|
||||
";\n";
|
||||
$fp=@fopen(PATH_LOGS."avis.csv", "a");
|
||||
@fwrite($fp, $strCsv);
|
||||
@fclose($fp);
|
||||
*/
|
||||
// $body contient l'avis de situation au format html
|
||||
$tabErreurs=array();
|
||||
if (preg_match('/name="erreurs" value="(.*)" class="erreurText" readonly/Ui', $body, $matches1) ||
|
||||
@ -6899,10 +6878,8 @@ class MInsee
|
||||
'dateInsert'=>date('YmdHis')));
|
||||
}
|
||||
$tabInfos['enCache']=false;
|
||||
// sendMail('production@scores-decisions.com', 'ylenaour@scores-decisions.com', "classMInsee::getAvisInsee... en ACCES HTTP sur $siren", print_r($tabInfos, true).mysql_error());
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
return $tabInfos;
|
||||
|
Loading…
Reference in New Issue
Block a user