2009-04-07 17:44:17 +00:00
|
|
|
|
<?php
|
2009-07-21 15:08:08 +00:00
|
|
|
|
if (!$_SESSION['connected']) die();
|
2009-04-07 17:44:17 +00:00
|
|
|
|
|
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-05-04 16:58:12 +00:00
|
|
|
|
$pays = $_SESSION['graydon']['pays'];
|
2009-05-11 09:52:19 +00:00
|
|
|
|
$mode = $_SESSION['graydon']['mode'];
|
2009-04-07 17:44:17 +00:00
|
|
|
|
|
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-05-07 14:31:17 +00:00
|
|
|
|
require_once 'graydon/graydon_log.php';
|
2009-05-04 16:58:12 +00:00
|
|
|
|
require_once 'dbbootstrap.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-05-11 15:55:28 +00:00
|
|
|
|
|
2009-05-12 16:57:43 +00:00
|
|
|
|
//V<>rifier si le rapport n'est pas disponible en base depuis une autre commandes
|
2009-05-14 16:44:01 +00:00
|
|
|
|
setDbConn('graydon');
|
2009-05-12 16:57:43 +00:00
|
|
|
|
$q = Doctrine_Query::create()
|
|
|
|
|
->from('Report')
|
|
|
|
|
->where('identifier = ?', $_REQUEST['identifier']);
|
|
|
|
|
$report = new Report();
|
|
|
|
|
$report = $q->fetchOne();
|
2009-05-11 15:55:28 +00:00
|
|
|
|
|
2009-05-12 16:57:43 +00:00
|
|
|
|
//@TODO : si le rapport existe d<>j<EFBFBD> ou que la date n'est pas tr<74>s <20>loign<67>
|
2009-05-14 16:44:01 +00:00
|
|
|
|
if($report==FALSE){
|
2009-10-02 09:12:06 +00:00
|
|
|
|
$firephp->info('Pas en cache');
|
2009-05-12 16:57:43 +00:00
|
|
|
|
//V<>rifier si le rapport en ligne <20> d<>j<EFBFBD> <20>t<EFBFBD> demand<6E>
|
|
|
|
|
$q = Doctrine_Query::create()
|
|
|
|
|
->from('Commandes')
|
|
|
|
|
->where('companyproductidentifier = ?', $CompanyProductIdentifier);
|
2009-07-21 15:08:08 +00:00
|
|
|
|
$commandes = new Commandes();
|
2009-05-12 16:57:43 +00:00
|
|
|
|
$commandes = $q->fetchOne();
|
|
|
|
|
$report = new Report();
|
|
|
|
|
$report = $commandes->Report;
|
2009-05-14 16:44:01 +00:00
|
|
|
|
if($commandes == FALSE && !isset($report->id)){
|
2009-10-02 09:12:06 +00:00
|
|
|
|
$xml = getIdentite($CompanyProductIdentifier, $path.'/'.$fileName);
|
2009-05-12 16:57:43 +00:00
|
|
|
|
//La commande <20> d<>j<EFBFBD> <20>t<EFBFBD> demand<6E>
|
|
|
|
|
}else{
|
|
|
|
|
$xml = $report->content;
|
2009-04-09 17:10:02 +00:00
|
|
|
|
}
|
2009-07-21 15:08:08 +00:00
|
|
|
|
//Le rapport est disponible
|
2009-04-09 17:10:02 +00:00
|
|
|
|
}else{
|
2009-10-02 09:12:06 +00:00
|
|
|
|
|
|
|
|
|
$country = Doctrine_Query::create()
|
|
|
|
|
->from('Country')
|
|
|
|
|
->where('graydon_country = ?', $pays)
|
|
|
|
|
->fetchOne();
|
|
|
|
|
|
2009-05-14 16:44:01 +00:00
|
|
|
|
//Enregistrement d'une fausse commande dans la bdd
|
|
|
|
|
$commandes = new Commandes();
|
|
|
|
|
$commandes->reference = $placeOrderResult->OrderStatus->OrderReference;
|
|
|
|
|
$commandes->servicespeed = $placeOrderResult->OrderStatus->Order->ServiceSpeed;
|
2009-06-08 15:36:41 +00:00
|
|
|
|
$commandes->prix = 0;
|
2009-05-14 16:44:01 +00:00
|
|
|
|
$commandes->orderstate = $placeOrderResult->OrderStatus->OrderState;
|
|
|
|
|
$commandes->dateordered = $placeOrderResult->OrderStatus->DateOrdered;
|
|
|
|
|
$commandes->datecompleted = $placeOrderResult->OrderStatus->DateCompleted;
|
|
|
|
|
$commandes->datedue = $placeOrderResult->OrderStatus->DateDue;
|
|
|
|
|
$commandes->companyproductidentifier = $CompanyProductIdentifier;
|
|
|
|
|
$commandes->sessionid = $sessionID;
|
|
|
|
|
$commandes->transactionidentifier = $transactionIdentifier;
|
|
|
|
|
$commandes->user = $tabInfo['login'];
|
|
|
|
|
$commandes->mode = $_SESSION['graydon']['mode'];
|
|
|
|
|
$commandes->Country = $country;
|
|
|
|
|
$commandes->save();
|
|
|
|
|
$firephp->log($commandes->toArray(),'dataCommandes');
|
|
|
|
|
$commandes_id = $commandes->id;
|
2009-06-08 15:36:41 +00:00
|
|
|
|
|
2009-05-14 16:44:01 +00:00
|
|
|
|
//Assignation du contenu
|
|
|
|
|
$xml = $report->content;
|
2009-07-21 15:08:08 +00:00
|
|
|
|
}
|
2009-04-09 17:10:02 +00:00
|
|
|
|
|
|
|
|
|
//========= Affichage des informations =========
|
2009-06-08 15:36:41 +00:00
|
|
|
|
if(isset($xml) && $xml!='' && $xml!==FALSE){
|
2009-04-09 17:10:02 +00:00
|
|
|
|
|
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-27 15:16:02 +00:00
|
|
|
|
|
2009-07-21 15:08:08 +00:00
|
|
|
|
//Cr<43>ation du DOM
|
2009-04-09 17:10:02 +00:00
|
|
|
|
$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)
|
|
|
|
|
{
|
2009-07-21 15:08:08 +00:00
|
|
|
|
$value = is_array($value) ?
|
|
|
|
|
array_map('utf8decode_deep', $value) :
|
2009-04-20 16:32:11 +00:00
|
|
|
|
cleanutf8($value);
|
|
|
|
|
return $value;
|
|
|
|
|
}
|
|
|
|
|
|
2009-04-16 16:34:13 +00:00
|
|
|
|
?>
|
2009-04-09 17:10:02 +00:00
|
|
|
|
|
2009-04-27 15:16:02 +00:00
|
|
|
|
<style type="text/css">
|
2009-04-27 16:29:57 +00:00
|
|
|
|
.bilans { margin-left:35px; }
|
|
|
|
|
div.bilans { margin-top:15px; font:bold 16px Verdana, Arial, Sans-serif; }
|
|
|
|
|
span.bilans { font-style:italic; }
|
|
|
|
|
table.bilans { width:545px; }
|
|
|
|
|
table.bilans .right {text-align:right;}
|
2009-04-27 15:16:02 +00:00
|
|
|
|
</style>
|
|
|
|
|
|
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-27 15:16:02 +00:00
|
|
|
|
<h2> Actionariat / Participation : </h2>
|
|
|
|
|
<?php dLiens($tabReport); ?>
|
|
|
|
|
<h2> Bilans : </h2>
|
|
|
|
|
<?php dBilans($tabReport); ?>
|
|
|
|
|
|
2009-07-21 15:08:08 +00:00
|
|
|
|
<?php
|
2009-04-07 17:44:17 +00:00
|
|
|
|
}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>
|
2009-07-21 15:08:08 +00:00
|
|
|
|
</table>
|
|
|
|
|
<?php
|
2009-04-07 17:44:17 +00:00
|
|
|
|
}
|
|
|
|
|
?>
|
2009-04-20 12:41:56 +00:00
|
|
|
|
</div>
|