From 6a0adde5532543a09bb427b34ab34eb86f873454 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sun, 17 Apr 2005 13:19:06 +0000 Subject: [PATCH] Modifs mineures --- htdocs/expedition/index.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index f5de7c45a86..c1d06a40299 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -105,7 +105,7 @@ if ( $db->query($sql) ) { $var=!$var; $obj = $db->fetch_object(); - print ""; + print ""; print "rowid\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.''; print ''.$obj->nom.''; $i++; @@ -159,11 +159,13 @@ if ( $resql ) $sql = "SELECT e.rowid, e.ref, s.nom, s.idp, c.ref as commande_ref, c.rowid as commande_id"; $sql.= " 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"; +$sql .= " ORDER BY e.date_expedition DESC"; $sql .= $db->plimit(5, 0); -if ( $db->query($sql) ) +$resql = $db->query($sql); +if ($resql) { - $num = $db->num_rows(); + $num = $db->num_rows($resql); if ($num) { $i = 0; @@ -174,7 +176,7 @@ if ( $db->query($sql) ) while ($i < $num) { $var=!$var; - $obj = $db->fetch_object(); + $obj = $db->fetch_object($resql); print "rowid\">".img_object($langs->trans("ShowSending"),"sending").' '; print $obj->ref.''; print ''.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.''; @@ -183,6 +185,7 @@ if ( $db->query($sql) ) } print "
"; } + $db->free($resql); } print '';