Ra 4-5
Ra 4-5
Ra 4-5
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>
<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
$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)){
?>
<?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>";
}
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>";
</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>
SIGN UP.PHP
<?php
if(isset($_POST['submit']))
{
$fname=$_POST['firstname'];
$lname=$_POST['lastname'];
$contno=$_POST['mobilenumber'];
$email=$_POST['email'];
$password=$_POST['password'];
?>
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">
<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
$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)){
?>
<?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>";
}
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>";
</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');
?>
<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>
<?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>
</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">[email protected]</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');";
}
}
//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>
/* 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%;
}
.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="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" >
<td>
<button id="myBtn">Pay online</button>
</td>
</tr>
<tr>
<td colspan="3" >
<input type="text" name="area" placeholder="Area" class="form-control" required="true">
</td>
</div>
</div>
</div>
</div>
</div><!-- Section Box -->
</div>
</section>
<script>
// Get the modal
var modal = document.getElementById("myModal");
<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'];
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 {
?>
<!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>
<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>
<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">
<?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>
</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">
<body>
<div id="wrapper">
<?php include_once('includes/leftbar.php');?>
<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>
</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>
?>
<!--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>
<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
}
};
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">
</head>
<body class="gray-bg">
<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">
</head>
<body>
<div id="wrapper">
<?php include_once('includes/leftbar.php');?>
</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>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<?php include_once('includes/footer.php');?>
</div>
</div>
<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;
}
// 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);
</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{
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div id="wrapper">
<?php include_once('includes/leftbar.php');?>
</div>
<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>
<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;
}
// 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);
</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">
</head>
<body>
<div id="wrapper">
<?php include_once('includes/leftbar.php');?>
</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="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>
<?php
</fieldset>
</fieldset>
</form>
</div>
</div>
</div>
</div>
</div>
<?php include_once('includes/footer.php');?>
</div>
</div>
<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;
}
// 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);
</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">
</head>
<body>
<div id="wrapper">
<?php include_once('includes/leftbar.php');?>
</div>
<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>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<?php include_once('includes/footer.php');?>
</div>
</div>
<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;
}
</body>
</html>