-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcateror.php
46 lines (38 loc) · 1.47 KB
/
cateror.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
<?php
session_start();
include_once 'connect.inc.php';
//$q1="delete from hall where name='{$_SESSION['username']}'";
//mysql_query($q1) or die(mysql_error());
$breakfast=$_POST['breakfast'];
$lunch=$_POST['lunch'];
$snacks=$_POST['snacks'];
$dinner=$_POST['dinner'];
for ($i=0;$i<=6;$i++)
{
if(isset($breakfast[$i])){
$q="update hall set breakfast='{$breakfast[$i]}' where name = '{$_SESSION['username']}' and dayid='{$i}'";
$q_r=mysql_query($q);
}
if(isset($lunch[$i])){
$q="update hall set lunch='{$lunch[$i]}' where name = '{$_SESSION['username']}' and dayid='{$i}' ";
$q_r=mysql_query($q);
}if(isset($snacks[$i])){
$q="update hall set snacks='{$snacks[$i]}' where name = '{$_SESSION['username']}' and dayid='{$i}'";
$q_r=mysql_query($q);
}if(isset($dinner[$i])){
$q="update hall set dinner='{$dinner[$i]}' where name = '{$_SESSION['username']}' and dayid='{$i}' ";
$q_r=mysql_query($q);
}
//$q="insert into hall values('{$_SESSION['username']}','{$i}','{$breakfast[$i]}','{$lunch[$i]}','{$snacks[$i]}','{$dinner[$i]}')";
//mysql_query($q) or die(mysql_error());
}
echo 'Menu is updated succesfull';
echo '<script>alert("Successfully entered..")</script>';
?>
<br><br>
<a href="student_feedback.php" style="font-size:25px">student's feedback</a>
<br><br>
<a href="desiredmenu_print.php" style="font-size:25px">student's Desired menu</a>
<pre>
<a href="logout.php" style="font-size:25px">Log out</a>
</pre>