43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
if ($_SESSION['connected'] == false) {
|
|
die();
|
|
}
|
|
|
|
require_once 'graydon/graydon_wsfunctions.php';
|
|
require_once 'dbbootstrap.php';
|
|
setDbConn('graydon');
|
|
|
|
$identifier = $_GET['identifier'];
|
|
$pidentifier = $_GET['pidentifier'];
|
|
|
|
print '<div id="center">';
|
|
|
|
// Si on a un rapport
|
|
$rapports = Doctrine_Query::create()
|
|
->from('Report')
|
|
->where('identifier = ?', $identifier)
|
|
->orderby('id desc')
|
|
->execute();
|
|
if ($rapports != false && count($rapports) > 0) {
|
|
$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);
|
|
}
|
|
} else {
|
|
$commande_id = getIdentite($identifier, $pidentifier);
|
|
}
|
|
|
|
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>';
|
|
}
|
|
print '</div>';
|
|
?>
|