Suppressions des totaux, changement du tri par défaut

This commit is contained in:
Rodolphe Quiedeville 2003-05-17 15:38:34 +00:00
parent 46f5808748
commit 98e250a0fb

View File

@ -284,7 +284,7 @@ if ($propalid) {
$total = $total + $objp->price; $total = $total + $objp->price;
$i++; $i++;
} }
//print "<tr><td align=\"right\" colspan=\"3\">Total : <b>".price($total)."</b></td><td>Euros HT</td></tr>\n";
print "</table>"; print "</table>";
} }
/* /*
@ -519,14 +519,14 @@ if ($propalid) {
*/ */
if ($sortfield == "") { if ($sortfield == "") {
$sortfield="p.fk_statut, datep "; $sortfield="p.datep";
} }
if ($sortorder == "") { if ($sortorder == "") {
$sortorder="ASC"; $sortorder="DESC";
} }
if ($page == -1) { $page = 0 ; } if ($page == -1) { $page = 0 ; }
$limit = 26;
$offset = $limit * $page ; $offset = $limit * $page ;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
@ -553,27 +553,13 @@ if ($propalid) {
$sql .= " AND date_format(p.datep, '%Y') = $year"; $sql .= " AND date_format(p.datep, '%Y') = $year";
} }
$sql .= " ORDER BY $sortfield ASC"; $sql .= " ORDER BY $sortfield $sortorder";
if ( $db->query($sql) ) { if ( $db->query($sql) ) {
$num = $db->num_rows(); $num = $db->num_rows();
$i = 0; $i = 0;
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">"; print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
$oldstatut = -1;
$subtotal = 0;
while ($i < $num) {
$objp = $db->fetch_object( $i);
if ($objp->statut <> $oldstatut ) {
$oldstatut = $objp->statut;
if ($i > 0) {
print "<tr><td align=\"right\" colspan=\"5\">Total : <b>".price($subtotal)."</b></td>\n";
print "<td align=\"left\">Euros HT</td></tr>\n";
}
$subtotal = 0;
print '<TR class="liste_titre">'; print '<TR class="liste_titre">';
print "<TD>Réf</TD><td>"; print "<TD>Réf</TD><td>";
print_liste_field_titre ("Société",$PHP_SELF,"s.nom"); print_liste_field_titre ("Société",$PHP_SELF,"s.nom");
@ -583,7 +569,10 @@ if ($propalid) {
print '<img src="/theme/'.$conf->theme.'/img/filter.png" border="0"></a></td>'; print '<img src="/theme/'.$conf->theme.'/img/filter.png" border="0"></a></td>';
print "</TR>\n"; print "</TR>\n";
$var=True; $var=True;
}
while ($i < $num)
{
$objp = $db->fetch_object( $i);
$var=!$var; $var=!$var;
print "<TR $bc[$var]>"; print "<TR $bc[$var]>";
@ -593,9 +582,12 @@ if ($propalid) {
$now = time(); $now = time();
$lim = 3600 * 24 * 15 ; $lim = 3600 * 24 * 15 ;
if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 ) { if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 )
{
print "<td><b> &gt; 15 jours</b></td>"; print "<td><b> &gt; 15 jours</b></td>";
} else { }
else
{
print "<td>&nbsp;</td>"; print "<td>&nbsp;</td>";
} }
@ -618,16 +610,13 @@ if ($propalid) {
$i++; $i++;
} }
print "<tr><td align=\"right\" colspan=\"5\">Total : <b>".price($subtotal)."</b></td>\n";
print "<td align=\"left\">Euros HT</td></tr>\n";
print "<tr><td></td><td>$i propales</td>";
print "<td colspan=\"3\" align=\"right\"><b>Total : ".price($total)."</b></td>";
print "<td align=\"left\"><b>Euros HT</b></td></tr>";
print "</TABLE>"; print "</TABLE>";
$db->free(); $db->free();
} else { }
else
{
print $db->error(); print $db->error();
} }
} }