<html> <head> <title> Manager Login | Le Cafe' </title> </head> <link rel="stylesheet" type = "text/css" href ="css/view_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> <body> <html> <head> <title> Manager Login | Le Cafe' </title> </head> <link rel="stylesheet" type = "text/css" href ="css/view_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> <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">Le Caffee'</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 </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>Hello Manager! </h1> <p>Manage all your restaurant from here</p> </div> </div> <div class="container"> <div class="container"> <div class="col"> </div> </div> <div class="col-xs-3" style="text-align: center;"> <div class="list-group"> <a href="myrestaurant.php" class="list-group-item ">My Restaurant</a> <a href="view_food_items.php" class="list-group-item active">View Food Items</a> <a href="add_food_items.php" class="list-group-item ">Add Food Items</a> <a href="edit_food_items.php" class="list-group-item ">Edit Food Items</a> <a href="delete_food_items.php" class="list-group-item ">Delete Food Items</a> <a href="view_order_details.php" class="list-group-item ">View Order Details</a> </div> </div> <div class="col-xs-9"> <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">Le Caffee'</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>Hello Manager! </h1> <p>Manage all your restaurant from here</p> </div> </div> <div class="container"> <div class="container"> <div class="col"> </div> </div> <div class="col-xs-3" style="text-align: center;"> <div class="list-group"> <a href="myrestaurant.php" class="list-group-item ">My Restaurant</a> <a href="view_food_items.php" class="list-group-item active">View Food Items</a> <a href="add_food_items.php" class="list-group-item ">Add Food Items</a> <a href="edit_food_items.php" class="list-group-item ">Edit Food Items</a> <a href="delete_food_items.php" class="list-group-item ">Delete Food Items</a> <a href="view_order_details.php" class="list-group-item ">View Order Details</a> </div> </div> <div class="col-xs-9"> <div class="form-area" style="padding: 0px 100px 100px 100px;"> <form action="" method="POST"> <br style="clear: both"> <h3 style="margin-bottom: 25px; text-align: center; font-size: 30px;"> YOUR FOOD ITEMS LIST </h3> <?php // Storing Session $user_check=$_SESSION['login_user1']; $sql = "SELECT * FROM food f WHERE f.R_ID IN (SELECT r.R_ID FROM RESTAURANTS r WHERE r.M_ID='$user_check') ORDER BY F_ID"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) > 0) { ?> <table class="table table-striped"> <thead class="thead-dark"> <tr> <th> </th> <th> Food ID </th> <th> Food Name </th> <th> Price </th> <th> Description </th> <th> Restaurant ID </th> </tr> </thead> <?PHP //OUTPUT DATA OF EACH ROW while($row = mysqli_fetch_assoc($result)){ ?> <tbody> <tr> <td> <span class="glyphicon glyphicon-menu-right"></span> </td> <td><?php echo $row["F_ID"]; ?></td> <td><?php echo $row["name"]; ?></td> <td><?php echo $row["price"]; ?></td> <td><?php echo $row["description"]; ?></td> <td><?php echo $row["R_ID"]; ?></td> </tr> </tbody> <?php } ?> </table> <br> <?php } else { ?> <h4><center>0 RESULTS</center> </h4> <?php } ?> </form> </div> </div> </div> <br> <br> <br> <br> </body> </html>
Write, Run & Share PHP code online using OneCompiler's PHP online compiler for free. It's one of the robust, feature-rich online compilers for PHP language, running on the latest version 7. Getting started with the OneCompiler's PHP compiler is simple and pretty fast. The editor shows sample boilerplate code when you choose language as PHP
and start coding.
OneCompiler's PHP online editor supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample PHP program which takes name as input and prints hello message with your name.
<?php
fscanf(STDIN, "%s\n", $name);
echo "Hello ".$name.".\n";
?>
PHP(Hypertext Preprocessor) is widely used server sripting language by Rasmus Lerdorf in the year 1994.
In PHP, there is no need to explicitly declare variables to reserve memory space. When you assign a value to a variable, declaration happens automatically. Variables are case-sensitive in PHP.
$variable_name = value;
If, If-else, Nested-Ifs are used when you want to perform a certain set of operations based on conditional expressions.
if(conditional-expression){
//code
}
if(conditional-expression){
//code if condition is true
} else {
//code if condition is false
}
if(condition-expression1) {
//code if above condition is true
} elseif(condition-expression2){
//code if above condition is true
}
elseif(condition-expression3) {
//code if above condition is true
}
...
else {
//code if all the conditions are false
}
Switch is used to execute one set of statement from multiple conditions.
switch(conditional-expression) {
case value1:
// code if the above value is matched
break; // optional
case value2:
// code if the above value is matched
break; // optional
...
default:
// code to be executed when all the above cases are not matched;
}
For loop is used to iterate a set of statements based on a condition.
for(Initialization; Condition; Increment/decrement){
// code
}
// you can use any of the below syntax
foreach ($array as $element-value) {
//code
}
foreach ($array as $key => $element-value) {
//code
}
While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.
while(condition) {
// code
}
Do-while is also used to iterate a set of statements based on a condition. It is mostly used when you need to execute the statements atleast once.
do {
// code
} while (condition);
Function is a sub-routine which contains set of statements. Usually functions are written when multiple calls are required to same set of statements which increases re-usuability and modularity.
function function_name(parameters) {
//code
}
function_name (parameters)