| Server IP : 31.14.161.123 / Your IP : 216.73.216.229 Web Server : Apache System : Linux cpanel.classit.ro 4.18.0-553.144.1.el8_10.x86_64 #1 SMP Tue Jul 14 09:26:58 EDT 2026 x86_64 User : diamedic ( 1014) PHP Version : 8.2.32 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/diamedic/public_html/exemple/ |
Upload File : |
<?php
/**
* PHPExcel
*/
/** Error reporting */
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
date_default_timezone_set('Europe/London');
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
/** Include PHPExcel */
require_once '../xls/PHPExcel.php';
require_once '../consumuri/api/functions/functii.php';
$luna = $_GET['luna'];
$an = $_GET['an'];
$d=cal_days_in_month(CAL_GREGORIAN, $luna, $an);
$denumiriLuni = array(
1 => 'ianuarie',
2 => 'februarie',
3 => 'martie',
4 => 'aprilie',
5 => 'mai',
6 => 'iunie',
7 => 'iulie',
8 => 'august',
9 => 'septembrie',
10 => 'octombrie',
11 => 'noiembrie',
12 => 'decembrie',
);
if($luna < 10){
$numeFisierMachete = 'raportare_01_' . $d . '.0' . $luna . '.' . $an;
}else{
$numeFisierMachete = 'raportare_01_' . $d . '.' . $luna . '.' . $an;
}
$numeFisierXML = '';
// 'machete_01_28.02.2014.xlsx'
$data = '01-' . $d . ' ' . $denumiriLuni[$luna] .' / '.$an;
// Create new PHPExcel object
//echo date('H:i:s') , " Create new PHPExcel object" , EOL;
$objPHPExcel = new PHPExcel();
// Set document properties
//echo date('H:i:s') , " Set document properties" , EOL;
$objPHPExcel->getProperties()->setCreator("DiaMedicalPort")
->setLastModifiedBy("DiaMedicalPort/** Include PHPExcel */")
->setTitle("PHPExcel Test Document")
->setSubject("PHPExcel Test Document")
->setDescription("Test document for PHPExcel, generated using PHP classes.")
->setKeywords("office PHPExcel php")
->setCategory("Test result file");
$objPHPExcel->getDefaultStyle()->getFont()->setName('Arial')
->setSize(9);
// prepare data HARDCODED
require_once 'centralizator.php';
//require_once 'desfasurator.php';
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
$objPHPExcel->setActiveSheetIndex(0);
// // Save Excel 2007 file
// echo date('H:i:s') , " Write to Excel2007 format" , EOL;
// $callStartTime = microtime(true);
// Redirect output to a client’s web browser (Excel5)
if($_GET['format'] === 'xlsx'){
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename="' . $numeFisierMachete . '.xlsx"');
}else{
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="' . $numeFisierMachete . '.xls"');
}
header('Cache-Control: max-age=0');
// If you're serving to IE 9, then the following may be needed
header('Cache-Control: max-age=1');
// If you're serving to IE over SSL, then the following may be needed
header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified
header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1
header ('Pragma: public'); // HTTP/1.0
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save('php://output');
exit;
// $objWriter->save( $numeFisierMachete . '.xlsx');
// $callEndTime = microtime(true);
// $callTime = $callEndTime - $callStartTime;
// echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
// echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
// // Echo memory usage
// echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
// // Save Excel5 file
// echo date('H:i:s') , " Write to Excel5 format" , EOL;
// $callStartTime = microtime(true);
// $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
// $objWriter->save( $numeFisierMachete.'.xls');
// $callEndTime = microtime(true);
// $callTime = $callEndTime - $callStartTime;
// echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
// echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
// // Echo memory usage
// echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
// // Echo memory peak usage
// echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
// // Echo done
// echo date('H:i:s') , " Done writing files" , EOL;
// // echo 'Files have been created in ' , getcwd() , EOL;