diff --git a/htdocs/compta/dons/liste.php b/htdocs/compta/dons/liste.php index 445b23af8b6..b9ebee85cc1 100644 --- a/htdocs/compta/dons/liste.php +++ b/htdocs/compta/dons/liste.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2001-2003 Rodolphe Quiedeville * * 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 @@ -25,26 +25,6 @@ llxHeader(); $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 ($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 .= " 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); $result = $db->query($sql); @@ -66,15 +50,29 @@ if ($result) $num = $db->num_rows(); $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 ""; print ''; - print ""; - print ""; - print ""; - print ""; - print ''; + print ""; + print "'; print "\n"; $var=True; @@ -83,7 +81,9 @@ if ($result) $objp = $db->fetch_object( $i); $var=!$var; print ""; - print "\n"; + print "\n"; + print "\n"; + print "\n"; print "\n"; print "\n"; print '';
Prenom Nom / SociétéDateProjetMontant "; + print_liste_field_titre("Prénom",$PHP_SELF,"d.prenom","&page=$page&statut=$statut"); + print ""; + print_liste_field_titre("Nom",$PHP_SELF,"d.nom","&page=$page&statut=$statut"); + print ""; + print_liste_field_titre("Société",$PHP_SELF,"d.societe","&page=$page&statut=$statut"); + print ""; + print_liste_field_titre("Date",$PHP_SELF,"d.datedon","&page=$page&statut=$statut"); + print "Projet"; + print_liste_field_titre("Montant",$PHP_SELF,"d.amount","&page=$page&statut=$statut"); + print ' 
rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)." / ".stripslashes($objp->societe)."rowid&action=edit\">".stripslashes($objp->prenom)."rowid&action=edit\">".stripslashes($objp->nom)."rowid&action=edit\">".stripslashes($objp->societe)."rowid&action=edit\">".strftime("%d %B %Y",$objp->datedon)."$objp->projet'.price($objp->amount).'