*
* $Id$
* $Source$
*
* 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.
*
*/
require("./pre.inc.php3");
/*
*
*/
llxHeader();
print "Point mort";
$db = new Db();
if ($action == 'update') {
$datepm = mktime(12, 0 , 0, $pmonth, 1, $pyear);
$sql = "DELETE FROM llx_pointmort WHERE int(month) = $datepm ;";
$sql .= "INSERT INTO llx_pointmort VALUES ($datepm, $pm)";
$result = $db->query($sql);
}
print "
";
print "";
$sql = "SELECT amount, int(month) as dm FROM llx_pointmort ORDER BY month DESC";
$result = $db->query($sql);
if ($result) {
print "";
print "";
print "| Mois | ";
print "Montant | ";
print " \n";
$bc[0]="bgcolor=\"#90c090\"";
$bc[1]="bgcolor=\"#b0e0b0\"";
$var = 1 ;
$i = 0;
$num = $db->num_rows();
while ($i < $num) {
$obj = $db->fetch_object( $i);
$var=!$var;
print "";
print "| ".strftime("%Y %B",$obj->dm)." | \n";
print "$obj->amount | \n";
print " \n";
$i++;
}
print " ";
}
print " | ";
print "";
print " |
";
$db->close();
llxFooter("Dernière modification $Date$ révision $Revision$");
?>