From 9e987b65e1d26d58147cb30ecd9090e2cc71f781 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Dec 2004 15:16:49 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20La=20liste=20des=20rapport=20s'affiche?= =?UTF-8?q?=20par=20d=E9faut=20sur=20l'ann=E9e=20courante.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/paiement/rapport.php | 55 +++++++++++++++++------------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index c71d1a7d26d..e6de71740ae 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -39,6 +39,7 @@ if (!$user->admin && $user->societe_id > 0) $year = $_GET["year"]; +if (! $year) { $year=date("Y"); } require("../../includes/modules/rapport/pdf_paiement.class.php"); @@ -63,9 +64,10 @@ llxHeader(); * Affichage liste des paiements * */ -print_titre("Rapport paiements"); +print_titre("Rapport paiements".($year?" $year":"")); -print '
'; +// Formulaire de génération +print '
'; print ''; $cmonth = date("n", time()); $syear = date("Y", time()); @@ -114,38 +116,43 @@ print "\n"; print ''; print '
'; + clearstatcache(); -$handle=opendir($dir); -while (($file = readdir($handle))!==false) -{ - if (is_dir($dir.$file) && substr($file, 0, 1) <> '.') +if (is_dir($dir)) { + $handle=opendir($dir); + while (($file = readdir($handle))!==false) { - print ''.$file.' '; + if (is_dir($dir.$file) && substr($file, 0, 1) <> '.') + { + print ''.$file.' '; + } } } if ($year) { - $handle=opendir($dir.'/'.$year); - print '
'; - print ''; - print ''; - $var=true; - while (($file = readdir($handle))!==false) - { - if (substr($file, 0, 8) == 'paiement') - { - $var=!$var; - $tfile = $dir . '/'.$year.'/'.$file; - $relativepath = $year.'/'.$file; - print "".''; - print ''; - print ''; - } + if (is_dir($dir.'/'.$year)) { + $handle=opendir($dir.'/'.$year); + print '
'; + print '
Rapport'.$langs->trans("Size").''.$langs->trans("Date").'
'.img_pdf().' '.$file.''.filesize($tfile). ' bytes'.strftime("%d %b %Y %H:%M:%S",filemtime($tfile)).'
'; + print ''; + $var=true; + while (($file = readdir($handle))!==false) + { + if (substr($file, 0, 8) == 'paiement') + { + $var=!$var; + $tfile = $dir . '/'.$year.'/'.$file; + $relativepath = $year.'/'.$file; + print "".''; + print ''; + print ''; + } + } + print '
Rapport'.$langs->trans("Size").''.$langs->trans("Date").'
'.img_pdf().' '.$file.''.filesize($tfile). ' bytes'.strftime("%d %b %Y %H:%M:%S",filemtime($tfile)).'
'; } - print ''; } $db->close();