| Server IP : 172.67.187.206 / Your IP : 162.159.115.41 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 : E:/Inetpub/www/myschool/triamudom/check/cardtime/ |
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_student_codecard = $_REQUEST['tb_student_codecard'];
$date_day = date("Y-m-d");
$date_time = date("H:i:s");
if($tb_student_codecard){
$num_student = $db->num_rows($db->query("select * from tb_students where tb_student_codecard='".$tb_student_codecard."' "));
if($num_student >0){
$fetch_student_code = $db->fetch_array($db->query("select * from tb_students where tb_student_codecard='".$tb_student_codecard."' "));
$tb_student_code=$fetch_student_code['tb_student_code'];
$tb_student_id=$fetch_student_code['tb_student_id'];
$tb_student_degree=$fetch_student_code['tb_student_degree'];
$tb_student_tname=$fetch_student_code['tb_student_tname'];
$delete_time = $db->query("DELETE FROM tb_times WHERE tb_time_stucode = '".$tb_student_code."' and tb_time_date='".$date_day."' ");
$insert_time = $db->query("INSERT INTO tb_times (tb_time_id,tb_time_stuid, tb_time_stucode, tb_time_date,tb_time_time, tb_time_type, tb_time_degree, tb_time_tname) VALUES (NULL,'".$tb_student_id."', '".$tb_student_code."', '".$date_day."','".$date_time."', '1', '".$tb_student_degree."', '".$tb_student_tname."')");
print "
<script language='javascript'>
window.location.href='register_time_today.php';
</script>
";
}else{
print "
<script language='javascript'>
window.location.href='register_time_today.php';
</script>
";
}
}
//--------------------ส่วนบนใช้สำหรับประกาศตัวแปรและ Config เท่านั้น----------------------------//
$fetch_public = $db->fetch_array($db->query("select * from tb_public"));
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ระบบเช็คชื่อออนไลน์ โรงเรียนแกลง"วิทยสถาวร" จังหวัดระยอง</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- FAVICON-->
<!-- Css styles -->
<link href="css/main.css" rel="stylesheet">
<META HTTP-EQUIV='Refresh' CONTENT = '1;URL=register_time_today_input.php'>
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/jquery.scrollTo-1.4.2-min.js"></script>
<script src="js/jquery.localscroll-1.2.7-min.js"></script>
<script src="js/jquery.mobilemenu.js"></script>
<script src="js/custom.js"></script>
<script type="text/javascript">
function FocusOnInput()
{
document.getElementById("tb_student_codecard").focus();
}
</script>
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style type="text/css">
body,td,th {
font-family: TH SarabunPSK;
font-size: 16px;
}
a:link {
color: #666666;
text-decoration: none;
}
body {
background-color: #FFF;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
.style7 {
color: #000000;
font-size: 44px;
font-weight: bold;
}
.style8 {color: #FF0000; font-size: 50px; font-weight: bold; }
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body onLoad="FocusOnInput()">
<?php include("com_top.php");?>
<br>
<form name="form2" method="post" action="<?php print $_SERVER['PHP_SELF'];?>" onSubmit="return chknull(this);">
<input name="tb_student_codecard" type="text" class="orange_textcheck" id="tb_student_codecard" size="1" style="border:none">
</form>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" valign="top"><?php
//set the number of columns
$columns = 2;
$sql_limit_q = "limit 4";
$sql_dis_pro="select * from tb_times where tb_time_date='".$date_day."' and tb_time_type='1' $sql_search order by tb_time_time desc $sql_limit_q ";
$query_dis_pro = $db->query($sql_dis_pro);
//we add this line because we need to know the number of rows
$num_dis_pro = $db->num_rows($query_dis_pro);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?
//changed this to a for loop so we can use the number of rows
for($i = 0; $i < $num_dis_pro; $i++) {
$fetch_dis_pro = $db->fetch_array($query_dis_pro);
if($i % $columns == 0) {
//if there is no remainder, we want to start a new row
echo "<TR>\n";
}
?>
<td><table width="50%" border="0" align="center" cellpadding="0" cellspacing="0">
<?php
$fetch_disstudent = $db->fetch_array($db->query("select * from tb_students where tb_student_id='".$fetch_dis_pro['tb_time_stuid']."' "));
//echo "select * from tb_students where tb_student_code='".$fetch_dis_pro['tb_time_stucode']."' ";
//echo $fetch_disstudent['tb_student_code'];
//echo $fetch_disstudent['tb_student_degree'];
$fetch_disstudentroom = $db->fetch_array($db->query("select * from tb_rooms where tb_room_id='".$fetch_disstudent['tb_student_degree']."' "));
//echo "select * from tb_rooms where tb_room_id='".$fetch_disstudent['tb_student_degree']."' ";
//echo $fetch_disstudentroom['tb_room_name'];
// echo "<br>";
//echo substr($fetch_disstudentroom['tb_room_name'],5);
?>
<tr>
<td width="23%" align="right" valign="top" nowrap><div class="span3">
<div class="team-wrap"><img src="../file_student/<?php print $fetch_public['tb_public_year'];?>/M<?php echo substr($fetch_disstudentroom['tb_room_name'],5);?>/<?php print $fetch_dis_pro['tb_time_stucode'];?>.jpg" width="200"></div>
</div></td>
<td width="77%" align="left" valign="top" nowrap><p class="style7">รหัสประจำตัว : <?php print $fetch_dis_pro['tb_time_stucode'];?><br>
<?php print $disp->display_studentallcode($fetch_dis_pro['tb_time_stucode']);?></p>
<span class="style8">เวลามา : <?php print $fetch_dis_pro['tb_time_time'];?> น.</span> </td>
</tr>
</table></td>
<? if(($i % $columns) == ($columns - 1) || ($i + 1) == $num_dis_pro) {
//if there is a remainder of 1, end the row
//or if there is nothing left in our result set, end the row
echo "</TR>\n";
}
}
?>
</table></td>
</tr>
</table>
</body>
</html>