-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudent_page.php
127 lines (105 loc) · 3.22 KB
/
student_page.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<style>
#tab {
border-spacing:10px 10px;
border:1px solid blue;
}
#tab tr td {
text-align:right;
border:1px solid red;
}
</style>
<?php
include_once 'core.inc.php';
include_once 'connect.inc.php';
if(isset($_GET['val'])){
if($_GET['val']==1){
echo '<script>alert("You\'re successfully registered..")</script>';
}
}
$student_username=getuserfield('username');
$firstname = getuserfield('firstname');
$surname = getuserfield('surname');
echo '<br>';
if(!empty($firstname)&&!empty($surname)){
echo 'You\'re logged in, '.$firstname.' '.$surname.' Welcome'.'<br><br>';
}
$query="SELECT * FROM hall where name in (select name from hallcon)";
$query_run=mysql_query($query);
echo '<table id="tab">';
?><tr>
<th>CATEROR NAME</th>
<th>DAY ID</th>
<th>BREAKFAST</th>
<th>LUNCH</th>
<th>SUPPER</th>
<th>DINNER</th>
</tr>
<?php
$a=0;
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>';
?>
<?php
if(isset($_POST['hallname']))
{
$q1="delete from selected_hall where student_username='{$student_username}'";
mysql_query($q1) or die(mysql_error());
$q2="insert into selected_hall(student_username,hall_selected) values('{$student_username}','{$_POST['hallname']}')";
$mysql_run_row=mysql_query($q2) or die(mysql_error());
if($mysql_run_row){
echo '<br><br>'.'your Selected hall is sent to the Administrator....'.'<br><br>';
echo 'collect your coupons at hall-'.$_POST['hallname'];
}
}
$q="select hall from hallcon";
$qr=mysql_query($q) or die(mysql_error());
$query="select name from hallcon";
$query_run=mysql_query($query) or die(mysql_error());
?>
<html>
<body>
<form action="#" method="POST">
<?php
echo 'select your option and click SUBMIT...'.'<br><br>';
while(($r=mysql_fetch_array($qr))&&($query_fetch=mysql_fetch_array($query_run)))
{
echo 'Hall no-'.$r[0].'<input type="radio" name="hallname" value="'.$r[0].'"/>'.$query_fetch['name'];
echo '<br><br>';
}
?>
<input type="submit" value="submit" style="height:40px;width:125px;font-size:25px"/><br><br>
</form>
<pre>
<a href="desiredmenu_inc.php" style="font-size:25px">Desired menu</a><br>
<a href="feedback.php" style="font-size:25px">do you want to give feedback???</a><br>
<a href="student_homepage.php" style="font-size:25px">Back to Student's page</a>
<a href="logout.php" style="font-size:25px">Log out</a><br>
</pre>
</body>
</html>