2009-04-07 17:44:17 +00:00
|
|
|
<?php
|
2010-03-29 15:43:25 +00:00
|
|
|
if ($_SESSION['connected'] == false) {
|
|
|
|
die();
|
2009-04-20 12:41:56 +00:00
|
|
|
}
|
2009-05-11 15:55:28 +00:00
|
|
|
|
2010-03-29 15:43:25 +00:00
|
|
|
require_once 'graydon/graydon_wsfunctions.php';
|
|
|
|
require_once 'dbbootstrap.php';
|
2009-05-14 16:44:01 +00:00
|
|
|
setDbConn('graydon');
|
2010-03-24 10:31:01 +00:00
|
|
|
|
2010-03-29 15:43:25 +00:00
|
|
|
$identifier = $_GET['identifier'];
|
|
|
|
$pidentifier = $_GET['pidentifier'];
|
|
|
|
|
|
|
|
print '<div id="center">';
|
|
|
|
|
2010-04-01 08:38:26 +00:00
|
|
|
// Si on a un rapport
|
2010-03-29 15:43:25 +00:00
|
|
|
$rapports = Doctrine_Query::create()
|
|
|
|
->from('Report')
|
|
|
|
->where('identifier = ?', $identifier)
|
2010-03-31 12:25:38 +00:00
|
|
|
->orderby('id desc')
|
2010-03-29 15:43:25 +00:00
|
|
|
->execute();
|
|
|
|
if ($rapports != false && count($rapports) > 0) {
|
2010-04-01 08:38:26 +00:00
|
|
|
$id = $rapports[0]->order_id;
|
|
|
|
// Si la commande appartient a cet utilisateur
|
|
|
|
if (Doctrine_Query::create()
|
|
|
|
->from('Commandes')
|
|
|
|
->where('id = ?', $id)
|
|
|
|
->fetchOne()->user == $_SESSION['tabInfo']['login']) {
|
|
|
|
$commande_id = $id;
|
|
|
|
} else {
|
|
|
|
$commande_id = copieDesRapports($id, $identifier, $pidentifier);
|
|
|
|
}
|
2010-03-29 15:43:25 +00:00
|
|
|
} else {
|
|
|
|
$commande_id = getIdentite($identifier, $pidentifier);
|
|
|
|
}
|
2010-03-24 10:31:01 +00:00
|
|
|
|
2010-03-29 15:43:25 +00:00
|
|
|
if ($commande_id > 0) {
|
|
|
|
header('Location: ?page=international_commandes&id='.$commande_id);
|
|
|
|
print '<a href="?page=international_commandes&id='.$commande_id.
|
|
|
|
'">Veuillez suivre ce lien</a>';
|
2009-04-07 17:44:17 +00:00
|
|
|
}
|
2010-03-29 15:43:25 +00:00
|
|
|
print '</div>';
|
2009-04-07 17:44:17 +00:00
|
|
|
?>
|