function echoRoomTime($room, $time) { global $timenow, $close, $num_room, $num_time, $open; #房號 for ($i = 0; $i < $num_room; $i++) { echo "<tr style='height:50px'><td>{$room[$i]}</td>"; #狀態 for ($j = 0; $j < $num_time; $j++) { $row = mysql_fetch_array(sql3($room[$i], $time[$j], $open)); echo "<td>"; if ($row['狀態'] == 2) { echo "使用中"; echo "</br>"; applyURL($row['自動編號'], $row['學號']); } elseif ($row['狀態'] == 3) { echo "已預約"; echo "</br>"; applyURL($row['自動編號'], $row['學號']); } elseif ($row['狀態'] == 5) { echo "已預約"; echo "</br>"; applyURL($row['自動編號'], $row['題目']); } else { echo "可申請"; } echo "</td>"; } echo "</tr>"; } }
function sql2($sql, $bd = '') { $t = sql3($sql, $bd); if (count($t) == 1) { return $t[0]; } return $t; }