* Copyright (C) 2004-2006 Laurent Destailleur * * 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$ */ /** \file htdocs/compta/dons/index.php \ingroup don \brief Page accueil espace don \version $Revision$ */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT ."/product/droitpret/droitpret.class.php"); require_once(DOL_DOCUMENT_ROOT ."/product/droitpret/modules_droitpret.php"); global $conf; $html = new Form($db); if($_GET['action'] && $_GET['action'] == 'create') { $dated = mktime($_POST['dhour'],$_POST['dmin'],0,$_POST['dmonth'],$_POST['dday'],$_POST['dyear']); $datef = mktime($_POST['fhour'],$_POST['fmin'],0,$_POST['fmonth'],$_POST['fday'],$_POST['fyear']); if($dated < $datef) { $droitpret = new DroitPret($db,$dated,$datef); $droitpret->CreateNewRapport(); $mesg = $droitpret->EnvoiMail(); } else { $mesg='
'.$langs->trans("ErrorDate").'
'; } } /* * Affichage */ llxHeader(); print_fiche_titre($langs->trans("DroitPretArea")); if ($mesg) print "$mesg\n"; $sql = "SELECT MAX(date_fin) as lastRapport FROM ".MAIN_DB_PREFIX."droitpret_rapport"; $result = $db->query($sql); $obj = $db->fetch_object($result); $lastRapport = $obj->lastRapport; print '
'; print ''; print ''; print ''; print ''; print '
Date de début de période'; $html->select_date($lastRapport,'d',1,1,'',"dated"); print '
Date de fin de période'; $html->select_date('','f',1,1,'',"datef"); print '
'; print '
'; print '
'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; $sql ="SELECT rowid, date_envoie, date_debut, date_fin, fichier, nbfact"; $sql.=" FROM ".MAIN_DB_PREFIX."droitpret_rapport"; $sql.=" ORDER BY rowid"; $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); $i = 0; $var = true; while ($i < $num) { $var = !$var; $obj = $db->fetch_object($resql); print ''; print ''; print ''; print ''; print ''; $i++; } } print '
DocumentDate du rapportDébut périodeFin périodeNb factures
'.$obj->fichier.''.$obj->date_envoie.''.$obj->date_debut.''.$obj->date_fin.''.$obj->nbfact.'
'; ?>