diff --git a/htdocs/compta/paiement/index.php b/htdocs/compta/paiement/index.php index d35ece689df..e4f600a6d1c 100644 --- a/htdocs/compta/paiement/index.php +++ b/htdocs/compta/paiement/index.php @@ -20,7 +20,6 @@ * */ require("./pre.inc.php"); - /* * Sécurité accés */ @@ -30,6 +29,18 @@ if ($user->societe_id > 0) exit; } +require("../../includes/modules/rapport/pdf_paiement.class.php"); + +$dir = DOL_DOCUMENT_ROOT."/document/rapport/"; + +if ($HTTP_POST_VARS["action"] == 'gen') +{ + $rap = new pdf_paiement($db); + $rap->write_pdf_file($dir, $HTTP_POST_VARS["remonth"], $HTTP_POST_VARS["reyear"]); + + $year = $HTTP_POST_VARS["reyear"]; +} + llxHeader(); @@ -39,13 +50,85 @@ llxHeader(); */ print_titre("Rapport paiements"); -require("../../includes/modules/rapport/pdf_paiement.class.php"); +print '
'; +print ''; +$cmonth = date("n", time()); +$syear = date("Y", time()); + +$strmonth[1] = "Janvier"; +$strmonth[2] = "Février"; +$strmonth[3] = "Mars"; +$strmonth[4] = "Avril"; +$strmonth[5] = "Mai"; +$strmonth[6] = "Juin"; +$strmonth[7] = "Juillet"; +$strmonth[8] = "Août"; +$strmonth[9] = "Septembre"; +$strmonth[10] = "Octobre"; +$strmonth[11] = "Novembre"; +$strmonth[12] = "Décembre"; -$rap = new pdf_paiement($db); -$rap->write_pdf_file(); +print '"; + +print '\n"; +print ''; +print '
'; +clearstatcache(); + +$handle=opendir($dir); + +while (($file = readdir($handle))!==false) +{ + if (is_dir($dir.$file) && substr($file, 0, 1) <> '.') + { + print ''.$file.' '; + } +} + +if ($year) +{ + $handle=opendir($dir.'/'.$year); + + print ''; + print ''; + while (($file = readdir($handle))!==false) + { + if (substr($file, 0, 8) == 'paiement') + { + $tfile = $dir . '/'.$year.'/'.$file; + print ''; + print ''; + print ''; + } + } + print '
RapportTailleDate de génération
'.$file.''.filesize($tfile). ' bytes'.strftime("%d %b %Y %H:%M:%S",filemtime($tfile)).'
'; +} $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$");