Mini Shell

Direktori : /var/www/vhosts/ccp.ac.th/smtp.ccp.ac.th/httpdocs/sp/admin/
Upload File :
Current File : /var/www/vhosts/ccp.ac.th/smtp.ccp.ac.th/httpdocs/sp/admin/academic_report_pdf.php

<?php
        include '../db/database.php';
        include '../mpdf/mpdf.php';
        ob_start();     
              
?>

<!DOCTYPE html>
<html>
    <head>      
    </head>
    <body>
        
        <div class="text-center">
        <img src="dist/img/logoccp.gif" width="92px">
        </div>
        <?php
          $academic = $_GET['itemname'];
    if(empty($academic)){
	$sql = "SELECT * FROM teacher AS t1 INNER JOIN title_name AS t2 ON (t1.titleID = t2.titleID) INNER JOIN academic AS t3 ON (t1.academic = t3.Code) where (status_user = 1 or status_user = 2 or status_user = 3) and academic LIKE '%{$academic}%'AND academic > '0' order By teacherID DESC";
         }else{
        $sql = "SELECT * FROM teacher AS t1 INNER JOIN title_name AS t2 ON (t1.titleID = t2.titleID) INNER JOIN academic AS t3 ON (t1.academic = t3.Code) where (status_user = 1 or status_user = 2 or status_user = 3) and academic = '$academic' order By teacherID DESC ";
         } 
      $query = mysqli_query($link,$sql);
      $row = mysqli_num_rows($query);
        
       if(empty($academic)){
         $academic_name = "แสดงทั้งหมด";
      }else if($academic==1){
         $academic_name = "ชำนาญการ";
     }else if($academic==2){
         $academic_name = "ชำนาญการพิเศษ";
     }else if($academic==3){
         $academic_name = "เชี่ยวชาญ";
     }else if($academic==4){
         $academic_name = "เชี่ยวชาญพิเศษ";
     }
      ?>
        <h3 class="text-center"><strong>โรงเรียนเทศบาลวัดชัยชุมพล  เทศบาลเมืองทุ่งสง</strong></h3>
        <h4 class="text-center"><strong>รายงานข้อมูลบุคลากรตามวิทยฐานะ&nbsp;<?php echo $academic_name; ?></strong></h4>
        <h4 class="text-center"><strong>ทั้งหมด <?php echo $row ?> คน</strong></h4>
        
        <section class="content">

        <div class="col-md-8 col-md-offset-2">

<div  class="table-responsive">
    <table  align="center"id="mytable" class="table table-bordered">
        <thead >
            <tr class="active">
                <th class="text-center">ลำดับ</th>
                <th>ชื่อ-นามสกุล</th>
                <th>วิทยฐานะ</th>
            </tr>
        </thead>
        <tbody>
            <?php 
            $i=1;
             if(!empty($row)){
                 
            while ($result = mysqli_fetch_assoc($query)) { ?>
            <tr>
                <td class="text-center"><?php echo $i;?></td>
                <td><?php echo $result['titleName']. $result['name'];?>&nbsp; <?php echo $result['lastName'];?></td>
                <td><?php echo $result['academicName'];?></td>              
            </tr>
            <?php $i++; } ?>
            <?php  
           }else if(empty($row)){ 
            ?>
       
       <tr>
        <th colspan="3" align="center"><i class="fa fa-folder-open"></i>&nbsp;ไม่พบข้อมูล</th>  
        </tr>
        
     <?php  }  ?>
        </tbody>
   
    </table>
                
            </div><!-- /.box-body -->
            <div class="box-footer">
              
            </div><!-- box-footer -->
          </div><!-- /.box -->
          

        </section><!-- /.content -->
     <?php 
     include 'function_datethai.php';
     date_default_timezone_set("Asia/Bangkok");
        $eng_date=time();
       ?>
        
        <?php
            $html = ob_get_contents();
            ob_end_clean();
            
            $mpdf=new mPDF('utf-8');
            $mpdf->margin_header = 9;
            $mpdf->SetHeader('รายงานโดย โรงเรียนเทศบาลวัดชัยชุมพล | รายงานข้อมูลบุคลากรตามวิทยฐานะ | ออกรายงานเมื่อ: '.thai_date($eng_date));
            $mpdf->margin_footer = 9;
            $mpdf->SetFooter('หน้าที่ {PAGENO}');
            // Define a Landscape page size/format by name
            //$mpdf=new mPDF('utf-8', 'A4-L');
            // Define a page size/format by array - page will be 190mm wide x 236mm height
            //$mpdf=new mPDF('utf-8', array(190,236));  
            $stylesheet = file_get_contents('./bootstrap/css/printpdf.css');
            //$mpdf->SetDisplayMode('fullpage');
            $mpdf->WriteHTML($stylesheet,1);
            $mpdf->WriteHTML($html,2);
            //$mpdf->Output();
            $mpdf->Output(time().'.pdf','I');
            
            
            exit;
        ?>
        
        
          
    </body>
</html>

Zerion Mini Shell 1.0