Files
dolibarr/htdocs/adherents/cotisations.php
Rodolphe Quiedeville 384b5ee54f .
2002-12-30 15:13:28 +00:00

103 lines
2.9 KiB
PHP
Raw Blame History

<?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/
require("./pre.inc.php");
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="c.dateadh"; }
if ($page == -1) { $page = 0 ; }
$offset = $conf->liste_limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, c.cotisation, ".$db->pdate("c.dateadh")." as dateadh";
$sql .= " FROM llx_adherent as d, llx_cotisation as c";
$sql .= " WHERE d.rowid = c.fk_adherent";
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset);
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$i = 0;
print_barre_liste("Liste des cotisations", $page, $PHP_SELF, "&statut=$statut");
print "<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"4\">";
print '<TR class="liste_titre">';
print "<td>Date</td>";
print "<td align=\"right\">Montant</TD>";
print "<td>Prenom Nom / Soci<63>t<EFBFBD></td>";
print "</TR>\n";
$var=True;
while ($i < $num)
{
$objp = $db->fetch_object( $i);
$var=!$var;
print "<TR $bc[$var]>";
print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".strftime("%d %B %Y",$objp->dateadh)."</a></td>\n";
print '<TD align="right">'.price($objp->cotisation).'</TD>';
print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)." / ".stripslashes($objp->societe)."</a></TD>\n";
print "</tr>";
$i++;
}
print "</table>";
}
else
{
print $sql;
print $db->error();
}
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>