diff --git a/htdocs/compta/compta-files.php b/htdocs/compta/compta-files.php index ef8c612ed84..2a4af918234 100644 --- a/htdocs/compta/compta-files.php +++ b/htdocs/compta/compta-files.php @@ -1,5 +1,8 @@ + +/* Copyright (C) 2001-2006 Rodolphe Quiedeville + * Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2017 Pierre-Henry Favre * * 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 @@ -185,7 +188,7 @@ if(($action=="searchfiles"||$action=="dl" ) && $date_start && $date_stop){ if($result & $action=="dl"){ unset($zip); $log='date,type,ref,total,paid,filename,item_id'."\n"; - $zipname = 'export.zip'; + $zipname = ($date_start)."-".($date_stop).'_export.zip'; $zip = new ZipArchive; $res = $zip->open($zipname, ZipArchive::OVERWRITE|ZipArchive::CREATE); if ($res){ @@ -200,6 +203,7 @@ if($result & $action=="dl"){ header('Content-disposition: attachment; filename='.$zipname); header('Content-Length: ' . filesize($zipname)); readfile($zipname); + unlink($zipname); exit(); } } @@ -285,14 +289,17 @@ if ($result) } print ""; print '
'."\n\t\t\t"; -print ''; -print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +//print ''; +//print ''; +//print ''; +//print ''; +//print ''; +//print ''; print '
'."\n\t\t\n\t\t\n\t\t\t";