fix bug
This commit is contained in:
parent
c2e025d1d9
commit
ead3361d32
|
@ -16,9 +16,6 @@ class DashboardController extends Controller {
|
|||
|
||||
public function init() {
|
||||
parent::init();
|
||||
if (Yii::$app->user->isGuest) {
|
||||
return $this->redirect(['/site/login']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -80,7 +77,7 @@ class DashboardController extends Controller {
|
|||
$totals = count($lists) + 2;
|
||||
$maxCol = "H";
|
||||
$activeSheet = $objPHPExcel->getActiveSheet();
|
||||
$activeSheet->setCellValue("A1", "DANH SÁCH CHẤM CÔNG");
|
||||
$activeSheet->setCellValue("A1", "DỮ LIỆU CHẤM CÔNG");
|
||||
$activeSheet->mergeCells('A1:' . $maxCol . '1');
|
||||
$activeSheet->getRowDimension('1')->setRowHeight(50);
|
||||
$activeSheet->getStyle("A2:" . $maxCol . "2")->getFont()->setBold(true);
|
||||
|
@ -138,12 +135,13 @@ class DashboardController extends Controller {
|
|||
]
|
||||
]);
|
||||
$objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
|
||||
ob_end_clean();
|
||||
header('Content-type: application/vnd.ms-excel');
|
||||
header('Content-Disposition: attachment; filename="du-lieu.xlsx"');
|
||||
header('Cache-Control: max-age=0');
|
||||
$objWriter->save('php://output');
|
||||
exit();
|
||||
// ob_end_clean();
|
||||
// header('Content-type: application/vnd.ms-excel');
|
||||
// header('Content-Disposition: attachment; filename="du-lieu.xlsx"');
|
||||
// header('Cache-Control: max-age=0');
|
||||
// $objWriter->save('php://output');
|
||||
$objWriter->save('du-lieu.xlsx');
|
||||
return $this->redirect(Yii::$app->request->hostInfo . "/BiFace_Server_Lite/web/du-lieu.xlsx");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user