from('Matchidentifiers') ->where('country = ?', $pays); $matchidentifiers = new Matchidentifiers(); $matchidentifiers = $q->fetchOne(); /** Recup des types d'identifiants pour le pays **/ if($matchidentifiers == FALSE){ //Récupération des intitulés identifiant $request = new StdClass(); $request->Authentication_Parameters = $authentication; $request->Country = $pays; $firephp->log($request,'REQUETE CompanyMatchIdentifier'); try { $result = $graydon->getCompanyMatchIdentifiers($request); //Enregistrement de l'action dans les logs $transactionIdentifier = $result->Service_Log->TransactionIdentifier; $sessionID = $result->Service_Log->SessionID; graydonRequeteLog($_SESSION['tabInfo']['login'], $page, 'getCompanyMatchIdentifiers', $transactionIdentifier, $sessionID); //Log de la requete dans la bdd setDbConn('graydon'); $log = new Requetelog(); $log->login = $_SESSION['tabInfo']['login']; $log->action = 'getCompanyMatchIdentifiers'; $log->request = serialize($request); $log->transactionIdentifier = $transactionIdentifier; $log->sessionID = $sessionID; $log->mode = $mode; $log->save(); $count = count($result->CompanyMatchIdentifiers); if ($count>1){ $tabIdentifiers = $result->CompanyMatchIdentifiers->CompanyMatchIdentifier->CompanyIdentifier; }elseif($count==1){ $tabIdentifiers[] = $result->CompanyMatchIdentifiers->CompanyMatchIdentifier->CompanyIdentifier; } //Stockage du résultat de la méthode en cache $matchidentifiers = new Matchidentifiers(); $matchidentifiers->country = $pays; $matchidentifiers->identifiers = serialize($tabIdentifiers); $matchidentifiers->replace(); }catch( SoapFault $fault ){ $code = $fault->detail->GraydonCompanyData_Fault->FaultReturnCode; $text = $fault->detail->GraydonCompanyData_Fault->FaultMessage; $firephp->log($text,'texterror'); require_once 'graydon/graydon_error.php'; if(graydon_error($code, $text)==FALSE){ graydon_processSoapFault($graydon,$fault,$tabInfo); } } }else{ $tabIdentifiers = unserialize($matchidentifiers->identifiers); } $firephp->log($tabIdentifiers,'tabIdentifiers'); /** Recup des produits de la company **/ setDbConn('graydon'); $q = Doctrine_Query::create() ->from('Companyproducts') ->where('identifiers = ?', $identifier); $companyproducts = new Companyproducts(); $companyproducts = $q->fetchOne(); $firephp->log($companyproducts->updated_at,'date'); $now = mktime(date('G'), date('i'), date('s'), date("m") , date("d"), date("Y")); if($companyproducts == FALSE){ $request = new StdClass(); $request->Authentication_Parameters = $authentication; $request->CompanyMatchIdentifier = $identifier; $firephp->log($request,'requete'); try { // Make a request on the web service $result = $graydon->getCompanyProducts($request); //Enregistrement de l'action dans les logs $transactionIdentifier = $result->Service_Log->TransactionIdentifier; $sessionID = $result->Service_Log->SessionID; graydonRequeteLog($_SESSION['tabInfo']['login'], $page, 'getCompanyProducts', $transactionIdentifier, $sessionID); //Log de la requete dans la bdd setDbConn('graydon'); $log = new Requetelog(); $log->login = $_SESSION['tabInfo']['login']; $log->action = 'getCompanyProducts'; $log->request = serialize($request); $log->transactionIdentifier = $transactionIdentifier; $log->sessionID = $sessionID; $log->mode = $mode; $log->save(); $firephp->log($result,'result'); //Sauvegarde dans la bdd setDbConn('graydon'); $companyproducts = new Companyproducts(); $companyproducts->identifiers = $identifier; $companyproducts->company = serialize($result->Company); $companyproducts->products = serialize($result->Products); $companyproducts->replace(); //Extraction $company = $result->Company; $products = $result->Products->Product; }catch( SoapFault $fault ){ $code = $fault->detail->GraydonCompanyData_Fault->FaultReturnCode; $text = $fault->detail->GraydonCompanyData_Fault->FaultMessage; $firephp->log($text,'texterror'); require_once 'graydon/graydon_error.php'; if(graydon_error($code, $text)==FALSE){ graydon_processSoapFault($graydon,$fault,$tabInfo); } } }else{ $company = unserialize($companyproducts->company); $products = unserialize($companyproducts->products); $products = $products->Product; } if(isset($company)){ $firephp->log($products,'products'); ?>

IDENTITÉ INTERNATIONALE DE L'ENTREPRISE

CompanyIdentifiers->CompanyIdentifier); if ($count>1){ $identifiers = $company->CompanyIdentifiers->CompanyIdentifier; }elseif($count==1){ $identifiers[] = $company->CompanyIdentifiers->CompanyIdentifier; } foreach($identifiers as $identifier){ if($identifier->Type != 'Internal'){ ?>
  Fiche identité simplifié
Accès à la fiche identité approfondie : ServiceSpeed == 'Normal' && $product->Type == 'Investigation' && $product->Level == 4 ){ $tabReport[$countProducts] = 'Normal'; $tabProducts[$countProducts]['identifier'] = $product->CompanyProductIdentifier; $tabProducts[$countProducts]['DaysFrom'] = $product->DaysFrom; $tabProducts[$countProducts]['DaysTo'] = $product->DaysTo; $countProducts++; } //Rapport en mode Superflash if ($product->ServiceSpeed == 'Superflash' && $product->Type == 'Investigation' && $product->Level == 4 ){ $tabReport[] = 'Superflash'; $tabProducts[$countProducts]['identifier'] = $product->CompanyProductIdentifier; $tabProducts[$countProducts]['DaysFrom'] = $product->DaysFrom; $tabProducts[$countProducts]['DaysTo'] = $product->DaysTo; $countProducts++; } //Rapport disponible avec mise à jour if ($product->ServiceSpeed == 'ImmediateWithUpdate' && $product->Type == 'Database' && $product->Level == 3 ){ require_once 'phpmailer/class.phpmailer.php'; $mail = new PHPMailer(); $mail->From = "contact@scores-decisions.com"; $mail->FromName = "Serveur SD-13408"; $mail->Host = "mail.scores-decisions.com"; $mail->Mailer = "smtp"; $mail->Subject = "Rapport International"; $body = "ImmediateWithUpdate disponible\n"; $body .= "Identifiant : ".$identifier.""; $mail->MsgHTML($body); $mail->AddAddress(EMAIL_SUPPORTDEV, "Support"); $mail->Send(); //Don't display ImmediateWithUpdate /* $mimetype = FALSE; if (is_array($product->MimeTypes->MimeType)){ if (in_array('xml', $product->MimeTypes->MimeType)){$mimetype = TRUE;} }else{ if ($product->MimeTypes->MimeType == 'xml' ){$mimetype = TRUE;} } if ($mimetype == TRUE ){ $tabReport[] = 'ImmediateWithUpdate'; $tabProducts[$countProducts]['identifier'] = $product->CompanyProductIdentifier; $tabProducts[$countProducts]['DaysFrom'] = $product->DaysFrom; $tabProducts[$countProducts]['DaysTo'] = $product->DaysTo; $countProducts++; } */ } //Rapport disponible en ligne if ($product->ServiceSpeed == 'Immediate' && $product->Type == 'Database' && $product->Level == 3 ){ $mimetype = FALSE; if (is_array($product->MimeTypes->MimeType)){ if (in_array('xml', $product->MimeTypes->MimeType)){$mimetype = TRUE;} else { require_once 'phpmailer/class.phpmailer.php'; $mail = new PHPMailer(); $mail->From = "contact@scores-decisions.com"; $mail->FromName = "Serveur SD-13408"; $mail->Host = "mail.scores-decisions.com"; $mail->Mailer = "smtp"; $mail->Subject = "Rapport International"; $body = "Le rapport international disponible dans un autre format que le XML\n"; $body .= "Identifiant : ".$identifier.""; $mail->MsgHTML($body); $mail->AddAddress(EMAIL_SUPPORTDEV, "Support"); $mail->Send(); } }else{ if ($product->MimeTypes->MimeType == 'xml' ){$mimetype = TRUE;} else { require_once 'phpmailer/class.phpmailer.php'; $mail = new PHPMailer(); $mail->From = "contact@scores-decisions.com"; $mail->FromName = "Serveur SD-13408"; $mail->Host = "mail.scores-decisions.com"; $mail->Mailer = "smtp"; $mail->Subject = "Rapport International"; $body = "Le rapport international disponible dans un autre format que le XML\n"; $body .= "Identifiant : ".$identifier.""; $mail->MsgHTML($body); $mail->AddAddress(EMAIL_SUPPORTDEV, "Support"); $mail->Send(); } } if ($mimetype == TRUE ){ $tabReport[] = 'Immediate'; $tabProducts[$countProducts]['identifier'] = $product->CompanyProductIdentifier; $countProducts++; } } } $firephp->log($tabProducts,'tabProducts'); if(count($tabReport)==0){ ?> (Aucun rapport disponible pour cette société) from('Price p') ->leftJoin('p.Country c') ->where('c.graydon_country = ?', $pays); $tabPaysPrix = $q->fetchArray(); $firephp->log($tabPaysPrix, 'tableau'); if(in_array('Normal',$tabReport)){ $key = array_search('Normal', $tabReport); $pidentifier = $tabProducts[$key]['identifier']; $daysFrom = $tabProducts[$key]['DaysFrom']; $daysTo = $tabProducts[$key]['DaysTo']; print '

Commander le rapport en mode normal
(Délais : '.$daysFrom.' à '.$daysTo.' Jours, Tarif : '.$tabPaysPrix[0]['normal'].' €)'; } //Affichage des différents rapports dans l'ordre if(in_array('Superflash',$tabReport)){ $key = array_search('Superflash', $tabReport); $pidentifier = $tabProducts[$key]['identifier']; $daysFrom = $tabProducts[$key]['DaysFrom']; $daysTo = $tabProducts[$key]['DaysTo']; print '

Commander le rapport en mode rapide
(Délais : '.$daysFrom.' à '.$daysTo.' Jours, Tarif : '.$tabPaysPrix[0]['superflash'].' €)'; } if(in_array('Immediate',$tabReport)){ $key = array_search('Immediate', $tabReport); $pidentifier = $tabProducts[$key]['identifier']; print '

Consutler le rapport disponible
(Délais : Immédiat, Tarif : '.$tabPaysPrix[0]['immediate'].' €)'; } } ?>
 
  Type == $identifier->Type){ print $tabIdentifier->Description; $identifierDescription = TRUE; } } if ($identifierDescription==FALSE){ print $identifier->Type; } //@TODO : Tester si la condition à bien été remplie ?> Identifier; ?>
 

