From a413b9ffe539e6e9ee1139ab0b68d3bab5f9a88c Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Wed, 21 Apr 2010 11:55:52 +0000 Subject: [PATCH] Correction requete sql --- includes/infogreffe/gestion.php | 14 ++++++++++---- www/pages/greffescmd.php | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/includes/infogreffe/gestion.php b/includes/infogreffe/gestion.php index 1aff08988..8c478c123 100644 --- a/includes/infogreffe/gestion.php +++ b/includes/infogreffe/gestion.php @@ -204,7 +204,7 @@ function documentStatut($commande){ * @param unknown_type $etat * @param unknown_type $date */ -function commandesListe($type, $etat, $date, $mode){ +function commandesListe($type, $etat, $date, $mode = ''){ setDbConn('sdv1'); $table = tableTypeCommande($type); @@ -224,7 +224,7 @@ function commandesListe($type, $etat, $date, $mode){ } else { switch($etat){ case 'commande': - $q->andWhere('statutCommande = ?', 0); + $q->andWhere('statutCommande != ?', 9); $q->andWhere('dateReception = ?', '0000-00-00 00:00:00'); break; case 'reception': @@ -237,14 +237,20 @@ function commandesListe($type, $etat, $date, $mode){ } } - if ($mode!=''){ - $q->andWhere('typeCommande = ?', $mode); + if ($mode!='-'){ + if ($mode == 'G') { + $q->orWhereIn('typeCommande', array('', $mode)); + } else { + $q->andWhere('typeCommande = ?', $mode); + } } if (!hasModeEdition()){ $q->andWhere('login = ?', $_SESSION['tabInfo']['login']); } + FB::log($q->getSqlQuery(),'SQL'); + FB::log($q->getFlattenedParams(),'SQL'); //Résultat $commandes = $q->execute(); FB::log($commandes->toArray(), 'commandes'); diff --git a/www/pages/greffescmd.php b/www/pages/greffescmd.php index 168cf10cd..e8b6e2378 100644 --- a/www/pages/greffescmd.php +++ b/www/pages/greffescmd.php @@ -226,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!='' && $dateTime=$date){ $selected = 'selected'; } + if ($date!='' && $dateTime==$date){ $selected = 'selected'; } ?>