Ajout des tris dans la liste
This commit is contained in:
parent
175a2e6e22
commit
e6b08dc371
@ -1,5 +1,5 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -25,26 +25,6 @@ llxHeader();
|
|||||||
|
|
||||||
$db = new Db();
|
$db = new Db();
|
||||||
|
|
||||||
if ($action == 'add') {
|
|
||||||
$datepaye = $db->idate(mktime(12, 0 , 0, $pmonth, $pday, $pyear));
|
|
||||||
|
|
||||||
$paiement = new Paiement($db);
|
|
||||||
|
|
||||||
$paiement->facid = $facid;
|
|
||||||
$paiement->datepaye = $datepaye;
|
|
||||||
$paiement->amount = $amount;
|
|
||||||
$paiement->author = $author;
|
|
||||||
$paiement->paiementid = $paiementid;
|
|
||||||
$paiement->num_paiement = $num_paiement;
|
|
||||||
$paiement->note = $note;
|
|
||||||
|
|
||||||
$paiement->create();
|
|
||||||
|
|
||||||
$action = '';
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if ($sortorder == "") { $sortorder="DESC"; }
|
if ($sortorder == "") { $sortorder="DESC"; }
|
||||||
if ($sortfield == "") { $sortfield="d.datedon"; }
|
if ($sortfield == "") { $sortfield="d.datedon"; }
|
||||||
|
|
||||||
@ -57,7 +37,11 @@ $pagenext = $page + 1;
|
|||||||
|
|
||||||
$sql = "SELECT d.rowid, ".$db->pdate("d.datedon")." as datedon, d.prenom, d.nom, d.societe, d.amount, p.libelle as projet";
|
$sql = "SELECT d.rowid, ".$db->pdate("d.datedon")." as datedon, d.prenom, d.nom, d.societe, d.amount, p.libelle as projet";
|
||||||
$sql .= " FROM llx_don as d, llx_don_projet as p";
|
$sql .= " FROM llx_don as d, llx_don_projet as p";
|
||||||
$sql .= " WHERE p.rowid = d.fk_don_projet AND d.fk_statut = $statut";
|
$sql .= " WHERE p.rowid = d.fk_don_projet";
|
||||||
|
if (strlen($statut))
|
||||||
|
{
|
||||||
|
$sql .= " AND d.fk_statut = $statut";
|
||||||
|
}
|
||||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset);
|
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset);
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -66,15 +50,29 @@ if ($result)
|
|||||||
$num = $db->num_rows();
|
$num = $db->num_rows();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
print_barre_liste($libelle[$statut], $page, $PHP_SELF, "&statut=$statut");
|
if (strlen($statut))
|
||||||
|
{
|
||||||
|
print_barre_liste($libelle[$statut], $page, $PHP_SELF, "&statut=$statut&sortorder=$sortorder&sortfield=$sortfield");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print_barre_liste("Dons", $page, $PHP_SELF, "&statut=$statut&sortorder=$sortorder&sortfield=$sortfield");
|
||||||
|
}
|
||||||
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||||
|
|
||||||
print '<TR class="liste_titre">';
|
print '<TR class="liste_titre">';
|
||||||
print "<td>Prenom Nom / Société</td>";
|
print "<td>";
|
||||||
print "<td>Date</td>";
|
print_liste_field_titre("Prénom",$PHP_SELF,"d.prenom","&page=$page&statut=$statut");
|
||||||
print "<td>Projet</td>";
|
print "</td><td>";
|
||||||
print "<td align=\"right\">Montant</TD>";
|
print_liste_field_titre("Nom",$PHP_SELF,"d.nom","&page=$page&statut=$statut");
|
||||||
print '<td> </td>';
|
print "</td><td>";
|
||||||
|
print_liste_field_titre("Société",$PHP_SELF,"d.societe","&page=$page&statut=$statut");
|
||||||
|
print "</td><td>";
|
||||||
|
print_liste_field_titre("Date",$PHP_SELF,"d.datedon","&page=$page&statut=$statut");
|
||||||
|
print "</td><td>Projet</td>";
|
||||||
|
print "<td align=\"right\">";
|
||||||
|
print_liste_field_titre("Montant",$PHP_SELF,"d.amount","&page=$page&statut=$statut");
|
||||||
|
print '</td><td> </td>';
|
||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
|
|
||||||
$var=True;
|
$var=True;
|
||||||
@ -83,7 +81,9 @@ if ($result)
|
|||||||
$objp = $db->fetch_object( $i);
|
$objp = $db->fetch_object( $i);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<TR $bc[$var]>";
|
print "<TR $bc[$var]>";
|
||||||
print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)." / ".stripslashes($objp->societe)."</a></TD>\n";
|
print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".stripslashes($objp->prenom)."</a></TD>\n";
|
||||||
|
print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".stripslashes($objp->nom)."</a></TD>\n";
|
||||||
|
print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".stripslashes($objp->societe)."</a></TD>\n";
|
||||||
print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".strftime("%d %B %Y",$objp->datedon)."</a></td>\n";
|
print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".strftime("%d %B %Y",$objp->datedon)."</a></td>\n";
|
||||||
print "<TD>$objp->projet</TD>\n";
|
print "<TD>$objp->projet</TD>\n";
|
||||||
print '<TD align="right">'.price($objp->amount).'</TD><td> </td>';
|
print '<TD align="right">'.price($objp->amount).'</TD><td> </td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user