Raison sociale et coordonnées :

  Raison Sociale Name; print cleanutf8($company->Name); ?>
  Adresse Complète RegisteredAddress->EntireAddress); ?>
  Adresse RegisteredAddress->Building.', '.$company->RegisteredAddress->Street); ?>
  Code Postal RegisteredAddress->PostCode; ?>
  Ville RegisteredAddress->City); ?>
  Pays RegisteredAddress->Country)){ print $company->RegisteredAddress->Country; }else{ print $pays; } ?>
  Téléphone Telephone; ?>
 

Activité(s) de l'entreprise :

Activites->Activity); if ($count>1){ $activites = $company->Activites->Activity; }elseif($count==1){ $activites[] = $company->Activites->Activity; } if ($count>0){ foreach($activites as $activity){ ?>
  Code Type;?> Code;?> - Description);?>
  Aucune information disponible
 

Géolocalisation :

RegisteredAddress->Building; $codePostal = $company->RegisteredAddress->PostCode; $ville = $company->RegisteredAddress->City; */ /* try { $geoCodeResult = $client->geoCode('19 rue de saulnier', '75009', 'paris', 'france'); $firephp->log($geoCodeResult, 'geocode'); }catch(SoapFault $fault){ print '
';
		print $client->__getLastResponse();
		print '
'; } */ /* * Récupération du geoCode * La page est chargé alors par javascript on load en ajax * Chargement de la carte (nouvelle page loadMap.php ??) * loadMap => On vérifie la session * => On envoi le geocode ?? les markers supplémentaires */ ?>
  Aucune information disponible