Fix: La liste des rapport s'affiche par défaut sur l'année courante.

This commit is contained in:
Laurent Destailleur 2004-12-28 15:16:49 +00:00
parent caa59d43ee
commit 9e987b65e1

View File

@ -39,6 +39,7 @@ if (!$user->admin && $user->societe_id > 0)
$year = $_GET["year"]; $year = $_GET["year"];
if (! $year) { $year=date("Y"); }
require("../../includes/modules/rapport/pdf_paiement.class.php"); require("../../includes/modules/rapport/pdf_paiement.class.php");
@ -63,9 +64,10 @@ llxHeader();
* Affichage liste des paiements * Affichage liste des paiements
* *
*/ */
print_titre("Rapport paiements"); print_titre("Rapport paiements".($year?" $year":""));
print '<form method="post" action="rapport.php?year='.$year.'">'; // Formulaire de génération
print '<br><form method="post" action="rapport.php?year='.$year.'">';
print '<input type="hidden" name="action" value="gen">'; print '<input type="hidden" name="action" value="gen">';
$cmonth = date("n", time()); $cmonth = date("n", time());
$syear = date("Y", time()); $syear = date("Y", time());
@ -114,10 +116,12 @@ print "</select>\n";
print '<input type="submit" value="'.$langs->trans("Create").'">'; print '<input type="submit" value="'.$langs->trans("Create").'">';
print '</form>'; print '</form>';
clearstatcache(); clearstatcache();
$handle=opendir($dir);
if (is_dir($dir)) {
$handle=opendir($dir);
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (is_dir($dir.$file) && substr($file, 0, 1) <> '.') if (is_dir($dir.$file) && substr($file, 0, 1) <> '.')
@ -125,9 +129,11 @@ while (($file = readdir($handle))!==false)
print '<a href="rapport.php?year='.$file.'">'.$file.'</a> '; print '<a href="rapport.php?year='.$file.'">'.$file.'</a> ';
} }
} }
}
if ($year) if ($year)
{ {
if (is_dir($dir.'/'.$year)) {
$handle=opendir($dir.'/'.$year); $handle=opendir($dir.'/'.$year);
print '<br>'; print '<br>';
print '<table width="100%" class="noborder">'; print '<table width="100%" class="noborder">';
@ -147,6 +153,7 @@ if ($year)
} }
print '</table>'; print '</table>';
} }
}
$db->close(); $db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>"); llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");