<? include('config.php');
$id =$_GET['exam_id'];
$sql = "select * from exam_set as e , courses as c where id='$id'";
//$sql = "select * from exam_object as eo , exam_subject as es group by eo_id and es_id";
$result = mysql_query($sql) or die (mysql_error());
$row = mysql_fetch_array($result)
?>
<?
$dates=date("Y-m-d");
$times=date("H:i:s");
echo "$dates | $times | ";
if($dates!=$row['dates'] )
{
echo "<script>";
echo "alert('ไม่สามารถเข้าสอบได้ ');";
echo "window.location='start-exam.php';";
echo "</script>";
}
else if($dates==$row['dates'] and $times between $row['stime'] and $row['etime'])
{
echo "<script>";
echo "alert('เริ่มทำข้อสอบ');";
echo "</script>";
}
?>