Petites correction

This commit is contained in:
Michael RICOIS 2010-04-20 13:58:21 +00:00
parent 2c8e409b8b
commit fba26ec15c
2 changed files with 19 additions and 16 deletions

View File

@ -208,7 +208,7 @@ function commandesListe($type, $etat, $date, $mode){
setDbConn('sdv1');
$table = tableTypeCommande($type);
$dateTDebut = mktime(0, 0, 0, date('m', $date), 0, date('Y', $date));
$dateTDebut = mktime(0, 0, 0, date('m', $date), 1, date('Y', $date));
$dateTFin = mktime(0, 0, 0, date('m', $date)+1, 0, date('Y', $date));
$dateDebut = date('Y-m-d H:i:s',$dateTDebut);
@ -219,18 +219,22 @@ function commandesListe($type, $etat, $date, $mode){
->Where('dateCommande > ? ', $dateDebut)
->andWhere('dateCommande < ? ', $dateFin);
switch($etat){
case 'commande':
$q->andWhere('statutCommande = ?', 0);
$q->andWhere('dateReception = ?', '0000-00-00 00:00:00');
break;
case 'reception':
$q->andWhere('dateReception != ?', '0000-00-00 00:00:00');
break;
case 'erreur':
$q->andWhere('statutCommande = ?', 9);
$q->andWhere('dateReception = ?', '0000-00-00 00:00:00');
break;
if (preg_match('/([A-Z])-([0-9]{1,})/', $etat, $matches)){
$q->andWhere('statutCommande = ?', $matches[2]);
} else {
switch($etat){
case 'commande':
$q->andWhere('statutCommande = ?', 0);
$q->andWhere('dateReception = ?', '0000-00-00 00:00:00');
break;
case 'reception':
$q->andWhere('dateReception != ?', '0000-00-00 00:00:00');
break;
case 'erreur':
$q->andWhere('statutCommande = ?', 9);
$q->andWhere('dateReception = ?', '0000-00-00 00:00:00');
break;
}
}
if ($mode!=''){

View File

@ -194,8 +194,7 @@ if (count($cStatuts)>0 && hasModeEdition()){
$select = ' selected';
}
?>
<option value="C-"<?=$cStatut->id?><?=$selected?>>
<?=$cStatut->libStatut?></option>
<option value="C-<?=$cStatut->id?>"<?=$select?>><?=$cStatut->libStatut?></option>
<?php
}
}
@ -227,7 +226,7 @@ for($i=$dateToday-$dateIntervalle; $i<=$dateToday; $i++)
$dateTime = mktime(0, 0, 0, $i+1, 0, date('Y'));
$selected = '';
if ($date=='' && $i==$dateToday ){ $selected = 'selected'; }
if ($date!='' && $i=$date){ $selected = 'selected'; }
if ($date!='' && $dateTime=$date){ $selected = 'selected'; }
?>
<option value="<?=$dateTime?>" <?=$selected?>>
<?=date('m/Y', $dateTime)?>