1314 lines
58 KiB
PHP
1314 lines
58 KiB
PHP
<?
|
||
|
||
include_once(FWK_PATH.'/common/curl.php');
|
||
|
||
class MEuridile {
|
||
|
||
private $body = '';
|
||
private $header = '';
|
||
private $codeRetour = 0;
|
||
private $wrncsrv2=false;
|
||
private $reference = 0;
|
||
private $timeOut=0;
|
||
private $url='';
|
||
private $urlRacine='http://www.euridile.com';
|
||
private $weur='weur3'; // Version Web 3 d'Euridile
|
||
private $referer='';
|
||
private $curPage='';
|
||
public $siren;
|
||
|
||
private $tabBS2BN=array('AH'=>'010',
|
||
'AI'=>'012',
|
||
'AJ'=>'014',
|
||
'AK'=>'016',
|
||
'AT'=>'028',
|
||
'AU'=>'030',
|
||
'BH'=>'040',
|
||
'BI'=>'042',
|
||
'BJ'=>'044',
|
||
'BK'=>'048',
|
||
'BT'=>'060',
|
||
'BU'=>'062',
|
||
'BV'=>'064',
|
||
'BW'=>'066',
|
||
'BX'=>'068',
|
||
'BY'=>'070',
|
||
'BZ'=>'072',
|
||
'CA'=>'074',
|
||
'CD'=>'080',
|
||
'CE'=>'082',
|
||
'CF'=>'084',
|
||
'CG'=>'086',
|
||
'CH'=>'092',
|
||
'CI'=>'094',
|
||
'CJ'=>'096',
|
||
'CK'=>'098',
|
||
'CO'=>'110',
|
||
'1A'=>'112',
|
||
'DA'=>'120',
|
||
'DC'=>'124',
|
||
'DD'=>'126',
|
||
'DF'=>'130',
|
||
'DG'=>'132',
|
||
'DH'=>'134',
|
||
'DI'=>'136',
|
||
'DK'=>'140',
|
||
'DL'=>'142',
|
||
'DR'=>'154',
|
||
'DP'=>'154',
|
||
'DU'=>'156',
|
||
'DV'=>'169',
|
||
'DW'=>'164',
|
||
'DX'=>'166',
|
||
'EA'=>'172-169',
|
||
'EB'=>'174',
|
||
'EC'=>'176',
|
||
'EE'=>'180',
|
||
'EH'=>'156-195',
|
||
'FA'=>'210-209',
|
||
'FB'=>'209',
|
||
'FC'=>'210',
|
||
'FD'=>'214-215',
|
||
'FE'=>'215',
|
||
'FF'=>'214',
|
||
'FH'=>'217',
|
||
'FI'=>'218',
|
||
'FK'=>'209+215+217',
|
||
'FL'=>'210+214+218',
|
||
'FM'=>'222',
|
||
'FN'=>'224',
|
||
'FO'=>'226',
|
||
'FQ'=>'230',
|
||
'FR'=>'232',
|
||
'FS'=>'234',
|
||
'FT'=>'236',
|
||
'FU'=>'238',
|
||
'FV'=>'240',
|
||
'FW'=>'242',
|
||
'FX'=>'244',
|
||
'FY'=>'250',
|
||
'FZ'=>'252',
|
||
'GA'=>'254',
|
||
'GE'=>'262',
|
||
'GF'=>'264',
|
||
'GG'=>'270',
|
||
'GP'=>'280',
|
||
'GU'=>'294',
|
||
'GW'=>'270+280+294',
|
||
'HD'=>'290',
|
||
'HH'=>'300',
|
||
'HI'=>'290-300',
|
||
'HK'=>'306',
|
||
'HL'=>'232+280+290',
|
||
'HM'=>'264+294+300+306',
|
||
'HN'=>'310',
|
||
'YY'=>'374',
|
||
'YZ'=>'378',
|
||
'YP'=>'376',
|
||
);
|
||
|
||
function __construct() {
|
||
$this->partGetSession();
|
||
$this->partConnection();
|
||
}
|
||
|
||
function __destruct() {
|
||
$this->partSaveSession();
|
||
}
|
||
|
||
function getInfosDisponbiles($siren) {
|
||
$this->siren=$siren;
|
||
$this->partConnection();
|
||
return $this->partVitrine(true);
|
||
}
|
||
|
||
function getBilan($idBilan) {
|
||
//$this->siren=$siren;
|
||
// $this->partConnection();
|
||
// $this->partVitrine();
|
||
return $this->partBilan($idBilan);
|
||
}
|
||
|
||
function getIdentite($siren) {
|
||
$this->siren=$siren;
|
||
// $this->partConnection();
|
||
// $this->partVitrine();
|
||
return $this->partIdentite();
|
||
}
|
||
|
||
private function partConnection() {
|
||
if (!$this->wrncsrv2 || time()>$this->timeOut) {
|
||
$this->timeOut=time()+900;
|
||
|
||
$this->url=$this->urlRacine.'/index.ow';
|
||
$page=getUrl($this->url, '', '', $this->urlRacine, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
echo date('Y/m/d - H:i:s') ." - Initialisation URL = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
$fp=fopen('./euridile_connexion1.log', 'w');
|
||
fwrite($fp,print_r($page,true));
|
||
fclose($fp);
|
||
if (preg_match('/<META HTTP-EQUIV="Refresh" CONTENT="0; URL=(.*)">/i', $this->body, $matches))
|
||
$this->url=$this->urlRacine.'/'.$matches[1];
|
||
else debugLog('E','Redirection non trouv<75>e sur la page '.$this->url,__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||
debugLog('I','Redirection trouv<75>e sur la page '.$this->url,__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||
|
||
if (preg_match('/\.ow\?WRNCSRV2=(.*)$/i', $matches[1], $matches)) {
|
||
$this->wrncsrv2=$matches[1];
|
||
debugLog('I','Session partenaire WRNCSRV2='.$this->wrncsrv2,__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||
}
|
||
else debugLog('E','Impossible d\'identifier le num<75>ro de session partenaire',__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||
|
||
$page=getUrl($this->url, '', '',$this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
debugLog('D',"Page d'accueil URL = $this->url (Code retour = $this->codeRetour)",__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||
$fp=fopen('./euridile_connexion2.log', 'w');
|
||
fwrite($fp,print_r($page,true));
|
||
fclose($fp);
|
||
/*
|
||
if (preg_match('/\/'.$this->weur.'\/stat_clic_abonnes\.ow\?WRNCSRV2=(.*)/i', $this->body, $matches)) {
|
||
$this->url=$this->urlRacine.$matches[0];
|
||
debugLog('I','Redirection OK vers l\'espace abonn<6E>',__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||
}
|
||
else debugLog('E','Redirection impossible vers l\'espace abonn<6E>',__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||
$this->wrncsrv2=$matches[1];
|
||
//die($this->url);
|
||
sleep(1);
|
||
$page=getUrl($this->url, '', '',$this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
debugLog('D',"Page Redirection espace abonn<6E> = $this->url (Code retour = $this->codeRetour)",__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||
$fp=fopen('./euridile_connexion3.log', 'w');
|
||
fwrite($fp,print_r($page,true));
|
||
fclose($fp);
|
||
|
||
if (preg_match('/<META HTTP-EQUIV="Refresh" CONTENT="0; URL=(.*)">/i', $this->body, $matches))
|
||
$this->url=$this->urlRacine.str_replace('..','',$matches[1]);
|
||
else die('Erreur redir vers test JS');
|
||
//die($this->url);
|
||
$page=getUrl($this->url, '', '',$this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
echo date('Y/m/d - H:i:s') ." - Page Test Javascript URL = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
|
||
if (preg_match('/<INPUT TYPE="HIDDEN" NAME="WRNCSRV2" VALUE="(.*)">/i', $this->body, $matches))
|
||
$postData=array('WRNCSRV2'=>$matches[1],
|
||
'javascript_state'=>'OK');
|
||
else die('Erreur JS');
|
||
//die($this->url);
|
||
$this->url=$this->urlRacine.'/weur2/iden_test_javascript_validite.ow';
|
||
$page=getUrl($this->url,'', $postData, $this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
echo date('Y/m/d - H:i:s') ." - Frames Saisie Codes Abo pass<73>e URL = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_gauche_general.ow?WRNCSRV2='.$this->wrncsrv2,'', '', $this->referer, false, 'www.euridile.com','',0.1);
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_haut_general.ow?WRNCSRV2='.$this->wrncsrv2,'', '', $this->referer, false, 'www.euridile.com','',0.1);
|
||
$page=getUrl($this->urlRacine.'/weur2/acc_test_abonnes_saisie_reference.ow?WRNCSRV2='.$this->wrncsrv2,'','',$this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
*/
|
||
if (preg_match('/<form method="POST" name="abonnement" ACTION="(.*)" /i', $this->body, $matches)) {
|
||
$postData=array('IDENT'=>'OK',
|
||
'MDP'=>'3180',
|
||
'cliref'=>'K5K3X5',
|
||
'PASS'=>'3180',
|
||
'WRNCSRV2'=>$this->wrncsrv2);
|
||
/** @todo Fair une fonction qui g<>re les URL commen<65>ant par ./ ou ../ ou / afin de pouvoir les concatener
|
||
**/
|
||
$this->url=$this->urlRacine.str_replace('..','',$matches[1]);
|
||
debugLog('D',"Authentification possible vers $this->url",__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||
}
|
||
else debugLog('E',"Authentification impossible car formulaire indisponible",__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||
|
||
sleep(1);
|
||
$page=getUrl($this->url,'', $postData, $this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
echo date('Y/m/d - H:i:s') ." - Apr<70>s authentification = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
$fp=fopen('./euridile_connexion3.log', 'w');
|
||
fwrite($fp,print_r($page,true));
|
||
fclose($fp);
|
||
/*
|
||
if (preg_match('/<META HTTP-EQUIV="Refresh" CONTENT="1; URL=(.*)"/i', $this->body, $matches))
|
||
$this->url=$this->urlRacine.'/weur2/'.$matches[1];
|
||
//http://www.euridile.com/weur2/ff_page_general.ow?WRNCSRV2=2618275395927201
|
||
else die('Erreur redir vers test JS');
|
||
//die($this->url);
|
||
sleep(1);
|
||
$page=getUrl($this->url, '', '',$this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
echo date('Y/m/d - H:i:s') ." - Redirection frames accueil connect<63> URL = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_gauche_general.ow?WRNCSRV2='.$this->wrncsrv2,'', '', $this->referer, false, 'www.euridile.com','',0.1);
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_haut_general.ow?WRNCSRV2='.$this->wrncsrv2,'', '', $this->referer, false, 'www.euridile.com','',0.1);
|
||
$page=getUrl($this->urlRacine.'/weur2/iden_saisie_criteres.ow?WRNCSRV2='.$this->wrncsrv2,'','',$this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
echo date('Y/m/d - H:i:s') ." - Frame recherche = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
|
||
$this->url=$this->urlRacine.'/weur2/iden_saisie_criteres_recherche_et_classement.ow?WRNCSRV2='.$this->wrncsrv2;
|
||
$page=getUrl($this->url,'', '', $this->referer, false, 'www.euridile.com');
|
||
$tmp=getUrl($this->urlRacine.'/weur2/rien.ow?WRNCSRV2='.$this->wrncsrv2,'','',$this->referer, false, 'www.euridile.com','',0.1);
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
echo date('Y/m/d - H:i:s') ." - Page recherche = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
|
||
if(preg_match('/\/weur2\/iden_evaluation_type_(.*)/i', $this->body, $matches))
|
||
{ $tabTmp=explode('"', $matches[0]);
|
||
$this->url=$this->urlRacine.$tabTmp[0];
|
||
} else die('Page de redirection recherche non trouv<75>e');
|
||
$this->curPage='recherche';
|
||
$fp=fopen('./euridile_connexion.log', 'w');
|
||
fwrite($fp,print_r($page,true));
|
||
fclose($fp);
|
||
// die(print_r($page['header']));
|
||
*/
|
||
if(preg_match('/\/'.$this->weur.'\/iden_evaluation_type_(.*)/i', $this->body, $matches))
|
||
{ $tabTmp=explode('"', $matches[0]);
|
||
$this->url=$this->urlRacine.$tabTmp[0];
|
||
debugLog('D',"Page de recherche recherche trouv<75>e = $this->url>",__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||
} else debugLog('E',"Page de recherche introuvable !",__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||
|
||
$this->curPage='recherche';
|
||
} else echo date('Y/m/d - H:i:s') ." - Deja connecte !<br/>".EOL;
|
||
return true;
|
||
}
|
||
|
||
private function partInitRecherche() {
|
||
if ($this->curPage<>'recherche') {
|
||
//$this->url=$this->urlRacine.'/weur2/ff_page_general.ow?WRNCSRV2='.$this->wrncsrv2.'&g_InfoChoix=IDEN_MC';
|
||
$this->url=$this->urlRacine.'/weur3/accueil.ow?WRNCSRV2='.$this->wrncsrv2.'&APPEL=tousnosdocs';
|
||
$page=getUrl($this->url, '', '',$this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
/*
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_gauche_general.ow?WRNCSRV2='.$this->wrncsrv2,'', '', $this->referer, false, 'www.euridile.com','',0.1);
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_haut_general.ow?WRNCSRV2='.$this->wrncsrv2,'', '', $this->referer, false, 'www.euridile.com','',0.1);
|
||
$page=getUrl($this->urlRacine.'/weur2/iden_saisie_criteres.ow?WRNCSRV2='.$this->wrncsrv2,'','',$this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
echo date('Y/m/d - H:i:s') ." - Frame recherche = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
|
||
$this->url=$this->urlRacine.'/weur2/iden_saisie_criteres_recherche_et_classement.ow?WRNCSRV2='.$this->wrncsrv2;
|
||
$page=getUrl($this->url,'', '', $this->referer, false, 'www.euridile.com');
|
||
$tmp=getUrl($this->urlRacine.'/weur2/rien.ow?WRNCSRV2='.$this->wrncsrv2,'','',$this->referer, false, 'www.euridile.com','',0.1);
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
echo date('Y/m/d - H:i:s') ." - Page recherche = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
*/
|
||
if(preg_match('/\/'.$this->weur.'\/iden_evaluation_type_(.*)/i', $this->body, $matches))
|
||
{ $tabTmp=explode('"', $matches[0]);
|
||
$this->url=$this->urlRacine.$tabTmp[0];
|
||
debugLog('D',"Page de recherche recherche trouv<75>e = $this->url>",__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||
} else debugLog('E',"Page de recherche introuvable !",__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||
|
||
$this->curPage='recherche';
|
||
$fp=fopen('./euridile_recherche.log', 'w');
|
||
fwrite($fp,print_r($page,true));
|
||
fclose($fp);
|
||
}
|
||
}
|
||
|
||
private function partVitrine($listeDocuments=false) {
|
||
if ($this->curPage<>'recherche')
|
||
$this->partInitRecherche();
|
||
|
||
$tabRet=$tabBilan=array();
|
||
$tabRet['siren']=$this->siren;
|
||
$tabRet['erreur']='';
|
||
/*<form name="n" action="../weur3/iden_evaluation_type_nlp.ow" method="post" onSubmit="return valide_criteres_Recherche(this);">
|
||
<INPUT type="hidden" name="codcom_srch" value="">
|
||
<input name="entrep_srch" type="text" size="40" maxlength="100" value="" onBlur="DelSpaces(this);"></td>
|
||
|
||
<td><input name="codpos_srch" type="text" size="6" maxlength="5" value="" onBlur="DelSpaces(this);DelCar(this);">
|
||
<td><input name="commune_srch" type="text" size="40" maxlength="50" value="" onBlur="UpperCase(this);DelSpaces(this);DelCar(this)"></td>
|
||
<input name="adress_srch" type="text" size="40" maxlength="100" value="" onBlur="DelSpaces(this);DelCar(this);"></td>
|
||
<input type="image" src="../weur3/images/bouton_rechercher.gif" border="0" align="absmiddle" width="80" alt="Rechercher">
|
||
<INPUT TYPE="HIDDEN" NAME="WRNCSRV2" VALUE="2621073612214588">
|
||
</form>
|
||
*/
|
||
$postData=array('codcom_srch'=>'',
|
||
'entrep_srch'=>$this->siren,
|
||
// 'contient'=>'contient', // contient=Contient, debute=D<>bute par, contientque=ne contient que les termes saisis
|
||
// 'phoneme'=>'non', // non=A l'identique, oui=approchant
|
||
'codpos_srch'=>'',
|
||
'commune_srch'=>'',
|
||
'adress_srch'=>'',
|
||
'x'=>rand(0,80),
|
||
'y'=>rand(0,17),
|
||
'WRNCSRV2'=>$this->wrncsrv2);
|
||
$page=getUrl($this->url,'', $postData, $this->referer, false, 'www.euridile.com');
|
||
echo date('Y/m/d - H:i:s') ." - Vitrine = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
$fp=fopen('./euridile_vitrine1.log', 'w');
|
||
fwrite($fp,print_r($page,true));
|
||
fclose($fp);
|
||
//die();
|
||
|
||
if (preg_match('/\/weur2\/iden_saisie_criteres\.ow/i', $this->body)) {
|
||
$tabRet['erreur']='Siren inconnu';
|
||
$this->curPage='recherche';
|
||
echo date('Y/m/d - H:i:s') ." - Vitrine : Erreur recherche = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
return $tabRet;
|
||
}
|
||
echo date('Y/m/d - H:i:s') ." - Vitrine : Apr<70>s recherche = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
|
||
$this->url=$this->urlRacine.'/'.$this->weur.'/iden_visu_vitrine.ow?WRNCSRV2='.$this->wrncsrv2;
|
||
$page=getUrl($this->urlRacine.'/'.$this->weur.'/bandeau_gauche_general.ow?WRNCSRV2='.$this->wrncsrv2,'', '', $this->referer, false, 'www.euridile.com','',0.1);
|
||
$page=getUrl($this->urlRacine.'/'.$this->weur.'/bandeau_haut_general.ow?WRNCSRV2='.$this->wrncsrv2,'', '', $this->referer, false, 'www.euridile.com','',0.1);
|
||
$page=getUrl($this->url,'','',$this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
$fp=fopen('./euridile_vitrine2.log', 'w');
|
||
fwrite($fp,print_r($page,true));
|
||
fclose($fp);
|
||
|
||
echo date('Y/m/d - H:i:s') ." - Vitrine : Frame = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
$this->curPage='vitrine';
|
||
|
||
$matches=explode("<A HREF=\"javascript:OpenHtmlWindow('paie_abonnes_livraison_directe_informations.ow','Compte_Annuel','", $this->body);
|
||
for ($i=1; isset($matches[$i]); $i++) {
|
||
$tabTmp=explode("','", $matches[$i]);
|
||
$idBilan=$tabTmp[0];
|
||
$tabTmp=explode('|', $idBilan);
|
||
$dateBilan=$tabTmp[1];
|
||
switch ($tabTmp[2]) {
|
||
case 'SC': $typeBilan='N'; break; // R<>el normal
|
||
case 'SS': $typeBilan='S'; break; // R<>el simplifi<66>
|
||
case 'CC': $typeBilan='C'; break; // CONSOLIDE
|
||
case 'SA': $typeBilan='A'; break; // Assurance
|
||
case 'SB': $typeBilan='B'; break; // Banque
|
||
default: die('Type de bilan non pris en charge : "'. $tabTmp[2] .'"');
|
||
}
|
||
$tabBilan[$typeBilan][$dateBilan]=$idBilan;
|
||
}
|
||
$tabRet['bilans']=$tabBilan;
|
||
/* if ($listeDocuments) {
|
||
$this->partVitrineDocuments();
|
||
}
|
||
*/
|
||
$fp=fopen('./euridile_vitrine.log', 'w');
|
||
fwrite($fp,print_r($page,true));
|
||
fclose($fp);
|
||
return $tabRet;
|
||
}
|
||
|
||
private function partVitrineDocuments() {
|
||
if ($this->curPage='vitrine')
|
||
$this->partVitrine();
|
||
|
||
$tabRet=$tabBilan=array();
|
||
$tabRet['siren']=$this->siren;
|
||
$tabRet['erreur']='';
|
||
|
||
$this->url=$this->urlRacine.'/weur2/ff_page_general.ow?WRNCSRV2='.$this->wrncsrv2.
|
||
'&g_InfoChoix=CMD_IN&first=actes&filtre_document=no&g_Onglet=info';
|
||
$page=getUrl($this->url,'','',$this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
|
||
$this->url=$this->urlRacine.'/weur2/cmd_panier_informations_numerises.ow?WRNCSRV2='.$this->wrncsrv2;
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_gauche_general.ow?WRNCSRV2='.$this->wrncsrv2,'','',$this->referer, false, 'www.euridile.com','',0.1);
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_haut_general.ow?WRNCSRV2='.$this->wrncsrv2,'', '', $this->referer, false, 'www.euridile.com','',0.1);
|
||
$page=getUrl($this->url,'','',$this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
|
||
preg_match('/<OPTION VALUE="'.$this->siren.'\|(.*)\|IMM\|COUR">/i', $this->body, $matches);
|
||
$tabDossier=array( 'libelle'=>'Dossier d\'immatriculation principale',
|
||
'idBalise'=>'IMMcombo',
|
||
'idLien'=>str_replace('<OPTION VALUE="','', str_replace('">','', $matches[0])));
|
||
|
||
$body=preg_replace('/(.*)<\/TABLE> +<\/TD><\/TR><TR><TD WIDTH=70% ALIGN=LEFT><FONT SIZE=2 FACE=ARIAL>/i','',str_replace("\r",'', str_replace("\n",'', $this->body)));
|
||
$tabTmp=explode('<TD ALIGN=RIGHT WIDTH=30% VALIGN=TOP><SELECT NAME=ACTcombo', $body);
|
||
|
||
$tabActes=array();
|
||
foreach ($tabTmp as $i=>$acte) {
|
||
if (!isset($tabTmp[$i+1])) {
|
||
$tabTmp2=explode('</TD></TR></TABLE>', $acte);
|
||
$acte=$tabTmp2[0];
|
||
}
|
||
if ($i<>0) {
|
||
$tabTmp2=explode('<TR><TD WIDTH=70% ALIGN=LEFT><FONT SIZE=2 FACE=ARIAL>', $acte);
|
||
if (preg_match('/<OPTION VALUE="'.$this->siren.'\|(.*)\|ACT\|(.*)\|(.*)\|(.*)\|TELE">/i', $tabTmp2[0], $matches))
|
||
$vecteur='TELE';
|
||
elseif (preg_match('/<OPTION VALUE="'.$this->siren.'\|(.*)\|ACT\|(.*)\|(.*)\|(.*)\|COUR">/i', $tabTmp2[0], $matches))
|
||
$vecteur='COUR';
|
||
if ($i<>1) {
|
||
$tabTmp2=explode('<TR><TD WIDTH=70% ALIGN=LEFT><FONT SIZE=2 FACE=ARIAL>', $tabTmp[$i-1]);
|
||
$strLibPre=$tabTmp2[1];
|
||
} else $strLibPre=$tabTmp[0];
|
||
$tabActes[$i-1]=array( 'vecteur'=>$vecteur,
|
||
'libelle'=>trim(strip_tags(preg_replace('/(.*)<BR>/i','',$strLibPre))),
|
||
'idBalise'=>'ACTcombo'.($i-1),
|
||
'date'=>$matches[2],
|
||
'nbPages'=>$matches[4],
|
||
'numero'=>$matches[3],
|
||
'idLien'=>str_replace('<OPTION VALUE="','', str_replace('">','', $matches[0])));
|
||
}
|
||
}
|
||
|
||
/** Recherche des comptes d<>pos<6F>s **/
|
||
$tabTmp=preg_split('/<SELECT NAME=(TT|BL|CM|GS)FAM(\d)/i', $body);
|
||
$tabCpt=array();
|
||
$nb=count($tabTmp);
|
||
for($i=1; $i<$nb; $i++) {
|
||
if (preg_match('/<OPTION VALUE="'.$this->siren.'\|(.*)\|BIL\|(.*)\|(.*)\|(TT|BL|CM|GS)\|(.*)\|(.*)\|TELE">/i', $tabTmp[$i], $matches))
|
||
$vecteur='TELE';
|
||
elseif (preg_match('/<OPTION VALUE="'.$this->siren.'\|(.*)\|BIL\|(.*)\|(.*)\|(TT|BL|CM|GS)\|(.*)\|(.*)\|COUR">/i', $tabTmp[$i], $matches))
|
||
$vecteur='COUR';
|
||
switch ($matches[3]) {
|
||
case 'SC': $typeBilan='N'; $bil='Bilan r<>el normal'; break; // R<>el normal
|
||
case 'SS': $typeBilan='S'; $bil='Bilan r<>el simplifi<66>'; break; // R<>el simplifi<66>
|
||
case 'CC': $typeBilan='C'; $bil='Bilan consolid<69>'; break; // CONSOLIDE
|
||
case 'SA': $typeBilan='A'; $bil='Bilan d\'assurance'; break; // Assurance
|
||
case 'SB': $typeBilan='B'; $bil='Bilan de banque'; break; // Banque
|
||
default: die('Type de bilan non pris en charge : "'. $tabTmp[2] .'"');
|
||
}
|
||
switch ($matches[4]) {
|
||
case 'TT': $lib='Comptes annuels complets'; break;
|
||
case 'BL': $lib='Bilan et compte de r<>sultat'; break;
|
||
case 'CM': $lib='Rapport des CAC'; break;
|
||
case 'GS': $lib='Rapport de gestion'; break;
|
||
default: die('Type d\'annexe de compte inconnu'); break;
|
||
}
|
||
$tabCpt[$i-1]=array( 'vecteur'=>$vecteur,
|
||
'libelle'=>$bil.' - '.$lib,
|
||
'idBalise'=>$matches[4].'FAM'.$i,
|
||
'typeBilan'=>$typeBilan,
|
||
'date'=>$matches[2],
|
||
'nbPages'=>$matches[5],
|
||
'numero'=>$matches[6],
|
||
'idLien'=>str_replace('<OPTION VALUE="','', str_replace('">','', $matches[0])));
|
||
}
|
||
|
||
/** @todo gestion des commandes :
|
||
<FORM NAME=FORMADDCART ACTION="../weur2/cmd_panier_informations_numerises_gestion.ow" METHOD=POST TARGET=_top>
|
||
<INPUT TYPE="HIDDEN" NAME="dejatraite" value="">
|
||
<INPUT TYPE=IMAGE SRC=images/boutons/valider.gif ALT="Valider" BORDER=0>
|
||
<INPUT TYPE="HIDDEN" NAME="WRNCSRV2" VALUE="171932431532858">
|
||
<SELECT NAME=ACTcombo0> // 1 select par acte de depot de 0 <20> N !!!
|
||
<SELECT NAME=IMMcombo> // Dossier immatriculiation principal
|
||
|
||
// Comptes R<>el Normal
|
||
<SELECT NAME=TTFAM1 // Ann<6E>e1 : Comptes Annuels complet
|
||
<OPTION VALUE="333192631|BILANS SERVICE|BIL|31/12/2005|SC|TT|22|33319263105122AN9201:33319263105122BL9201:33319263105122CM9201:33319263105122GS9201|TELE">
|
||
<OPTION VALUE="333192631|BILANS SERVICE|BIL|31/12/2005|SC|TT|22|33319263105122AN9201:33319263105122BL9201:33319263105122CM9201:33319263105122GS9201|COUR">
|
||
|
||
<SELECT NAME=BLFAM1 // Ann<6E>e 1 : Bilan, Compte de r<>sultat
|
||
<OPTION VALUE="333192631|BILANS SERVICE|BIL|31/12/2005|SC|BL|4|33319263105122BL9201|TELE">
|
||
<OPTION VALUE="333192631|BILANS SERVICE|BIL|31/12/2005|SC|BL|4|33319263105122BL9201|COUR">
|
||
|
||
<SELECT NAME=CMFAM1 // Ann<6E>e 1 : Rapport des CAC
|
||
<OPTION VALUE="333192631|BILANS SERVICE|BIL|31/12/2005|SC|CM|2|33319263105122CM9201|TELE">
|
||
|
||
<SELECT NAME=GSFAM1 // Ann<6E>e 1 : Rapport de Gestion
|
||
<OPTION VALUE="333192631|BILANS SERVICE|BIL|31/12/2005|SC|GS|4|33319263105122GS9201|TELE">
|
||
|
||
|
||
// Comptes consolid<69>s
|
||
<select name="TTFAM6"
|
||
<option value="552100554|PEUGEOT SA|BIL|31/12/2004|SC|TT|159|55210055404122AN7501:55210055404122BL7501:55210055404122CM7501:55210055404122GS7501|TELE">
|
||
|
||
<select name="BLFAM6"
|
||
<option value="552100554|PEUGEOT SA|BIL|31/12/2004|SC|BL|3|55210055404122BL7501|TELE">
|
||
<option value="552100554|PEUGEOT SA|BIL|31/12/2004|SC|BL|3|55210055404122BL7501|COUR">Courrier
|
||
<option value="552100554|PEUGEOT SA|BIL|31/12/2004|SC|BL|159|55210055404122AN7501:55210055404122BL7501:55210055404122CM7501:55210055404122GS7501|INCLUS">
|
||
|
||
<select name="CMFAM6"
|
||
<option value="552100554|PEUGEOT SA|BIL|31/12/2004|SC|CM|3|55210055404122CM7501|TELE">
|
||
<option value="552100554|PEUGEOT SA|BIL|31/12/2004|SC|CM|3|55210055404122CM7501|COUR">
|
||
<option value="552100554|PEUGEOT SA|BIL|31/12/2004|SC|CM|159|55210055404122AN7501:55210055404122BL7501:55210055404122CM7501:55210055404122GS7501|INCLUS">
|
||
|
||
<select name="GSFAM6"
|
||
<option value="552100554|PEUGEOT SA|BIL|31/12/2004|SC|GS|108|55210055404122GS7501|TELE">
|
||
<option value="552100554|PEUGEOT SA|BIL|31/12/2004|SC|GS|159|55210055404122AN7501:55210055404122BL7501:55210055404122CM7501:55210055404122GS7501|INCLUS">
|
||
|
||
**/
|
||
$tabRet=array( 'actes'=>$tabActes,
|
||
'comptes'=>$tabCpt,
|
||
'dossier'=>$tabDossier);
|
||
print_r($tabRet);
|
||
die();
|
||
$fp=fopen('./euridile_vitrineDocs.log', 'w');
|
||
fwrite($fp,print_r($page,true));
|
||
fclose($fp);
|
||
echo date('Y/m/d - H:i:s') ." - Vitrine Documents = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
die();
|
||
return $tabRet;
|
||
}
|
||
|
||
/*private*/ function partChercheDirigeant($nomPrenom) {
|
||
if ($this->curPage<>'recherche')
|
||
$this->partInitRecherche();
|
||
|
||
$tabRet=$tabBilan=array();
|
||
//$tabRet['siren']=$this->siren;
|
||
$tabRet['erreur']='';
|
||
|
||
$postData=array('codcom_srch'=>'',
|
||
'entrep_srch'=>urlencode($nomPrenom),
|
||
'contient'=>'contient', // contient=Contient, debute=D<>bute par, contientque=ne contient que les termes saisis
|
||
'phoneme'=>'non', // non=A l'identique, oui=approchant
|
||
'adress_srch'=>'',
|
||
'codpos_srch'=>'',
|
||
'commune_srch'=>'',
|
||
'x'=>rand(0,72),
|
||
'y'=>rand(0,20),
|
||
'WRNCSRV2'=>$this->wrncsrv2);
|
||
$page=getUrl($this->url,'', $postData, $this->referer, false, 'www.euridile.com');
|
||
echo date('Y/m/d - H:i:s') ." - Recherche Dirigeant = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
|
||
$this->url=$this->urlRacine.'/weur2/iden_req_multibase_deno.ow?WRNCSRV2='.$this->wrncsrv2;
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_gauche_general.ow?WRNCSRV2='.$this->wrncsrv2,'', '', $this->referer, false, 'www.euridile.com','',0.1);
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_haut_general.ow?WRNCSRV2='.$this->wrncsrv2,'', '', $this->referer, false, 'www.euridile.com','',0.1);
|
||
$page=getUrl($this->url,'','',$this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
|
||
$fp=fopen('./euridile_recherche2.log', 'w');
|
||
fwrite($fp,print_r($page,true));
|
||
fclose($fp);
|
||
/** Entreprises trouv<75>es **/
|
||
//../weur2/iden_selection_bases.ow?WRNCSRV2=1711245812917368&infosBase=EURENT|densig|entreprise(s)|234 TARGET=_top>Entreprise(s)
|
||
if (preg_match('/\/weur2\/iden_selection_bases\.ow\?WRNCSRV2='.$this->wrncsrv2.'&infosBase=EURENT\|densig\|entreprise\(s\)\|(.*) TARGET=_top>Ent/i', $this->body, $matches)) {
|
||
$fctEntUrl=preg_replace('/ (.*)/','',$matches[0]);
|
||
$fctEntNb=$matches[1];
|
||
}
|
||
/** Fonctions de direction trouv<75>es **/
|
||
if (preg_match('/\/weur2\/iden_selection_bases\.ow\?WRNCSRV2='.$this->wrncsrv2.'&infosBase=EURDIR\|dirig\|dirigeant\(s\)\|(.*) TARGET=_top>Dir/i', $this->body, $matches)) {
|
||
$fctDirUrl=preg_replace('/ (.*)/','',$matches[0]);
|
||
$fctDirNb=$matches[1];
|
||
}
|
||
/** Fonctions d'administration trouv<75>e **/
|
||
//../weur2/iden_selection_bases.ow?WRNCSRV2=1711245812917368&infosBase=EURDIR|admin|administrateur(s)|44 TARGET=_top>Administrateur(s)
|
||
if (preg_match('/\/weur2\/iden_selection_bases\.ow\?WRNCSRV2='.$this->wrncsrv2.'&infosBase=EURDIR\|admin\|administrateur\(s\)\|(.*) TARGET=_top>Adm/i', $this->body, $matches)) {
|
||
$fctAdmUrl=preg_replace('/ (.*)/','',$matches[0]);
|
||
$fctAdmNb=$matches[1];
|
||
}
|
||
|
||
echo date('Y/m/d - H:i:s') ." - R<>sultat : $fctDirNb dirigeant(s), $fctAdmNb administrateur(s) et $fctEntNb entreprise(s)".EOL;
|
||
echo date('Y/m/d - H:i:s') ." - URL : $fctDirUrl".EOL;
|
||
|
||
$this->url=$this->urlRacine.$fctDirUrl;
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_gauche_general.ow?WRNCSRV2='.$this->wrncsrv2,'','',$this->referer,false,'www.euridile.com','',0.1);
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_haut_general.ow?WRNCSRV2='.$this->wrncsrv2,'', '', $this->referer,false,'www.euridile.com','',0.1);
|
||
$page=getUrl($this->url,'','',$this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
$fp=fopen('./euridile_recherche3.log', 'w');
|
||
fwrite($fp,print_r($page,true));
|
||
fclose($fp);
|
||
|
||
if (preg_match('/\/weur2\/iden_affinage_critere\.ow/i', $this->body)) {
|
||
/** Visualisation du formulaire d'affinage **/
|
||
$this->url=$this->urlRacine.'/weur2/iden_affinage_critere.ow?WRNCSRV2='.$this->wrncsrv2;
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_gauche_general.ow?WRNCSRV2='.$this->wrncsrv2,'','',$this->referer,false,'www.euridile.com','',0.1);
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_haut_general.ow?WRNCSRV2='.$this->wrncsrv2,'', '', $this->referer,false,'www.euridile.com','',0.1);
|
||
$page=getUrl($this->url,'','',$this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
|
||
/** On outrepasse l'affinage **/
|
||
$this->url=$this->urlRacine.'/weur2/iden_req_multibase_affinage_critere.ow?WRNCSRV2='.$this->wrncsrv2;
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_gauche_general.ow?WRNCSRV2='.$this->wrncsrv2,'','',$this->referer,false,'www.euridile.com','',0.1);
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_haut_general.ow?WRNCSRV2='.$this->wrncsrv2,'', '', $this->referer,false,'www.euridile.com','',0.1);
|
||
$page=getUrl($this->url,'','',$this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
/*
|
||
$fp=fopen('./euridile_recherche_affinage.log', 'w');
|
||
fwrite($fp,print_r($page,true));
|
||
fclose($fp);
|
||
die();
|
||
$tabRet['erreur']='Trop de choix possibles';
|
||
$this->curPage='autre';
|
||
echo date('Y/m/d - H:i:s') ." - Multipropositions, trop de choix possibles = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
return $tabRet;
|
||
*/
|
||
} elseif (!preg_match('/\/weur2\/iden_req_multibase_liste\.ow/i', $this->body)) {
|
||
$tabRet['erreur']='Erreur inconnue';
|
||
$this->curPage='autre';
|
||
echo date('Y/m/d - H:i:s') ." - Page de Multipropositions erreur inconnue = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
return $tabRet;
|
||
}
|
||
|
||
/** Liste des entreprises dirig<69>es */
|
||
$this->url=$this->urlRacine.'/weur2/iden_req_multibase_liste.ow?WRNCSRV2='.$this->wrncsrv2;
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_gauche_general.ow?WRNCSRV2='.$this->wrncsrv2,'','',$this->referer,false,'www.euridile.com','',0.1);
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_haut_general.ow?WRNCSRV2='.$this->wrncsrv2,'', '', $this->referer,false,'www.euridile.com','',0.1);
|
||
$page=getUrl($this->url,'','',$this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
$fp=fopen('./euridile_recherche4.log', 'w');
|
||
fwrite($fp,print_r($page,true));
|
||
fclose($fp);
|
||
|
||
$body=str_replace("\r",'', str_replace("\n",'', $this->body));
|
||
$tabTmp=explode('<TABLE BORDER=0><TR><TD><FONT SIZE=2 FACE=ARIAL><A HREF="../weur2/ff_page_general.ow?WRNCSRV2='.$this->wrncsrv2.'&g_InfoChoix=IDEN_VI&rcs=', $body);
|
||
array_shift($tabTmp);
|
||
$tabEntrep=array();
|
||
for($i=0, $nbPages=0; $i<$fctDirNb; $i++) {
|
||
if ($i%10==0) {
|
||
$nbPages++;
|
||
$this->url=$this->urlRacine.'/weur2/iden_req_superindex_liste_suite.ow?WRNCSRV2='.$this->wrncsrv2;
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_gauche_general.ow?WRNCSRV2='.$this->wrncsrv2,'','',$this->referer,false,'www.euridile.com','',0.1);
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_haut_general.ow?WRNCSRV2='.$this->wrncsrv2,'', '', $this->referer,false,'www.euridile.com','',0.1);
|
||
$page=getUrl($this->url,'','',$this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
$body=str_replace("\r",'', str_replace("\n",'', $this->body));
|
||
$tabTmp2=explode('<TABLE BORDER=0><TR><TD><FONT SIZE=2 FACE=ARIAL><A HREF="../weur2/ff_page_general.ow?WRNCSRV2='.$this->wrncsrv2.'&g_InfoChoix=IDEN_VI&rcs=', $body);
|
||
array_shift($tabTmp2);
|
||
for ($j=0; isset($tabTmp2[$j]); $j++)
|
||
$tabTmp[($nbPages*10)+$j]=$tabTmp2[$j];
|
||
}
|
||
$tabTmp2=explode('</TD></TR>', $tabTmp[$i]);
|
||
$siren=substr($tabTmp2[0],0,9);
|
||
$raisonSoc=trim(preg_replace('/(.*)<B>/i','', preg_replace('/<\/B>(.*)/i','', $tabTmp2[0])));
|
||
$cpVille=trim(strip_tags($tabTmp2[1]));
|
||
$cp=substr($cpVille,0,5);
|
||
$ville=substr($cpVille,6,strlen($cpVille)-6);
|
||
$tabTmp3=explode(' : ', trim(strip_tags($tabTmp2[2])));
|
||
$fonction=$tabTmp3[0];
|
||
$nomPrenom=$tabTmp3[1];
|
||
$tabTmp3=explode(' - ', trim(strip_tags($tabTmp2[3])));
|
||
$nafCod=$tabTmp3[0];
|
||
$nafLib=$tabTmp3[1];
|
||
$tabEntrep[]=array( 'siren'=>$siren,
|
||
'raisonSociale'=>$raisonSoc,
|
||
'cp'=>$cp,
|
||
'ville'=>$ville,
|
||
'fonction'=>$fonction,
|
||
'nomPrenom'=>$nomPrenom,
|
||
'naf'=>$nafCod,
|
||
'nafLib'=>$nafLib);
|
||
}
|
||
|
||
print_r($tabEntrep);
|
||
/* <TABLE BORDER=0><TR><TD><FONT SIZE=2 FACE=ARIAL><A HREF="../weur2/ff_page_general.ow?WRNCSRV2=1712113814717908&g_InfoChoix=IDEN_VI&rcs=350902813" target=_top><B>MC 2</B></A></TD></TR><TR><TD><FONT SIZE=2 FACE=ARIAL>68500 GUEBWILLER</TD></TR>
|
||
<TR><TD VALIGN=TOP BGCOLOR=#FFFFFF><FONT FACE=ARIAL SIZE=2>Liquidateur : HEITZ Jean-Marc</TD></TR>
|
||
<TR><TD VALIGN=TOP BGCOLOR=#FFFFFF><FONT FACE=ARIAL SIZE=2>742C - Ing<6E>nierie, <20>tudes techniques</TD></TR>
|
||
</TABLE><TR><TD BGCOLOR=#FFF0D0 WIDTH=5% ALIGN=CENTER VALIGN=TOP>*/
|
||
|
||
//echo date('Y/m/d - H:i:s') ." - R<>sultat recherche : Frame = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
$this->curPage='autre';
|
||
return;
|
||
//$this->curPage='vitrine';
|
||
|
||
//http://www.euridile.com/weur2/iden_req_multibase_deno.ow?WRNCSRV2=171104063134552
|
||
/* if (preg_match('/\/weur2\/iden_saisie_criteres\.ow/i', $this->body)) {
|
||
$tabRet['erreur']='Siren inconnu';
|
||
$this->curPage='recherche';
|
||
echo date('Y/m/d - H:i:s') ." - Vitrine : Erreur recherche = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
return $tabRet;
|
||
}
|
||
echo date('Y/m/d - H:i:s') ." - Vitrine : Apr<70>s recherche = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
|
||
// URL=http://www.euridile.com/weur2/iden_req_multibase_liste.ow?WRNCSRV2=1708540753425987
|
||
// URL=http://www.euridile.com/weur2/ff_page_general.ow?WRNCSRV2=1708540753425987&g_InfoChoix=IDEN_VI&rcs=309358224
|
||
|
||
// Page suivante
|
||
// http://www.euridile.com/weur2/iden_req_superindex_liste_suite.ow?WRNCSRV2=171104063134552
|
||
|
||
// Page pr<70>c
|
||
// http://www.euridile.com/weur2/iden_req_superindex_liste_retour.ow?WRNCSRV2=171104063134552
|
||
*/
|
||
|
||
$this->url=$this->urlRacine.'/weur2/iden_visu_vitrine.ow?WRNCSRV2='.$this->wrncsrv2;
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_gauche_general.ow?WRNCSRV2='.$this->wrncsrv2,'', '', $this->referer, false, 'www.euridile.com','',0.1);
|
||
$page=getUrl($this->urlRacine.'/weur2/bandeau_haut_general.ow?WRNCSRV2='.$this->wrncsrv2,'', '', $this->referer, false, 'www.euridile.com','',0.1);
|
||
$page=getUrl($this->url,'','',$this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
|
||
echo date('Y/m/d - H:i:s') ." - Vitrine : Frame = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
$this->curPage='vitrine';
|
||
|
||
$matches=explode("<A HREF=\"javascript:OpenHtmlWindow('paie_abonnes_livraison_directe_informations.ow','Compte_Annuel','", $this->body);
|
||
for ($i=1; isset($matches[$i]); $i++) {
|
||
$tabTmp=explode("','", $matches[$i]);
|
||
$idBilan=$tabTmp[0];
|
||
$tabTmp=explode('|', $idBilan);
|
||
$dateBilan=$tabTmp[1];
|
||
switch ($tabTmp[2]) {
|
||
case 'SC': $typeBilan='N'; break; // R<>el normal
|
||
case 'SS': $typeBilan='S'; break; // R<>el simplifi<66>
|
||
case 'CC': $typeBilan='C'; break; // CONSOLIDE
|
||
case 'SA': $typeBilan='A'; break; // Assurance
|
||
case 'SB': $typeBilan='B'; break; // Banque
|
||
default: die('Type de bilan non pris en charge : "'. $tabTmp[2] .'"');
|
||
}
|
||
$tabBilan[$typeBilan][$dateBilan]=$idBilan;
|
||
}
|
||
$tabRet['bilans']=$tabBilan;
|
||
$fp=fopen('./euridile_vitrine.log', 'w');
|
||
fwrite($fp,print_r($page,true));
|
||
fclose($fp);
|
||
return $tabRet;
|
||
}
|
||
|
||
private function partListeActes() {
|
||
|
||
//http://www.euridile.com/weur2/ff_page_general.ow?WRNCSRV2=1717224430910945&g_InfoChoix=CMD_IN&first=actes&filtre_document=no&g_Onglet=info
|
||
|
||
// 2 cadres classiques +
|
||
//weur2/cmd_panier_informations_numerises.ow?WRNCSRV2=1717224430910945
|
||
|
||
|
||
}
|
||
|
||
private function partIdentite() {
|
||
if ($this->curPage<>'vitrine')
|
||
$this->partVitrine();
|
||
$url=$this->urlRacine.'/'.$this->weur.'/paie_abonnes_livraison_directe_informations.ow?flag_type_acces_direct_infos=FIC&WRNCSRV2='.$this->wrncsrv2;
|
||
$page=getUrl($url, '', '', $this->referer, false, 'www.euridile.com');
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
echo date('Y/m/d - H:i:s') ." - Fiche d'identit<69> = $url (Code retour = $this->codeRetour)<br/>".EOL;
|
||
//$this->curPage='vitrine';
|
||
$tabRet=array();
|
||
|
||
/**@todo Traiter le cas donn<6E>es provisoires :
|
||
<TR><TD bgcolor='#fff0d0'><FONT COLOR=#100070 FACE=ARIAL SIZE=2><B><!-- Donn<6E>es provisoires --> En cours d'immatriculation, donn<6E>es provisoires</B></FONT></TD></TR><TR><TD bgcolor=#fff0d0><FONT COLOR=#100070 FACE=ARIAL SIZE=2>Nombre d'<27>tablissements : <FONT COLOR=#100070 FACE=ARIAL SIZE=2><B></B></TD></TR>
|
||
</TABLE>
|
||
*/
|
||
// Identit<69>
|
||
$tabRet['siren']=$this->siren;
|
||
$tabRet['codeRetour']=$this->codeRetour;
|
||
$tabRet['rcs']=@getTextInHtml($this->body, 'FACE="ARIAL,HELVETICA" SIZE=2>RCS : ', '<b>','</b>');
|
||
$strTmp=@getTextInHtml($this->body, 'FACE="ARIAL,HELVETICA" SIZE=2>RCS : <b>', 'FACE="ARIAL,HELVETICA" SIZE=2><b>', '<img src=\'images/rouge.gif\'');
|
||
$tabTmp=explode('</TD>', $strTmp);
|
||
$tabRet['nom']=strip_tags($tabTmp[0]);
|
||
// ... adresse
|
||
for ($i=1; $i<5; $i++) {
|
||
if (strpos($tabTmp[$i], 'Nom commercial - Enseigne :')===false &&
|
||
strpos($tabTmp[$i], 'Sigle :')===false ) {
|
||
$ligne=trim(strip_tags($tabTmp[$i]));
|
||
if (preg_match("/^([0-9]{5,5})([\D]*)/i", $ligne, $matches)) {
|
||
$tabRet['cp']=trim($matches[1]);
|
||
$tabRet['ville']=trim($matches[2]);
|
||
break;
|
||
} else $tabRet['adresse'.$i]=$ligne;
|
||
}
|
||
}
|
||
|
||
$pp_nais=trim(strip_tags(@getTextInHtml($this->body, 'FACE=\'ARIAL,HELVETICA\' SIZE=2>Date et lieu de naissance :', '<B>','</B>')));
|
||
$tabTmp=explode(' <20> ', $pp_nais);
|
||
$tabRet['naiss_date']=trim(str_replace('N<>(e) le ', '', strip_tags($tabTmp[0])));
|
||
$tabRet['naiss_lieu']=trim(strip_tags($tabTmp[1]));
|
||
$tabRet['sexe']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=\'ARIAL,HELVETICA\' SIZE=2>Sexe :', '<B>','</B>')));
|
||
|
||
$tabRet['enseigne']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>Nom commercial - Enseigne :', '<B>','</B>')));
|
||
$tabRet['sigle']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>Sigle :', '<B>','</B>')));
|
||
$tabRet['fj_lib']=@getTextInHtml($this->body, 'FACE=\'ARIAL,HELVETICA\' SIZE=2>Forme juridique :', '<B>','</B>');
|
||
$strTmp=@getTextInHtml($this->body, 'FACE=\'ARIAL,HELVETICA\' SIZE=2>Activité :', '<B>','</B>');
|
||
$tabTmp=explode(' - ', $strTmp);
|
||
$tabRet['naf_code']=$tabTmp[0];
|
||
$tabRet['naf_lib']=$tabTmp[1];
|
||
$tabRet['date_crea']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>Date de création :', '<B>','</B>')));
|
||
$tabRet['date_imma']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>Date d\'immatriculation :', '<B>','</B>')));
|
||
$tabRet['greffe']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>Greffe :', '<B>','</B>')));
|
||
$tabRet['num_gestion']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>N<>de gestion :', '<B>','</B>')));
|
||
$strTmp=@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>Capital :', '<B>','</B>');
|
||
if (preg_match('/([0-9\.,\s]*)([\D]*)/i', $strTmp, $matches)) {
|
||
$tabRet['capital_mnt']=trim(str_replace(' ','',str_replace(',','.',$matches[1])));
|
||
$tabRet['capital_dev']=$matches[2];
|
||
}
|
||
else {
|
||
$tabRet['capital_mnt']=0;
|
||
$tabRet['capital_dev']='';
|
||
}
|
||
$tabRet['nationalite']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>Nationalité :', '<B>','</B>')));
|
||
$tabRet['nb_etab']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>Nombre d\'<27>tablissements :', '<B>','</B>')));
|
||
if (strpos($this->body,'FACE=ARIAL SIZE=2><B>Radiation</B>')>0) {
|
||
$tabRet['indRadiation']=true;
|
||
$tabRet['date_radiation']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>Entreprise radi<64>e le :', '<B>','</B>')));
|
||
} else
|
||
$tabRet['indRadiation']=false;
|
||
|
||
// Proc<6F>dures collectives
|
||
if (strpos($this->body,'FACE=ARIAL SIZE=2><B>Les proc<6F>dures collectives</B>')>0) {
|
||
$tabRet['indProcol']=true;
|
||
$strTmp=@getTextInHtml($this->body, '<B>Les proc<6F>dures collectives</B></FONT>', "<img src='./images/rouge.gif' width=4 height=4 border='0'>",
|
||
'</TABLE>');
|
||
$tabTmp=explode("<img src='./images/rouge.gif' width=4 height=4 border='0'>", $strTmp);
|
||
foreach ($tabTmp as $nproc=>$proc) {
|
||
$tabTmp2=explode('</TD></TR>', $proc);
|
||
$tabTmp3=explode(' du ', $tabTmp2[0]);
|
||
$tabTmp2=explode('<TD WIDTH=99% ALIGN=LEFT BGCOLOR=#fff0d0 colspan=2><FONT COLOR=#100070 FACE=ARIAL SIZE=2>', $proc);
|
||
$tabInter=array();
|
||
for($nInter=1; isset($tabTmp2[$nInter]); $nInter++) {
|
||
$tabTmp4=explode('</TD></TR>', $tabTmp2[$nInter]);
|
||
$tabInter[]=array( 'type'=>trim(strip_tags($tabTmp4[0])),
|
||
'nom'=>trim(str_replace(' ','',strip_tags($tabTmp4[1]))),
|
||
'adresse'=>trim(str_replace(' ','',strip_tags($tabTmp4[2]))),
|
||
'cpVille'=>trim(str_replace(' ','',strip_tags($tabTmp4[3]))));
|
||
}
|
||
$tabRet['procedures'][$nproc]=array('type'=>trim(strip_tags($tabTmp3[0])),
|
||
'date'=>trim(strip_tags($tabTmp3[1])),
|
||
'intervenant'=>$tabInter);
|
||
}
|
||
}
|
||
else $tabRet['procol']=false;
|
||
|
||
// Dirigeants
|
||
$strTmp=@getTextInHtml($this->body, '<B>Les dirigeants</B></FONT>', "<img src='./images/rouge.gif' width=4 height=4 border='0'>",'</TABLE>');
|
||
$tabTmp=explode("<img src='./images/rouge.gif' width=4 height=4 border='0'>", $strTmp);
|
||
foreach ($tabTmp as $ndir=>$dir) {
|
||
$tabTmp2=explode('</TD>', $dir);
|
||
$tabTmp3=explode('</B> ', $tabTmp2[1]);
|
||
$nom=trim(strip_tags($tabTmp3[0]));
|
||
$prenom=trim(strip_tags($tabTmp3[1]));
|
||
$naiss=trim(strip_tags($tabTmp2[3]));
|
||
if (strpos($naiss, 'N<>(e) le')===false) {
|
||
$fonction=$naiss;
|
||
} else {
|
||
$tabTmp3=explode(' <20> ', $naiss);
|
||
$naiss_date=trim(str_replace('N<>(e) le ', '', strip_tags($tabTmp3[0])));
|
||
$naiss=trim(strip_tags($tabTmp3[1]));
|
||
$tabTmp3=explode('(', $naiss);
|
||
$naiss_ville=trim(strip_tags($tabTmp3[0]));
|
||
$naiss_depPays=trim(str_replace(')','', strip_tags($tabTmp3[1])));
|
||
$fonction=trim(strip_tags($tabTmp2[5]));
|
||
}
|
||
$tabRet['dirigeants'][$ndir]=array( 'nom'=>$nom,
|
||
'prenom'=>$prenom,
|
||
'naiss_date'=>$naiss_date,
|
||
'naiss_ville'=>$naiss_ville,
|
||
'naiss_depPays'=>$naiss_depPays,
|
||
'fonction'=>$fonction);
|
||
}
|
||
|
||
// Dirigeants - Administrateurs
|
||
$strTmp=trim(@getTextInHtml($this->body, '<B>Les administrateurs</B></FONT>', "<img src='./images/rouge.gif' width=4 height=4 border='0'>",'</TABLE>'));
|
||
if ($strTmp<>'') {
|
||
$tabTmp=explode("<img src='./images/rouge.gif' width=4 height=4 border='0'>", $strTmp);
|
||
foreach ($tabTmp as $nadm=>$dir) {
|
||
$tabTmp2=explode('</TD>', $dir);
|
||
$tabTmp3=explode('</B> ', $tabTmp2[1]);
|
||
$nom=trim(strip_tags($tabTmp3[0]));
|
||
$prenom=trim(strip_tags($tabTmp3[1]));
|
||
$naiss=trim(strip_tags($tabTmp2[3]));
|
||
if (strpos($naiss, 'N<>(e) le')===false) {
|
||
$naiss_date=$naiss_ville=$naiss_depPays='';
|
||
$fonction=$naiss;
|
||
} else {
|
||
$tabTmp3=explode(' <20> ', $naiss);
|
||
$naiss_date=trim(str_replace('N<>(e) le ', '', strip_tags($tabTmp3[0])));
|
||
$naiss=trim(strip_tags($tabTmp3[1]));
|
||
$tabTmp3=explode('(', $naiss);
|
||
$naiss_ville=trim(strip_tags($tabTmp3[0]));
|
||
$naiss_depPays=trim(str_replace(')','', strip_tags($tabTmp3[1])));
|
||
$fonction=trim(strip_tags($tabTmp2[5]));
|
||
}
|
||
$tabRet['dirigeants'][$nadm+$ndir+1]=array( 'nom'=>$nom,
|
||
'prenom'=>$prenom,
|
||
'naiss_date'=>$naiss_date,
|
||
'naiss_ville'=>$naiss_ville,
|
||
'naiss_depPays'=>$naiss_depPays,
|
||
'fonction'=>$fonction);
|
||
}
|
||
}
|
||
|
||
// Etablissements
|
||
$strTmp=@getTextInHtml($this->body, '<B>Les <20>tablissements</B></FONT>', "<img src='./images/rouge.gif' width=4 height=4 border='0'>",'</TABLE>');
|
||
$tabTmp=explode("<img src='./images/rouge.gif' width=4 height=4 border='0'>", $strTmp);
|
||
foreach ($tabTmp as $netab=>$dir) {
|
||
$cp=$ville=$ensEtab=''; $j=0;
|
||
$tabTmp2=explode('</TD>', $dir);
|
||
for($i=1; $i<=9; $i=$i+2) {
|
||
$next=$i+2;
|
||
$strTmp=trim(strip_tags($tabTmp2[$i]));
|
||
if (preg_match("/^([0-9]{5,5})([\D]*)/i", $strTmp, $matches)) {
|
||
$adresse[$j]='';
|
||
$cp=trim($matches[1]);
|
||
$ville=trim($matches[2]);
|
||
break;
|
||
} else
|
||
$adresse[$j]=$strTmp;
|
||
|
||
$j++;
|
||
}
|
||
/** Gestion des cas o<> la 1<>re ligne d'adresse contient l'enseigne de l'<27>tablissement */
|
||
if (strtoupper($adresse[0])==strtoupper($tabRet['enseigne'])) {
|
||
$ensEtab=$adresse[0];
|
||
array_shift($adresse);
|
||
}
|
||
$strTmp=trim(strip_tags($tabTmp2[$next]));
|
||
$tabTmp3=explode(' - ', $strTmp);
|
||
$tabRet['etablissements'][$netab]=array( 'enseigne'=>$ensEtab,
|
||
'adresse1'=>$adresse[0],
|
||
'adresse2'=>$adresse[1],
|
||
'adresse3'=>$adresse[2],
|
||
'cp'=>$cp,
|
||
'ville'=>$ville,
|
||
'naf_code'=>$tabTmp3[0],
|
||
'naf_lib'=>$tabTmp3[1]);
|
||
}
|
||
|
||
$fp=fopen('./euridile_identite.log', 'w');
|
||
fwrite($fp,print_r($page,true));
|
||
fclose($fp);
|
||
return $tabRet;
|
||
}
|
||
|
||
private function partBilan($idBilanPart) {
|
||
if ($this->curPage<>'vitrine')
|
||
$this->partVitrine();
|
||
$url=$this->urlRacine.'/'.$this->weur."/paie_abonnes_livraison_directe_informations.ow?flag_type_acces_direct_infos=$idBilanPart&WRNCSRV2=".$this->wrncsrv2;
|
||
|
||
$page=getUrl($url, '', '', $this->referer, false, 'www.euridile.com');
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
|
||
if (preg_match('/<META HTTP-EQUIV="Refresh" CONTENT="0; URL=(.*)"/i', $this->body, $matches))
|
||
$this->url=$matches[1];
|
||
else die('Erreur redir vers Bilan INPI');
|
||
$page=getUrl($this->url, '', '',$this->referer, false);
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
|
||
$urlInpi='http://modules.euridile.inpi.fr';
|
||
|
||
// http://modules.euridile.inpi.fr/accesproduits.ow?MODUSRV1=2701291735122345
|
||
if (preg_match('/<META HTTP-EQUIV="Refresh" CONTENT="0; URL=(.*)"/i', $this->body, $matches))
|
||
$this->url=$urlInpi.'/'.$matches[1];
|
||
else die('Erreur redir vers Bilan INPI 2');
|
||
$page=getUrl($this->url, '', '',$this->referer, false);
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
$tabTmp=explode('=', $this->url);
|
||
$modusrv1=$tabTmp[1];
|
||
|
||
// http://modules.euridile.inpi.fr/analyse/TOTAL_BILAN/f_total_bilan.ow?MODUSRV1=2701221057921108
|
||
if (preg_match('/<META HTTP-EQUIV="Refresh" CONTENT="0; URL=(.*)"/i', $this->body, $matches))
|
||
$this->url=$urlInpi.$matches[1];
|
||
else die('Erreur redir vers Bilan INPI 3');
|
||
$page=getUrl($this->url, '', '',$this->referer, false);
|
||
$this->referer=$this->url;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
//*die($this->url);
|
||
|
||
getUrl($urlInpi.'/analyse/TOTAL_BILAN/menu.ow?MODUSRV1='.$modusrv1,'', '', $this->referer, false);
|
||
$page=getUrl($urlInpi.'/comptesAvecContexte.ow?MODUSRV1='.$modusrv1,'','',$this->referer, false);
|
||
$this->referer=$urlInpi.'/analyse/TOTAL_BILAN/menu.ow?MODUSRV1='.$modusrv1;
|
||
$this->body=$page['body'];
|
||
$this->codeRetour=$page['code'];
|
||
$this->header=$page['header'];
|
||
|
||
$tabTmp=explode('|', $idBilanPart);
|
||
$dateBilan=$tabTmp[1];
|
||
$tabBilan=array();
|
||
$tabBilan['SIREN']=$this->siren;
|
||
$tabBilan['DATE_FRAICHE_BILAN']=date('Ymd');
|
||
$tabBilan['DATE_CLOTURE']=$dateBilan;
|
||
switch ($tabTmp[2]) {
|
||
case 'SC': // Bilans r<>els Normal
|
||
$tabBilan['TYPE_BILAN']='N';
|
||
// http://modules.euridile.inpi.fr/comptesAvecContexte.ow?MODUSRV1=2712291618629017&PAGE=ACTIFSC (d<>j<EFBFBD> vue)
|
||
$page=getUrl($urlInpi.'/comptesAvecContexte.ow?MODUSRV1='.$modusrv1.'&PAGE=PASSIFSC','','',$this->referer, false);
|
||
$this->body.=$page['body'];
|
||
sleep(1);
|
||
$page=getUrl($urlInpi.'/comptesAvecContexte.ow?MODUSRV1='.$modusrv1.'&PAGE=CPTRESSC','','',$this->referer, false);
|
||
$this->body.=$page['body'];
|
||
sleep(1);
|
||
$page=getUrl($urlInpi.'/comptesAvecContexte.ow?MODUSRV1='.$modusrv1.'&PAGE=ANXSC','','',$this->referer, false);
|
||
$this->body.=$page['body'];
|
||
/** Lecture et d<>coupage du bilan
|
||
**/
|
||
$body=strtoupper($this->body);
|
||
preg_match_all('/bgcolor="#e6efff"><FONT SIZE=-1>([A-Z0-9]{2,2})(?:<\/font>|)<\/TD>/i', $body, $matches);
|
||
$tabP=$matches[1];
|
||
$tabPostes=array();
|
||
foreach ($tabP as $iPoste=>$poste) {
|
||
if ($poste<>'ZR') {
|
||
$strTmp=str_replace("\n",'',@getTextInHtml($body, 'BGCOLOR="#E6EFFF"><FONT SIZE=-1>'.$poste, ' ','</TR>'));
|
||
$strTmp2=preg_replace('/bgcolor="#e6efff"><FONT SIZE=-1>(?:[A-Z0-9]{2,2})(?:<\/font>|)<\/TD>(.*)/i', '', $strTmp);
|
||
$tabTmp=explode(' ', $strTmp2);
|
||
for ($j=0; $j<3;$j++) {
|
||
if ($j==0) $indice='';
|
||
elseif ($j==1) $indice=1;
|
||
else $indice=2;
|
||
if (isset($tabTmp[$j])) {
|
||
$tabPostes[$poste.$indice]=trim(str_replace(' ', '',
|
||
str_replace('-->', '',
|
||
str_replace('&NBSP;', '',
|
||
strip_tags($tabTmp[$j])))));
|
||
if ($tabPostes[$poste.$indice]=='') unset($tabPostes[$poste.$indice]);
|
||
elseif (!is_numeric($tabPostes[$poste.$indice])) unset($tabPostes[$poste.$indice]);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
$strTmp=@getTextInHtml($this->body, 'Montants exprim<69>s en :<b> ', '<TRANSLATE COD=1756>','</TRANSLATE>');
|
||
//milliers d'Euros (KE)
|
||
$tabTmp=explode('(', $strTmp);
|
||
if ($tabTmp[1]=='KE)') {
|
||
$tabBilan['MONNAIE']='EUR';
|
||
$tabBilan['MONNAIE_ORI']='EUR';
|
||
$tabBilan['MONNAIE_LIV_UNITE']='K';
|
||
} else die('Devise INPI non g<>r<EFBFBD>e : '.$strTmp);
|
||
$tabBilan['DATE_CLOTURE_PRE']=@getTextInHtml($this->body, 'Exercices, clos le : </td>', '<b> ','</b></td>');
|
||
$tabBilan['DUREE_MOIS']=@getTextInHtml($this->body, 'Dur<75>e des exercices : </td><td align=center colspan=2 width=100>', '<b>','</b>');
|
||
$tabBilan['DUREE_MOIS_PRE']=@getTextInHtml($this->body, 'Dur<75>e des exercices : </td><td align=center colspan=2 width=100>', '<b> ','</b></td>');
|
||
$tabBilan['POSTES']=$tabPostes;
|
||
|
||
break;
|
||
case 'SS': // Bilans r<>els simplifi<66>s
|
||
$tabBilan['TYPE_BILAN']='S';
|
||
//http://modules.euridile.inpi.fr/comptesAvecContexte.ow?MODUSRV1=2712250539227157&PAGE=ACTPASSS (d<>j<EFBFBD> vue)
|
||
$page=getUrl($urlInpi.'/comptesAvecContexte.ow?MODUSRV1='.$modusrv1.'&PAGE=CPTRESSS','','',$this->referer, false);
|
||
$this->body.=$page['body'];
|
||
sleep(1);
|
||
$page=getUrl($urlInpi.'/comptesAvecContexte.ow?MODUSRV1='.$modusrv1.'&PAGE=IMMAMOSS','','',$this->referer, false);
|
||
$this->body.=$page['body'];
|
||
|
||
/** Lecture et d<>coupage du bilan
|
||
**/
|
||
$body=strtoupper($this->body);
|
||
preg_match_all('/bgcolor="#e6efff"><FONT SIZE=-1>([0-9]{3,3})(?:<\/font>|)<\/TD>/i', $body, $matches);
|
||
$tabP=$matches[1];
|
||
$tabPostes=array();
|
||
foreach ($tabP as $iPoste=>$poste) {
|
||
if ($poste<>'ZR') {
|
||
$poste=''.$poste;
|
||
$strTmp=str_replace("\n",'',@getTextInHtml($body, 'BGCOLOR="#E6EFFF"><FONT SIZE=-1>'.$poste, ' ','</TR>'));
|
||
$strTmp2=preg_replace('/bgcolor="#e6efff"><FONT SIZE=-1>(?:[0-9]{3,3})(?:<\/font>|)<\/TD>(.*)/i', '', $strTmp);
|
||
$tabTmp=explode(' ', $strTmp2);
|
||
for ($j=0; $j<3;$j++) {
|
||
if ($j==0) $indice='';
|
||
elseif ($j==1) $indice='a';
|
||
else $indice='b';
|
||
if (isset($tabTmp[$j])) {
|
||
$tabPostes[$poste.$indice]=trim(str_replace(' ', '',
|
||
str_replace('-->', '',
|
||
str_replace('&NBSP;', '',
|
||
strip_tags($tabTmp[$j])))));
|
||
if ($tabPostes[$poste.$indice]=='') unset($tabPostes[$poste.$indice]);
|
||
elseif (!is_numeric($tabPostes[$poste.$indice])) unset($tabPostes[$poste.$indice]);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
$strTmp=@getTextInHtml($this->body, 'Montants exprim<69>s en :<b> ', '<TRANSLATE COD=1756>','</TRANSLATE>');
|
||
//milliers d'Euros (KE)
|
||
$tabTmp=explode('(', $strTmp);
|
||
if ($tabTmp[1]=='KE)') {
|
||
$tabBilan['MONNAIE']='EUR';
|
||
$tabBilan['MONNAIE_ORI']='EUR';
|
||
$tabBilan['MONNAIE_LIV_UNITE']='K';
|
||
} else die('Devise INPI non g<>r<EFBFBD>e : '.$strTmp);
|
||
$tabBilan['DATE_CLOTURE_PRE']=@getTextInHtml($this->body, 'Exercices, clos le : </td>','<td align=center width=80><b>','</b></td>');
|
||
$tabBilan['DUREE_MOIS']=@getTextInHtml($this->body, 'Dur<75>e des exercices : </td><td align=center colspan=1 width=80>', '<b>','</b>');
|
||
$tabBilan['DUREE_MOIS_PRE']=@getTextInHtml($this->body, 'Dur<75>e des exercices : </td><td align=center colspan=1 width=80>', '<b> ','</b></td>');
|
||
$tabBilan['POSTES']=$tabPostes;
|
||
|
||
break;
|
||
case 'CC': // Bilans Consolid<69>s
|
||
$tabBilan['TYPE_BILAN']='C';
|
||
// http://modules.euridile.inpi.fr/comptesAvecContexte.ow?MODUSRV1=2712304993629995&PAGE=ACTIFCC (d<>j<EFBFBD> vue)
|
||
$page=getUrl($urlInpi.'/comptesAvecContexte.ow?MODUSRV1='.$modusrv1.'&PAGE=PASSIFCC','','',$this->referer, false);
|
||
$this->body.=$page['body'];
|
||
sleep(1);
|
||
$page=getUrl($urlInpi.'/comptesAvecContexte.ow?MODUSRV1='.$modusrv1.'&PAGE=CPTRESCC','','',$this->referer, false);
|
||
$this->body.=$page['body'];
|
||
|
||
/** Lecture et d<>coupage du bilan
|
||
**/
|
||
$body=strtoupper($this->body);
|
||
preg_match_all('/bgcolor="#e6efff"><FONT SIZE=-1>([A-Z0-9]{2,2})(?:<\/font>|)<\/TD>/i', $body, $matches);
|
||
$tabP=$matches[1];
|
||
$tabPostes=array();
|
||
foreach ($tabP as $iPoste=>$poste) {
|
||
if ($poste<>'ZR') {
|
||
$strTmp=str_replace("\n",'',@getTextInHtml($body, 'BGCOLOR="#E6EFFF"><FONT SIZE=-1>'.$poste, ' ','</TR>'));
|
||
$strTmp2=preg_replace('/bgcolor="#e6efff"><FONT SIZE=-1>(?:[A-Z0-9]{2,2})(?:<\/font>|)<\/TD>(.*)/i', '', $strTmp);
|
||
$tabTmp=explode(' ', $strTmp2);
|
||
for ($j=0; $j<3;$j++) {
|
||
if ($j==0) $indice='';
|
||
elseif ($j==1) $indice=1;
|
||
else $indice=2;
|
||
if (isset($tabTmp[$j])) {
|
||
$tabPostes[$poste.$indice]=trim(str_replace(' ', '',
|
||
str_replace('-->', '',
|
||
str_replace('&NBSP;', '',
|
||
strip_tags($tabTmp[$j])))));
|
||
if ($tabPostes[$poste.$indice]=='') unset($tabPostes[$poste.$indice]);
|
||
elseif (!is_numeric($tabPostes[$poste.$indice])) unset($tabPostes[$poste.$indice]);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
$strTmp=@getTextInHtml($this->body, 'Montants exprim<69>s en :<b> ', '<TRANSLATE COD=1756>','</TRANSLATE>');
|
||
//milliers d'Euros (KE)
|
||
$tabTmp=explode('(', $strTmp);
|
||
if ($tabTmp[1]=='KE)') {
|
||
$tabBilan['MONNAIE']='EUR';
|
||
$tabBilan['MONNAIE_ORI']='EUR';
|
||
$tabBilan['MONNAIE_LIV_UNITE']='K';
|
||
} else die('Devise INPI non g<>r<EFBFBD>e : '.$strTmp);
|
||
$tabBilan['DATE_CLOTURE_PRE']=@getTextInHtml($this->body, 'Exercices, clos le : </td>', '<td align=center width=100><FONT SIZE=-1><b>','</b><FONT></td>');
|
||
$tabBilan['DUREE_MOIS']=@getTextInHtml($this->body, 'Dur<75>e des exercices : </td><td align=center colspan=2 width=100>', '<b>','</b>');
|
||
$tabBilan['DUREE_MOIS_PRE']=@getTextInHtml($this->body, 'Dur<75>e des exercices : </td><td align=center colspan=2 width=100>', '<b> ','</b></font></td>');
|
||
$tabBilan['POSTES']=$tabPostes;
|
||
|
||
break;
|
||
default:
|
||
return array();
|
||
break;
|
||
}
|
||
|
||
$this->curPage='bilan';
|
||
|
||
$fp=fopen('./euridile_bilan.log', 'w');
|
||
fwrite($fp,$this->body);
|
||
fclose($fp);
|
||
|
||
return $tabBilan;
|
||
}
|
||
|
||
function bilanSimplifie2Normal($bilanRS) {
|
||
$bilanRN=array();
|
||
foreach ($this->tabBS2BN as $posteRN => $formule) {
|
||
if (preg_match('/\+|\-/', $formule)) {
|
||
$tabTmp=preg_split('/\+|\-/', $formule, -1, PREG_SPLIT_OFFSET_CAPTURE);
|
||
//$bilanRN[$posteRN]=0;
|
||
$scalc='';
|
||
foreach ($tabTmp as $i=>$tab) {
|
||
if ($i==0) {
|
||
$bilanRN[$posteRN]=$bilanRS[$tab[0]];
|
||
$scalc.=$bilanRS[$tab[0]];
|
||
}
|
||
else {
|
||
$signe=$formule[$tab[1]-1];
|
||
$scalc.=$signe;
|
||
if ($signe=='+') $bilanRN[$posteRN]+=$bilanRS[$tab[0]];
|
||
elseif ($signe=='-') $bilanRN[$posteRN]-=$bilanRS[$tab[0]];
|
||
$scalc.=$bilanRS[$tab[0]];
|
||
}
|
||
}
|
||
$bilanRN[$posteRN]=$bilanRN[$posteRN]." (formule=$formule soit $scalc)";
|
||
}
|
||
else $bilanRN[$posteRN]=$bilanRS[$formule];
|
||
}
|
||
if ($bilanRS['240']<>0) {
|
||
$bilanRN['BL']=$bilanRS['050'];
|
||
$bilanRN['BM']=$bilanRS['052'];
|
||
} else {
|
||
$bilanRN['BN']=$bilanRS['050'];
|
||
$bilanRN['BO']=$bilanRS['052'];
|
||
}
|
||
|
||
if ($bilanRS['070']<>0 || $bilanRS['074']<>0 || $bilanRS['052']<>0 || $bilanRS['062']<>0)
|
||
$bilanRN['GC']=$bilanRS['256'];
|
||
elseif ($bilanRS['070']==0 && $bilanRS['074']==0 && $bilanRS['052']==0 && $bilanRS['062']==0 && $bilanRS['254']<>0)
|
||
$bilanRN['GD']=$bilanRS['256'];
|
||
|
||
if ($bilanRS['584']<>0) {
|
||
$bilanRN['HB']=$bilanRS['584'];
|
||
$bilanRN['HA']=$bilanRS['290']-$bilanRS['584'];
|
||
} else
|
||
$bilanRN['HA']=$bilanRS['290'];
|
||
|
||
if ($bilanRS['582']<>0) {
|
||
$bilanRN['HF']=$bilanRS['582'];
|
||
$bilanRN['HE']=$bilanRS['582']-$bilanRS['300'];
|
||
} else
|
||
$bilanRN['HE']=$bilanRS['300'];
|
||
|
||
return $bilanRN;
|
||
}
|
||
|
||
private function partSaveSession() {
|
||
$fp=fopen('/tmp/php_rncs_session.id', 'w');
|
||
fwrite($fp,$this->wrncsrv2.'^'.$this->timeOut.'^'.$this->curPage.'^'.$this->siren.'^'.$this->url.'^'.$this->referer);
|
||
fclose($fp);
|
||
}
|
||
|
||
private function partGetSession() {
|
||
$strTmp=@file_get_contents('/tmp/php_rncs_session.id');
|
||
if ($strTmp) {
|
||
$tabTmp=explode('^', $strTmp);
|
||
$this->wrncsrv2=$tabTmp[0];
|
||
$this->timeOut=$tabTmp[1];
|
||
$this->curPage=$tabTmp[2];
|
||
$this->siren=$tabTmp[3];
|
||
$this->url=$tabTmp[4];
|
||
$this->referer=$tabTmp[5];
|
||
} else $this->timeOut=0;
|
||
|
||
|
||
}
|
||
|
||
}
|
||
|
||
|
||
?>
|