2009-08-11 14:41:16 +00:00
|
|
|
<script language="javascript">
|
2009-09-10 15:31:37 +00:00
|
|
|
<!--
|
2009-08-11 15:39:23 +00:00
|
|
|
//exporter le rapport
|
2009-08-11 14:41:16 +00:00
|
|
|
function download(id, format) {
|
|
|
|
location.href = 'modules/graydon/export.php?id=' + id + '&format=' + format;
|
|
|
|
}
|
2009-08-11 15:39:23 +00:00
|
|
|
|
|
|
|
// exporter le tableau des commandes
|
2009-08-13 08:58:08 +00:00
|
|
|
function export_tableau(params) {
|
|
|
|
location.href = 'modules/graydon/export_tableau_xls.php?p=1' + params;
|
2009-08-11 15:39:23 +00:00
|
|
|
}
|
2009-09-10 15:31:37 +00:00
|
|
|
-->
|
2009-08-11 14:41:16 +00:00
|
|
|
</script>
|
2009-08-13 08:58:08 +00:00
|
|
|
|
2009-05-25 16:23:19 +00:00
|
|
|
<form name="tri" action="./index.php?q=graydon/commandes" method="post">
|
2009-08-11 12:48:17 +00:00
|
|
|
<input type="hidden" name="mode" value="search" />
|
|
|
|
<table border="0" width="50%" cellspacing="2" cellpadding="3">
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<select name="country">
|
|
|
|
<option value="">Tri par pays</option>
|
|
|
|
<?php echo affiche_pays();?>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
<td> </td>
|
|
|
|
<td>Reference : <input type="text" name="reference" /></td>
|
|
|
|
</tr>
|
2009-08-19 12:10:34 +00:00
|
|
|
|
2009-08-11 12:48:17 +00:00
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<select name="servicespeed">
|
|
|
|
<option value="">Tri par type de commande</option>
|
|
|
|
<option value="immediate">Immediate</option>
|
|
|
|
<option value="normal">Normal</option>
|
|
|
|
<option value="Express">Rapide</option>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
<td> </td>
|
|
|
|
<td>
|
|
|
|
<select name="status">
|
2010-02-10 17:27:03 +00:00
|
|
|
<option value="">Tri par état de la commande</option>
|
2009-08-11 12:48:17 +00:00
|
|
|
<option value="Completed">Completed</option>
|
|
|
|
<option value="Assigned">Assigned</option>
|
|
|
|
<option value="InError">InError</option>
|
|
|
|
<option value="Initialised">Initialised</option>
|
|
|
|
<option value="Delivered">Delivered</option>
|
|
|
|
<option value="Notified">Notified</option>
|
|
|
|
<option value="ReCompleted">ReCompleted</option>
|
|
|
|
<option value="SendError">SendError</option>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2009-08-19 12:10:34 +00:00
|
|
|
|
2009-08-11 12:48:17 +00:00
|
|
|
<tr>
|
2009-08-19 12:10:34 +00:00
|
|
|
<td colspan="3">De <input type="text" name="dateFrom" />
|
2010-02-10 17:27:03 +00:00
|
|
|
à <input type="text" name="dateTo" /> (Format : AAAA-MM-JJ)
|
2009-08-11 12:48:17 +00:00
|
|
|
</td>
|
2009-08-19 12:10:34 +00:00
|
|
|
</tr>
|
2009-08-11 12:48:17 +00:00
|
|
|
<tr>
|
2009-08-13 08:58:08 +00:00
|
|
|
<td> </td>
|
2009-08-11 15:39:23 +00:00
|
|
|
<td> </td>
|
|
|
|
<td><input type="submit" value="Rechercher" /></td>
|
2009-08-11 12:48:17 +00:00
|
|
|
</tr>
|
|
|
|
</table>
|
2009-05-06 17:01:50 +00:00
|
|
|
</form>
|
2009-08-11 14:41:16 +00:00
|
|
|
|
2009-06-04 10:35:53 +00:00
|
|
|
<table>
|
2009-05-06 17:01:50 +00:00
|
|
|
<tr>
|
2009-08-11 12:48:17 +00:00
|
|
|
<th>Date de la commande</th>
|
|
|
|
<th>Reference</th>
|
2009-05-06 17:01:50 +00:00
|
|
|
<th>Pays</th>
|
|
|
|
<th>Reference</th>
|
2010-02-10 17:27:03 +00:00
|
|
|
<th>Service commandé</th>
|
2009-05-25 16:23:19 +00:00
|
|
|
<th>Prix de la commande</th>
|
2009-05-06 17:01:50 +00:00
|
|
|
<th>Status de la commande</th>
|
|
|
|
<th>Date due</th>
|
|
|
|
<th>Actions</th>
|
|
|
|
</tr>
|
2009-08-19 12:10:34 +00:00
|
|
|
<?php
|
2009-08-11 12:48:17 +00:00
|
|
|
|
|
|
|
$mode = $_REQUEST['mode'];
|
|
|
|
switch ($mode) {
|
|
|
|
case "search" :
|
|
|
|
if (sizeof($_POST) > 0) {
|
2009-08-19 12:10:34 +00:00
|
|
|
$search = $_POST;
|
|
|
|
affiche_liste_commandes();
|
|
|
|
}
|
|
|
|
break;
|
2009-08-11 12:48:17 +00:00
|
|
|
default :
|
|
|
|
affiche_liste_commandes();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* FONCTIONS
|
|
|
|
*****************************************************************************/
|
|
|
|
/*
|
|
|
|
* Fonction affiche la liste des commandes
|
|
|
|
*/
|
|
|
|
|
2009-08-19 12:10:34 +00:00
|
|
|
function affiche_liste_commandes()
|
|
|
|
{
|
2009-08-11 12:48:17 +00:00
|
|
|
global $search;
|
2009-08-19 12:33:42 +00:00
|
|
|
require realpath(dirname(__FILE__)).'/mysql_inc.php';
|
2009-08-11 12:48:17 +00:00
|
|
|
|
|
|
|
$WHERE = "";
|
2009-08-13 08:58:08 +00:00
|
|
|
$params = "";
|
2009-08-19 12:10:34 +00:00
|
|
|
|
|
|
|
if(!empty($search['reference'])) {
|
|
|
|
$WHERE .= " AND cmd.reference = '".$search['reference']."'";
|
|
|
|
$_SESSION['params'] = "&reference=".$search['reference'];}
|
|
|
|
|
|
|
|
if(!empty($search['country'])) {
|
|
|
|
$WHERE .= " AND cmd.country_id = '".$search['country']."'";
|
|
|
|
$params .= "&country=".$search['country']; }
|
|
|
|
|
|
|
|
if(!empty($search['servicespeed'])) {
|
|
|
|
$WHERE .= " AND cmd.servicespeed = '".$search['servicespeed']."'";
|
|
|
|
$params .= "&servicespeed=".$search['servicespeed'];}
|
|
|
|
|
|
|
|
if(!empty($search['status'])) {
|
|
|
|
$WHERE .= " AND cmd.orderstate = '".$search['status']."'";
|
|
|
|
$params .= "&status=".$search['status'];}
|
|
|
|
|
|
|
|
if(!empty($search['dateFrom']) && !empty($search['dateTo'])) {
|
|
|
|
|
|
|
|
if (preg_match("#^([0-9]{4})(-[0-9]{2}){2}$#", $search['dateFrom']) &&
|
|
|
|
preg_match("#^([0-9]{4})(-[0-9]{2}){2}$#", $search['dateTo'])) {
|
|
|
|
|
|
|
|
$WHERE .= " AND cmd.dateordered BETWEEN '".$search['dateFrom']."' AND '".$search['dateTo']."'";
|
|
|
|
$params .= "&dateFrom=".$search['dateFrom'];
|
|
|
|
$params .= "&dateTo=".$search['dateTo'];
|
2009-08-11 12:48:17 +00:00
|
|
|
}
|
2009-08-19 12:10:34 +00:00
|
|
|
}
|
2009-08-11 14:41:16 +00:00
|
|
|
$result_commande = mysql_query("
|
|
|
|
SELECT cmd.*
|
|
|
|
, cntr.graydon_country
|
|
|
|
, cmdd.*
|
2009-08-19 12:10:34 +00:00
|
|
|
, rpt.id as id_rapport, rpt.content, rpt.format, rpt.order_id
|
|
|
|
FROM commandes cmd
|
2009-08-11 12:48:17 +00:00
|
|
|
LEFT JOIN country cntr
|
|
|
|
ON cntr.id = cmd.country_id
|
|
|
|
LEFT JOIN commandes_detail cmdd
|
|
|
|
ON cmdd.commandes_id = cmd.id
|
2009-08-11 14:41:16 +00:00
|
|
|
LEFT JOIN report rpt
|
|
|
|
ON rpt.order_id = cmd.id
|
2009-08-19 12:10:34 +00:00
|
|
|
WHERE 1 $WHERE
|
|
|
|
ORDER by dateordered
|
2009-08-11 12:48:17 +00:00
|
|
|
");
|
|
|
|
if(mysql_num_rows($result_commande) == 0) {
|
2010-02-10 17:27:03 +00:00
|
|
|
echo "<tr><td colspan=\"8\"><p>Aucune commande n'est enregistrée.</p></td></tr>";
|
2009-08-11 12:48:17 +00:00
|
|
|
}
|
2009-08-19 12:10:34 +00:00
|
|
|
|
2009-08-19 12:33:42 +00:00
|
|
|
while($commande = mysql_fetch_object($result_commande))
|
|
|
|
{
|
|
|
|
?>
|
2009-08-11 12:48:17 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function(){
|
2009-08-19 12:10:34 +00:00
|
|
|
|
2009-08-11 12:48:17 +00:00
|
|
|
$("a.detailsBtn<?=$commande->id;?>").click(function () {
|
|
|
|
$("a.detailsBtn<?=$commande->id;?>").toggle();
|
|
|
|
$("a.closeBtn<?=$commande->id;?>").toggle();
|
|
|
|
$("div#advanceBtn<?=$commande->id;?>").slideToggle("slow");
|
|
|
|
});
|
2009-08-19 12:10:34 +00:00
|
|
|
|
2009-08-11 12:48:17 +00:00
|
|
|
$("a.closeBtn<?=$commande->id;?>").click(function () {
|
|
|
|
$("a.detailsBtn<?=$commande->id;?>").toggle();
|
|
|
|
$("a.closeBtn<?=$commande->id;?>").toggle();
|
|
|
|
$("div#advanceBtn<?=$commande->id;?>").slideToggle("slow");
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
<style type="text/css">
|
|
|
|
|
|
|
|
.detailsBtn<?=$commande->id;?> {
|
|
|
|
margin-left: 10px;
|
|
|
|
}
|
|
|
|
.closeBtn<?=$commande->id;?> {
|
|
|
|
margin-left: 10px;
|
|
|
|
display:none;
|
|
|
|
}
|
|
|
|
#advanceBtn<?=$commande->id;?> {
|
|
|
|
display:none;
|
|
|
|
width:350px;
|
|
|
|
}
|
|
|
|
</style>
|
2009-05-06 17:01:50 +00:00
|
|
|
<tr>
|
2009-08-11 12:48:17 +00:00
|
|
|
<td><?=$commande->dateordered;?></td>
|
|
|
|
<td><?=$commande->reference;?></td>
|
|
|
|
<td><?=$commande->graydon_country;?></td>
|
|
|
|
<td><?=$commande->reference;?></td>
|
|
|
|
<td><?=$commande->servicespeed;?></td>
|
|
|
|
<td><?=$commande->prix;?></td>
|
|
|
|
<td><?=$commande->orderstate;?></td>
|
|
|
|
<td><?=$commande->datedue;?></td>
|
2009-05-06 17:01:50 +00:00
|
|
|
<td>
|
2009-08-19 12:10:34 +00:00
|
|
|
<?php
|
|
|
|
if(is_null($commande->commandes_id)) {
|
2010-02-10 17:27:03 +00:00
|
|
|
echo " <font color=\"gray\">Afficher Détails</font>";
|
2009-08-11 12:48:17 +00:00
|
|
|
}
|
2009-08-19 12:10:34 +00:00
|
|
|
else {
|
2009-08-11 12:48:17 +00:00
|
|
|
?>
|
2010-02-10 17:27:03 +00:00
|
|
|
<a href="Javascript:;" class="detailsBtn<?=$commande->id;?>">Afficher Détails</a>
|
|
|
|
<a href="Javascript:;" class="closeBtn<?=$commande->id;?>">Masquer Détails</a>
|
2009-08-11 12:48:17 +00:00
|
|
|
<?php } ?>
|
2009-08-19 12:10:34 +00:00
|
|
|
|
|
|
|
| <?php
|
|
|
|
if(is_null($commande->order_id)) {
|
2009-08-11 14:41:16 +00:00
|
|
|
echo "<font color=\"gray\">Rapport</font>";
|
|
|
|
}
|
2009-08-19 12:10:34 +00:00
|
|
|
else {
|
2009-08-11 14:41:16 +00:00
|
|
|
?>
|
2009-08-11 15:39:23 +00:00
|
|
|
<a href="Javascript:;" onclick="download('<?=$commande->id_rapport?>', '<?=$commande->format?>');">Rapport</a>
|
2009-08-11 14:41:16 +00:00
|
|
|
<?php } ?>
|
2009-05-06 17:01:50 +00:00
|
|
|
</td>
|
2009-08-11 12:48:17 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td colspan="6"> </td>
|
|
|
|
<td colspan="3">
|
|
|
|
<div id="advanceBtn<?=$commande->id;?>">
|
2009-08-19 12:10:34 +00:00
|
|
|
<?php
|
2009-08-11 12:48:17 +00:00
|
|
|
echo "<b>dIdentite :</b> ".$commande->dIdentite."<br />";
|
|
|
|
echo "<b>dTelephone :</b> ".$commande->dTelephone."<br />";
|
|
|
|
echo "<b>dEmail :</b> ".$commande->dEmail."<br />";
|
|
|
|
echo "<b>dFax :</b> ".$commande->dFax."<br />";
|
|
|
|
echo "<b>eLanguageCode :</b> ".$commande->eLanguageCode."<br />";
|
|
|
|
echo "<b>eName :</b> ".$commande->eName;
|
|
|
|
echo "<b>eIdentifiers :</b> ".$commande->eIdentifiers."<br />";
|
|
|
|
echo "<b>eAdresse :</b> ".$commande->eAdresse."<br />";
|
|
|
|
echo "<b>eTelephone :</b> ".$commande->eTelephone."<br />";
|
|
|
|
echo "<b>eCreditOpinionCurrency :</b> ".$commande->eCreditOpinionCurrency."<br />";
|
|
|
|
echo "<b>eCreditOpinionPeriod :</b> ".$commande->eCreditOpinionPeriod."<br />";
|
|
|
|
echo "<b>eBankers :</b> ".$commande->eBankers."<br />";
|
|
|
|
echo "<b>eAttentionOf :</b> ".$commande->eAttentionOf."<br />";
|
|
|
|
echo "<b>eSpecialRemarks :</b> ".$commande->eSpecialRemarks."<br />";
|
|
|
|
echo "<b>commandes_id :</b> ".$commande->commandes_id."<br />";
|
|
|
|
echo "<b>CreditOpinionPeriod :</b> ".$commande->eCreditOpinionPeriod."<br />";
|
|
|
|
echo "<b>Date de commande :</b> ".$commande->created_at;
|
|
|
|
?>
|
|
|
|
</div></td>
|
|
|
|
</tr>
|
2009-08-19 12:10:34 +00:00
|
|
|
<?php
|
2009-08-11 12:48:17 +00:00
|
|
|
} // Fin de la boucle
|
2009-08-13 08:58:08 +00:00
|
|
|
?>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td colspan="6"><a href="Javascript:;" onclick="export_tableau('<?=$params;?>');" style="color:green;">Exporter le tableau<img src="http://<?=$_SERVER['HTTP_HOST'];?>/img/icones/xls.jpeg" width="20" border="0" align="absmiddle" /></a></td>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<?
|
2009-08-19 12:10:34 +00:00
|
|
|
mysql_free_result($result_commande);
|
|
|
|
mysql_close($connexion);
|
2009-05-06 17:01:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-08-11 12:48:17 +00:00
|
|
|
/*
|
|
|
|
* Fonction affiche la liste des pays qui ont un status actif
|
|
|
|
*/
|
|
|
|
|
2009-08-19 12:10:34 +00:00
|
|
|
function affiche_pays() {
|
2009-08-11 12:48:17 +00:00
|
|
|
|
2009-08-19 12:33:42 +00:00
|
|
|
require realpath(dirname(__FILE__)).'/mysql_inc.php';
|
2009-08-11 12:48:17 +00:00
|
|
|
$result_pays = mysql_query("SELECT id, graydon_country FROM country WHERE status = 'actif'");
|
|
|
|
while($pays = mysql_fetch_array($result_pays, MYSQL_ASSOC)) {
|
|
|
|
echo "<option value=\"".$pays['id']."\">".$pays['graydon_country']."</option>";
|
|
|
|
}
|
|
|
|
mysql_free_result($result_pays);
|
2009-08-19 12:10:34 +00:00
|
|
|
mysql_close($connexion);
|
2009-08-11 12:48:17 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</table>
|