From 98e250a0fb9cd6f5f3027bb553a4546138d76149 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sat, 17 May 2003 15:38:34 +0000 Subject: [PATCH] =?UTF-8?q?Suppressions=20des=20totaux,=20changement=20du?= =?UTF-8?q?=20tri=20par=20d=E9faut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/propal.php3 | 123 ++++++++++++++++++---------------------- 1 file changed, 56 insertions(+), 67 deletions(-) diff --git a/htdocs/comm/propal.php3 b/htdocs/comm/propal.php3 index 05dedef218e..c281deddd31 100644 --- a/htdocs/comm/propal.php3 +++ b/htdocs/comm/propal.php3 @@ -284,7 +284,7 @@ if ($propalid) { $total = $total + $objp->price; $i++; } - //print "Total : ".price($total)."Euros HT\n"; + print ""; } /* @@ -519,14 +519,14 @@ if ($propalid) { */ if ($sortfield == "") { - $sortfield="p.fk_statut, datep "; + $sortfield="p.datep"; } if ($sortorder == "") { - $sortorder="ASC"; + $sortorder="DESC"; } if ($page == -1) { $page = 0 ; } - $limit = 26; + $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; @@ -553,83 +553,72 @@ if ($propalid) { $sql .= " AND date_format(p.datep, '%Y') = $year"; } - $sql .= " ORDER BY $sortfield ASC"; + $sql .= " ORDER BY $sortfield $sortorder"; if ( $db->query($sql) ) { $num = $db->num_rows(); $i = 0; print ""; - $oldstatut = -1; - $subtotal = 0; - while ($i < $num) { - $objp = $db->fetch_object( $i); - - if ($objp->statut <> $oldstatut ) { - $oldstatut = $objp->statut; - - if ($i > 0) { - print "\n"; - print "\n"; - } - $subtotal = 0; + print ''; + print ""; + print ""; + print "'; + print "\n"; + $var=True; + + while ($i < $num) + { + $objp = $db->fetch_object( $i); - print ''; - print ""; - print ""; - print "'; + $var=!$var; + print ""; + print "\n"; + print "\n"; + + $now = time(); + $lim = 3600 * 24 * 15 ; + + if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 ) + { + print ""; + } + else + { + print ""; + } + + print "\n"; + + print "\n"; + print "\n"; print "\n"; - $var=True; - } - - $var=!$var; - print ""; - print "\n"; - print "\n"; - - $now = time(); - $lim = 3600 * 24 * 15 ; - - if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 ) { - print ""; - } else { - print ""; - } - - print "\n"; - - print "\n"; - print "\n"; - print "\n"; - - $total = $total + $objp->price; - $subtotal = $subtotal + $objp->price; - - $i++; + + $total = $total + $objp->price; + $subtotal = $subtotal + $objp->price; + + $i++; } - print "\n"; - print "\n"; - print ""; - print ""; - print ""; print "
Total : ".price($subtotal)."Euros HT
Réf"; + print_liste_field_titre ("Société",$PHP_SELF,"s.nom"); + print "DatePrixStatut statutid\">"; + print '
Réf"; - print_liste_field_titre ("Société",$PHP_SELF,"s.nom"); - print "DatePrixStatut statutid\">"; - print '
propalid\">$objp->refidp\">$objp->nom > 15 jours "; + $y = strftime("%Y",$objp->dp); + $m = strftime("%m",$objp->dp); + + print strftime("%d",$objp->dp)."\n"; + print " "; + print strftime("%B",$objp->dp)."\n"; + print " "; + print strftime("%Y",$objp->dp)."".price($objp->price)."$objp->statut
propalid\">$objp->refidp\">$objp->nom > 15 jours "; - $y = strftime("%Y",$objp->dp); - $m = strftime("%m",$objp->dp); - - print strftime("%d",$objp->dp)."\n"; - print " "; - print strftime("%B",$objp->dp)."\n"; - print " "; - print strftime("%Y",$objp->dp)."".price($objp->price)."$objp->statut
Total : ".price($subtotal)."Euros HT
$i propalesTotal : ".price($total)."Euros HT
"; $db->free(); - } else { - print $db->error(); } + else + { + print $db->error(); + } } $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$");