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-10-28 14:18:22 +00:00
|
|
|
isset($_REQUEST['format']) ? $format = $_REQUEST['format'] : $format = 'xml';
|
|
|
|
|
|
|
|
$firephp->log($identifier, 'identifier');
|
|
|
|
$firephp->log($CompanyProductIdentifier, 'CompanyProductIdentifier');
|
|
|
|
|
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-10-28 14:18:22 +00:00
|
|
|
require_once 'graydon/graydon.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-05-11 15:55:28 +00:00
|
|
|
|
2009-10-28 14:18:22 +00:00
|
|
|
$firephp->info('Fomat HTML');
|
|
|
|
|
|
|
|
$path = PATH_DATA.'/graydon';
|
|
|
|
$fileName = strtolower(str_replace( array(':',' '), '-', $identifier).'.'.$format);
|
|
|
|
|
2010-02-10 17:27:03 +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()
|
2009-10-28 14:18:22 +00:00
|
|
|
->from('Report')
|
|
|
|
->where('identifier = ?', $_REQUEST['identifier'])
|
|
|
|
->andWhere('format = ?', $format);
|
|
|
|
|
|
|
|
$firephp->log($q->getSql(), 'Requete SQL');
|
|
|
|
$firephp->log($q->getParams(), 'Params SQL');
|
|
|
|
|
2009-05-12 16:57:43 +00:00
|
|
|
$report = new Report();
|
|
|
|
$report = $q->fetchOne();
|
2009-05-11 15:55:28 +00:00
|
|
|
|
2009-10-28 14:18:22 +00:00
|
|
|
if($format == 'html')
|
|
|
|
{
|
|
|
|
|
|
|
|
|
2010-02-10 17:27:03 +00:00
|
|
|
//@TODO : si le rapport existe déjà ou que la date n'est pas très éloigné
|
2009-10-28 14:18:22 +00:00
|
|
|
if($report==FALSE)
|
|
|
|
{
|
|
|
|
$firephp->info('Pas en cache');
|
2010-02-10 17:27:03 +00:00
|
|
|
//Vérifier si le rapport en ligne à déjà été demandé
|
2009-10-28 14:18:22 +00:00
|
|
|
/*
|
|
|
|
$q = Doctrine_Query::create()
|
|
|
|
->from('Commandes')
|
|
|
|
->where('companyproductidentifier = ?', $CompanyProductIdentifier);
|
|
|
|
|
|
|
|
$commandes = new Commandes();
|
|
|
|
$commandes = $q->fetchOne();
|
|
|
|
|
|
|
|
$report = new Report();
|
|
|
|
$report = $commandes->Report;
|
|
|
|
|
|
|
|
if($commandes == FALSE && !isset($report->id)){
|
|
|
|
$html = getIdentite($identifier, $CompanyProductIdentifier, $path.'/'.$fileName, $format);
|
2010-02-10 17:27:03 +00:00
|
|
|
//La commande à déjà été demandé
|
2009-10-28 14:18:22 +00:00
|
|
|
}else{
|
|
|
|
$html = $report->content;
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
$html = getIdentite($identifier, $CompanyProductIdentifier, $path.'/'.$fileName, $format);
|
|
|
|
//Le rapport est disponible
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$country = Doctrine_Query::create()
|
|
|
|
->from('Country')
|
|
|
|
->where('graydon_country = ?', $pays)
|
|
|
|
->fetchOne();
|
|
|
|
|
|
|
|
//Enregistrement d'une fausse commande dans la bdd
|
|
|
|
$commandes = new Commandes();
|
|
|
|
$commandes->reference = $placeOrderResult->OrderStatus->OrderReference;
|
|
|
|
$commandes->servicespeed = $placeOrderResult->OrderStatus->Order->ServiceSpeed;
|
|
|
|
$commandes->prix = 0;
|
|
|
|
$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;
|
|
|
|
|
|
|
|
//Assignation du contenu
|
|
|
|
$html = $report->content;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(isset($html) && $html!='' && $html!==FALSE)
|
|
|
|
{
|
|
|
|
$html = str_replace('<html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">', '', $html);
|
|
|
|
$html = str_replace('<body>', '', $html);
|
|
|
|
$html = str_replace('</body></html>', '', $html);
|
|
|
|
$html = preg_replace('@<style[^>]*?>.*?</style>@si', '', $html);
|
|
|
|
$html = preg_replace('@<h1[^>]*?>Graydon .*?</h1>@si', '', $html);
|
|
|
|
?>
|
|
|
|
<style type="text/css">
|
|
|
|
h1{font-family : Verdana, Arial, Helvetica, sans-serif;font-size: 14px;font-weight : bold;color : white;padding: 3px;margin: 10px 0px 6px 0px;border-width : 1px;border-style : solid;border-color : #31659C;background-color : #31659C; text-align: left;}
|
|
|
|
h1.header{font-size: 18px;font-weight : 900;border-width : 0px;text-align: center;color : #31659C;background-color : white;}
|
|
|
|
h1.trailer{border-width : 0px;text-align: center;color : #31659C;background-color : white;}
|
|
|
|
img{border-style : none;align: left;vertical-align: middle;}
|
|
|
|
img.link{height: 11px;width: 13px}
|
|
|
|
p{font-size: 13px;font-family: Verdana, Arial, Helvetica, sans-serif;margin : 0px;padding-left : 3px;padding-right : 3px;padding-top : 3px;padding-bottom : 3px;text-align: left;}
|
|
|
|
p.smallSpace{font-size: 1px;}
|
|
|
|
table{}
|
|
|
|
table.border{border-style : solid;border-width : 1px;border-color: #31659C;}
|
|
|
|
table.header{margin: 10px 0px 6px 0px;border-width : 1px;border-style : solid;border-color : #31659C;text-align: left; width:100%;}
|
|
|
|
table.small{width: 300px;}
|
|
|
|
tr{page-break-inside: avoid;}
|
|
|
|
th{font-family : Verdana, Arial, Helvetica, sans-serif;font-weight: bold;font-size: 13px;padding-left: 3px;width: 177px;color: #31659C;background-color : #e7eff8;text-align: left;vertical-align: top;}
|
|
|
|
th.h1{font-size: 14px;padding: 3px;font-weight : bold;background-color : #31659C;color : white;}
|
|
|
|
th.minusBackgroundColor{background-color : white;}
|
|
|
|
th.label{font-weight: normal;background-color : white;width: auto;}
|
|
|
|
th.indent{padding-left: 6px;}
|
|
|
|
th.indentDouble{padding-left: 12px;}
|
|
|
|
td{font-size: 13px;font-family: Verdana, Arial, Helvetica, sans-serif;color: black;padding-left: 3px;vertical-align: top;text-align: left;}
|
|
|
|
a{font-family: Verdana, Arial, Helvetica, sans-serif;text-decoration : underline;color : blue;vertical-align: middle;}
|
|
|
|
a:HOVER{font-family: Verdana, Arial, Helvetica, sans-serif;color : gold;vertical-align: middle;}
|
|
|
|
input{font-size : 13px;font-family : Verdana,Arial;font-weight : lighter;border-width : 1px 1px 1px 1px;border-top-style : solid;border-left-style: solid;border-right-style : solid;border-bottom-style : solid;}
|
|
|
|
select{font-size : 7pt;font-family : "Small Fonts",Arial;border-top-width : 1px;border-left-width : 1px;border-right-width : 1px;border-bottom-width : 1px;border-top-style : solid;border-left-style : solid;border-right-style : solid;border-bottom-style : solid;border-color : black black black black;font-weight : lighter;background-color : #f1f1f1;}
|
|
|
|
.submit{font-size : 14px;font-family : Verdana,Arial;font-weight : normal;color : #f1f1f1;background-color : black;}
|
|
|
|
.bold{font-weight: bold;}
|
|
|
|
.red{color: red;}
|
|
|
|
.white{background-color: white;}
|
|
|
|
.lightGrey{background-color: lightGrey;}.italic{font-style: italic;}.dashed{border-bottom-style : dashed;border-bottom-width : 1px;border-bottom-color: silver;padding-left: 3px;padding-right: 3px;margin-top: 3px;margin-bottom: 3px;}
|
|
|
|
.marginTop{margin-top: 6px;}
|
|
|
|
.paddingTop{padding-top: 3px;}
|
|
|
|
.paddingBottom{padding-bottom: 6px;}
|
|
|
|
.textAlignRight{text-align: right;padding-right: 3px;}
|
|
|
|
.signature_color1{color: #31659C;}
|
|
|
|
.border_right{border-right-style : solid;border-right-width : 1px;border-right-color: #31659C;}
|
|
|
|
.border_left{border-right-style : solid;border-right-width : 1px;border-right-color: #31659C;}
|
|
|
|
.border_bottom{border-bottom-style : solid;border-bottom-width : 1px;border-bottom-color: #31659C;}
|
|
|
|
.center{text-align: center;width: auto;}
|
|
|
|
.paymentBox {font-size: large;width: 100;height: 100;border: 1px solid #191970;text-align: center;padding-top: 35;margin-left: 70;}ul{list-style: none;padding: 0;margin: 0}li{padding-left: 10px;margin-right: 0px;background-image: url("/Creditline_core/images/tab-blue-left.gif");background-position: left top;background-repeat: no-repeat;background-color : #31659C;color: white;float: left;}li span{padding-right: 10px;padding-bottom: 3px;background-image: url("/Creditline_core/images/tab-blue-right.gif");background-position: right top;background-repeat: no-repeat;background-color : #31659C;float: left;}li a{color: white;}li a:hover{color: gold;}li a:hover span{color: gold;}</style><style media="print" type="text/css">/* HTML Elements */body{scrollbar-face-color : #31659C;scrollbar-track-color : #F1F1F1;scrollbar-base-color : #F1F1F1;scrollbar-arrow-color : #e7eff8;scrollbar-shadow-color : #31659C;scrollbar-highlight-color : #31659C;scrollbar-3dlight-color : #e7eff8;scrollbar-darkshadow-color : #e7eff8;background: #FFFFFF;font-size: 13px;font-family: Verdana, Arial, Helvetica, sans-serif;color: black;text-align: center;}h1{font-family : Verdana, Arial, Helvetica, sans-serif;font-size: 14px;font-weight : bold;color : white;padding: 3px;margin: 10px 0px 6px 0px;border-width : 1px;border-style : solid;border-color : #31659C;background-color : #31659C;text-align: left;}
|
|
|
|
</style>
|
|
|
|
<?php
|
|
|
|
print $html;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td width="30"> </td>
|
|
|
|
<td width="500" class="StyleInfoLib">Aucune information disponible.</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
elseif($format == 'xml')
|
|
|
|
{
|
|
|
|
$path = PATH_DATA.'/graydon';
|
|
|
|
$fileName = strtolower(str_replace( array(':',' '), '-', $identifier).'.xml');
|
|
|
|
|
2010-02-10 17:27:03 +00:00
|
|
|
//Vérifier si le rapport n'est pas disponible en base depuis une autre commandes
|
2009-10-28 14:18:22 +00:00
|
|
|
setDbConn('graydon');
|
2009-05-12 16:57:43 +00:00
|
|
|
$q = Doctrine_Query::create()
|
2009-10-28 14:18:22 +00:00
|
|
|
->from('Report')
|
|
|
|
->where('identifier = ?', $_REQUEST['identifier'])
|
|
|
|
->andWhere('format = ?', $format);
|
2009-05-12 16:57:43 +00:00
|
|
|
$report = new Report();
|
2009-10-28 14:18:22 +00:00
|
|
|
$report = $q->fetchOne();
|
|
|
|
|
2010-02-10 17:27:03 +00:00
|
|
|
//@TODO : si le rapport existe déjà ou que la date n'est pas très éloigné
|
2009-10-28 14:18:22 +00:00
|
|
|
if($report==FALSE)
|
|
|
|
{
|
|
|
|
$firephp->info('Pas en cache');
|
2010-02-10 17:27:03 +00:00
|
|
|
//Vérifier si le rapport en ligne à déjà été demandé
|
2009-10-28 14:18:22 +00:00
|
|
|
$q = Doctrine_Query::create()
|
|
|
|
->from('Commandes')
|
|
|
|
->where('companyproductidentifier = ?', $CompanyProductIdentifier);
|
|
|
|
$commandes = new Commandes();
|
|
|
|
$commandes = $q->fetchOne();
|
|
|
|
$report = new Report();
|
|
|
|
$report = $commandes->Report;
|
|
|
|
if($commandes == FALSE && !isset($report->id)){
|
|
|
|
$xml = getIdentite($identifier, $CompanyProductIdentifier, $path.'/'.$fileName);
|
2010-02-10 17:27:03 +00:00
|
|
|
//La commande à déjà été demandé
|
2009-10-28 14:18:22 +00:00
|
|
|
}else{
|
|
|
|
$xml = $report->content;
|
|
|
|
}
|
|
|
|
//Le rapport est disponible
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$country = Doctrine_Query::create()
|
|
|
|
->from('Country')
|
|
|
|
->where('graydon_country = ?', $pays)
|
|
|
|
->fetchOne();
|
|
|
|
|
|
|
|
//Enregistrement d'une fausse commande dans la bdd
|
|
|
|
$commandes = new Commandes();
|
|
|
|
$commandes->reference = $placeOrderResult->OrderStatus->OrderReference;
|
|
|
|
$commandes->servicespeed = $placeOrderResult->OrderStatus->Order->ServiceSpeed;
|
|
|
|
$commandes->prix = 0;
|
|
|
|
$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;
|
|
|
|
|
|
|
|
//Assignation du contenu
|
2009-05-12 16:57:43 +00:00
|
|
|
$xml = $report->content;
|
2009-04-09 17:10:02 +00:00
|
|
|
}
|
2009-10-28 14:18:22 +00:00
|
|
|
|
|
|
|
//========= Affichage des informations =========
|
|
|
|
if(isset($xml) && $xml!='' && $xml!==FALSE)
|
|
|
|
{
|
|
|
|
|
|
|
|
$tabReport = array();
|
|
|
|
|
2010-02-10 17:27:03 +00:00
|
|
|
//Création du DOM
|
2009-10-28 14:18:22 +00:00
|
|
|
$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;
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<style type="text/css">
|
|
|
|
.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;}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<h1 class="titre">IDENTITÉ INTERNATIONALE DE L'ENTREPRISE</h1>
|
|
|
|
<?php dIdentifiant($tabReport); ?>
|
2010-02-10 17:27:03 +00:00
|
|
|
<h2>Raison sociale et coordonnées : </h2>
|
2009-10-28 14:18:22 +00:00
|
|
|
<?php dIdentite($tabReport);?>
|
2010-02-10 17:27:03 +00:00
|
|
|
<h2>Activité(s) et chiffre d'affaire de l'entreprise : </h2>
|
2009-10-28 14:18:22 +00:00
|
|
|
<?php dActivite($tabReport); ?>
|
2010-02-10 17:27:03 +00:00
|
|
|
<h2> Résumé financier : </h2>
|
2009-10-28 14:18:22 +00:00
|
|
|
<?php dResume($tabReport); ?>
|
|
|
|
<h2> Credit : </h2>
|
|
|
|
<?php dCredit($tabReport); ?>
|
|
|
|
<h2> Actionariat / Participation : </h2>
|
|
|
|
<?php dLiens($tabReport); ?>
|
|
|
|
<h2> Bilans : </h2>
|
|
|
|
<?php dBilans($tabReport); ?>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
}else{
|
|
|
|
?>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td width="30"> </td>
|
|
|
|
<td width="500" class="StyleInfoLib">Aucune information disponible.</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<?php
|
2009-04-07 17:44:17 +00:00
|
|
|
}
|
|
|
|
?>
|