2009-04-07 17:44:17 +00:00
|
|
|
|
<?php
|
2009-04-20 16:32:11 +00:00
|
|
|
|
session_start();
|
2009-04-07 17:44:17 +00:00
|
|
|
|
if (!$_SESSION['connected']) die();
|
|
|
|
|
|
2009-04-16 16:34:13 +00:00
|
|
|
|
$tabInfo = $_SESSION['tabInfo'];
|
|
|
|
|
|
2009-04-07 17:44:17 +00:00
|
|
|
|
$identifier = $_REQUEST['identifier'];
|
|
|
|
|
$CompanyProductIdentifier = $_REQUEST['pidentifier'];
|
|
|
|
|
|
2009-04-20 16:32:11 +00:00
|
|
|
|
require_once 'i18n/cleanchar.php';
|
2009-04-07 17:44:17 +00:00
|
|
|
|
require_once 'graydon/graydonws.php';
|
2009-04-24 14:14:48 +00:00
|
|
|
|
require_once 'graydon/log.php';
|
2009-04-07 17:44:17 +00:00
|
|
|
|
|
2009-04-20 12:41:56 +00:00
|
|
|
|
function dVal($value){
|
|
|
|
|
if($value == '' || $value == NULL){
|
|
|
|
|
print 'NC';
|
|
|
|
|
}else{
|
|
|
|
|
print $value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
<div id="center">
|
|
|
|
|
<?php
|
|
|
|
|
|
2009-04-09 17:10:02 +00:00
|
|
|
|
$path = PATH_DATA.'/graydon';
|
2009-04-20 12:41:56 +00:00
|
|
|
|
$fileName = strtolower(str_replace( array(':',' '), '-', $identifier).'.xml');
|
2009-04-07 17:44:17 +00:00
|
|
|
|
|
2009-04-09 17:10:02 +00:00
|
|
|
|
if(!file_exists($path.'/'.$fileName)){
|
|
|
|
|
/*
|
|
|
|
|
placeOrder
|
|
|
|
|
CompanyProductIdentifier
|
|
|
|
|
Language
|
|
|
|
|
CreditOpinionCurrency
|
|
|
|
|
Country
|
|
|
|
|
|
|
|
|
|
getCompanyReport
|
|
|
|
|
OrderReference
|
|
|
|
|
MimeType
|
|
|
|
|
*/
|
|
|
|
|
//placeOrder
|
2009-04-07 17:44:17 +00:00
|
|
|
|
$request = new StdClass();
|
|
|
|
|
$request->Authentication_Parameters = $authentication;
|
2009-04-09 17:10:02 +00:00
|
|
|
|
$request->OrderCreatorEmail = 'mricois@scores-decisions.com';
|
|
|
|
|
$request->CompanyProductIdentifier = $CompanyProductIdentifier;
|
|
|
|
|
$request->PartnerData = '';
|
2009-04-07 17:44:17 +00:00
|
|
|
|
|
|
|
|
|
$firephp->log($request,'requete');
|
|
|
|
|
try
|
|
|
|
|
{
|
2009-04-09 17:10:02 +00:00
|
|
|
|
$placeOrderResult = $graydon->placeOrder($request);
|
2009-04-24 14:14:48 +00:00
|
|
|
|
|
|
|
|
|
//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);
|
|
|
|
|
|
2009-04-09 17:10:02 +00:00
|
|
|
|
$firephp->log($placeOrderResult,'placeOrder');
|
2009-04-24 14:14:48 +00:00
|
|
|
|
|
2009-04-16 16:34:13 +00:00
|
|
|
|
}catch( SoapFault $fault ){
|
|
|
|
|
require_once 'soaperror.php';
|
|
|
|
|
processSoapFault($client,$fault,$tabInfo);
|
2009-04-07 17:44:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-04-09 17:10:02 +00:00
|
|
|
|
//On v<>rifie l'<27>tat de le demande
|
|
|
|
|
if (isset($placeOrderResult) && $placeOrderResult->OrderStatus->OrderState == 'Completed'){
|
|
|
|
|
//getCompanyReport
|
|
|
|
|
$request = new StdClass();
|
|
|
|
|
$request->Authentication_Parameters = $authentication;
|
|
|
|
|
$request->LanguageCode = 'E'; //Sp<53>cifier la langue du rapport
|
|
|
|
|
$request->OrderReference = $placeOrderResult->OrderStatus->OrderReference;
|
|
|
|
|
$request->MimeType = 'xml';
|
|
|
|
|
|
|
|
|
|
$firephp->log($request,'requete');
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
$reportResult = $graydon->getCompanyReport($request);
|
2009-04-24 14:14:48 +00:00
|
|
|
|
|
|
|
|
|
//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);
|
|
|
|
|
|
2009-04-09 17:10:02 +00:00
|
|
|
|
$firephp->log($reportResult,'reportResult');
|
|
|
|
|
$xml = $reportResult->ReportXML;
|
|
|
|
|
|
|
|
|
|
//Enregistrement du fichier xml
|
|
|
|
|
$xml = $reportResult->ReportXML->any;
|
|
|
|
|
file_put_contents($path.'/'.$fileName, $xml);
|
|
|
|
|
|
2009-04-16 16:34:13 +00:00
|
|
|
|
}catch( SoapFault $fault ){
|
|
|
|
|
require_once 'soaperror.php';
|
|
|
|
|
processSoapFault($client,$fault,$tabInfo);
|
|
|
|
|
die();
|
2009-04-09 17:10:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//On prend les donn<6E>es du fichier
|
|
|
|
|
}else{
|
|
|
|
|
$firephp->log('Data depuis fichier XML');
|
|
|
|
|
$xml = file_get_contents($path.'/'.$fileName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//========= Affichage des informations =========
|
|
|
|
|
if(isset($xml) && $xml!=''){
|
|
|
|
|
|
2009-04-24 09:48:19 +00:00
|
|
|
|
$tabReport = array();
|
|
|
|
|
|
2009-04-24 09:52:30 +00:00
|
|
|
|
require_once 'graydon/functions.php';
|
2009-04-24 09:48:19 +00:00
|
|
|
|
require_once 'graydon/format.php';
|
2009-04-09 17:10:02 +00:00
|
|
|
|
//Cr<43>ation du DOM
|
|
|
|
|
$doc = new DOMDocument;
|
|
|
|
|
$doc->preserveWhiteSpace = false;
|
|
|
|
|
$doc->loadxml($xml);
|
|
|
|
|
$xpath = new DOMXPath($doc);
|
2009-04-23 06:53:26 +00:00
|
|
|
|
|
|
|
|
|
$tabReport = parseReportXML($xml);
|
|
|
|
|
$firephp->log($tabReport, 'tabReport');
|
2009-04-20 16:32:11 +00:00
|
|
|
|
function utf8decode_deep($value)
|
|
|
|
|
{
|
|
|
|
|
$value = is_array($value) ?
|
|
|
|
|
array_map('utf8decode_deep', $value) :
|
|
|
|
|
cleanutf8($value);
|
|
|
|
|
return $value;
|
|
|
|
|
}
|
|
|
|
|
|
2009-04-16 16:34:13 +00:00
|
|
|
|
?>
|
2009-04-09 17:10:02 +00:00
|
|
|
|
|
2009-04-24 09:48:19 +00:00
|
|
|
|
<h1 class="titre">IDENTITÉ INTERNATIONALE DE L'ENTREPRISE</h1>
|
|
|
|
|
<?php dIdentifiant($tabReport); ?>
|
2009-04-20 12:41:56 +00:00
|
|
|
|
<h2>Raison sociale et coordonn<EFBFBD>es : </h2>
|
2009-04-24 09:48:19 +00:00
|
|
|
|
<?php dIdentite($tabReport);?>
|
2009-04-20 12:41:56 +00:00
|
|
|
|
<h2>Activit<EFBFBD>(s) et chiffre d'affaire de l'entreprise : </h2>
|
2009-04-24 09:48:19 +00:00
|
|
|
|
<?php dActivite($tabReport); ?>
|
|
|
|
|
<h2> R<EFBFBD>sum<EFBFBD> financier : </h2>
|
|
|
|
|
<?php dResume($tabReport); ?>
|
|
|
|
|
<h2> Credit : </h2>
|
|
|
|
|
<?php dCredit($tabReport); ?>
|
2009-04-07 17:44:17 +00:00
|
|
|
|
<?php
|
|
|
|
|
}else{
|
|
|
|
|
?>
|
2009-04-20 12:41:56 +00:00
|
|
|
|
<table>
|
2009-04-07 17:44:17 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
|
|
|
|
<td width="500" class="StyleInfoLib">Aucune information disponible.</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</table>
|
2009-04-20 12:41:56 +00:00
|
|
|
|
</div>
|
2009-04-07 17:44:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|