2009-06-04 10:35:53 +00:00

121 lines
2.8 KiB
PHP

<?php
setDbConn('graydon');
//Liste des pays
$q = Doctrine_Query::create()
->from('Country')
->where('status="actif"');
$results = $q->execute();
$tabPays = $results->toArray();
//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);
$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');
}
$tabCommandes = $q->execute();
?>
<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>
<form name="tri" action="./index.php?q=graydon/commandes" method="post">
<select name="country">
<option value="">Tri par pays</option>
<?php
foreach($tabPays as $pays){
?>
<option value="<?php print $pays['graydon_country']; ?>"><?php print $pays['graydon_country']; ?></option>
<?php
}
?>
</select>
<select name="servicespeed">
<option>Tri par type de commande</option>
<option value="immediate">Immediate</option>
<option value="normal">Normal</option>
<option value="rapide">Rapide</option>
</select>
<select name="status">
<option>Tri par é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>
<option>SendError</option>
</select>
De <input type="text" name="dateFrom" /> à <input type="text" name="dateTo" /> (Format : AAAA-MM-JJ)
</form>
<table>
<tr>
<th>Pays</th>
<th>Reference</th>
<th>Service commandé</th>
<th>Prix de la commande</th>
<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>
<td><?php print $commande->Country->graydon_country; ?></td>
<td><?php print $commande->reference; ?></td>
<td><?php print $commande->servicespeed; ?></td>
<td><?php print $commande->prix; ?></td>
<td><?php print $commande->orderstate; ?></td>
<td><?php print $commande->dateordered; ?></td>
<td><?php print $commande->datedue; ?></td>
<td>
<a href="">Détails</a>
<a href="">Rapport</a>
</td>
</tr>
<?php
}
?>
</table>