-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathtemp
138 lines (121 loc) · 3.25 KB
/
temp
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
128
129
130
131
132
133
134
135
136
137
138
<?php
$duser ='root';
$dpass ='';
$db = 'restaurant';
$con = new mysqli('localhost',$duser,$dpass,$db) or die("Unable to connect..!!");
$query="select * from order_status";
$result=mysqli_query($con,$query);
if(isset($_POST['menu']))
{
$con = mysqli_connect('localhost','root','');
if(!$con)
{
die('Unable to connect..!!');
}
mysqli_select_db($con,'restaurant');
$f= $_POST['cid'];
$q = "call display_food()";
$result=mysqli_query($con,$q);
if(mysqli_num_rows($result))
{
while($row=mysqli_fetch_array($result))
{
echo "<br/> category_id: " .$row['category_id'];
echo "<br/>category name: " .$row['category_name'];
echo "<br/>food id : ".$lname=$row['Food_id'];
echo "<br/>food name: ".$city=$row['Food_name'];
echo "<br/>price: ".$address=$row['Price'];
echo "<br/>rate: ".$pcode=$row['Rate'];
echo "<br/>prep_time: ".$cno=$row['Prep_time'];
echo "<br/>spice_level: ".$salary=$row['Spice_level'];
echo "<br/>is_jain: ".$state=$row['Is_Jain'];
echo "<br/>food_description: ".$state=$row['Food_description'];
}
}
else
{
echo 'Data is not found ...!!';
}
header("refresh:5; url=page1.html");
}
else if(isset($_POST['book']))
{
$var1= $_POST['custid'];
$var2= $_POST['mem'];
$con = mysqli_connect('localhost','root','');
if(!$con)
{
die('Unable to connect..!!');
}
mysqli_select_db($con,'restaurant');
$query2 = "call Table_allocation('$var1','$var2')";
$result2=mysqli_query($con,$query2);
if(mysqli_num_rows($result2))
{
while($row1=mysqli_fetch_array($result2))
{
echo "<br/> Your Table id is: " .$row1['Table_id'];
}
}
else
{
echo 'Data is not found ...!!';
}
header("refresh:2; url=page1.html");
}
?>
<!doctype html>
<html>
<head>
<style>
h2{
background-color: #008B8B
}
</style>
</head>
<body ><form action="page2.php" method="post">
<h2 align="center" ba >View Menu </h2> <input type="submit" name="menu" value="menu">
<h2 align="center">Book Table :</h2>
Customer Id: <input type="text" name="custid"> <br/> <br/>
Members : <input type="text" name="mem">
<input type="submit" name="book" value="book">
<h2 align="center">Track Order status </h2>
<table border="1" style="line-height:30px;">
<tr>
<th>Order ID</th>
<th>Serve Status</th>
</tr>
<?php
//Fetch Data form database
if(mysqli_num_rows($result)){
while($row=mysqli_fetch_array($result)){
?>
<tr>
<td><?php echo $row['Order_id']; ?></td>
<td><?php echo $row['serve_status']; ?></td>
</tr>
<?php
}
}
else
{
?>
<tr>
<th colspan="2">There's No data found!!!</th>
</tr>
<?php
}
?>
</table>
<h4 >Update Status:</h4>
Order Id: <input type="text" name="orderid1">
<input type="submit" name="served" value="Served">
<h2 align="center">Discount Calculation :</h2>
Order Id: <input type="text" name="orderid2">
<input type="submit" name="Calculatedis" value="Calculate">
<h2 align="center">Bill Calculation :</h2>
Order Id: <input type="text" name="orderid2">
<input type="submit" name="Calculatebill" value="Calculate">
</form>
</body>
</html>