| Server IP : 172.67.187.206 / Your IP : 172.71.28.155 Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30 System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586 User : SYSTEM ( 0) PHP Version : 5.6.30 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Inetpub/www/myschool/triamudom/check/timework/ |
Upload File : |
<?php
session_start();
$path = "../";
include ($path.'include/config_db.php');
include ($path.'include/class_db.php');
include ($path.'include/class_display.php');
include ($path.'include/function.php');
$CLASS['db'] = new db();
$CLASS['db']->connect();
$CLASS['disp'] = new display();
$db = $CLASS['db'];
$disp = $CLASS['disp'];
$date_day = date("Y-m-d");
#ตั้งค่า IP ADDRESS
if (getenv(HTTP_X_FORWARDED_FOR))
$tb_timeteacher_ip=getenv(HTTP_X_FORWARDED_FOR);
else
$tb_timeteacher_ip=getenv(REMOTE_ADDR);
// print "Your IP Address is $tb_timeteacher_ip";
$tb_teacher_number = $_REQUEST['tb_teacher_number'];
$date_insert = date('Y-m-d');
$time_insert = date('H:i:s');
if($tb_teacher_number){
$sql_chk = "select * from tb_timeteachers where tb_teacher_number = '".$tb_teacher_number."' and tb_timeteacher_date = '".$date_insert."' ";
$result_chk = $db->query($sql_chk);
$num_chk = $db->num_rows($result_chk);
$sql_chknull = "select * from tb_teachers where tb_teacher_number = '".$tb_teacher_number."' ";
$result_chknull = $db->query($sql_chknull);
$num_chknull = $db->num_rows($result_chknull);
$fetch_teacher_do = $db->fetch_array($result_chknull);
if($num_chk =="0" && $num_chknull >"0"){
$sql_insert = $db->query("INSERT INTO tb_timeteachers (tb_timeteacher_id,tb_teacher_id, tb_teacher_number, tb_timeteacher_date, tb_timeteacher_time, tb_timeteacher_type, tb_timeteacher_status,tb_timeteacher_ip) VALUES (NULL,'".$fetch_teacher_do['tb_teacher_id']."', '".$tb_teacher_number."', '".$date_insert."', '".$time_insert."', '1', '1','".$tb_timeteacher_ip."')");
print "
<script language='javascript'>
window.location.href='".$_SERVER['PHP_SELF']."';
</script>
";
}
}
//----------------------------ค่าพื้นฐานระบบเว็บไซต์-----------------------------//
$fetch_public = $db->fetch_array($db->query("select * from tb_public"));
//----------------------------ค่าพื้นฐานระบบเว็บไซต์-----------------------------//
//if($_SESSION['sessionuser_id']){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ระบบลงเวลาปฏิบัติราชการ โรงเรียนแกลง''วิทยสถาวร'' จังหวัดระยอง</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/default.CSS" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
background-color: #FF2F2F;
}
.style1 {
font-size: 18px;
color: #0000FF;
}
.style2 {font-size: 18px}
-->
</style>
<script type="text/javascript">
function FocusOnInput()
{
document.getElementById("tb_teacher_number").focus();
}
</script>
</head>
<body onload="FocusOnInput()">
<table width="988" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="200" valign="top" bgcolor="#3882F6"><?php include("header.php");?></td>
</tr>
<tr>
<td height="100%" align="center" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="100%" align="center" valign="top"> </td>
<td width="1" align="center" valign="top" background="images/hdot.gif"></td>
<td align="center" valign="top" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td width="230" height="100%" align="center" valign="top"><?php include('com_left.php');?></td>
<td width="1" align="center" valign="top" background="images/hdot.gif"></td>
<td align="center" valign="top" bgcolor="#FFFFFF"><table width="95%" border="0" cellspacing="3" cellpadding="3">
<tr>
<td><fieldset>
<legend class="bigone"><strong>ลงเวลาปฏิบัติงานราชการ หน้าที่ของข้าราชการและลูกจ้างทกคน </strong></legend>
<table width="95%" border="0" align="center" cellpadding="3" cellspacing="3">
<tr>
<td align="center" valign="top" class="style1">วันที่ <?php print display_date($date_day,"longthai")?> เวลา <?php print date("H:i:s");?> น.</td>
<td width="21%" rowspan="2" align="center" valign="top" class="style1"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="130" height="130">
<param name="movie" value="watch7.swf" />
<param name="quality" value="high" /><param name="BGCOLOR" value="#FFFFFF" />
<embed src="watch7.swf" width="130" height="130" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#FFFFFF"></embed>
</object></td>
</tr>
<tr>
<td width="79%" align="center" valign="top"><form id="form1" name="form1" method="post" action="<?php print $_SERVER['PHP_SELF'];?>" enctype="multipart/form-data">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="50%" align="right" nowrap="nowrap" class="orange_textcheck"><strong>เลขประจำตำแหน่ง : </strong></td>
<td width="50%" nowrap="nowrap"><input name="tb_teacher_number" type="text" class="boxcheckry" id="tb_teacher_number" size="10" maxlength="10"></td>
</tr>
<tr>
<td colspan="2" align="center"><label>
<input name="Submit" type="submit" class="Submit" value="ลงเวลาปฏิบัติงาน" />
</label></td>
</tr>
<tr>
<td colspan="2" align="center">
<?php
$sql_chkq = "select * from tb_timeteachers where tb_teacher_number = '".$tb_teacher_number."' and tb_timeteacher_date = '".$date_insert."' ";
$result_chkq = $db->query($sql_chkq);
$num_chkq = $db->num_rows($result_chkq);
if($num_chkq !="0"){
?><span class="red_text style2">ท่านลงเวลาแล้ววันนี้ !!!!!</span>
<?php }?> </td>
</tr>
<tr>
<td colspan="2" align="center">
<?php
if($tb_teacher_number){
$sql_chknullq = "select * from tb_teachers where tb_teacher_number = '".$tb_teacher_number."' ";
$result_chknullq = $db->query($sql_chknullq);
$num_chknullq = $db->num_rows($result_chknullq);
if($num_chknullq =="0"){
?><span class="red_text style2">ไม่มีรหัส <?php print $tb_teacher_number;?> ในระบบ !!!!!</span>
<?php } }?> </td>
</tr>
</table>
</form> </td>
</tr>
</table>
</fieldset></td>
</tr>
</table>
<?php
$display_teacher = $db->query("select * from tb_timeteachers where tb_timeteacher_date='".date('Y-m-d')."' order by tb_timeteacher_id desc");
$fetch_teacher = $db->fetch_array($display_teacher);
//echo $fetch_teacher['tb_teacher_number'];
$displayimg = $disp->display_teachertimepic($fetch_teacher['tb_teacher_number']);
?>
<?php if($fetch_teacher['tb_teacher_number']){?>
<table width="90%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td><fieldset>
<legend class="bigone"><strong>ผู้ที่ลงเวลาปฏิบัติราชการล่าสุด</strong></legend>
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr valign="top">
<td width="50%"><table width="90%" border="0" align="center" cellpadding="3" cellspacing="3">
<tr>
<td width="50%" align="center" nowrap="nowrap"><p class="B_textcheck"><?php print $disp->display_teachertimename($fetch_teacher['tb_teacher_number'])?> : <?php print $fetch_teacher['tb_teacher_number'];?> </p>
<p class="orange_textcheck">มาทำงานเวลา <?php print $fetch_teacher['tb_timeteacher_time'];?> น. </p>
<p><span class="bigone">
<?php
function compareDate($date1,$date2) {
$arrDate1 = explode(":",$date1);
$arrDate2 = explode(":",$date2);
//$timStmp1 = mktime(0,0,0,$arrDate1[1],$arrDate1[2],$arrDate1[0]);
$timStmp1 = mktime($arrDate1[0],$arrDate1[1],$arrDate1[2],0,0,0);
//$timStmp2 = mktime(0,0,0,$arrDate2[1],$arrDate2[2],$arrDate2[0]);
$timStmp2 = mktime($arrDate2[0],$arrDate2[1],$arrDate2[2],0,0,0);
// mktime($arrDate1[0],$arrDate1[1],$arrDate1[2],0,0,0);
if ($timStmp1 == $timStmp2) {
//echo "<span class=\"green_text\">มาทำงานปกติ</span>";
} else if ($timStmp1 > $timStmp2) {
//echo "<span class=\"red_textlate\">มาทำงานสาย</span>";
} else if ($timStmp1 < $timStmp2) {
//echo "<span class=\"green_text\">มาทำงานปกติ</span>";
}
}
//echo compareDate($fetch_teacher['tb_timeteacher_time'],"08:00:00");
?>
</span></p></td>
</tr>
<tr>
<td align="center" nowrap="nowrap"><?php if($displayimg){?>
<img src="../id-plan/file_uploads/<?php print $disp->display_teachertimepic($fetch_teacher['tb_teacher_number'])?>" width="100" border="1" />
<?php }else{?>
<img src="../id-plan/file_uploads/photo.png" width="100" /> <br />
<span class="alertred"><br />
*สามารถอัพเดทภาพใหม่ได้ที่ ID PLAN </span>
<?php }?></td>
</tr>
</table></td>
<td><table width="90%" border="0" align="center" cellpadding="5" cellspacing="2" bgcolor="#CCCCCC">
<tr bgcolor="#FFFF66">
<td colspan="4" align="center" class="bigone">สรุปข้อมูลการลงเวลาเบื้องต้น <br />
ตั้งแต่ <?php print display_date($fetch_public['tb_public_datetime'],"longthai")?></td>
</tr>
<tr>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowtree"><strong>มาทำงาน </strong></td>
<?php /*?>date between '".$date_serach."' and '".$date_search_end."';<?php */
$date_serach = $fetch_public['tb_public_datetime'];
$date_search_end =date("Y-m-d");
//echo "select * from tb_timeteachers where tb_teacher_number='".$tb_teacher_number."' and tb_timeteacher_type='1' and tb_timeteacher_date between '".$date_serach."' and '".$date_search_end."'";
?>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowtree"><?php echo $num_displayyess = $db->num_rows($db->query("select * from tb_timeteachers where tb_teacher_number='".$fetch_teacher['tb_teacher_number']."' and tb_timeteacher_type='1' and tb_timeteacher_date between '".$date_serach."' and '".$date_search_end."' "));?> วัน </td>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowtree"><strong>ไปราชการ </strong></td>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowtree"><?php echo $num_displayyess = $db->num_rows($db->query("select * from tb_timeteachers where tb_teacher_number='".$fetch_teacher['tb_teacher_number']."' and tb_timeteacher_type !='1' and tb_timeteacher_type !='2' and tb_timeteacher_type !='3' and tb_timeteacher_type !='4' and tb_timeteacher_type !='5' and tb_timeteacher_type !='6' and tb_timeteacher_type !='7' and tb_timeteacher_type !='8' and tb_timeteacher_type !='19' and tb_timeteacher_date between '".$date_serach."' and '".$date_search_end."' "));?> วัน </td>
</tr>
<tr>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowone"><strong>ขาดราชการ</strong></td>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowone"><?php echo $num_displayyess = $db->num_rows($db->query("select * from tb_timeteachers where tb_teacher_number='".$fetch_teacher['tb_teacher_number']."' and tb_timeteacher_type='2' and tb_timeteacher_date between '".$date_serach."' and '".$date_search_end."' "));?> วัน </td>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowone"><strong>ลากิจ</strong></td>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowone"><?php echo $num_displayyess = $db->num_rows($db->query("select * from tb_timeteachers where tb_teacher_number='".$fetch_teacher['tb_teacher_number']."' and tb_timeteacher_type='3' and tb_timeteacher_date between '".$date_serach."' and '".$date_search_end."' "));?> วัน </td>
</tr>
<tr>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowtree"><strong>ลาป่วย</strong></td>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowtree"><?php echo $num_displayyess = $db->num_rows($db->query("select * from tb_timeteachers where tb_teacher_number='".$fetch_teacher['tb_teacher_number']."' and tb_timeteacher_type='4' and tb_timeteacher_date between '".$date_serach."' and '".$date_search_end."' "));?> วัน </td>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowtree"><strong>ลาคลอด</strong></td>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowtree"><?php echo $num_displayyess = $db->num_rows($db->query("select * from tb_timeteachers where tb_teacher_number='".$fetch_teacher['tb_teacher_number']."' and tb_timeteacher_type='6' and tb_timeteacher_date between '".$date_serach."' and '".$date_search_end."' "));?> วัน </td>
</tr>
<tr>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowone"><strong>ลาไปเมกกะ</strong></td>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowone"><?php echo $num_displayyess = $db->num_rows($db->query("select * from tb_timeteachers where tb_teacher_number='".$fetch_teacher['tb_teacher_number']."' and tb_timeteacher_type='7' and tb_timeteacher_date between '".$date_serach."' and '".$date_search_end."' "));?> วัน </td>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowone"><strong>ลาบวช</strong></td>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowone"><?php echo $num_displayyess = $db->num_rows($db->query("select * from tb_timeteachers where tb_teacher_number='".$fetch_teacher['tb_teacher_number']."' and tb_timeteacher_type='8' and tb_timeteacher_date between '".$date_serach."' and '".$date_search_end."' "));?> วัน </td>
</tr>
<tr>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowtree"><strong>ลาพักผ่อน</strong></td>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowtree"><?php echo $num_displayyess = $db->num_rows($db->query("select * from tb_timeteachers where tb_teacher_number='".$fetch_teacher['tb_teacher_number']."' and tb_timeteacher_type='5' and tb_timeteacher_date between '".$date_serach."' and '".$date_search_end."' "));?> วัน </td>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowtree"><strong>ลาศึกษาต่อ</strong></td>
<td nowrap="nowrap" bgcolor="#FFFFFF" class="rowtree"><?php echo $num_displayyess = $db->num_rows($db->query("select * from tb_timeteachers where tb_teacher_number='".$fetch_teacher['tb_teacher_number']."' and tb_timeteacher_type='19' and tb_timeteacher_date between '".$date_serach."' and '".$date_search_end."' "));?> วัน </td>
</tr>
<tr>
<td colspan="4" align="center" nowrap="nowrap" bgcolor="#FFFFFF" class="alertred">* ข้อมูลเบื้องต้น ยังไม่ได้ปรับข้อมูลจากใบลา</td>
</tr>
</table></td>
</tr>
</table>
</fieldset>
</td>
</tr>
<tr>
<td align="center"> </td>
</tr>
</table>
<?php }?>
</td>
</tr>
<tr>
<td height="100%" align="center" valign="top"> </td>
<td width="1" align="center" valign="top" background="images/hdot.gif"></td>
<td align="center" valign="top" bgcolor="#FFFFFF"> </td>
</tr>
</table></td>
</tr>
<tr>
<td height="50" valign="bottom"><?php include("footer.php");?></td>
</tr>
</table>
</body>
</html>
<?php /*?><?php }else{?>
<script language="javascript">window.location.href = 'login.php'</script>
<?php }?><?php */?>