'" . $cur_time . "' and signin_time='0000-00-00 00:00:00'"); if (!$result) { echo mysql_error(); exit; } } ?> '" . $cur_time . "'"); if (!$result) { echo mysql_error(); exit; } } ?> Reservation of XRD (for Qualified Person Only)\n"; echo "

Welcome $login_user

\n"; /* show message */ $result = mysql_query("select * from xrd where reserved_by='root'"); $data = mysql_fetch_array($result); if (($cur_time > $data['start_time']) && ($cur_time < $data['end_time'])) { $message=$data['cancelled_by']; echo "

$message

\n"; } /* show table */ echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $result = mysql_query("select * from xrd where reserved_by<>'root' order by start_time"); while ($data = mysql_fetch_array($result)) { $start_time=$data['start_time']; $end_time=$data['end_time']; $reserved_by=$data['reserved_by']; $action=$data['action']; $signin_time=$data['signin_time']; $cancelled_by=$data['cancelled_by']; $remark=$data['remark']; $session_date=substr($start_time,0,10); if (substr($start_time,11,5)=="09:30") $session_time="S1 "; else if (substr($start_time,11,5)=="14:00") $session_time="S2 "; else $session_time="S3 "; $session_time=$session_time . substr($start_time,-8) . "-" . substr($end_time,-8); if ($end_time>$cur_time) if ($start_time>$cur_time) $fcol="#000000"; else $fcol="#0080FF"; else $fcol="#FF0000"; echo "\n"; echo "\n"; echo "\n"; if ($reserved_by=="") echo "\n"; else echo "\n"; if ($signin_time=="0000-00-00 00:00:00") echo "\n"; else echo "\n"; if ($cancelled_by=="--------") echo "\n"; else echo "\n"; if ($remark=="") echo "\n"; else echo "\n"; } mysql_free_result($result); ?>
DateTimeReserved bySignin timeLast Cancelled byRemark
$session_date$session_time-------- $reserved_by--------$signin_time$cancelled_by $cancelled_by--------$remark

Current time is $cur_time\n"; if ($xrd_user) echo "

You are allowed to reserve Session 3

\n"; else echo "

You are not allowed to reserve Session 3

\n"; echo "

You have reserved $reserved time slot(s) out of 2 allowed

\n"; if ($signin_allowed && !$signined) echo "

You can signin now

\n"; if ($signin_allowed && !$signined) { echo "

Your action:

\n"; echo ""; } if ($reserved<2) { echo "

Your action:

\n"; echo ""; } if ($reserved) { echo "

Your action:

\n"; echo "

Think twice before clicking the following button:

"; echo ""; } echo ""; ?> "; echo "if (NS4) {document.write('');}\n"; echo "if ((IE4) || (NS6)) {document.write('
');}\n"; echo "\n"; ?> \n"; echo "if (NS4) {document.write('');}\n"; echo "if ((IE4) || (NS6)) {document.write('
');}\n"; echo "ifloatX=floatX;\n"; echo "ifloatY=floatY;\n"; echo "define();\n"; echo "window.onresize=define;\n"; echo "lastX=-1;\n"; echo "lastY=-1;\n"; echo "adjust();\n"; echo "\n"; ?>