-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdesiredmenu_print.php
66 lines (56 loc) · 1.3 KB
/
desiredmenu_print.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
<style>
#tab {
border-spacing:10px 10px;
border:1px solid blue;
}
#tab tr td {
text-align:right;
border:1px solid red;
}
</style>
<?php
include_once 'connect.inc.php';
$query="SELECT * FROM desired_menu where 1";
$query_run=mysql_query($query);
echo '<table id="tab">';
?><tr>
<th>STUDENT NAME</th>
<th>DAY</th>
<th>BREAKFAST</th>
<th>LUNCH</th>
<th>SUPPER</th>
<th>DINNER</th>
</tr>
<?php
while($row=mysql_fetch_array($query_run))
{
switch($row['dayid']){
case 0:
$day='monday';break;
case 1:
$day='tuesday';break;
case 2:
$day='wednesday';break;
case 3:
$day='thursday';break;
case 4:
$day='friday';break;
case 5:
$day='saturday';break;
case 6:
$day='sunday';break;
default:
$day='NULL';break;
}
if($row[1]==0)
echo '<tr ><td colspan="6" style="border:0px;" > </tr>';
echo '<tr><td>';
echo $row['name'].'</td><td> '.$day.'</td><td> '.$row['breakfast'].'</td><td> '.$row['lunch'].'</td><td> '.$row['snacks'].'</td><td> '.$row['dinner'];
echo '</td></tr>';
}
echo '</table>';
echo '<br><br>';
?>
<pre>
<a href="logout.php" style="font-size:25px">Log out</a>
</pre>