Mini Shell
<?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>รายงานข้อมูลบุคลากร <?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> รหัสบุคลากร</strong> <abbr> <?php echo $row['teacherID']; ?> </abbr>
<table class="table">
<tbody>
<tr>
<td><strong >ชื่อ-สกุล</strong> <abbr> <?php echo $row['titleName']; ?> <?php echo $row['name']; ?> <?php echo $row['lastName']; ?></abbr></td>
<td><strong>เงินค่าตอบแทนพิเศษ</strong><abbr> <?php echo number_format($row['salaryCompensation']); ?> </abbr><strong> บาท</strong></td>
</tr>
<tr>
<td><strong>เลขที่ตำแหน่ง</strong> <abbr > <?php echo $row['noPosition']; ?></abbr></td>
<td><strong>ตำแหน่ง</strong><abbr> <?php echo $row['type_name']; ?></abbr></td>
</tr>
<tr>
<td><strong>เลขที่ใบอนุญาตประกอบวิชาชีพ</strong> <abbr> <?php echo $row['licenseNumber']; ?></abbr></td>
<td><strong>สายงาน</strong><abbr> <?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> <?php echo $date; ?></abbr></td>
<td><strong>สายชั้นที่สอนปีที่</strong><abbr> <?php echo $row['class']; ?></abbr></td>
</tr>
<tr>
<td><strong>เลขบัตรประชาชน</strong><abbr> <?php echo FnID($row['idCard']); ?></abbr></td>
<td><strong>วิทยฐานะ</strong><abbr> <?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> <?php echo $date; ?></abbr></td>
<td><strong>อันดับ</strong><abbr> <?php echo $row['rating']; ?></abbr></td>
</tr>
<tr>
<td><strong>หมู่โลหิต</strong><abbr> <?php echo 'กรุป '.$row['bloodGroup']; ?></abbr></td>
<td><strong>ประเภทบุคลากร</strong><abbr> <?php echo $row['typePersonnel']; ?></abbr></td>
</tr>
<tr>
<td> <strong>สถานภาพ</strong><abbr> <?php echo $row['status']; ?></abbr></td>
<td></td>
</tr>
<tr>
<td> <strong>อายุ</strong> <abbr> <?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> <?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> <?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> <?php echo ' '.$date; ?></abbr></td>
<td></td>
</tr>
<tr>
<td><strong>ขั้นเงินเดือน</strong><abbr> <?php echo number_format($row['salary']); ?> </abbr><strong> บาท</strong></td>
<td></td>
</tr>
<tr>
<td><strong>เงินวิทยฐานะ</strong><abbr> <?php echo number_format($row['salaryPosition']); ?></abbr><strong> บาท</strong></td>
<td></td>
</tr>
<tr>
<td><strong>เงินเพิ่มการครองชีพชั่วคราว</strong><abbr> <?php echo number_format($row['salaryCost']); ?> </abbr><strong> บาท</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