-
Notifications
You must be signed in to change notification settings - Fork 0
/
getInfo.php
69 lines (51 loc) · 1.17 KB
/
getInfo.php
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<?php
$fac=$_GET["q"];
$sub = $_GET["q2"];
$con = mysqli_connect('localhost','root','');
if (!$con) {
die('Could not connect: ' . mysqli_error($con));
}
mysqli_select_db($con,"minor");
$sql="SELECT day,time,room FROM timetable WHERE tid = '".$fac."' and subject='".$sub."'";
$result = mysqli_query($con,$sql);
echo "<table>
<tr>
<th>Day</th>
<th>Time</th>
<th>Room No.</th>
</tr>";
while($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['day'] . "</td>";
echo "<td>" . $row['time'] . "</td>";
echo "<td>" . $row['room'] . "</td>";
echo "</tr>";
}
$sql="SELECT counter FROM faculty WHERE username = '$fac' and subject1='$sub'";
$result = mysqli_query($con,$sql);
while($row = mysqli_fetch_array($result)) {
echo "<table>
<tr>
<th>Slot:</th>
</tr>";
echo "<td>" . $row['counter'] . "</td>";
}
$sql="SELECT counter FROM faculty WHERE username = '$fac' and subject2='$sub'";
$result = mysqli_query($con,$sql);
while($row = mysqli_fetch_array($result)) {
echo "<table>
<tr>
<th>Slot:</th>
</tr>";
echo "<td>" . $row['counter'] . "</td>";
}
echo "</table>";
mysqli_close($con);
?>
</body>
</html>