2009-08-11 15:00:18 +00:00
|
|
|
<?
|
|
|
|
header("content-type: ". mimetype($_REQUEST['format']));
|
2009-08-19 12:33:42 +00:00
|
|
|
header("Content-type: application/force-download");
|
|
|
|
header("Content-Disposition: attachment; filename=export_rapport".date("Ymd_Hi").".".$_REQUEST['format']);
|
2009-08-11 15:00:18 +00:00
|
|
|
|
2009-08-19 12:33:42 +00:00
|
|
|
function mimetype($file){
|
|
|
|
$file2mime = array(
|
|
|
|
"doc"=>"application/msword",
|
|
|
|
"htm"=>"text/html",
|
|
|
|
"html"=>"text/html",
|
2009-08-11 15:00:18 +00:00
|
|
|
"xlm"=>"application/vnd.ms-excel"
|
2009-08-19 12:33:42 +00:00
|
|
|
);
|
|
|
|
return @$file2mime[$file];
|
2009-08-11 15:00:18 +00:00
|
|
|
}
|
|
|
|
|
2009-08-19 12:33:42 +00:00
|
|
|
require_once realpath(dirname(__FILE__)).'/mysql_inc.php';
|
2009-08-11 15:00:18 +00:00
|
|
|
|
|
|
|
echo mysql_result(mysql_query("SELECT content FROM report WHERE id = '".intval($_REQUEST['id'])."'"), 0);
|
|
|
|
|
|
|
|
mysql_close($connexion);
|
|
|
|
?>
|