from('Commandes') ->where('companyproductidentifier = ?', $CompanyProductIdentifier); $commandes = new Commandes(); $commandes = $q->fetchOne(); $nbReport = $q->count(); $report = new Report(); $report = $commandes->Report; $path = PATH_DATA.'/graydon'; $fileName = strtolower(str_replace( array(':',' '), '-', $identifier).'.xml'); if($nbReport==0){ /* placeOrder CompanyProductIdentifier Language CreditOpinionCurrency Country getCompanyReport OrderReference MimeType */ //placeOrder $request = new StdClass(); $request->Authentication_Parameters = $authentication; $request->OrderCreatorEmail = 'mricois@scores-decisions.com'; $request->CompanyProductIdentifier = $CompanyProductIdentifier; $request->PartnerData = ''; try { $placeOrderResult = $graydon->placeOrder($request); //Enregistrement de l'action dans les logs $transactionIdentifier = $placeOrderResult->Service_Log->TransactionIdentifier; $sessionID = $placeOrderResult->Service_Log->SessionID; graydonRequeteLog($_SESSION['tabInfo']['login'], $page, 'placeOrder', $transactionIdentifier, $sessionID); //Log de la requete dans la bdd $log = new Requetelog(); $log->login = $_SESSION['tabInfo']['login']; $log->action = 'placeOrder'; $log->request = serialize($request); $log->transactionIdentifier = $transactionIdentifier; $log->sessionID = $sessionID; $log->mode = $mode; $log->save(); //Enregistrement des commandes dans la bdd $commandes = new Commandes(); $commandes->reference = $placeOrderResult->OrderStatus->OrderReference; $commandes->orderstate = $placeOrderResult->OrderStatus->OrderState; $commandes->dateordered = $placeOrderResult->OrderStatus->DateOrdered; $commandes->datecompleted = $placeOrderResult->OrderStatus->DateCompleted; $commandes->datedue = $placeOrderResult->OrderStatus->DateDue; $commandes->servicespeed = $placeOrderResult->OrderStatus->Order->ServiceSpeed; $commandes->companyproductidentifier = $CompanyProductIdentifier; $commandes->sessionid = $sessionID; $commandes->transactionidentifier = $transactionIdentifier; $commandes->user = $tabInfo['login']; $commandes->mode = $_SESSION['graydon']['mode']; $country = Doctrine_Query::create() ->from('Country') ->where('country = ?', $pays) ->fetchOne(); $commandes->Country = $country; $commandes->save(); $firephp->log($commandes->toArray(),'dataCommandes'); $commandes_id = $commandes->id; //Pas d'enregistrement des détails de la commande car elle est immédiate //$firephp->log($placeOrderResult,'placeOrder'); }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); } } //On vérifie l'état de le demande if (isset($placeOrderResult) && $placeOrderResult->OrderStatus->OrderState == 'Completed'){ //getCompanyReport $request = new StdClass(); $request->Authentication_Parameters = $authentication; $request->LanguageCode = 'E'; //Spécifier la langue du rapport $request->OrderReference = $placeOrderResult->OrderStatus->OrderReference; $request->MimeType = 'xml'; $firephp->log($request,'requete'); try { $reportResult = $graydon->getCompanyReport($request); //Enregistrement de l'action dans les logs $transactionIdentifier = $reportResult->Service_Log->TransactionIdentifier; $sessionID = $reportResult->Service_Log->SessionID; graydonRequeteLog($_SESSION['tabInfo']['login'], $page, 'getCompanyReport', $transactionIdentifier, $sessionID); //Enregistrement dans la bdd $log = new Requetelog(); $log->login = $_SESSION['tabInfo']['login']; $log->action = 'getCompanyReport'; $log->request = serialize($request); $log->transactionIdentifier = $transactionIdentifier; $log->sessionID = $sessionID; $log->mode = $mode; $log->save(); $firephp->log($reportResult,'reportResult'); $xml = $reportResult->ReportXML->any; //Enregistrement du fichier xml file_put_contents($path.'/'.$fileName, $xml); //Mise en cache dans la bdd $report = new Report(); $report->identifier = $identifier; $report->name= $_SESSION['graydon']['name']; $report->content = $xml; $report->format = 'xml'; $report->order_id = $commandes_id; $report->save(); }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{ if($nbReport>0){ $xml = $report->content; }else{ $firephp->log('Data depuis fichier XML'); $xml = file_get_contents($path.'/'.$fileName); } } //========= Affichage des informations ========= if(isset($xml) && $xml!=''){ $tabReport = array(); require_once 'graydon/functions.php'; require_once 'graydon/format.php'; //Création du DOM $doc = new DOMDocument; $doc->preserveWhiteSpace = false; $doc->loadxml($xml); $xpath = new DOMXPath($doc); $tabReport = parseReportXML($xml); $firephp->log($tabReport, 'tabReport'); function utf8decode_deep($value) { $value = is_array($value) ? array_map('utf8decode_deep', $value) : cleanutf8($value); return $value; } ?>

IDENTITÉ INTERNATIONALE DE L'ENTREPRISE

Raison sociale et coordonnées :

Activité(s) et chiffre d'affaire de l'entreprise :

Résumé financier :

Credit :

Actionariat / Participation :

Bilans :

  Aucune information disponible.