'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)
".EOL; $fp=fopen('./euridile_connexion1.log', 'w'); fwrite($fp,print_r($page,true)); fclose($fp); if (preg_match('//i', $this->body, $matches)) $this->url=$this->urlRacine.'/'.$matches[1]; else debugLog('E','Redirection non trouvée sur la page '.$this->url,__LINE__,__FILE__,__FUNCTION__,__CLASS__); debugLog('I','Redirection trouvé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é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é',__LINE__,__FILE__,__FUNCTION__,__CLASS__); } else debugLog('E','Redirection impossible vers l\'espace abonné',__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é = $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('//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)
".EOL; if (preg_match('//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ée URL = $this->url (Code retour = $this->codeRetour)
".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('/
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ç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ès authentification = $this->url (Code retour = $this->codeRetour)
".EOL; $fp=fopen('./euridile_connexion3.log', 'w'); fwrite($fp,print_r($page,true)); fclose($fp); /* if (preg_match('/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é URL = $this->url (Code retour = $this->codeRetour)
".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)
".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)
".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é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é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 !
".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)
".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)
".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é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']=''; /*
*/ $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)
".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)
".EOL; return $tabRet; } echo date('Y/m/d - H:i:s') ." - Vitrine : Après recherche = $this->url (Code retour = $this->codeRetour)
".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)
".EOL; $this->curPage='vitrine'; $matches=explode("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é 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('/