1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
$conn = mysql_connect($dbhost, $dbuser, $dbpwd) or die ("can't connect database");
mysql_select_db($dbname);
$query = "SELECT * FROM ppt.reference";
$result = mysql_query($query);
echo "<table border='1'>";
echo "<tr><th>Room</th><th>Computer</th><th>Username</th><th>Status</th></tr>";
while($row = mysql_fetch_array($result, MYSQL_BOTH)) {
echo "<tr><td>";
echo $row[0];
echo "</td><td>";
echo $row[1];
echo "</td><td>";
echo $row[2];
echo "</td><td>";
if ($row[3] == 0) {
echo "<p><input type='submit' name='status' value='start'disabled> <input type='submit' name='status' value='stop' disabled></p>";
} elseif ($row[3] == 1) {
echo "<form name='input' action='capture.php' method='get'>";
echo "<p><input type='submit' name='status' value='start'> <input type='submit' name='status' value='stop'></p>";
echo "<p><input type='hidden' value='$row[0]' name='room'></p>";
echo "</form>";
}
echo "</td></tr>";
}
echo "</table>";
?> |