From 64647b3b0b2b9c0a579d0c02dd1832fb16e771e2 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 4 Apr 2005 19:53:43 +0000 Subject: [PATCH] Mise aux normes --- htdocs/commande/index.php | 8 ++----- htdocs/expedition/index.php | 45 +++++++++++++------------------------ 2 files changed, 18 insertions(+), 35 deletions(-) diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 0203102c49c..f88e1c56e3d 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -48,7 +48,7 @@ print '
'; print ''; print ''; print "'; +print $langs->trans("Ref").' : '; print "
'.$langs->trans("SearchOrder").'
"; -print $langs->trans("Ref").' :

\n"; @@ -90,11 +90,7 @@ if ( $db->query($sql) ) */ $sql = "SELECT c.rowid, c.ref, s.nom, s.idp FROM ".MAIN_DB_PREFIX."commande as c, ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE c.fk_soc = s.idp AND c.fk_statut = 1"; -if ($socidp) -{ - $sql .= " AND c.fk_soc = $socidp"; -} -$sql .= " ORDER BY c.rowid DESC"; +$sql .= " ORDER BY c.rowid ASC"; if ( $db->query($sql) ) { diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index 1869c21cc13..cc4e7a8850c 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2003-2005 Rodolphe Quiedeville * Copyright (C) 2004-2005 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -22,23 +22,21 @@ */ /** - \file htdocs/expedition/index.php - \ingroup expedition - \brief Page accueil du module expedition - \version $Revision$ + \file htdocs/expedition/index.php + \ingroup expedition + \brief Page accueil du module expedition + \version $Revision$ */ require("./pre.inc.php"); $langs->load("sendings"); - llxHeader('','Expéditions','ch-expedition.html',$form_search); print_titre($langs->trans("Sendings")); -print ''; - +print '
'; print '
'; print '
'; @@ -46,7 +44,7 @@ print ''; print ''; print "'; -print "
'.$langs->trans("SearchASending").'
"; print $langs->trans("Ref").' :
\n"; +print "

\n"; /* * Expeditions à valider @@ -87,10 +85,7 @@ if ( $db->query($sql) ) */ $sql = "SELECT c.rowid, c.ref, s.nom, s.idp FROM ".MAIN_DB_PREFIX."commande as c, ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE c.fk_soc = s.idp AND c.fk_statut = 1"; -if ($socidp) -{ - $sql .= " AND c.fk_soc = $socidp"; -} +$sql .= " ORDER BY c.rowid ASC"; if ( $db->query($sql) ) { @@ -108,7 +103,7 @@ if ( $db->query($sql) ) { $var=!$var; $obj = $db->fetch_object(); - print "rowid\">".img_file()." "; + print "rowid\">".img_file()." "; print "rowid\">$obj->ref"; print ''.$obj->nom.''; $i++; @@ -129,16 +124,12 @@ print ''; */ $sql = "SELECT c.rowid, c.ref, s.nom, s.idp FROM ".MAIN_DB_PREFIX."commande as c, ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE c.fk_soc = s.idp AND c.fk_statut = 2"; -if ($socidp) -{ - $sql .= " AND c.fk_soc = $socidp"; -} - -if ( $db->query($sql) ) +$resql = $db->query($sql); +if ( $resql ) { $langs->load("orders"); - $num = $db->num_rows(); + $num = $db->num_rows($resql); if ($num) { $i = 0; @@ -149,8 +140,8 @@ if ( $db->query($sql) ) while ($i < $num) { $var=!$var; - $obj = $db->fetch_object(); - print "rowid\">".img_file()." "; + $obj = $db->fetch_object($resql); + print "rowid\">".img_file()." "; print "rowid\">$obj->ref"; print ''.$obj->nom.''; $i++; @@ -160,18 +151,14 @@ if ( $db->query($sql) ) } - /* * Expeditions à valider */ $sql = "SELECT e.rowid, e.ref, s.nom, s.idp, c.ref as commande_ref, c.rowid as commande_id FROM ".MAIN_DB_PREFIX."expedition as e, ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; $sql .= " WHERE e.fk_commande = c.rowid AND c.fk_soc = s.idp AND e.fk_statut = 1"; -if ($socidp) -{ - $sql .= " AND c.fk_soc = $socidp"; -} -$sql .= " ORDER BY c.rowid DESC"; + $sql .= $db->plimit(5, 0); + if ( $db->query($sql) ) { $num = $db->num_rows();