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/show_teacher_pdf.php

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

<!DOCTYPE html>
<html>
    <head>      
    </head>
    <body>
   <?php 
     include 'function_datethai.php';
     date_default_timezone_set("Asia/Bangkok");
        $eng_date=time();
       ?>
        
        <div class="text-center">
        <img src="dist/img/logoccp.gif" width="92px">
        </div>
        <?php
          $teacherID = $_GET['teacherID'];
             $sql = "SELECT * FROM teacher AS t1 LEFT JOIN title_name AS t2 ON (t1.titleID = t2.titleID) LEFT JOIN type_personnel AS t3 ON (t1.typeID = t3.typeID) LEFT JOIN tbl_type AS t4 ON (t1.position = t4.type_id) LEFT JOIN tbl_sub_type AS t5 ON (t1.positionManage = t5.sub_type_id) LEFT JOIN academic AS t6 ON (t1.academic = t6.Code) WHERE teacherID='$teacherID'";
             $result = mysqli_query($link, $sql);
             $row = mysqli_fetch_assoc($result);
        
      ?>
        <h3 class="text-center"><strong>โรงเรียนเทศบาลวัดชัยชุมพล  เทศบาลเมืองทุ่งสง<strong></h3><strong>
        <h4 class="text-center"><strong>รายงานข้อมูลบุคลากร&nbsp;<?php echo  $row['titleName']; ?><?php echo  $row['name']; ?> <?php echo  $row['lastName']; ?><strong></h4><strong>
        <h5 class="text-right"><strong><?php echo thai_date1($eng_date); ?></strong></h5>
        
        <?php
      $pic_name = $row['picture'];
      if (empty($pic_name)){
       $pic_name = 'noimg.jpg';
         }
      ?>
      <p class="text-center">
      <img class="img-thumbnail" src="./dist/img/<?php echo  $pic_name; ?>" alt="./dist/img/<?php echo $pic_name; ?>" width= "80" height="100" ></a>
      </p>
     
      <strong>&nbsp;&nbsp;รหัสบุคลากร</strong> <abbr>&nbsp;&nbsp;&nbsp;<?php echo $row['teacherID']; ?> </abbr>
      
   <table class="table">
    <tbody>
      <tr>
        <td><strong >ชื่อ-สกุล</strong> <abbr>&nbsp;&nbsp;&nbsp;<?php echo $row['titleName']; ?> <?php echo $row['name']; ?>&nbsp;&nbsp; <?php echo  $row['lastName']; ?></abbr></td>
        <td><strong>เงินค่าตอบแทนพิเศษ</strong><abbr>&nbsp;&nbsp;&nbsp;<?php echo  number_format($row['salaryCompensation']); ?> </abbr><strong>&nbsp;บาท</strong></td>
       
      </tr>
      <tr>
        <td><strong>เลขที่ตำแหน่ง</strong> <abbr >&nbsp;&nbsp;&nbsp;<?php echo  $row['noPosition']; ?></abbr></td>
        <td><strong>ตำแหน่ง</strong><abbr>&nbsp;&nbsp;&nbsp;<?php echo  $row['type_name']; ?></abbr></td>
        
      </tr>
      <tr>
        <td><strong>เลขที่ใบอนุญาตประกอบวิชาชีพ</strong> <abbr>&nbsp;&nbsp;&nbsp;<?php echo  $row['licenseNumber']; ?></abbr></td>
        <td><strong>สายงาน</strong><abbr>&nbsp;&nbsp;&nbsp;<?php echo  $row['sub_type_name']; ?></abbr></td>
        
      </tr>
       <tr>
        <?php 
         
        $date1 = $row['licenseDate'];
        if ($date1 == "0000-00-00"){
            $date = "";
        }else{       
          $date=displaydate($date1);           
        }
       ?> 
        <td><strong>วัน เดือน ปี ใบประกอบวิชาชีพ</strong><abbr>&nbsp;&nbsp;&nbsp;<?php echo $date; ?></abbr></td>
        <td><strong>สายชั้นที่สอนปีที่</strong><abbr>&nbsp;&nbsp;&nbsp;<?php echo  $row['class']; ?></abbr></td>
        
      </tr>
         <tr>
        <td><strong>เลขบัตรประชาชน</strong><abbr>&nbsp;&nbsp;&nbsp;<?php echo FnID($row['idCard']); ?></abbr></td>
        <td><strong>วิทยฐานะ</strong><abbr>&nbsp;&nbsp;&nbsp;<?php echo  $row['academicName']; ?></abbr></td>
        
      </tr>
       <tr>
           <?php  
          $date1 = $row['birthDate'];
          if ($date1 == "0000-00-00"){
            $date = "";
           }else{       
          $date=displaydate($date1); 
           }
           ?> 
        <td><strong>วัน เดือน ปี เกิด</strong><abbr>&nbsp;&nbsp;&nbsp;<?php echo $date; ?></abbr></td>
        <td><strong>อันดับ</strong><abbr>&nbsp;&nbsp;&nbsp;<?php echo  $row['rating']; ?></abbr></td>
      </tr>
       <tr>
        <td><strong>หมู่โลหิต</strong><abbr>&nbsp;&nbsp;&nbsp;<?php echo 'กรุป&nbsp;'.$row['bloodGroup']; ?></abbr></td>
        <td><strong>ประเภทบุคลากร</strong><abbr>&nbsp;&nbsp;&nbsp;<?php echo  $row['typePersonnel']; ?></abbr></td>
        
      </tr>
       <tr>
        <td> <strong>สถานภาพ</strong><abbr>&nbsp;&nbsp;&nbsp;<?php echo  $row['status']; ?></abbr></td>
        <td></td>
      </tr>
       <tr>
        <td> <strong>อายุ</strong> <abbr>&nbsp;&nbsp;&nbsp;<?php  
                  $date = new DateTime('now');
                  $dateUS = new DateTime('now', new DateTimeZone('Asia/Bangkok'));
                  $timeStart = DateTime::createFromFormat('Y-m-d', $row['birthDate']);
                  echo $timeStart->diff($date)->format('%y'), ' ปี ', $timeStart->diff($date)->format('%m'), ' เดือน ', $timeStart->diff($date)->format('%d'), ' วัน'; 
           ?> </abbr></td>
        <td></td>
      </tr>
       <tr>
        <td><strong>เบอร์โทรศัพท์</strong><abbr>&nbsp;&nbsp;&nbsp;<?php echo TelFormat($row['telephone']); ?></abbr></td>
        <td></td>
      </tr>
       <tr>
            <?php  
          $date1 = $row['dateGovernment'];
          if ($date1 == "0000-00-00"){
            $date = "";
           }else{       
          $date=displaydate($date1);
           }
           ?>
        <td><strong>วันที่เริ่มรับราชการ</strong><abbr>&nbsp;&nbsp;&nbsp;<?php echo $date; ?></abbr></td>
        <td></td>
      </tr>
       <tr>
         <?php  
          $date1 = $row['dateGovernmentPresent'];
          if ($date1 == "0000-00-00"){
            $date = "";
        }else{       
          $date=displaydate($date1); 
        }
           ?>   
        <td><strong>วันที่ดำรงตำแหน่งปัจจุบัน	</strong><abbr>&nbsp;&nbsp;&nbsp;<?php echo '&nbsp;'.$date; ?></abbr></td>
        <td></td>
      </tr>
       <tr>
        <td><strong>ขั้นเงินเดือน</strong><abbr>&nbsp;&nbsp;&nbsp;<?php echo  number_format($row['salary']); ?> </abbr><strong>&nbsp;บาท</strong></td>
        <td></td>
      </tr>
       <tr>
        <td><strong>เงินวิทยฐานะ</strong><abbr>&nbsp;&nbsp;&nbsp;<?php echo  number_format($row['salaryPosition']); ?></abbr><strong>&nbsp;บาท</strong></td>
        <td></td>
      </tr>
       <tr>
        <td><strong>เงินเพิ่มการครองชีพชั่วคราว</strong><abbr>&nbsp;&nbsp;&nbsp;<?php echo  number_format($row['salaryCost']); ?> </abbr><strong>&nbsp;บาท</strong></td>
        <td></td>
      </tr>
       <tr>
        <td></td>
        <td></td>
      </tr>
    
   
    </tbody>
  </table>

        <?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