Path : /var/www/html/smart_kpp2_v2/modules/person/
File Upload :
Current File : /var/www/html/smart_kpp2_v2/modules/person/person_detail_sch.php

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
date_default_timezone_set('Asia/Bangkok');
require_once "../../amssplus_connect.php";	
require_once("../../include/time_inc.php");

echo "<font color=#8080ff>".$office."</font>";

if(isset($_SESSION['user_os'])){
	if($_SESSION['user_os']=='mobile'){
	echo "<meta name = 'viewport' content = 'width = device-width'>";
	}
}

$sql = "select * from person_sch_main, person_detail where person_sch_main.person_id=person_detail.person_id and person_detail.person_id='$_GET[person_id]'";
$dbquery=mysqli_query($connect,$sql);
$result=mysqli_fetch_array($dbquery);
$prename=$result['prename'];
$name= $result['name'];
$surname = $result['surname'];
$full_name="$prename $name  $surname";
$pic = $result['pic'];

echo "<center>";
echo "<table width=100% class=myTableGold>";
	echo "<tr><td rowspan=5 align=center valign=middle width='30%'><img src='$pic' border='0' height='150'></td>";
	echo "<th colspan=2>".$full_name."</th>";
	$sql_position = "select * from person_sch_position where position_code='$result[position_code]' ";
	$dbquery_position=mysqli_query($connect,$sql_position);
	$result_position=mysqli_fetch_array($dbquery_position);
	echo "<tr><td width=20%>ตำแหน่ง</td><td>".$result_position['position_name']."</td></tr>";

	$sql="select * from system_school where school_code='$result[school_code]'";
	$dbquery=mysqli_query($connect,$sql);
	$result_school=mysqli_fetch_array($dbquery);
	echo "<tr><td>โรงเรียน</td><td>".$result_school['school_name'];

	// ส่วนบุคลากรขยาย
	$sql_other="select system_school.school_name from person_sch_other left join system_school on person_sch_other.school_code=system_school.school_code where person_id='$result[person_id]' ";
	$dbquery_other=mysqli_query($connect,$sql_other);
	$num_other=mysqli_num_rows($dbquery_other);
	if($num_other!=0){
		echo " <font color=#008000>และ</font> <font color=red>";
		while($result_other=mysqli_fetch_array($dbquery_other)){
			echo $result_other[school_name].",";
		}
		echo "</font>";
	}
	echo "</td></tr>";

	$sql_position_class = "select * from person_position_class where code='$result[position_class]' ";
	$dbquery_position_class = mysqli_query($connect,$sql_position_class);
	$result_position_class=mysqli_fetch_array($dbquery_position_class);
	echo "<tr><td>วิทยฐานะ/ระดับ </td><td>".$result_position_class[name]."</td></tr>";
	echo "<tr><td>ชื่อเล่น</td><td>".$result[nickname]."</td></tr>";
	echo "</tr>";

	$birth_day=thai_date_full($result[birth_day]);
	echo "<tr><td>วันเกิด </td><td colspan=2>".$birth_day."</td></tr>";
	$start_day=thai_date_full($result[start_day]);
	echo "<tr><td>บรรจุครั้งแรก </td><td colspan=2>".$start_day."</td></tr>";
	$end_day=thai_date_full($result[end_day]);
	echo "<tr><td>เกษียณอายุ </td><td colspan=2>".$end_day."</td></tr>";

	$sql_education_class = "select * from person_education_class where code='$result[education_class]' ";
	$dbquery_education_class=mysqli_query($connect,$sql_education_class);
	$result_education_class=mysqli_fetch_array($dbquery_education_class);
	echo "<tr><td>วุฒิการศึกษาสูงสุด </td><td colspan=2>".$result_education_class[name]."</td></tr>";
	echo "<tr><td>ชื่อวุฒิการศึกษา/วิชาเอก </td><td colspan=2>".$result[major]."</td></tr>";

	$email=str_replace("|"," , ",$result[email]);
	echo "<tr><td>อีเมล์ </td><td colspan=2>".$email."</td></tr>";
	$tel=str_replace("|"," , ",$result[tel]);
	echo "<tr><td>หมายเลขโทรศัพท์ </td><td colspan=2>".$tel."</td></tr>";
	echo "<tr><td>เว็บไซต์ e-PORTFOLIO </td><td colspan=2>".$result[url]."</td></tr>";
echo "</table>";
echo "</center>";
?>