-
Notifications
You must be signed in to change notification settings - Fork 1
/
userMain.php
152 lines (102 loc) · 3.19 KB
/
userMain.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<?php
session_start();
$flag=0;
if(isset($_SESSION['uid']))
{$flag=1;
print_r($_SESSION['uid']);}
else
$flag=0;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script> -->
<meta charset="UTF-8">
<!-- Important to make website responsive -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Restaurant Website</title>
<!-- Link our CSS file -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!-- Navbar Section Starts Here -->
<?php require('navbar.php'); ?>
<!-- Navbar Section Ends Here -->
<!-- fOOD sEARCH Section Starts Here -->
<section class="food-search text-center">
<div class="container">
<h1>McBurger</h1>
</div>
</section>
<!-- fOOD sEARCH Section Ends Here -->
<!-- MAIN CODE TO ACCESS AND OUTPUT EACH ITEM -->
<?php
include 'connect.php';
?>
<!-- MAIN CODE TO ACCESS AND OUTPUT EACH ITEM -->
<!-- fOOD MEnu Section Starts Here -->
<?php
// $sql= "SELECT * FROM menu";
// $res = $db->query($sql);
// if($res==True)
// {
// while ($obj = $res -> fetch_object()) {
// printf("%s (%s)\n", $obj->foodName, $obj->foodPrice);
// }
?>
<!-- SEND DATA TO NEXT PAGE -->
<!-- ################################################################# -->
<section class="food-menu">
</div>
<div class="boxm">
<div class="boxmin" id="OFood"><h1>Order Food</h1></div>
<?php if(isset($_SESSION['uid'])){ $flag=1;?>
<div class="boxmin" id="profile"><h1>Profile</h1></div>
<?php } ?>
</div>
<?php
?>
<div class="clearfix"></div>
</div>
</section>
<!-- fOOD Menu Section Ends Here -->
<!-- social Section Starts Here -->
<section class="social">
<div class="container text-center">
<ul>
<li>
<a href="#"><img src="https://img.icons8.com/fluent/50/000000/facebook-new.png"/></a>
</li>
<li>
<a href="#"><img src="https://img.icons8.com/fluent/48/000000/instagram-new.png"/></a>
</li>
<li>
<a href="https://github.com/keerat21"><img src="images/gitIcon.gif" width="50" height="50"/></a>
</li>
</ul>
</div>
</section>
<!-- social Section Ends Here -->
<!-- footer Section Starts Here -->
<section class="footer">
<div class="container text-center">
<p>All rights reserved. University project.Current page work done onit By <a href="https://github.com/keerat21">Keerat Tanwar</a></p>
</div>
</section>
</body>
<script type="text/javascript">
var flag = <?php echo $flag; ?>;
var o_food = document.getElementById("OFood");
if(flag==1)
{ var profile = document.getElementById("profile");
profile.addEventListener("click",function(){
window.location.href = "profile.php";
});}
o_food.addEventListener("click",function(){
if(flag==0)
window.location.href = "Signin.php";
else if(flag==1)
window.location.href = "foods.php";
});
</script>
</html>