include "../config.inc.php";
$thai_month_arr=array(
"0"=>"",
"1"=>"มกราคม",
"2"=>"กุมภาพันธ์",
"3"=>"มีนาคม",
"4"=>"เมษายน",
"5"=>"พฤษภาคม",
"6"=>"มิถุนายน",
"7"=>"กรกฎาคม",
"8"=>"สิงหาคม",
"9"=>"กันยายน",
"10"=>"ตุลาคม",
"11"=>"พฤศจิกายน",
"12"=>"ธันวาคม"
);
?>
|
|
|
|
|
|
|
if($_POST[stuid] == "")
{
$tmpid = date("His");
?>
}else{
$stuid = $_POST['stuid'];
$today = getdate();
$y_check = $today[year];
$m_check = $today[mon];
$d_check = $today[mday];
$m_word = $thai_month_arr[$m_check];
if ($d_check > 18 and $_POST['stuid'] <> "55074266") // If date more than 10th of this month cannot register CEPT //
{
exit("");
}
if ($d_check < 3 and $_POST['stuid'] <> "55074266") // If date less than 2nd of any month cannot register CEPT //
{
exit("");
}
$date_check = date("d");
$time_check = date("H");
if($date_check == 3 and $time_check < 10)
//Server time more than Real Time 1 Hour
// Real Time 9:00 == Server Time 10:00
{
exit("");
}
// End Check Date //---------------------------/////////////////////////////////
$sql = "SELECT * FROM testing_graduate_student_info WHERE stuid = '$stuid'";
$sqlquery = mysql_db_query($dbname, $sql);
$numrow = mysql_num_rows($sqlquery);
$array = mysql_fetch_array($sqlquery);
if($numrow == 0)
{
exit("");
}
else
{
$s = "grad";
}
//Check Student Status if not regular can not Register
//(Regular => Status = "10" รักษาสภาพ = "11" ลาพักการศึกษา = "12" )
if( $array['status'] <> "10" and $array['status'] <> "11" and $array['status'] <> "12")
{
exit("");
}
$date_set = '23/01/2021';
$date_txt = '23 มกราคม 2564';
$sql_row = "SELECT * FROM testing_reg_writing WHERE date_test = '$date_set' and stuid = '$stuid' ";
$sqlquery_row = mysql_db_query($dbname, $sql_row);
$numrow_row = mysql_num_rows($sqlquery_row);
$array_time = mysql_fetch_array($sqlquery_row);
if($numrow_row == 0)
{
exit("");
}
if($array_time['test_time'] <> '')
{
exit("");
}
?>
mysql_close();
}
?>
|
|
|
|
|