<style type="text/css">
@font-face {
font-family: 'Sarabun';
src:url('font/Sarabun.ttf.woff') format('woff'),
url('font/Sarabun.ttf.svg#Sarabun') format('svg'),
url('font/Sarabun.ttf.eot'),
url('font/Sarabun.ttf.eot?#iefix') format('embedded-opentype');
font-weight: normal;
font-style: normal;
}
</style>
<?php
$user_agent = $_SERVER['HTTP_USER_AGENT'];
function getOS() {
global $user_agent;
$os_platform = "desktop";
$os_array = array(
'/windows nt 10.0/i' => 'Windows 10',
'/windows nt 6.3/i' => 'Windows 8.1',
'/windows nt 6.2/i' => 'Windows 8',
'/windows nt 6.1/i' => 'Windows 7',
'/windows nt 6.0/i' => 'Windows Vista',
'/windows nt 5.2/i' => 'Windows Server 2003/XP x64',
'/windows nt 5.1/i' => 'Windows XP',
'/windows xp/i' => 'Windows XP',
'/windows nt 5.0/i' => 'Windows 2000',
'/macintosh|mac os x/i' => 'Mac OS X',
'/mac_powerpc/i' => 'Mac OS 9',
'/linux/i' => 'Linux',
'/ubuntu/i' => 'Ubuntu',
'/iphone/i' => 'iPhone',
'/ipod/i' => 'iPod',
'/ipad/i' => 'iPad',
'/android/i' => 'Android',
'/blackberry/i' => 'BlackBerry',
'/webos/i' => 'Mobile'
);
foreach ($os_array as $regex => $value) {
if (preg_match($regex, $user_agent)) {
$os_platform = $value;
if(($os_platform=='Android') or ($os_platform=='BlackBerry') or ($os_platform=='iPhone') or ($os_platform=='iPad')){
$os_platform="mobile";
}
else{
$os_platform="desktop";
}
}
}
return $os_platform;
}
$user_os = getOS();
if(!isset($_SESSION['workgroup'])){
$sql = "SELECT * FROM `system_workgroup` Where workgroup = (SELECT department FROM `person_main` where person_id = '". $_SESSION['login_user_id'] ."')";
//echo $sql;
//$sql = "SELECT * FROM `person_main` ";//department
$dbquery = mysqli_query($connect,$sql);
$data = mysqli_fetch_assoc($dbquery);
$_SESSION['workgroup'] = $data['workgroup'];
$_SESSION['workgroup_name'] = $data['workgroup_desc'];
}
?>
<!-- Bootstrap Include -->
<link rel="stylesheet" type="text/css" href="./bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="./bootstrap/css/datepicker.css">
<script src="./bootstrap/js/jquery-1.11.3.min.js"></script>
<script src="./bootstrap/js/bootstrap.min.js"></script>
<script src="./bootstrap/js/bootstrap-confirmation.min.js"></script>
<script src="./bootstrap/js/bootstrap-datepicker.js"></script>
<script src="./bootstrap/js/jquery.dataTables.min.js"></script>
<script src="./bootstrap/js/dataTables.bootstrap.min.js
"></script>
<!--script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap.min.js
"></script-->
<script src="./ckeditor/ckeditor.js"></script>
<?php
if(isset($_GET['index'])){
$index=$_GET['index'];
}
else{
$index="";
}
//ผนวกเมนู
if($_SESSION['user_os']=='mobile'){
$module_menu_path="./modules/".$_REQUEST['option']."/menu_mobile.php";
}
else{
$module_menu_path="./modules/".$_REQUEST['option']."//menu.php";
}
//เช็คการเปิดใช้งานทะเบียน
$sql_start="select * from bookregister_year where year_active='1' and school_code is null";
$query_start=mysqli_query($connect,$sql_start);
$result_start=mysqli_fetch_array($query_start);
if(!($result_start)){
echo "<div align='center'>ยังไม่ได้กำหนดปีปฏิทินการทำงาน กรุณาแจ้งเจ้าหน้าที่ทะเบียน</div>";
exit();
}else{
$_SESSION['bookregister_year'] = $result_start['year'] ;
$sqlPosition = "SELECT * FROM `person_position`";
$queryPosition=mysqli_query($connect,$sqlPosition);
while($resultPosition=mysqli_fetch_array($queryPosition)){
$Position[$resultPosition['position_code']] = $resultPosition['position_name'];
}
}
if($result_start['start_send_num']==0){
echo "<div align='center'>ทะเบียนหนังสือส่งไม่เปิดใช้งาน</div>";
exit();
}
//ตั้งค่าเวลาลงทะเบียนไม่ให้เกินปี
$this_year=$result_start['year']-543;
$now=time();
$timestamp_end_year=mktime(23,59,59,12,31,$this_year);
if($now>=$timestamp_end_year){
echo "<div align='center'>ทะเบียนปีเก่าปิดโดยอัตโนมัติหลังสิ้นปี เจ้าหน้าที่กรุณาตั้งปีใหม่เพื่อลงทะเบียน</div>";
exit();
}
if(file_exists($module_menu_path)){
require_once("$module_menu_path");
}
else{
die ("No MenuPage");
}
//ผนวกไฟล์
if($task!=""){
$module_file_path="modules/$_REQUEST[option]/".$task;
if(file_exists($module_file_path)){
require_once("$module_file_path");
}else{
die ("No Page");
}
}
else {
$module_file_path="modules/$_REQUEST[option]/"."default.php";
if(file_exists($module_file_path)){
require_once("$module_file_path");
}else{
die ("No DefaultPage");
}
}
?>
<link rel="stylesheet" type="text/css" href="css/mm1_training.css">