From 92c5b10a52df6ce884854c9ea54fc8c276940fb9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Sep 2005 16:47:39 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Le=20tri=20en=20conservait=20pas=20le=20?= =?UTF-8?q?filtre=20sur=20ann=E9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/adherents/cotisations.php | 123 ++++++++++++++++--------------- 1 file changed, 62 insertions(+), 61 deletions(-) diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php index 3a19bb21dd6..1eab3a05da2 100644 --- a/htdocs/adherents/cotisations.php +++ b/htdocs/adherents/cotisations.php @@ -19,7 +19,6 @@ * * $Id$ * $Source$ - * */ /** @@ -119,7 +118,8 @@ $sql.= " b.fk_account"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."cotisation as c"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank=b.rowid"; $sql.= " WHERE d.rowid = c.fk_adherent"; -if(isset($date_select) && $date_select != ''){ +if(isset($date_select) && $date_select != '') +{ $sql .= " AND dateadh LIKE '$date_select%'"; } $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset); @@ -127,71 +127,72 @@ $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $of $result = $db->query($sql); if ($result) { - $num = $db->num_rows($result); - $i = 0; + $num = $db->num_rows($result); + $i = 0; - print ''; + print '
'; - print ''; - print_liste_field_titre($langs->trans("Date"),"cotisations.php","c.dateadh","&page=$page&statut=$statut","","",$sortfield); - print_liste_field_titre($langs->trans("Name"),"cotisations.php","d.nom","&page=$page&statut=$statut","","",$sortfield); - print_liste_field_titre($langs->trans("Amount"),"cotisations.php","c.cotisation","&page=$page&statut=$statut","","align=\"right\"",$sortfield); - if (defined("ADHERENT_BANK_USE") && ADHERENT_BANK_USE !=0) - { - print_liste_field_titre($langs->trans("Bank"),"cotisations.php","b.fk_account","&page=$page&statut=$statut","","",$sortfield); - } - print "\n"; - - $var=true; - $total=0; - while ($i < $num) - { - $objp = $db->fetch_object($result); - $total+=price($objp->cotisation); - - $var=!$var; - print ""; - print "\n"; - print "\n"; - print ''; + $param="&page=$page&statut=$statut&date_select=$date_select"; + print ''; + print_liste_field_titre($langs->trans("Date"),"cotisations.php","c.dateadh",$param,"","",$sortfield); + print_liste_field_titre($langs->trans("Name"),"cotisations.php","d.nom",$param,"","",$sortfield); + print_liste_field_titre($langs->trans("Amount"),"cotisations.php","c.cotisation",$param,"","align=\"right\"",$sortfield); if (defined("ADHERENT_BANK_USE") && ADHERENT_BANK_USE !=0) { - if ($objp->fk_account) - { - $acc=new Account($db); - $acc->fetch($objp->fk_account); - print ''; - } - else - { - print ""; - // print ""; - print ''; - print "\n"; - print "\n"; - } + print_liste_field_titre($langs->trans("Bank"),"cotisations.php","b.fk_account",$pram,"","",$sortfield); } - print ""; - $i++; - } + print "\n"; - $var=!$var; - print ''; - print "\n"; - print "\n"; - print "\n"; - print ''; - print "\n"; - print "
".dolibarr_print_date($objp->dateadh)."rowid&action=edit\">".img_object($langs->trans("ShowMember"),"user").' '.stripslashes($objp->prenom)." ".stripslashes($objp->nom)."'.price($objp->cotisation).'
'.$acc->label.'"; - print "
"; - print ''; - print ''; - $html = new Form($db); - $html->select_types_paiements(); - print ' - '; - print "trans("Subscriptions").' '.stripslashes($objp->prenom)." ".stripslashes($objp->nom)." ".strftime("%Y",$objp->dateadh)."\" >\n"; - // print "
".$langs->trans("Total")." ".price($total)." 
"; - print "
\n"; + $var=true; + $total=0; + while ($i < $num) + { + $objp = $db->fetch_object($result); + $total+=price($objp->cotisation); + + $var=!$var; + print ""; + print "".dolibarr_print_date($objp->dateadh)."\n"; + print "rowid&action=edit\">".img_object($langs->trans("ShowMember"),"user").' '.stripslashes($objp->prenom)." ".stripslashes($objp->nom)."\n"; + print ''.price($objp->cotisation).''; + if (defined("ADHERENT_BANK_USE") && ADHERENT_BANK_USE !=0) + { + if ($objp->fk_account) + { + $acc=new Account($db); + $acc->fetch($objp->fk_account); + print ''.$acc->label.''; + } + else + { + print ""; + print "
"; + print ''; + print ''; + $html = new Form($db); + $html->select_types_paiements(); + print ' - '; + print "trans("Subscriptions").' '.stripslashes($objp->prenom)." ".stripslashes($objp->nom)." ".strftime("%Y",$objp->dateadh)."\" >\n"; + // print ""; + // print ""; + print ''; + print "
\n"; + print "\n"; + } + } + print ""; + $i++; + } + + $var=!$var; + print ''; + print "".$langs->trans("Total")."\n"; + print " \n"; + print "".price($total)."\n"; + print ' '; + print "\n"; + print ""; + print "
\n"; }