inital commit
This commit is contained in:
38
webroot/Staff/common_admin_file.php
Normal file
38
webroot/Staff/common_admin_file.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
$html = str_replace($varList,$valueList,$html);
|
||||
|
||||
include("../mpdf60/mpdf.php");
|
||||
$mpdf=new mPDF();
|
||||
$mpdf->SetProtection(array("print"));
|
||||
$mpdf->defaultfooterline = 0;
|
||||
$mpdf->setFooter("Page {PAGENO} of {nb}");
|
||||
$mpdf->WriteHTML($html);
|
||||
/*
|
||||
if(isset($deletionArray) && !empty($deletionArray)){
|
||||
foreach($deletionArray as $key=>$value){
|
||||
@unlink($value);
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
$mpdf->Output($file_name);
|
||||
|
||||
|
||||
|
||||
$fullPath = $file_name;
|
||||
|
||||
header("Cache-Control: public");
|
||||
header("Content-Description: File Transfer");
|
||||
header('Content-disposition: attachment;filename='.basename($fullPath));
|
||||
header("Content-Type: application/pdf");
|
||||
header("Content-Transfer-Encoding: Binary");
|
||||
header('Content-Length: '. filesize($fullPath));
|
||||
ob_implicit_flush(true);
|
||||
ob_clean();
|
||||
flush();
|
||||
readfile($fullPath);
|
||||
@unlink($fullPath);
|
||||
exit;
|
||||
?>
|
||||
Reference in New Issue
Block a user