2009-05-06 17:01:50 +00:00
|
|
|
|
<?php
|
2009-05-25 16:23:19 +00:00
|
|
|
|
setDbConn('graydon');
|
|
|
|
|
|
|
|
|
|
//Liste des pays
|
2009-05-06 17:01:50 +00:00
|
|
|
|
$q = Doctrine_Query::create()
|
|
|
|
|
->from('Country')
|
|
|
|
|
->where('status="actif"');
|
|
|
|
|
|
2009-05-12 16:57:43 +00:00
|
|
|
|
$results = $q->execute();
|
|
|
|
|
$tabPays = $results->toArray();
|
2009-05-06 17:01:50 +00:00
|
|
|
|
|
2009-05-25 16:23:19 +00:00
|
|
|
|
//Tri ou Liste des commandes
|
|
|
|
|
$condition = array();
|
|
|
|
|
$conditionValue = array();
|
|
|
|
|
if(isset($_REQUEST['country'])){
|
|
|
|
|
$condition[] = 'p.graydon_country = ?';
|
|
|
|
|
$conditionValue[] = $_REQUEST['country'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(count($condition)>0){
|
|
|
|
|
$where = join(' AND ',$condition);
|
2009-05-12 16:57:43 +00:00
|
|
|
|
|
2009-05-25 16:23:19 +00:00
|
|
|
|
$q = Doctrine_Query::create()
|
|
|
|
|
->from('Commandes c')
|
|
|
|
|
->leftJoin('c.Country p, c.CommandesDetail cd')
|
|
|
|
|
->orderBy('c.dateordered')
|
|
|
|
|
->where($where, $conditionValue);
|
|
|
|
|
}else{
|
|
|
|
|
$q = Doctrine_Query::create()
|
|
|
|
|
->from('Commandes c')
|
|
|
|
|
->leftJoin('c.Country p, c.CommandesDetail cd')
|
|
|
|
|
->orderBy('c.dateordered');
|
|
|
|
|
}
|
2009-05-12 16:57:43 +00:00
|
|
|
|
$tabCommandes = $q->execute();
|
2009-05-06 17:01:50 +00:00
|
|
|
|
?>
|
2009-05-25 16:23:19 +00:00
|
|
|
|
<script>
|
|
|
|
|
$(document).ready(function(){
|
|
|
|
|
$("select[name=country]").change(function ()
|
|
|
|
|
{
|
|
|
|
|
var trivalue = $(this).val();
|
|
|
|
|
document.location.href='<?php print EXTRANET_URL;?>dashboard/?q=graydon/commandes/country/'+trivalue;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("select[name=servicespeed]").change(function ()
|
|
|
|
|
{
|
|
|
|
|
var trivalue = $(this).val();
|
|
|
|
|
document.location.href='<?php print EXTRANET_URL;?>dashboard/?q=graydon/commandes/servicespeed/'+trivalue;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
</script>
|
2009-05-06 17:01:50 +00:00
|
|
|
|
|
2009-05-25 16:23:19 +00:00
|
|
|
|
<form name="tri" action="./index.php?q=graydon/commandes" method="post">
|
2009-05-06 17:01:50 +00:00
|
|
|
|
|
|
|
|
|
<select name="country">
|
|
|
|
|
<option value="">Tri par pays</option>
|
|
|
|
|
<?php
|
|
|
|
|
foreach($tabPays as $pays){
|
|
|
|
|
?>
|
2009-05-12 16:57:43 +00:00
|
|
|
|
<option value="<?php print $pays['graydon_country']; ?>"><?php print $pays['graydon_country']; ?></option>
|
2009-05-06 17:01:50 +00:00
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select name="servicespeed">
|
|
|
|
|
<option>Tri par type de commande</option>
|
2009-05-25 16:23:19 +00:00
|
|
|
|
<option value="immediate">Immediate</option>
|
|
|
|
|
<option value="normal">Normal</option>
|
|
|
|
|
<option value="rapide">Rapide</option>
|
2009-05-06 17:01:50 +00:00
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select name="status">
|
|
|
|
|
<option>Tri par <EFBFBD>tat de la commande</option>
|
|
|
|
|
<option>Completed</option>
|
|
|
|
|
<option>Assigned</option>
|
|
|
|
|
<option>InError</option>
|
|
|
|
|
<option>Initialised</option>
|
|
|
|
|
<option>Delivered</option>
|
|
|
|
|
<option>Notified</option>
|
|
|
|
|
<option>ReCompleted</option>
|
2009-05-25 16:23:19 +00:00
|
|
|
|
<option>SendError</option>
|
2009-05-06 17:01:50 +00:00
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
De <input type="text" name="dateFrom" /> <EFBFBD> <input type="text" name="dateTo" /> (Format : AAAA-MM-JJ)
|
|
|
|
|
</form>
|
|
|
|
|
|
2009-06-04 10:35:53 +00:00
|
|
|
|
<table>
|
2009-05-06 17:01:50 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<th>Pays</th>
|
|
|
|
|
<th>Reference</th>
|
|
|
|
|
<th>Service command<EFBFBD></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 de la commande</th>
|
|
|
|
|
<th>Date due</th>
|
|
|
|
|
<th>Actions</th>
|
|
|
|
|
</tr>
|
|
|
|
|
<?php
|
|
|
|
|
foreach($tabCommandes as $commande){
|
|
|
|
|
?>
|
|
|
|
|
<tr>
|
2009-05-12 16:57:43 +00:00
|
|
|
|
<td><?php print $commande->Country->graydon_country; ?></td>
|
2009-05-06 17:01:50 +00:00
|
|
|
|
<td><?php print $commande->reference; ?></td>
|
|
|
|
|
<td><?php print $commande->servicespeed; ?></td>
|
2009-05-12 16:57:43 +00:00
|
|
|
|
<td><?php print $commande->prix; ?></td>
|
2009-05-06 17:01:50 +00:00
|
|
|
|
<td><?php print $commande->orderstate; ?></td>
|
|
|
|
|
<td><?php print $commande->dateordered; ?></td>
|
|
|
|
|
<td><?php print $commande->datedue; ?></td>
|
|
|
|
|
<td>
|
|
|
|
|
<a href="">D<EFBFBD>tails</a>
|
|
|
|
|
<a href="">Rapport</a>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|