| Server IP : 104.21.80.248 / 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/library/ |
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'];
$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) VALUES (NULL,'".$fetch_teacher_do['tb_teacher_id']."', '".$tb_teacher_number."', '".$date_insert."', '".$time_insert."', '1', '1')");
print "
<script language='javascript'>
window.location.href='".$_SERVER['PHP_SELF']."';
</script>
";
}
}
//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" class="style1">วันที่ <?php print display_date($date_day,"longthai")?> เวลา <?php print date("H:i:s");?> น.</td>
<td width="21%" rowspan="2" align="center" 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="relog.swf" />
<param name="quality" value="high" /><param name="BGCOLOR" value="#FFFFFF" />
<embed src="relog.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"><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="boxcheck" 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'];
?>
<?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="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:15:00");
$displayimg = $disp->display_teachertimepic($fetch_teacher['tb_teacher_number']);
?>
</span></p></td>
<td width="50%" align="center" nowrap="nowrap"><?php if($displayimg){?><img src="../id-plan/file_uploads/<?php print $disp->display_teachertimepic($fetch_teacher['tb_teacher_number'])?>" width="140" border="1" /><?php }else{?><img src="../id-plan/file_uploads/photo.png" width="120" >
<br />
<span class="alertred"><br />
*สามารถอัพเดทภาพใหม่ได้ที่ ID PLAN </span><?php }?></td>
</tr>
</table>
</fieldset>
</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 = 'index.php'</script>
<?php }?><?php */?>