80 lines
2.4 KiB
PHP
80 lines
2.4 KiB
PHP
<?php
|
|
if (!$_SESSION['connected']) {
|
|
die();
|
|
}
|
|
if (isset($_POST['type_enq']) == false) {
|
|
$type_enq = 'Delivered';
|
|
} else {
|
|
$type_enq = $_POST['type_enq'];
|
|
}
|
|
require_once 'dbbootstrap.php';
|
|
require_once 'user/user.php';
|
|
|
|
$etatsEnq = array('Toutes' => 'Toutes',
|
|
'Initialised' => 'Initialisées',
|
|
'Assigned' => 'Assignées',
|
|
'Completed' => 'Completées',
|
|
'Delivered' => 'Délivrées',
|
|
'NonD' => 'Non délivrées');
|
|
|
|
function ajouteOption(&$etatsEnq, $type_enq, $index) {
|
|
print '<option value="'.$index.'"';
|
|
if ($type_enq == $index) {
|
|
print ' selected';
|
|
}
|
|
print '>'.$etatsEnq[$index].'</option>';
|
|
}
|
|
?>
|
|
|
|
<div id="center">
|
|
<h1>Commandes Internationales</h1>
|
|
|
|
<form method="post">
|
|
<label>Type d'enquête:</label>
|
|
<select name="type_enq" onchange="this.form.submit();">
|
|
<?php
|
|
foreach ($etatsEnq as $index => $valeur) {
|
|
ajouteOption($etatsEnq, $type_enq, $index);
|
|
}
|
|
?>
|
|
</select>
|
|
</form>
|
|
<br/>
|
|
|
|
<?php
|
|
setDbConn('graydon');
|
|
$tabCommandes = Doctrine_Query::create()
|
|
->from('Commandes')
|
|
->where('user = ?', $_SESSION['tabInfo']['login'])
|
|
->orderby('id')
|
|
->execute();
|
|
foreach ($tabCommandes as $commande) {
|
|
if (($type_enq != 'Toutes' &&
|
|
$type_enq != 'NonD' &&
|
|
$type_enq != $commande->orderstate) ||
|
|
($type_enq == 'NonD' &&
|
|
$commande->orderstate == 'Delivered')) {
|
|
continue;
|
|
}
|
|
$detail = Doctrine_Query::create()
|
|
->from('CommandesDetail')
|
|
->where('commandes_id = ?', $commande->id)
|
|
->fetchOne();
|
|
print $detail->eName.'<br/>'.
|
|
$detail->eAdresse.'<br/>'.
|
|
'Type d'enquête: '.$commande->servicespeed.'<br/>'.
|
|
'État: '.$commande->orderstate.'<br/>'.
|
|
'Prix: '.$commande->prix.' euros<br/>'.
|
|
'Date de la commande: ' .$commande->dateordered.'<br/>'.
|
|
'Date de réception prévue: '.$commande->datedue.'<br/>';
|
|
if ($commande->orderstate == 'Completed' ||
|
|
$commande->orderstate == 'CompletedwithUpdate' ||
|
|
$commande->orderstate == 'ReCompleted') {
|
|
print 'Date de réception: '.$commande->datecompleted.'<br/>';
|
|
print '<a href="">Télécharger le rapport</a><br/>';
|
|
}
|
|
print '<br/>';
|
|
}
|
|
?>
|
|
</div>
|