-
Notifications
You must be signed in to change notification settings - Fork 1
/
add_food_items1.php
121 lines (92 loc) · 3.5 KB
/
add_food_items1.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
<?php
include('session_m.php');
if(!isset($login_session)){
header('Location: managerlogin.php');
}
$name = $conn->real_escape_string($_POST['name']);
$price = $conn->real_escape_string($_POST['price']);
$description = $conn->real_escape_string($_POST['description']);
// Storing Session
$user_check=$_SESSION['login_user1'];
$R_IDsql = "SELECT RESTAURANTS.R_ID FROM RESTAURANTS, MANAGER WHERE RESTAURANTS.M_ID='$user_check'";
$R_IDresult = mysqli_query($conn,$R_IDsql);
$R_IDrs = mysqli_fetch_array($R_IDresult, MYSQLI_BOTH);
$R_ID = $R_IDrs['R_ID'];
$images_path = $conn->real_escape_string($_POST['images_path']);
$query = "INSERT INTO FOOD(name,price,description,R_ID,images_path) VALUES('" . $name . "','" . $price . "','" . $description . "','" . $R_ID ."','" . $images_path . "')";
$success = $conn->query($query);
if (!$success){
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type = "text/css" href ="css/add_food_items.css">
<link rel="stylesheet" type = "text/css" href ="css/bootstrap.min.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
</head>
<body>
<button onclick="topFunction()" id="myBtn" title="Go to top">
<span class="glyphicon glyphicon-chevron-up"></span>
</button>
<script type="text/javascript">
window.onscroll = function()
{
scrollFunction()
};
function scrollFunction(){
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("myBtn").style.display = "block";
} else {
document.getElementById("myBtn").style.display = "none";
}
}
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
</script>
<nav class="navbar navbar-inverse navbar-fixed-top navigation-clean-search" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#myNavbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">ZenHospitality'</a>
</div>
<div class="collapse navbar-collapse " id="myNavbar">
<ul class="nav navbar-nav">
<li><a href="index.php">Home</a></li>
<li><a href="aboutus.php">About</a></li>
<li><a href="contactus.php">Contact Us</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><span class="glyphicon glyphicon-user"></span> Welcome <?php echo $login_session; ?> </a></li>
<li class="active"> <a href="managerlogin.php">MANAGER CONTROL PANEL</a></li>
<li><a href="logout_m.php"><span class="glyphicon glyphicon-log-out"></span> Log Out </a></li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="jumbotron">
<h1>Oops...!!! </h1>
<p>Kindly enter your Restaurant details before adding food items.</p>
<p><a href="myrestaurant.php"> Click Me </a></p>
</div>
</div>
<br><br><br><br><br><br><br><br><br><br><br><br>
</body>
</html>
<?php
}
else {
echo "SUCCESS";
header('Location: add_food_items.php');
}
$conn->close();
?>