Ra 4-5

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 63

CHAPTER 4

ADMIN PANEL
dashboard
USER PANEL
SOURCE CODE

INDEX.PHP

<?php
session_start();
include_once('includes/dbconnection.php');
if(isset($_POST['addcart']))
{
$foodid=$_POST['foodid'];
$foodqty=$_POST['foodqty'];
$userid= $_SESSION['fosuid'];
$query=mysqli_query($con,"insert into tblorders(UserId,FoodId,FoodQty)
values('$userid','$foodid','$foodqty') ");
if($query)
{
echo "<script>alert('Food has been added in to the cart');</script>";
} else {
echo "<script>alert('Something went wrong.');</script>";
}
}
?>
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="" />
<meta name="keywords" content="" />
<title>RA COFFEE SESSION</title>

<link rel="stylesheet" href="assets/css/icons.min.css">


<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/main.css">
<link rel="stylesheet" href="assets/css/red-color.css">
<link rel="stylesheet" href="assets/css/yellow-color.css">
<link rel="stylesheet" href="assets/css/responsive.css">
<link rel="shortcut icon" href="assets/images/ICON.png" type="image/x-icon">
<style>
.blackish:before {
background-color: #00000063;
}
.popular-dish-info .log-popup-btn {
background-color: #d01212;
color: white;
margin-left: 0px;
}
</style>
</head>
<body itemscope>
<?php include_once('includes/header.php');?>

<section>
<div class="block blackish opac90">
<div class="fixed-bg" style="background-image: url('assets/images/banner_bg.png')"
height="100%";> </div>
<div class="restaurant-searching style2 text-center">
<div class="restaurant-searching-inner">
<span>Welcome to RA COFFE </span>
<h2 itemprop="headline">Order and it will be delivered</h2>
<form class="restaurant-search-form2 brd-rd30" method="post" action="search-
result.php">
<input class="brd-rd30" type="text" placeholder="Dish Name" required="true"
name="searchdata">
<button class="brd-rd30 red-bg" type="submit" name="search">SEARCH</button>
</form>
</div>
</div><!-- Restaurant Searching -->
</div>
</section>

<section>
<div class="block less-spacing gray-bg top-padd30">
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-12 col-lg-12">
<div class="sec-box">
<div class="remove-ext">
<div class="row">

<?php

if (isset($_GET['page_no']) && $_GET['page_no']!="") {


$page_no = $_GET['page_no'];
} else {
$page_no = 1;
}

$total_records_per_page = 12;
$offset = ($page_no-1) * $total_records_per_page;
$previous_page = $page_no - 1;
$next_page = $page_no + 1;
$adjacents = "2";
$result_count = mysqli_query($con,"SELECT COUNT(*) As total_records FROM tblfood");
$total_records = mysqli_fetch_array($result_count);
$total_records = $total_records['total_records'];
$total_no_of_pages = ceil($total_records / $total_records_per_page);
$second_last = $total_no_of_pages - 1; // total page minus 1
$result = mysqli_query($con,"SELECT * FROM tblfood LIMIT $offset,
$total_records_per_page");
while($row = mysqli_fetch_array($result)){
?>

<div class="col-md-4 col-sm-6 col-lg-4">


<div class="popular-dish-box style2 wow fadeIn" data-wow-delay="0.2s">
<div class="popular-dish-thumb">
<a href="food-detail.php?fid=<?php echo $row['ID'];?>" title=""
itemprop="url"><img src="admin/itemimages/<?php echo $row['Image'];?>" alt="<?php echo
$row['ItemName'];?>" itemprop="image" width="400" height="180"></a>
</div>
<div class="popular-dish-info">
<h4 itemprop="headline"><a href="food-detail.php?fid=<?php echo
$row['ID'];?>" title="" itemprop="url"><?php echo $row['ItemName'];?></a></h4>
<form method="post">
<p itemprop="description">
<input type="hidden" name="foodid" value="<?php echo $row['ID'];?>">
<input class="qty" name="foodqty" type="text" value="1">
</p>
<span class="price">₱ <?php echo $row['ItemPrice'];?></span>

<?php if($_SESSION['fosuid']==""){?>
<a class="log-popup-btn btn pull-right blue-bg brd-rd3" href="#" title="Login">Order Now</a>
<?php } else {?>
<button type="submit" name="addcart" class="btn pull-right blue-bg brd-rd3">Order Now</button>
<?php } ?>
</form>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
<div class="pagination-wrapper text-center">
<ul class="pagination justify-content-center">

<!--
<ul class="pagination"> -->
<?php // if($page_no > 1){ echo "<li><a href='?page_no=1'>First Page</a></li>"; } ?>
<li class="page-item prev" <?php if($page_no <= 1){ echo "class='disabled'"; } ?>>
<a class="page-link brd-rd2" <?php if($page_no > 1){ echo "href='?
page_no=$previous_page'"; } ?>>Previous</a>
</li>

<?php
if ($total_no_of_pages <= 10){
for ($counter = 1; $counter <= $total_no_of_pages; $counter++){
if ($counter == $page_no) {
echo "<li class='active'><a>$counter</a></li>";
}else{
echo "<li><a href='?page_no=$counter'>$counter</a></li>";
}
}
}
elseif($total_no_of_pages > 10){

if($page_no <= 4) {
for ($counter = 1; $counter < 8; $counter++){
if ($counter == $page_no) {
echo "<li class='active'><a>$counter</a></li>";
}else{
echo "<li><a href='?page_no=$counter'>$counter</a></li>";
}
}
echo "<li><a>...</a></li>";
echo "<li><a href='?page_no=$second_last'>$second_last</a></li>";
echo "<li><a href='?page_no=$total_no_of_pages'>$total_no_of_pages</a></li>";
}

elseif($page_no > 4 && $page_no < $total_no_of_pages - 4) {


echo "<li><a href='?page_no=1'>1</a></li>";
echo "<li><a href='?page_no=2'>2</a></li>";
echo "<li><a>...</a></li>";
for ($counter = $page_no - $adjacents; $counter <= $page_no + $adjacents; $counter++) {

if ($counter == $page_no) {
echo "<li class='active'><a>$counter</a></li>";
}else{
echo "<li><a href='?page_no=$counter'>$counter</a></li>";
}
}
echo "<li><a>...</a></li>";
echo "<li><a href='?page_no=$second_last'>$second_last</a></li>";
echo "<li><a href='?page_no=$total_no_of_pages'>$total_no_of_pages</a></li>";
}
else {
echo "<li><a href='?page_no=1'>1</a></li>";
echo "<li><a href='?page_no=2'>2</a></li>";
echo "<li><a>...</a></li>";

for ($counter = $total_no_of_pages - 6; $counter <= $total_no_of_pages; $counter++) {


if ($counter == $page_no) {
echo "<li class='active'><a>$counter</a></li>";
}else{
echo "<li><a href='?page_no=$counter'>$counter</a></li>";
}
}
}
}
?>

<li class="page-item next" <?php if($page_no >= $total_no_of_pages){ echo


"class='disabled'"; } ?>>
<a class="page-link brd-rd2" <?php if($page_no < $total_no_of_pages) { echo "href='?
page_no=$next_page'"; } ?>>Next</a>
</li>
<?php if($page_no < $total_no_of_pages){ ?>
<li class="page-item next"><a class="page-link brd-rd2" href='?page_no=<?php echo
$total_no_of_pages;?>'>Last &rsaquo;&rsaquo;</a></li>
<?php
} ?>

</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</section>

<?php include_once('includes/footer.php');
include_once('includes/signin.php');
include_once('includes/signup.php');
?>
</main><!-- Main Wrapper -->

<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/plugins.js"></script>
<script src="assets/js/main.js"></script>
</body>

</html>

SIGNIN.PHP

<?php
if(isset($_POST['login']))
{
$emailcon=$_POST['emailcont'];
$password=$_POST['password'];
$query=mysqli_query($con,"select ID,Email from tbluser where (Email='$emailcon' ||
MobileNumber='$emailcon') && Password='$password' ");
$ret=mysqli_fetch_array($query);
if($ret>0){
$_SESSION['fosuid']=$ret['ID'];
$_SESSION['uemail']=$ret['Email'];
echo "<script>window.location.href='index.php'</script>";
}
else{
echo "<script>alert('Invalid details');</script>";
}
}
?>
<style>
.sign-form input {

position: relative;
z-index: 1000;
}
.sign-form button {

position: relative;
z-index: 1000;
}
</style>

<div class="log-popup text-center">


<div class="sign-popup-wrapper brd-rd5">
<div class="sign-popup-inner brd-rd5">
<a class="log-close-btn" href="#" title="" itemprop="url"><i class="fa fa-close"></i></a>
<div class="sign-popup-title text-center">
<h4 itemprop="headline">SIGN IN</h4>
</div>

<form class="sign-form" method="post">


<div class="row">
<div class="col-md-12 col-sm-12 col-lg-12">
<input name="emailcont" id="email" placeholder="Registered Email or Contact
Number" required>
</div>
<div class="col-md-12 col-sm-12 col-lg-12">
<input type="password" id="password" name="password" placeholder="Password"
required>
</div>
<div class="col-md-12 col-sm-12 col-lg-12">
<button class="red-bg brd-rd3" type="submit" name="login">SIGN IN</button>
</div>
<div class="col-md-12 col-sm-12 col-lg-12">
<a class="sign-popup-btn" href="#" title="Register" itemprop="url">Not Registered
yet? Sign up</a>
<a class="recover-btn" href="forgot-password.php" title="" itemprop="url">Recover
my password</a>
</div>
</div>
</form>
</div>
</div>
</div>

SIGN UP.PHP

<?php
if(isset($_POST['submit']))
{
$fname=$_POST['firstname'];
$lname=$_POST['lastname'];
$contno=$_POST['mobilenumber'];
$email=$_POST['email'];
$password=$_POST['password'];

$ret=mysqli_query($con, "select Email from tbluser where Email='$email' ||


MobileNumber='$contno'");
$result=mysqli_fetch_array($ret);
if($result>0){
echo "<script>alert('This email or Contact Number already associated with another account');</script>";
}
else{
$query=mysqli_query($con, "insert into tbluser(FirstName, LastName, MobileNumber, Email,
Password) value('$fname', '$lname','$contno', '$email', '$password' )");
if ($query) {
echo "<script>alert('You have successfully registered');</script>";
echo "<script>window.location.href='index.php'</script>";
}
else
{
echo "<script>alert('Something Went Wrong. Please try again.');</script>";
echo "<script>window.location.href='index.php'</script>";
}
}
}

?>

<!-- Javascript for password confirmation-->


<script type="text/javascript">
function checkpass()
{
if(document.signup.password.value!=document.signup.repeatpassword.value)
{
alert('Password and Repeat Password field does not match');
document.signup.repeatpassword.focus();
return false;
}
return true;
}
</script>

<div class="sign-popup text-center">


<div class="sign-popup-wrapper brd-rd5">
<div class="sign-popup-inner brd-rd5">
<a class="sign-close-btn" href="#" title="" itemprop="url"><i class="fa fa-close"></i></a>
<div class="sign-popup-title text-center">
<h4 itemprop="headline">SIGN UP</h4>
</div>

<span class="popup-seprator text-center"><i class="brd-rd50">Signup</i></span>


<form class="sign-form" name="signup" onsubmit="return checkpass();" method="post">
<div class="row">
<div class="col-md-6 col-sm-6 col-lg-6">
<input class="brd-rd3" type="text" id="firstname" name="firstname" required="true"
placeholder="First Name">
</div>
<div class="col-md-6 col-sm-6 col-lg-6">
<input class="brd-rd3" type="text" id="lastname" name="lastname" required="true"
placeholder="Last Name">
</div>
<div class="col-md-12 col-sm-12 col-lg-12">
<input class="brd-rd3" type="email" name="email" required="true"
placeholder="Email id">
</div>
<div class="col-md-12 col-sm-12 col-lg-12">
<input class="brd-rd3" id="mobilenumber" name="mobilenumber" required="true"
maxlength="10" pattern="[0-9]{10}" title="Mobile must contain 10 digits only" placeholder="Mobile
Number">
</div>

<div class="col-md-12 col-sm-12 col-lg-12">


<input class="brd-rd3" type="password" name="password" required="true"
required="true" placeholder="Password">
</div>

<div class="col-md-12 col-sm-12 col-lg-12">


<input class="brd-rd3" type="password" id="repeatpassword"
name="repeatpassword" required="true" placeholder="Confirm Password">
</div>
<div class="col-md-12 col-sm-12 col-lg-12">
<button class="red-bg brd-rd3" type="submit" name="submit">REGISTER
NOW</button>
</div>
<div class="col-md-12 col-sm-12 col-lg-12">
<a class="sign-btn" href="#" title="" itemprop="url">Already Registered? Sign in</a>
<a class="recover-btn" href="forgot-password.php" title="" itemprop="url">Recover
my password</a>
</div>
</div>
</form>
</div>
</div>
</div>

OUR MENU.PHP

<?php
session_start();
include_once('includes/dbconnection.php');
if(isset($_POST['addcart']))
{
$foodid=$_POST['foodid'];
$foodqty=$_POST['foodqty'];
$userid= $_SESSION['fosuid'];
$query=mysqli_query($con,"insert into tblorders(UserId,FoodId,FoodQty)
values('$userid','$foodid','$foodqty') ");
if($query)
{
echo "<script>alert('Food has been added in to the cart');</script>";
} else {
echo "<script>alert('Something went wrong.');</script>";
}
}
?>
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="" />
<meta name="keywords" content="" />
<title>RA COFFEE SESSION| Food Details</title>
<link rel="shortcut icon" href="assets/images/ICON.png" type="image/x-icon">

<link rel="stylesheet" href="assets/css/icons.min.css">


<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/main.css">
<link rel="stylesheet" href="assets/css/red-color.css">
<link rel="stylesheet" href="assets/css/yellow-color.css">
<link rel="stylesheet" href="assets/css/responsive.css">
</head>
<body itemscope>
<?php include_once('includes/header.php');?>

<section>
<div class="block">
<div class="fixed-bg" style="background-image: url(assets/images/banner_bg1.png);"></div>
<div class="page-title-wrapper text-center">
<div class="col-md-12 col-sm-12 col-lg-12">
<div class="page-title-inner">
<h1 itemprop="headline">Our Menu</h1>
</div>
</div>
</div>
</div>
</section>
<section>
<div class="block less-spacing gray-bg top-padd30">
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-12 col-lg-12">
<div class="sec-box">
<div class="remove-ext">
<div class="row">

<?php

if (isset($_GET['page_no']) && $_GET['page_no']!="") {


$page_no = $_GET['page_no'];
} else {
$page_no = 1;
}

$total_records_per_page = 12;
$offset = ($page_no-1) * $total_records_per_page;
$previous_page = $page_no - 1;
$next_page = $page_no + 1;
$adjacents = "2";
$result_count = mysqli_query($con,"SELECT COUNT(*) As total_records FROM tblfood");
$total_records = mysqli_fetch_array($result_count);
$total_records = $total_records['total_records'];
$total_no_of_pages = ceil($total_records / $total_records_per_page);
$second_last = $total_no_of_pages - 1; // total page minus 1
$result = mysqli_query($con,"SELECT * FROM tblfood LIMIT $offset,
$total_records_per_page");
while($row = mysqli_fetch_array($result)){
?>

<div class="col-md-4 col-sm-6 col-lg-4">


<div class="popular-dish-box style2 wow fadeIn" data-wow-delay="0.2s">
<div class="popular-dish-thumb">
<a href="food-detail.php?fid=<?php echo $row['ID'];?>" title=""
itemprop="url"><img src="admin/itemimages/<?php echo $row['Image'];?>" alt="<?php echo
$row['ItemName'];?>" itemprop="image" width="400" height="180"></a>
</div>
<div class="popular-dish-info">
<h4 itemprop="headline"><a href="food-detail.php?fid=<?php echo
$row['ID'];?>" title="" itemprop="url"><?php echo $row['ItemName'];?></a></h4>
<form method="post">
<p itemprop="description">
<input type="hidden" name="foodid" value="<?php echo $row['ID'];?>">
<input class="qty" name="foodqty" type="text" value="1">
</p>
<span class="price">₱ <?php echo $row['ItemPrice'];?></span>

<?php if($_SESSION['fosuid']==""){?>
<a class="log-popup-btn btn pull-right red-bg brd-rd3" href="#" title="Login">Order Now</a>
<?php } else {?>
<button type="submit" name="addcart" class="btn pull-right red-bg brd-rd3">Order Now</button>
<?php } ?>
</form>
</div>
</div><!-- Popular Dish Box -->
</div>
<?php } ?>
</div>
</div>
<div class="pagination-wrapper text-center">
<ul class="pagination justify-content-center">

<!--
<ul class="pagination"> -->
<?php // if($page_no > 1){ echo "<li><a href='?page_no=1'>First Page</a></li>"; } ?>

<li class="page-item prev" <?php if($page_no <= 1){ echo "class='disabled'"; } ?>>
<a class="page-link brd-rd2" <?php if($page_no > 1){ echo "href='?
page_no=$previous_page'"; } ?>>Previous</a>
</li>

<?php
if ($total_no_of_pages <= 10){
for ($counter = 1; $counter <= $total_no_of_pages; $counter++){
if ($counter == $page_no) {
echo "<li class='active'><a>$counter</a></li>";
}else{
echo "<li><a href='?page_no=$counter'>$counter</a></li>";
}
}
}
elseif($total_no_of_pages > 10){

if($page_no <= 4) {
for ($counter = 1; $counter < 8; $counter++){
if ($counter == $page_no) {
echo "<li class='active'><a>$counter</a></li>";
}else{
echo "<li><a href='?page_no=$counter'>$counter</a></li>";
}
}
echo "<li><a>...</a></li>";
echo "<li><a href='?page_no=$second_last'>$second_last</a></li>";
echo "<li><a href='?page_no=$total_no_of_pages'>$total_no_of_pages</a></li>";
}

elseif($page_no > 4 && $page_no < $total_no_of_pages - 4) {


echo "<li><a href='?page_no=1'>1</a></li>";
echo "<li><a href='?page_no=2'>2</a></li>";
echo "<li><a>...</a></li>";
for ($counter = $page_no - $adjacents; $counter <= $page_no + $adjacents; $counter++) {

if ($counter == $page_no) {
echo "<li class='active'><a>$counter</a></li>";
}else{
echo "<li><a href='?page_no=$counter'>$counter</a></li>";
}
}
echo "<li><a>...</a></li>";
echo "<li><a href='?page_no=$second_last'>$second_last</a></li>";
echo "<li><a href='?page_no=$total_no_of_pages'>$total_no_of_pages</a></li>";
}

else {
echo "<li><a href='?page_no=1'>1</a></li>";
echo "<li><a href='?page_no=2'>2</a></li>";
echo "<li><a>...</a></li>";

for ($counter = $total_no_of_pages - 6; $counter <= $total_no_of_pages; $counter++) {


if ($counter == $page_no) {
echo "<li class='active'><a>$counter</a></li>";
}else{
echo "<li><a href='?page_no=$counter'>$counter</a></li>";
}
}
}
}
?>

<li class="page-item next" <?php if($page_no >= $total_no_of_pages){ echo


"class='disabled'"; } ?>>
<a class="page-link brd-rd2" <?php if($page_no < $total_no_of_pages) { echo "href='?
page_no=$next_page'"; } ?>>Next</a>
</li>
<?php if($page_no < $total_no_of_pages){ ?>
<li class="page-item next"><a class="page-link brd-rd2" href='?page_no=<?php echo
$total_no_of_pages;?>'>Last &rsaquo;&rsaquo;</a></li>
<?php
} ?>

</ul>
</div><!-- Pagination Wrapper -->
</div>
</div>
</div>
</div>
</div>
</section>

<?php include_once('includes/footer.php');
include_once('includes/signin.php');
include_once('includes/signup.php');
?>

</main><!-- Main Wrapper -->

<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/plugins.js"></script>
<script src="assets/js/main.js"></script>
</body>

</html>

CONTACT US.PHP

<?php
session_start();
include_once('includes/dbconnection.php');
?>
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="" />
<meta name="keywords" content="" />
<title>RA COFFEE SESSION| Food Details</title>

<link rel="stylesheet" href="assets/css/icons.min.css">


<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/main.css">
<link rel="stylesheet" href="assets/css/red-color.css">
<link rel="stylesheet" href="assets/css/yellow-color.css">
<link rel="stylesheet" href="assets/css/responsive.css">
</head>
<body itemscope>

<?php include_once('includes/header.php');?>
<section>
<div class="block">
<div class="fixed-bg" style="background-image:
url(assets/images/banner_bg1.png);"></div>
<div class="page-title-wrapper text-center">
<div class="col-md-12 col-sm-12 col-lg-12">
<div class="page-title-inner">
<h1 itemprop="headline">Contact Us</h1>
</div>
</div>
</div>
</div>
</section>

<div class="bread-crumbs-wrapper">
<div class="container">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.php" title="" itemprop="url">Home</a></li>
<li class="breadcrumb-item active">Contact Us</li>
</ol>
</div>
</div>

<section>
<div class="block less-spacing gray-bg top-padd30">

<div class="container">
<div class="row">

<div class="col-md-12 col-sm-12 col-lg-12">


<div class="sec-box">

<div class="contact-info-sec text-center">


<div class="row">
<div class="col-md-4 col-sm-4 col-lg-4">
<div class="contact-info-box">
<i class="fa fa-phone-square"></i>
<h5 itemprop="headline">PHONE</h5>
<p itemprop="description">Phone :+639302264484</p>

</div>
</div>
<div class="col-md-4 col-sm-4 col-lg-4">
<div class="contact-info-box">
<i class="fa fa-map-marker"></i>
<h5 itemprop="headline">ADDRESS</h5>
<p itemprop="description">Cabanatuan CIty</p>
</div>
</div>
<div class="col-md-4 col-sm-4 col-lg-4">
<div class="contact-info-box">
<i class="fa fa-envelope"></i>
<h5 itemprop="headline">EMAIL</h5>
<p itemprop="description">racoffee@gmail.com</p>

</div>
</div>
</div>
</div>

</div>
</div>
</div>
</div>
</div>
</section>

<?php include_once('includes/footer.php');
include_once('includes/signin.php');
include_once('includes/signup.php');
?>
</main><!-- Main Wrapper -->

<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/plugins.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<script src="assets/js/google-map-int.js"></script>
<script src="../../www.google.com/recaptcha/api.js"></script>
<script src="assets/js/main.js"></script>
</body>

</html>

CART.PHP

<?php
session_start();
error_reporting(0);
include_once('includes/dbconnection.php');
if (strlen($_SESSION['fosuid']==0)) {
header('location:logout.php');
} else{

if(isset($_POST['placeorder'])){
//getting address
$fnaobno=$_POST['flatbldgnumber'];
$street=$_POST['streename'];
$area=$_POST['area'];
$lndmark=$_POST['landmark'];
$city=$_POST['city'];
$userid=$_SESSION['fosuid'];
//genrating order number
$orderno= mt_rand(100000000, 999999999);
$query="update tblorders set OrderNumber='$orderno',IsOrderPlaced='1' where UserId='$userid' and
IsOrderPlaced is null;";
$query.="insert into
tblorderaddresses(UserId,Ordernumber,Flatnobuldngno,StreetName,Area,Landmark,City)
values('$userid','$orderno','$fnaobno','$street','$area','$lndmark','$city');";

$result = mysqli_multi_query($con, $query);


if ($result) {
//Code for email
$toemail=$_SESSION['uemail'];
$subj="FOS Order Confirmation";
$heade .= "MIME-Version: 1.0"."\r\n";
$heade .= 'Content-type: text/html; charset=iso-8859-1'."\r\n";
$heade .= 'From:FOS<noreply@yourdomain.com>'."\r\n"; // Put your sender email here
$msgec.="<html></body><div><div>Hello,</div></br></br>";
$msgec.="<div style='padding-top:8px;'> Your order has been placed successfully <br />
<strong> Order Number: </strong> $orderno </br>
</div><div></div></body></html>";
mail($toemail,$subj,$msgec,$heade);
echo '<script>alert("Your order placed successfully. Order number is "+"'.$orderno.'")</script>';
echo "<script>window.location.href='my-account.php'</script>";

}
}

//Code deletion
if(isset($_GET['delid'])) {
$rid=$_GET['delid'];
$query=mysqli_query($con,"delete from tblorders where ID='$rid'");
echo '<script>alert("Food item deleted")</script>';
echo "<script>window.location.href='cart.php'</script>";

}
?>
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="" />
<meta name="keywords" content="" />
<title>RA COFFEE SESSION| Food Details</title>

<link rel="stylesheet" href="assets/css/icons.min.css">


<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/main.css">
<link rel="stylesheet" href="assets/css/red-color.css">
<link rel="stylesheet" href="assets/css/yellow-color.css">
<link rel="stylesheet" href="assets/css/responsive.css">
<style>
/* The Modal (background) */
.modal {

display: none; /* Hidden by default */


position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
padding-top: 250px; /* Location of the box */
left: 0%;

width: 100%; /* Full width */


height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.2); /* Black w/ opacity */
}

/* Modal Content */

.modal-content {
position:relative;
background-color: #fefefe;
margin:block;
margin: auto;
margin-left: auto;
margin-right: auto;
top:5%;
bottom:10%;
padding-top:5px;
padding-bottom:5px;
width: 55%;
}

/* The Close Button */


.close {
color: black;
float: right;
font-size: 28px;
font-weight: bold;
}

.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
#myBtn {
color:white;
background-color:#1d0b54;

}
}
</style>
</head>
<body itemscope>
<?php include_once('includes/header.php');?>

<section>
<div class="block">
<div class="fixed-bg" style="background-image:
url(assets/images/banner_bg1.png);"></div>
<div class="page-title-wrapper text-center">
<div class="col-md-12 col-sm-12 col-lg-12">
<div class="page-title-inner">
<h1 itemprop="headline"
style="color:;">Cart</h1>

</div>
</div>
</div>
</div>
</section>

<div class="bread-crumbs-wrapper">
<div class="container">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.php" title="" itemprop="url">Home</a></li>
<li class="breadcrumb-item active">My Cart</li>
</ol>
</div>
</div>

<section>
<div class="block gray-bg bottom-padd210 top-padd30">

<div class="container">
<div class="row">
<div class="col-md-12">
<div class="sec-box">
<div class="sec-wrapper">

<div class="col-md-12 col-sm-12 col-lg-12">

<div class="booking-table">
<table>
<thead>
<tr>
<th>#</th>
<th>Food Item</th>
<th>Qty</th>
<th>Per Unit Price</th>
<th>Total</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$userid= $_SESSION['fosuid'];
$query=mysqli_query($con,"select tblorders.ID as
frid,tblfood.Image,tblfood.ItemName,tblfood.ItemDes,tblfood.ItemPrice,tblfood.ItemQty,tblorders.Food
Id,tblorders.FoodQty from tblorders join tblfood on tblfood.ID=tblorders.FoodId where
tblorders.UserId='$userid' and tblorders.IsOrderPlaced is null");
$num=mysqli_num_rows($query);
if($num>0){
while ($row=mysqli_fetch_array($query)) {

?>
<tr>
<td><img src="admin/itemimages/<?php echo $row['Image']?>" width="100" height="80" alt="<?php
echo $row['ItemName']?>"></td>
<td>
<a href="food-detail.php?fid=<?php echo $row['FoodId'];?>" title="" itemprop="url"><?php echo
$row['ItemName']?></a>
</td>
<td><?php echo $qty=$row['FoodQty']?></td>
<td>₱<?php echo $ppu=$row['ItemPrice']?></td>
<td>₱<?php echo $total=$qty*$ppu;?></td>
<td><a href="cart.php?delid=<?php echo $row['frid'];?>" onclick="return confirm('Do you really want to
delete?');";><i class="fa fa-trash" aria-hidden="true" title="Delete this food item"></i><a/></span></td>
</tr>

<?php $grandtotal+=$total;}?>
<thead>
<tr>
<th colspan="4" style="text-align:center;">Grand Total</th>
<th style="text-align:center;">₱<?php echo $grandtotal;?></th>
<th></th>
</tr>
</thead>
<form method="post">
<tr>

</div>
<thead>

</thead>
<form method="post">
<tr >
<td colspan="3" >

<input type="text" name="landmark" placeholder="Mode of Payment" class="form-control"


list="MOD">
<datalist id="MOD">
<option value="GCASH">
<option value="Cash on Delivery">
</datalist>
</td>

<td>
<button id="myBtn">Pay online</button>
</td>

<!-- The Modal -->

<div id="myModal" class="modal">

<!-- Modal content -->


<div class="modal-content">
<span class="close">&times;</span>
<center><img src="assets/images/gcash.jpg" class="center" height="70%" width="50%"/></center>
</div>
</tr>
<tr>

<td colspan="3" >


<input type="text" name="flatbldgnumber" placeholder="Block or Building Number"
class="form-control" required="true"></td>

<td colspan="3" >


<input type="text" name="streename" placeholder="Street Name" class="form-control"
required="true">
</td>

</tr>
<tr>
<td colspan="3" >
<input type="text" name="area" placeholder="Area" class="form-control" required="true">
</td>

<td colspan="3" >


<input type="text" name="city" placeholder="City" class="form-control">
</td>
</tr>
<tr>
<td colspan="3">
<button type="submit" name="placeorder" class="btn theme-btn btn-lg">Place order</button>
</td></tr>
</form>

<?php } else {?>


<tr>
<td colspan="6" style="color:red">You cart is empty</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>

</div>
</div>
</div>
</div>
</div><!-- Section Box -->
</div>
</section>

<!-- red section -->


<?php include_once('includes/footer.php');
include_once('includes/signin.php');
include_once('includes/signup.php');
?>
</main><!-- Main Wrapper -->

<script>
// Get the modal
var modal = document.getElementById("myModal");

// Get the button that opens the modal


var btn = document.getElementById("myBtn");

// Get the <span> element that closes the modal


var span = document.getElementsByClassName("close")[0];

// When the user clicks the button, open the modal


btn.onclick = function() {
modal.style.display = "block";
}

// When the user clicks on <span> (x), close the modal


span.onclick = function() {
modal.style.display = "none";
}

// When the user clicks anywhere outside of the modal, close it


window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
</script>

<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<script src="assets/js/google-map-int3.js"></script>
<script src="assets/js/plugins.js"></script>
<script src="assets/js/main.js"></script>
</body>

</html>
<?php } ?>

MY ACCOUNT.PHP

<?php
session_start();
//error_reporting(0);
include_once('includes/dbconnection.php');
if (strlen($_SESSION['fosuid']==0)) {
header('location:logout.php');
} else{

//Update Profile
if(isset($_POST['updateprofile']))
{
$sid=$_SESSION['fosuid'];
$fname=$_POST['firstname'];
$lname=$_POST['lastname'];

$query=mysqli_query($con, "update tbluser set FirstName='$fname', LastName='$lname' where


ID='$sid'");

if ($query) {
$msg="Your profile has been updated";
}
else
{
$msg="Something Went Wrong. Please try again";
}

// change Password
if(isset($_POST['changepassword']))
{
$userid=$_SESSION['fosuid'];
$cpassword=md5($_POST['currentpassword']);
$newpassword=md5($_POST['newpassword']);
$query=mysqli_query($con,"select ID from tbluser where ID='$userid' and Password='$cpassword'");
$row=mysqli_fetch_array($query);
if($row>0){
$ret=mysqli_query($con,"update tbluser set Password='$newpassword' where ID='$userid'");
$msg= "Your password successully changed";
} else {

$msg="Your current password is wrong";


}

?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="" />
<meta name="keywords" content="" />
<title>RA COFFEE SESSION | My Account</title>
<link rel="stylesheet" href="assets/css/icons.min.css">
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/main.css">
<link rel="stylesheet" href="assets/css/red-color.css">
<link rel="stylesheet" href="assets/css/yellow-color.css">
<link rel="stylesheet" href="assets/css/responsive.css">
<script type="text/javascript">
function checkpass()
{
if(document.changepassword.newpassword.value!=document.changepassword.confirmpassword.value)
{
alert('New Password and Confirm Password field does not match');
document.changepassword.confirmpassword.focus();
return false;
}
return true;
}

</script>
<script language="javascript" type="text/javascript">
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
if(popUpWin)
{
if(!popUpWin.closed) popUpWin.close();
}
popUpWin = open(URLStr,'popUpWin',
'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory
=yes,width='+600+',height='+600+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

</script>
</head>
<body itemscope>
<?php include_once('includes/header.php');?>
<section>
<div class="block">
<div class="fixed-bg" style="background-image: url(assets/images/topbg.jpg);"></div>
<div class="page-title-wrapper text-center">
<div class="col-md-12 col-sm-12 col-lg-12">
<div class="page-title-inner">
<h1 itemprop="headline">My Account</h1>
</div>
</div>
</div>
</div>
</section>
<div class="bread-crumbs-wrapper">
<div class="container">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.php" title="" itemprop="url">Home</a></li>
<li class="breadcrumb-item active">Dashboard</li>
</ol>
</div>
</div>
<section>
<div class="block less-spacing gray-bg top-padd30">
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-12 col-lg-12">
<div class="sec-box">
<div class="dashboard-tabs-wrapper">
<div class="row">
<div class="col-md-4 col-sm-12 col-lg-4">
<div class="profile-sidebar brd-rd5 wow fadeIn" data-wow-delay="0.2s">
<div class="profile-sidebar-inner brd-rd5">

<?php
$pid=$_SESSION['fosuid'];
$ret=mysqli_query($con,"select * from tbluser where ID='$pid'");
$cnt=1;
while ($row=mysqli_fetch_array($ret)) {
?>

<div class="user-info red-bg">


<img class="brd-rd50" src="assets/images/profile.png" alt="user-avatar.jpg"
itemprop="image">
<div class="user-info-inner">
<h5 itemprop="headline"><a href="#" title="" itemprop="url"><?php echo
$row['FirstName']." ".$row['LastName'];?></a></h5>
<span><a href="#" title="" itemprop="url"><?php echo
$row['Email'];?></a></span>
<a class="brd-rd3 sign-out-btn yellow-bg" href="logout.php" title=""
itemprop="url"><i class="fa fa-sign-out"></i> SIGN OUT</a>
</div>
</div>
<?php } ?>
<ul class="nav nav-tabs">

<li class="active"><a href="#my-orders" data-toggle="tab"><i class="fa fa-


shopping-basket"></i> MY ORDERS</a></li>

<li><a href="#statement" data-toggle="tab"><i class="fa fa-wpforms"></i>


Change Password</a></li>
<li><a href="#account-settings" data-toggle="tab"><i class="fa fa-cog"></i>
Profile</a></li>
</ul>
</div>
</div>
</div>
<div class="col-md-8 col-sm-12 col-lg-8">
<div class="tab-content">
<p style="font-size:16px; color:red" align="center"> <?php if($msg){
echo $msg;
} ?> </p>

<div class="tab-pane fade in active" id="my-orders">


<div class="tabs-wrp brd-rd5">
<h4 itemprop="headline">MY ORDERS</h4>
<hr />
<div class="select-wrap-inner">

</div>
<div class="order-list">

<?php
$uid=$_SESSION['fosuid'];
$query=mysqli_query($con,"select * from tblorderaddresses where UserId='$uid'");
$count=1;
$num=mysqli_num_rows( $query);
if($num>0){
while($row=mysqli_fetch_array($query))
{ ?>

<div class="order-item brd-rd5">


<div class="order-thumb brd-rd5">
<a href="#" title="" itemprop="url"><img src="assets/images/order.jpg"
alt="order-img1.jpg" itemprop="image"></a>

</div>
<div class="order-info">
<span class="red-clr"><b>Order Date :</b> <?php echo $row['OrderTime']?
></span>
<h4 itemprop="headline"><a href="#" title="" itemprop="url">Order # <?
php echo $row['Ordernumber'];?></a></h4>
<span class="processing brd-rd3"> <?php $status=$row['OrderFinalStatus'];
if($status==''){
echo "Waiting for Order confirmation";
} else{
echo $status;
}

?></span>
<a class="brd-rd2" href="order-details.php?onumber=<?php echo
$row['Ordernumber'];?>" title="Order Detail" itemprop="url">Order Details</a>

<ul class="post-meta">

<li style="font-size:16px;"> <a href="javascript:void(0);"


onClick="popUpWindow('trackorder.php?oid=<?php echo htmlentities($row['Ordernumber']);?>');"
title="Track order"><i class="flaticon-transport"></i> Track Order</a></li>
</ul>
</div>
</div>
<?php } } else {?>
<h5 style="color:red">No order found</h5>
<?php } ?>
</div>

<!-- Pagination Wrapper -->


</div>
</div>

<div class="tab-pane fade" id="statement">


<div class="tabs-wrp brd-rd5">
<h4 itemprop="headline">Change Password</h4>
<form method="post" class="profile-info-form" name="changepassword" onsubmit="return
checkpass();">
<div class="col-md-12 col-sm-12 col-lg-12">
<label>Current Password<sup>*</sup></label>
<input class="brd-rd3" type="password" name="currentpassword"
id="currentpassword"required="true">
</div>

<div class="col-md-12 col-sm-12 col-lg-12">


<label>New Password<sup>*</sup></label>
<input class="brd-rd3" type="password" id="newpassword" value=""
name="newpassword" required="true">
</div>

<div class="col-md-12 col-sm-12 col-lg-12">


<label>Confirm Password<sup>*</sup></label>
<input class="brd-rd3" type="password" id="confirmpassword"
value="" name="confirmpassword" required="true">
</div>

<div class="col-md-12 col-sm-12 col-lg-12">


<button class="red-bg brd-rd3" type="submit" name="changepassword">Change
Password</button>
</div>
</form>
</div>
</div>
<div class="tab-pane fade" id="account-settings">
<div class="tabs-wrp account-settings brd-rd5">
<h4 itemprop="headline">My Profile</h4>
<div class="account-settings-inner">
<div class="row">

<?php
$pid=$_SESSION['fosuid'];
$ret=mysqli_query($con,"select * from tbluser where ID='$pid'");
$cnt=1;
while ($row=mysqli_fetch_array($ret)) {

?>
<form method="post" class="profile-info-form">
<div class="col-md-12 col-sm-12 col-lg-12">
<div class="profile-info-form-wrap">
<form class="profile-info-form">
<div class="row mrg20">
<div class="col-md-12 col-sm-12 col-lg-12">
<label>First Name<sup>*</sup></label>
<input class="brd-rd3" type="text" value="<?php echo
$row['FirstName'];?>" id="firstname" name="firstname" required="true">
</div>
<div class="col-md-12 col-sm-12 col-lg-12">
<label>Lasr Name <sup>*</sup></label>
<input class="brd-rd3" type="text" value="<?php echo
$row['LastName'];?>" id="lastname" name="lastname" required="true">
</div>
<div class="col-md-12 col-sm-12 col-lg-12">
<label>Email address <sup>*</sup></label>
<input class="brd-rd3" type="text" name="email" value="<?php
echo $row['Email'];?>" readonly="true">
</div>

<div class="col-md-6 col-sm-6 col-lg-6">


<label>Mobile Number <sup>*</sup></label>
<input class="brd-rd3" type="text" id="mobilenumber"
name="mobilenumber" value="<?php echo $row['MobileNumber'];?>" readonly="true">
</div>

<div class="col-md-6 col-sm-6 col-lg-6">


<label>Registraton Date </label>
<input class="brd-rd3" type="text" name="regdate" value="<?php
echo $row['RegDate'];?>" readonly="true">
</div>

<div class="col-md-12 col-sm-12 col-lg-12">


<button class="red-bg brd-rd3" type="submit" name="updateprofile">Update
Profile</button>
</div>
</div>
</form>
</div>
</div>
</form>
<?php } ?>

</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Section Box -->
</div>
</div>
</div>
</div>
</section>
<?php include_once('includes/footer.php');
include_once('includes/signin.php');
include_once('includes/signup.php');
?>
</main>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/plugins.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<script src="assets/js/google-map-int.js"></script>
<script src="../../www.google.com/recaptcha/api.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>
<?php } ?>

DASHBOARD.PHP
<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');
if (strlen($_SESSION['fosaid']==0)) {
header('location:logout.php');
}
?>

<!DOCTYPE html>
<html>

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>RA COFFEE SESSION</title>

<link href="css/bootstrap.min.css" rel="stylesheet">


<link href="font-awesome/css/font-awesome.css" rel="stylesheet">

<link href="css/animate.css" rel="stylesheet">


<link href="css/style.css" rel="stylesheet">
</head>

<body>
<div id="wrapper">
<?php include_once('includes/leftbar.php');?>

<div id="page-wrapper" class="gray-bg">


<?php include_once('includes/header.php');?>
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-lg-4">
<div class="ibox ">
<div class="ibox-title">
<?php $query=mysqli_query($con,"Select * from tblorderaddresses");
$totalorder=mysqli_num_rows($query);
?>
<a class="text-muted text-uppercase m-b-20" href="all-order.php" style="font-size:
20px"><strong>Total Order</strong></a>
<h5></h5>
</div>
<div class="ibox-content">
<h1 class="no-margins"><?php echo $totalorder;?></h1>

<small>Total order</small>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="ibox ">
<div class="ibox-title">
<?php $query1=mysqli_query($con,"Select * from tblorderaddresses where
OrderFinalStatus is null");
$notconfirmedorder=mysqli_num_rows($query1);
?>
<a class="text-muted text-uppercase m-b-20" href="notconfirmedyet.php" style="font-size:
20px"><strong>New Order</strong></a>

</div>
<div class="ibox-content">
<h1 class="no-margins"><?php echo $notconfirmedorder;?></h1>
<small>New Order</small>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="ibox ">
<div class="ibox-title">
<?php $query2=mysqli_query($con,"Select * from tblorderaddresses where
OrderFinalStatus ='Order Confirmed'");
$conforder=mysqli_num_rows($query2);
?>
<a class="text-muted text-uppercase m-b-20" href="confirmed-order.php" style="font-size:
20px"><strong>Confirmed Order</strong></a>

</div>
<div class="ibox-content">
<h1 class="no-margins"><?php echo $conforder;?></h1>

<small>Confirmed Order</small>
</div>
</div>
</div>

</div>
<div class="row">

<div class="col-lg-4">
<div class="ibox ">
<div class="ibox-title">
<?php $query3=mysqli_query($con,"Select * from tblorderaddresses where
OrderFinalStatus ='Food being Prepared'");
$beigpre=mysqli_num_rows($query3);
?>
<a class="text-muted text-uppercase m-b-20" href="foodbeingprepared.php" style="font-size:
20px"><strong>Food being Prepared</strong></a>

</div>
<div class="ibox-content">
<h1 class="no-margins"><?php echo $beigpre;?></h1>
<small>Food being Prepared</small>
</div>
</div>
</div>

<div class="col-lg-4">
<div class="ibox ">
<div class="ibox-title">
<?php $query4=mysqli_query($con,"Select * from tblorderaddresses where
OrderFinalStatus ='Food Pickup'");
$foodpickup=mysqli_num_rows($query4);
?>
<a class="text-muted text-uppercase m-b-20" href="food-pickup.php" style="font-size: 20px"><strong>
Food Pickup</strong></a>
</div>
<div class="ibox-content">
<h1 class="no-margins"><?php echo $foodpickup;?></h1>

<small> Food Pickup</small>


</div>
</div>
</div>
<div class="col-lg-4">
<div class="ibox ">
<div class="ibox-title">
<?php $query5=mysqli_query($con,"Select * from tblorderaddresses where
OrderFinalStatus ='Food Delivered'");
$fooddel=mysqli_num_rows($query5);
?>
<a class="text-muted text-uppercase m-b-20" href="food-delivered.php" style="font-size:
20px"><strong>Total Food Deliver</strong></a>

</div>
<div class="ibox-content">
<h1 class="no-margins"><?php echo $fooddel;?></h1>
<small>Total Food Deliver</small>
</div>
</div>
</div>

<div class="col-lg-4">
<div class="ibox ">
<div class="ibox-title">
<?php $query1=mysqli_query($con,"Select * from tblorderaddresses where OrderFinalStatus='Order
Cancelled'");
$notconfirmedorder=mysqli_num_rows($query1);
?>
<a class="text-muted text-uppercase m-b-20" href="canclled-order.php" style="font-size:
20px"><strong>Cancelled Order</strong></a>

</div>
<div class="ibox-content">
<h1 class="no-margins"><?php echo $notconfirmedorder;?></h1>
<small>Cancelled Order</small>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="ibox ">
<div class="ibox-title">
<?php $query=mysqli_query($con,"Select * from tbluser");
$usercount=mysqli_num_rows($query);
?>
<a class="text-muted text-uppercase m-b-20" href="user-detail.php" style="font-size:
25px"><strong>Total Regd. User</strong></a>

</div>
<div class="ibox-content">
<h1 class="no-margins"><?php echo $usercount;?></h1>

<small>Total Regd. User</small>


</div>
</div>
</div>

?>
<!--a class="text-muted text-uppercase m-b-20" href="reservations.php"style="font-size:
25px"><strong>Total Reserved</strong></a-->
<div>
<div class="inbox-content">
<h1 class="no-margins"><?php echo $reservation;?></h1>

<!--small>Total reserved</small-->
</div>
</div>

</div>
</div>
<?php include_once('includes/footer.php');?>
</div>
</div>

<!-- Mainly scripts -->


<script src="js/jquery-3.1.1.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>

<!-- Flot -->


<script src="js/plugins/flot/jquery.flot.js"></script>
<script src="js/plugins/flot/jquery.flot.tooltip.min.js"></script>
<script src="js/plugins/flot/jquery.flot.spline.js"></script>
<script src="js/plugins/flot/jquery.flot.resize.js"></script>
<script src="js/plugins/flot/jquery.flot.pie.js"></script>
<script src="js/plugins/flot/jquery.flot.symbol.js"></script>
<script src="js/plugins/flot/jquery.flot.time.js"></script>

<!-- Peity -->


<script src="js/plugins/peity/jquery.peity.min.js"></script>
<script src="js/demo/peity-demo.js"></script>

<!-- Custom and plugin javascript -->


<script src="js/inspinia.js"></script>
<script src="js/plugins/pace/pace.min.js"></script>

<!-- jQuery UI -->


<script src="js/plugins/jquery-ui/jquery-ui.min.js"></script>

<!-- Jvectormap -->


<script src="js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js"></script>
<script src="js/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>

<!-- EayPIE -->


<script src="js/plugins/easypiechart/jquery.easypiechart.js"></script>

<!-- Sparkline -->


<script src="js/plugins/sparkline/jquery.sparkline.min.js"></script>

<!-- Sparkline demo data -->


<script src="js/demo/sparkline-demo.js"></script>

<script>
$(document).ready(function() {
$('.chart').easyPieChart({
barColor: '#f8ac59',
// scaleColor: false,
scaleLength: 5,
lineWidth: 4,
size: 80
});

$('.chart2').easyPieChart({
barColor: '#1c84c6',
// scaleColor: false,
scaleLength: 5,
lineWidth: 4,
size: 80
});

var data2 = [
[gd(2012, 1, 1), 7], [gd(2012, 1, 2), 6], [gd(2012, 1, 3), 4], [gd(2012, 1, 4), 8],
[gd(2012, 1, 5), 9], [gd(2012, 1, 6), 7], [gd(2012, 1, 7), 5], [gd(2012, 1, 8), 4],
[gd(2012, 1, 9), 7], [gd(2012, 1, 10), 8], [gd(2012, 1, 11), 9], [gd(2012, 1, 12), 6],
[gd(2012, 1, 13), 4], [gd(2012, 1, 14), 5], [gd(2012, 1, 15), 11], [gd(2012, 1, 16), 8],
[gd(2012, 1, 17), 8], [gd(2012, 1, 18), 11], [gd(2012, 1, 19), 11], [gd(2012, 1, 20), 6],
[gd(2012, 1, 21), 6], [gd(2012, 1, 22), 8], [gd(2012, 1, 23), 11], [gd(2012, 1, 24), 13],
[gd(2012, 1, 25), 7], [gd(2012, 1, 26), 9], [gd(2012, 1, 27), 9], [gd(2012, 1, 28), 8],
[gd(2012, 1, 29), 5], [gd(2012, 1, 30), 8], [gd(2012, 1, 31), 25]
];

var data3 = [
[gd(2012, 1, 1), 800], [gd(2012, 1, 2), 500], [gd(2012, 1, 3), 600], [gd(2012, 1, 4), 700],
[gd(2012, 1, 5), 500], [gd(2012, 1, 6), 456], [gd(2012, 1, 7), 800], [gd(2012, 1, 8), 589],
[gd(2012, 1, 9), 467], [gd(2012, 1, 10), 876], [gd(2012, 1, 11), 689], [gd(2012, 1, 12), 700],
[gd(2012, 1, 13), 500], [gd(2012, 1, 14), 600], [gd(2012, 1, 15), 700], [gd(2012, 1, 16), 786],
[gd(2012, 1, 17), 345], [gd(2012, 1, 18), 888], [gd(2012, 1, 19), 888], [gd(2012, 1, 20), 888],
[gd(2012, 1, 21), 987], [gd(2012, 1, 22), 444], [gd(2012, 1, 23), 999], [gd(2012, 1, 24), 567],
[gd(2012, 1, 25), 786], [gd(2012, 1, 26), 666], [gd(2012, 1, 27), 888], [gd(2012, 1, 28), 900],
[gd(2012, 1, 29), 178], [gd(2012, 1, 30), 555], [gd(2012, 1, 31), 993]
];

var dataset = [
{
label: "Number of orders",
data: data3,
color: "#1ab394",
bars: {
show: true,
align: "center",
barWidth: 24 * 60 * 60 * 600,
lineWidth:0
}

}, {
label: "Payments",
data: data2,
yaxis: 2,
color: "#1C84C6",
lines: {
lineWidth:1,
show: true,
fill: true,
fillColor: {
colors: [{
opacity: 0.2
}, {
opacity: 0.4
}]
}
},
splines: {
show: false,
tension: 0.6,
lineWidth: 1,
fill: 0.1
},
}
];

var options = {
xaxis: {
mode: "time",
tickSize: [3, "day"],
tickLength: 0,
axisLabel: "Date",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Arial',
axisLabelPadding: 10,
color: "#d5d5d5"
},
yaxes: [{
position: "left",
max: 1070,
color: "#d5d5d5",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Arial',
axisLabelPadding: 3
}, {
position: "right",
clolor: "#d5d5d5",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: ' Arial',
axisLabelPadding: 67
}
],
legend: {
noColumns: 1,
labelBoxBorderColor: "#000000",
position: "nw"
},
grid: {
hoverable: false,
borderWidth: 0
}
};

function gd(year, month, day) {


return new Date(year, month - 1, day).getTime();
}

var previousPoint = null, previousLabel = null;

$.plot($("#flot-dashboard-chart"), dataset, options);

var mapData = {
"US": 298,
"SA": 200,
"DE": 220,
"FR": 540,
"CN": 120,
"AU": 760,
"BR": 550,
"IN": 200,
"GB": 120,
};

$('#world-map').vectorMap({
map: 'world_mill_en',
backgroundColor: "transparent",
regionStyle: {
initial: {
fill: '#e4e4e4',
"fill-opacity": 0.9,
stroke: 'none',
"stroke-width": 0,
"stroke-opacity": 0
}
},

series: {
regions: [{
values: mapData,
scale: ["#1ab394", "#22d6b1"],
normalizeFunction: 'polynomial'
}]
},
});
});
</script>
</body>
</html>
ADMIN.PHP

<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');

if(isset($_POST['login']))
{
$adminuser=$_POST['username'];
$password=$_POST['password'];
$query=mysqli_query($con,"select ID from tbladmin where UserName='$adminuser' &&
Password='$password' ");
$ret=mysqli_fetch_array($query);
if($ret>0){
$_SESSION['fosaid']=$ret['ID'];
header('location:dashboard.php');
}
else{
$msg="Invalid Details.";
}
}
?>
<!DOCTYPE html>
<html>

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>RA| Admin Login</title>

<link href="css/bootstrap.min.css" rel="stylesheet">


<link href="font-awesome/css/font-awesome.css" rel="stylesheet">

<link href="css/animate.css" rel="stylesheet">


<link href="css/style.css" rel="stylesheet">

</head>

<body class="gray-bg">

<div class="loginColumns animated fadeInDown">


<div class="row">

<div class="col-md-6">
<h2 class="font-bold">RA COFFEE SESSION | Admin Login</h2>

</div>
<div class="col-md-6">
<div class="ibox-content">
<p style="font-size:16px; color:red" align="center"> <?php if($msg){
echo $msg;
} ?> </p>
<form class="m-t" role="form" action="" method="post" name="login">
<div class="form-group">
<input type="text" class="form-control" placeholder="username" name="username"
required="">
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Password" required=""
name="password">
</div>
<button type="submit" class="btn btn-primary block full-width m-b"
name="login">Login</button>

<a href="forgot-password.php">
<p>Forgot password?</p>
</a>

</form>

</div>
</div>
</div>
<hr/>

</div>
<?php include_once('includes/footer.php');?>
</body>

</html>

MANAGEFOODCATEGORY.PHP
<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');
if (strlen($_SESSION['fosaid']==0)) {
header('location:logout.php');
} else{
//Code for deletion
if (isset($_GET['del'])) {
$catid=intval($_GET['del']);
$query=mysqli_query($con,"delete from tblcategory where ID='$catid'");
if ($query) {
echo "<script>alert('Category deleted');</script>";
echo "<script>window.location.href='manage-foodcategory.php'</script>";
}
else
{
echo "<script>alert('Something Went Wrong. Please try again.');</script>";
echo "<script>window.location.href='manage-foodcategory.php'</script>";
}
}

?>
<!DOCTYPE html>
<html>

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Food Ordering System</title>

<link href="css/bootstrap.min.css" rel="stylesheet">


<link href="font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="css/plugins/iCheck/custom.css" rel="stylesheet">
<link href="css/plugins/steps/jquery.steps.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">

</head>

<body>

<div id="wrapper">

<?php include_once('includes/leftbar.php');?>

<div id="page-wrapper" class="gray-bg">


<?php include_once('includes/header.php');?>

<div class="row border-bottom">

</div>
<div class="wrapper wrapper-content animated fadeInRight">

<div class="row">
<div class="col-lg-12">
<div class="ibox">

<div class="ibox-content">
<table class="table table-bordered mg-b-0">
<p style="text-align: center; color: blue;font-size: 30px">Manage Food Category
</p>
<thead>
<tr>
<th>S.NO</th>
<th>Category Name</th>
<th>Creation Date</th>
<th>Action</th>
</tr>
</thead>
<?php
$ret=mysqli_query($con,"select * from tblcategory");
$cnt=1;
while ($row=mysqli_fetch_array($ret)) {

?>
<tbody>
<tr>
<td><?php echo $cnt;?></td>

<td><?php echo $row['CategoryName'];?></td>


<td><?php echo $row['CreationDate'];?></td>
<td><a href="editcategory.php?editid=<?php echo $row['ID'];?>">Edit</a> |
<a href="manage-foodcategory.php?del=<?php echo $row['ID'];?>" style="color:red;"
onclick="return confirm('Do you really want to delete the category?');">Delete</a>
</tr>
<?php
$cnt=$cnt+1;
}?>

</tbody>
</table>

</div>
</div>
</div>

</div>
</div>
<?php include_once('includes/footer.php');?>

</div>
</div>

<!-- Mainly scripts -->


<script src="js/jquery-3.1.1.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>

<!-- Custom and plugin javascript -->


<script src="js/inspinia.js"></script>
<script src="js/plugins/pace/pace.min.js"></script>

<!-- Steps -->


<script src="js/plugins/steps/jquery.steps.min.js"></script>

<!-- Jquery Validate -->


<script src="js/plugins/validate/jquery.validate.min.js"></script>

<script>
$(document).ready(function(){
$("#wizard").steps();
$("#form").steps({
bodyTag: "fieldset",
onStepChanging: function (event, currentIndex, newIndex)
{
// Always allow going backward even if the current step contains invalid fields!
if (currentIndex > newIndex)
{
return true;
}

// Forbid suppressing "Warning" step if the user is to young


if (newIndex === 3 && Number($("#age").val()) < 18)
{
return false;
}

var form = $(this);

// Clean up if user went backward before


if (currentIndex < newIndex)
{
// To remove error styles
$(".body:eq(" + newIndex + ") label.error", form).remove();
$(".body:eq(" + newIndex + ") .error", form).removeClass("error");
}

// Disable validation on fields that are disabled or hidden.


form.validate().settings.ignore = ":disabled,:hidden";

// Start validation; Prevent going forward if false


return form.valid();
},
onStepChanged: function (event, currentIndex, priorIndex)
{
// Suppress (skip) "Warning" step if the user is old enough.
if (currentIndex === 2 && Number($("#age").val()) >= 18)
{
$(this).steps("next");
}

// Suppress (skip) "Warning" step if the user is old enough and wants to the previous step.
if (currentIndex === 2 && priorIndex === 3)
{
$(this).steps("previous");
}
},
onFinishing: function (event, currentIndex)
{
var form = $(this);

// Disable validation on fields that are disabled.


// At this point it's recommended to do an overall check (mean ignoring only disabled fields)
form.validate().settings.ignore = ":disabled";

// Start validation; Prevent form submission if false


return form.valid();
},
onFinished: function (event, currentIndex)
{
var form = $(this);

// Submit form input


form.submit();
}
}).validate({
errorPlacement: function (error, element)
{
element.before(error);
},
rules: {
confirm: {
equalTo: "#password"
}
}
});
});
</script>

</body>
</html>
<?php } ?>
MANAGE FOOD.PHP
<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');
if (strlen($_SESSION['fosaid']==0)) {
header('location:logout.php');
} else{

//Code for deletion


if (isset($_GET['delfood'])) {
$catid=intval($_GET['delfood']);
$query=mysqli_query($con,"delete from tblfood where ID='$catid'");
if ($query) {
echo "<script>alert('Food item deleted from menu');</script>";
echo "<script>window.location.href='manage-fooditems.php'</script>";
} else {
echo "<script>alert('Something Went Wrong. Please try again.');</script>";
echo "<script>window.location.href='manage-fooditems.php'</script>";
}
}

?>
<!DOCTYPE html>
<html>

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Food Ordering System</title>

<link href="css/bootstrap.min.css" rel="stylesheet">


<link href="font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="css/plugins/iCheck/custom.css" rel="stylesheet">
<link href="css/plugins/steps/jquery.steps.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">

</head>

<body>

<div id="wrapper">

<?php include_once('includes/leftbar.php');?>

<div id="page-wrapper" class="gray-bg">


<?php include_once('includes/header.php');?>

<div class="row border-bottom">

</div>

<div class="wrapper wrapper-content animated fadeInRight">

<div class="row">

<div class="col-lg-12">
<div class="ibox">

<div class="ibox-content">
<table class="table table-bordered mg-b-0">
<p style="text-align: center; color: blue;font-size: 30px">Manage Food Items </p>
<thead>
<tr>
<th>S.NO</th>
<th>Category Name</th>
<th>Item Name</th>
<th>Action</th>
</tr>
</thead>
<?php
$ret=mysqli_query($con,"select * from tblfood");
$cnt=1;
while ($row=mysqli_fetch_array($ret)) {

?>
<tbody>
<tr>
<td><?php echo $cnt;?></td>
<td><?php echo $row['CategoryName'];?></td>
<td><?php echo $row['ItemName'];?></td>
<td><a href="editfooditem.php?editid=<?php echo $row['ID'];?>">Edit</a> |
<a href="manage-fooditems.phpp?delfood=<?php echo $row['ID'];?>" style="color:red;"
onclick="return confirm('Do you really want to delete the food item?');">Delete</a>
</tr>
<?php
$cnt=$cnt+1;
}?>

</tbody>
</table>

</div>
</div>
</div>

</div>
</div>
<?php include_once('includes/footer.php');?>

</div>
</div>

<!-- Mainly scripts -->


<script src="js/jquery-3.1.1.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>

<!-- Custom and plugin javascript -->


<script src="js/inspinia.js"></script>
<script src="js/plugins/pace/pace.min.js"></script>

<!-- Steps -->


<script src="js/plugins/steps/jquery.steps.min.js"></script>

<!-- Jquery Validate -->


<script src="js/plugins/validate/jquery.validate.min.js"></script>

<script>
$(document).ready(function(){
$("#wizard").steps();
$("#form").steps({
bodyTag: "fieldset",
onStepChanging: function (event, currentIndex, newIndex)
{
// Always allow going backward even if the current step contains invalid fields!
if (currentIndex > newIndex)
{
return true;
}

// Forbid suppressing "Warning" step if the user is to young


if (newIndex === 3 && Number($("#age").val()) < 18)
{
return false;
}

var form = $(this);

// Clean up if user went backward before


if (currentIndex < newIndex)
{
// To remove error styles
$(".body:eq(" + newIndex + ") label.error", form).remove();
$(".body:eq(" + newIndex + ") .error", form).removeClass("error");
}

// Disable validation on fields that are disabled or hidden.


form.validate().settings.ignore = ":disabled,:hidden";

// Start validation; Prevent going forward if false


return form.valid();
},
onStepChanged: function (event, currentIndex, priorIndex)
{
// Suppress (skip) "Warning" step if the user is old enough.
if (currentIndex === 2 && Number($("#age").val()) >= 18)
{
$(this).steps("next");
}

// Suppress (skip) "Warning" step if the user is old enough and wants to the previous step.
if (currentIndex === 2 && priorIndex === 3)
{
$(this).steps("previous");
}
},
onFinishing: function (event, currentIndex)
{
var form = $(this);

// Disable validation on fields that are disabled.


// At this point it's recommended to do an overall check (mean ignoring only disabled fields)
form.validate().settings.ignore = ":disabled";

// Start validation; Prevent form submission if false


return form.valid();
},
onFinished: function (event, currentIndex)
{
var form = $(this);

// Submit form input


form.submit();
}
}).validate({
errorPlacement: function (error, element)
{
element.before(error);
},
rules: {
confirm: {
equalTo: "#password"
}
}
});
});
</script>

</body>
</html>
<?php } ?>

ADD FOOD.PHP

<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');
if (strlen($_SESSION['fosaid']==0)) {
header('location:logout.php');
} else{

if(isset($_POST['submit']))
{
$faid=$_SESSION['fosaid'];
$fcat=$_POST['foodcategory'];
$itemname=$_POST['itemname'];
$description=$_POST['description'];
$quantity=$_POST['quantity'];
$price=$_POST['price'];

$itempic=$_FILES["itemimages"]["name"];
$extension = substr($itempic,strlen($itempic)-4,strlen($itempic));
// allowed extensions
$allowed_extensions = array(".jpg","jpeg",".png",".gif");
// Validation for allowed extensions .in_array() function searches an array for a specific value.
if(!in_array($extension,$allowed_extensions))
{
echo "<script>alert('Invalid format. Only jpg / jpeg/ png /gif format allowed');</script>";
}
else
{
$itempic=md5($itempic).$extension;
move_uploaded_file($_FILES["itemimages"]["tmp_name"],"itemimages/".$itempic);
$query=mysqli_query($con, "insert into
tblfood(CategoryName,ItemName,ItemPrice,ItemDes,ItemQty,Image)
value('$fcat','$itemname','$price','$description','$quantity','$itempic')");
if ($query) {
$msg="Food Item has been added.";
}
else
{
$msg="Something Went Wrong. Please try again";
}

}
}
?>
<!DOCTYPE html>
<html>

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Food Ordering System</title>

<link href="css/bootstrap.min.css" rel="stylesheet">


<link href="font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="css/plugins/iCheck/custom.css" rel="stylesheet">
<link href="css/plugins/steps/jquery.steps.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">

</head>

<body>

<div id="wrapper">

<?php include_once('includes/leftbar.php');?>

<div id="page-wrapper" class="gray-bg">


<?php include_once('includes/header.php');?>
<div class="row border-bottom">

</div>
<div class="row wrapper border-bottom white-bg page-heading">
<div class="col-lg-10">
<h2>Food Items</h2>
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="dashboard.php">Home</a>
</li>
<li class="breadcrumb-item">
<a>Item Name</a>
</li>
<li class="breadcrumb-item active">
<strong>Add</strong>
</li>
</ol>
</div>
</div>

<div class="wrapper wrapper-content animated fadeInRight">

<div class="row">
<div class="col-lg-12">
<div class="ibox">

<div class="ibox-content">
<p style="font-size:16px; color:red;"> <?php if($msg){
echo $msg;
} ?> </p>

<form id="submit" action="#" class="wizard-big" method="post" name="submit"


enctype="multipart/form-data">
<fieldset>
<div class="form-group row"><label class="col-sm-2 col-form-label">Food
Category:</label>
<div class="col-sm-10"><select name='foodcategory' id="foodcategory"
class="form-control white_bg" required="true">

<?php

$query=mysqli_query($con,"select * from tblcategory");


while($row=mysqli_fetch_array($query))
{
?>
<option value="<?php echo $row['CategoryName'];?>"><?php echo $row['CategoryName'];?
></option>
<?php } ?>
</select></div>
</div>
<div class="form-group row"><label class="col-sm-2 col-form-label">Item
Name:</label>
<div class="col-sm-10"><input type="text" class="form-control"
name="itemname" required="true"></div>
</div>

<div class="form-group row"><label class="col-sm-2 col-form-


label">Description:</label>
<div class="col-sm-10">
<textarea type="text" class="form-control" name="description" row="8"
cols="12" required="true">
</textarea>
</div>
</div>
<div class="form-group row"><label class="col-sm-2
col-form-label">Image</label>
<div class="col-sm-10"><input type="file" name="itemimages"
required="true"></div>
</div>
<div class="form-group row"><label class="col-sm-2 col-form-
label">Quantity:</label>
<div class="col-sm-10"><input type="text" class="form-control"
name="quantity" required="true"></div>
</div>
<div class="form-group row"><label class="col-sm-2
col-form-label">Price:</label>
<div class="col-sm-10"><input type="text" class="form-control" name="price"
required="true"></div>
</div>

</fieldset>
</fieldset>

<p style="text-align: center;"><button type="submit" name="submit" class="btn btn-


primary">Submit</button></p>

</form>
</div>
</div>
</div>

</div>
</div>
<?php include_once('includes/footer.php');?>

</div>
</div>

<!-- Mainly scripts -->


<script src="js/jquery-3.1.1.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>

<!-- Custom and plugin javascript -->


<script src="js/inspinia.js"></script>
<script src="js/plugins/pace/pace.min.js"></script>

<!-- Steps -->


<script src="js/plugins/steps/jquery.steps.min.js"></script>

<!-- Jquery Validate -->


<script src="js/plugins/validate/jquery.validate.min.js"></script>

<script>
$(document).ready(function(){
$("#wizard").steps();
$("#form").steps({
bodyTag: "fieldset",
onStepChanging: function (event, currentIndex, newIndex)
{
// Always allow going backward even if the current step contains invalid fields!
if (currentIndex > newIndex)
{
return true;
}

// Forbid suppressing "Warning" step if the user is to young


if (newIndex === 3 && Number($("#age").val()) < 18)
{
return false;
}

var form = $(this);

// Clean up if user went backward before


if (currentIndex < newIndex)
{
// To remove error styles
$(".body:eq(" + newIndex + ") label.error", form).remove();
$(".body:eq(" + newIndex + ") .error", form).removeClass("error");
}

// Disable validation on fields that are disabled or hidden.


form.validate().settings.ignore = ":disabled,:hidden";

// Start validation; Prevent going forward if false


return form.valid();
},
onStepChanged: function (event, currentIndex, priorIndex)
{
// Suppress (skip) "Warning" step if the user is old enough.
if (currentIndex === 2 && Number($("#age").val()) >= 18)
{
$(this).steps("next");
}

// Suppress (skip) "Warning" step if the user is old enough and wants to the previous step.
if (currentIndex === 2 && priorIndex === 3)
{
$(this).steps("previous");
}
},
onFinishing: function (event, currentIndex)
{
var form = $(this);

// Disable validation on fields that are disabled.


// At this point it's recommended to do an overall check (mean ignoring only disabled fields)
form.validate().settings.ignore = ":disabled";

// Start validation; Prevent form submission if false


return form.valid();
},
onFinished: function (event, currentIndex)
{
var form = $(this);

// Submit form input


form.submit();
}
}).validate({
errorPlacement: function (error, element)
{
element.before(error);
},
rules: {
confirm: {
equalTo: "#password"
}
}
});
});
</script>

</body>

</html>
<?php } ?>

ALLORDER.PHP
<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');
if (strlen($_SESSION['fosaid']==0)) {
header('location:logout.php');
} else{

}
?>
<!DOCTYPE html>
<html>
<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Food Ordering System</title>

<link href="css/bootstrap.min.css" rel="stylesheet">


<link href="font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="css/plugins/iCheck/custom.css" rel="stylesheet">
<link href="css/plugins/steps/jquery.steps.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">

</head>

<body>

<div id="wrapper">

<?php include_once('includes/leftbar.php');?>

<div id="page-wrapper" class="gray-bg">


<?php include_once('includes/header.php');?>

<div class="row border-bottom">

</div>

<div class="wrapper wrapper-content animated fadeInRight">

<div class="row">
<div class="col-lg-12">
<div class="ibox">

<div class="ibox-content">
<table class="table table-bordered mg-b-0">
<p style="text-align: center; color: blue; font-size: 25px">Detail of All Order
Received</p>
<thead>
<tr>
<th>S.NO</th>
<th>Order Number</th>
<th>Order Date</th>
<th>Action</th>
</tr>
</thead>
<?php
$ret=mysqli_query($con,"select * from tblorderaddresses");
$cnt=1;
while ($row=mysqli_fetch_array($ret)) {

?>
<tbody>
<tr>
<td><?php echo $cnt;?></td>

<td><?php echo $row['Ordernumber'];?></td>


<td><?php echo $row['OrderTime'];?></td>
<td><a href="viewfoodorder.php?orderid=<?php echo $row['Ordernumber'];?
>">View Details</a>
</tr>
<?php
$cnt=$cnt+1;
}?>

</tbody>
</table>

</div>
</div>
</div>

</div>
</div>
<?php include_once('includes/footer.php');?>

</div>
</div>

<!-- Mainly scripts -->


<script src="js/jquery-3.1.1.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>

<!-- Custom and plugin javascript -->


<script src="js/inspinia.js"></script>
<script src="js/plugins/pace/pace.min.js"></script>

<!-- Steps -->


<script src="js/plugins/steps/jquery.steps.min.js"></script>
<!-- Jquery Validate -->
<script src="js/plugins/validate/jquery.validate.min.js"></script>

<script>
$(document).ready(function(){
$("#wizard").steps();
$("#form").steps({
bodyTag: "fieldset",
onStepChanging: function (event, currentIndex, newIndex)
{
// Always allow going backward even if the current step contains invalid fields!
if (currentIndex > newIndex)
{
return true;
}

// Forbid suppressing "Warning" step if the user is to young


if (newIndex === 3 && Number($("#age").val()) < 18)
{
return false;
}

var form = $(this);

// Clean up if user went backward before


if (currentIndex < newIndex)
{
// To remove error styles
$(".body:eq(" + newIndex + ") label.error", form).remove();
$(".body:eq(" + newIndex + ") .error", form).removeClass("error");
}

// Disable validation on fields that are disabled or hidden.


form.validate().settings.ignore = ":disabled,:hidden";

// Start validation; Prevent going forward if false


return form.valid();
},
onStepChanged: function (event, currentIndex, priorIndex)
{
// Suppress (skip) "Warning" step if the user is old enough.
if (currentIndex === 2 && Number($("#age").val()) >= 18)
{
$(this).steps("next");
}
// Suppress (skip) "Warning" step if the user is old enough and wants to the previous step.
if (currentIndex === 2 && priorIndex === 3)
{
$(this).steps("previous");
}
},
onFinishing: function (event, currentIndex)
{
var form = $(this);

// Disable validation on fields that are disabled.


// At this point it's recommended to do an overall check (mean ignoring only disabled fields)
form.validate().settings.ignore = ":disabled";

// Start validation; Prevent form submission if false


return form.valid();
},
onFinished: function (event, currentIndex)
{
var form = $(this);

// Submit form input


form.submit();
}
}).validate({
errorPlacement: function (error, element)
{
element.before(error);
},
rules: {
confirm: {
equalTo: "#password"
}
}
});
});
</script>

</body>

</html>

You might also like