Вы находитесь на странице: 1из 20

FOOD ORDERING SYSTEM

SCSE
CSE2004
Food Ordering System

FOOD ORDERING SYSTEM


Team Members:
1)Suyash Shrivastava-19BCE1503
2)Varun Salgarkar-19BCE1435
3)Rishik Ganta-19BCE1494
4)Amey Chitnis-19BCE1453

Course Code: CSE2004


Course Title: Database Management Systems
Class Number: CH2019205000734
Course Faculty: Dr.L.M.Jenila Livingston

TABLE OF CONTENTS Page No.

1. Abstract 3
2. Introduction 3
3. Project Motive 4
4. Modules 5
5. System Specifications 6
6. Screenshots 7
7. Conclusion 11

8. Coding and Queries 11


Food Ordering System

ABSTRACT:
Food Ordering System is a website designed primarily for use in the food
delivery industry. This system will allow hotels and restaurants to increase
scope of business by reducing the labour cost involved. The system also allows
to quickly and easily manage an online menu which customers can browse and
use to place orders with just few clicks. Restaurant employees then use these
orders through an easy to navigate graphical interface for efficient processing

INTRODUCTION:
Food Ordering System has been proposed to be implemented the manual
system. The main aim of this project is computerization of all processes which
happens in the Restaurant. It is a database system for creating a selective
retrieved of information, for subsequent analysis, manipulation and
application.
The main advantage of this system is that it greatly simplifies the ordering
process for both the customer and the restaurant. Here the customer visits the
ordering webpage where they are presented with an interactive and up to
date menu complete with all available options and dynamically adjusting prices
based on the selected options. After making a selection the item is then added
to their order which the customer can review the details of at any time before
checking out. This provides instant visual confirmation of what was selected
and ensures that items in the order are in fact what was intended. This system
also greatly lightens the load on the restaurant’s end as the entire process of
taking orders is automated. Once an order is placed on the webpage it is
entered into the database and then retrieved in pretty much real time by
a desktop application on the restaurant’s end. Within this application all items
in the order are displayed along with their corresponding options and delivery
details in a concise and easy to read manner. This allows restaurant employees
to quickly go through the orders as they are placed and produce the necessary
items with minimal delay and confusion
Food Ordering System

Project Motive:
In today’s age of fast food and take-out many restaurants have chosen to focus
on quick preparation and speedy delivery of orders rather than offering a rich
dining experience. Until very recently all of these delivery orders were placed
over the phone but there are many disadvantages to this system including the
inconvenience of the customer needing to have a physical copy of the menu
lack of a visual confirmation that the order was placed correctly and the
necessity for the restaurant to have an employee answering the phone and
taking orders. So we propose this system where customers can order their
favourite cuisine just with some clicks on the website.
Food Ordering System

MODULES:
Items Module:
Sales Module:
Maintenance Module:
Items Module:
This module is used to store and retrieve the details of available items in the
Restaurant.
Sales Module:
To keep track of the business each and every sales done in the shop to any
customers should be maintained. This module helps in storing data for all the
sales in the shop.
Maintenance Module:
To keep track of the change in the menu in the Restaurant. This module helps
in this change.

ER DIAGRAM:
Food Ordering System

SYSTEM SPECIFICATION:
HARDWARE SPECIFICATION:
Processor: Intel Pentium D (Dual Core 3.0 GHz)
Speed: 933 MHz
Hard Disk: 40 GB
Ram: 256 MB
SOFTWARE SPECIFICATION:
Operating System: Windows XP, 7,8,10
Front End: HTML
Back End: SQL+php
Food Ordering System

SCREENSHOTS:
MENU PAGE:
Food Ordering System
Food Ordering System

ORDERS PAGE:
Food Ordering System

SALES PAGE:

Maintenance Page:
Food Ordering System

CONCLUSION:
The project entitled “FOOD ORDERING SYSTEM “has been proposed to be
implementing to replace the manual system. The developed system
accomplishes all the objectives stated for the need for the change of the
system. The outputs produced seem to satisfy all the users but it will definitely
take to look forwarded for the real consequences the new system could
produce.

CODING AND QUERIES:


Connection.php:
<?php

$conn = new mysqli('localhost', 'root', '', 'foodsys');

if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}

?>

Header.php:
<?php include('conn.php'); ?>
Food Ordering System

<!DOCTYPE html>
<html>
<head>
<title>FoodOrderSystem</title>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>

Category.php:
<?php include('header.php'); ?>
<body>
<?php include('navbar.php'); ?>
<div class="container">
<h1 class="page-header text-center">CATEGORY CRUD</h1>
<div class="row">
<div class="col-md-12">
<a href="#addcategory" data-toggle="modal" class="pull-right btn btn-
primary"><span class="glyphicon glyphicon-plus"></span> Category</a>
</div>
</div>
<div style="margin-top:10px;">
<table class="table table-striped table-bordered">
<thead>
<th>Category Name</th>
<th>Action</th>
</thead>
<tbody>
<?php
$sql="select * from category order by categoryid asc";
$query=$conn->query($sql);
while($row=$query->fetch_array()){
?>
<tr>
<td><?php echo $row['catname']; ?></td>
<td>
<a href="#editcategory<?php echo
$row['categoryid']; ?>" data-toggle="modal" class="btn btn-success btn-sm"><span class="glyphicon
glyphicon-pencil"></span> Edit</a> || <a href="#deletecategory<?php echo $row['categoryid']; ?>"
data-toggle="modal" class="btn btn-danger btn-sm"><span class="glyphicon glyphicon-trash"></span>
Delete</a>
<?php
include('category_modal.php'); ?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
<?php include('modal.php'); ?>
Food Ordering System

</body>

Index.php:

<?php include('header.php'); ?>


<body>
<?php include('navbar.php'); ?>
<div class="container">
<h1 class="page-header text-center">MENU</h1>
<ul class="nav nav-tabs">
<?php
$sql="select * from category order by categoryid asc limit 1";
$fquery=$conn->query($sql);
$frow=$fquery->fetch_array();
?>
<li class="active"><a data-toggle="tab" href="#<?php echo
$frow['catname'] ?>"><?php echo $frow['catname'] ?></a></li>
<?php

$sql="select * from category order by categoryid asc";


$nquery=$conn->query($sql);
$num=$nquery->num_rows-1;

$sql="select * from category order by categoryid asc limit 1, $num";


$query=$conn->query($sql);
while($row=$query->fetch_array()){
?>
<li><a data-toggle="tab" href="#<?php echo $row['catname'] ?>"><?
php echo $row['catname'] ?></a></li>
<?php
}
?>
</ul>

<div class="tab-content">
<?php
$sql="select * from category order by categoryid asc limit 1";
$fquery=$conn->query($sql);
$ftrow=$fquery->fetch_array();
?>
<div id="<?php echo $ftrow['catname']; ?>" class="tab-pane fade in
active" style="margin-top:20px;">
<?php

$sql="select * from product where categoryid='".


$ftrow['categoryid']."'";
$pfquery=$conn->query($sql);
$inc=4;
while($pfrow=$pfquery->fetch_array()){
$inc = ($inc == 4) ? 1 : $inc+1;
if($inc == 1) echo "<div class='row'>";
?>
<div class="col-md-3">
Food Ordering System

<div class="panel panel-


default">
<div class="panel-
heading text-center">
<b><?php
echo $pfrow['productname']; ?></b>
</div>
<div class="panel-
body">
<img
src="<?php if(empty($pfrow['photo'])){echo "upload/noimage.jpg";} else{echo $pfrow['photo'];} ?>"
height="225px;" width="100%">
</div>
<div class="panel-
footer text-center">
&#x20A8;
<?php echo number_format($pfrow['price'], 2); ?>
</div>
</div>
</div>
<?php
if($inc == 4) echo "</div>";
}
if($inc == 1) echo "<div class='col-md-3'></div><div
class='col-md-3'></div><div class='col-md-3'></div></div>";
if($inc == 2) echo "<div class='col-md-3'></div><div
class='col-md-3'></div></div>";
if($inc == 3) echo "<div class='col-md-
3'></div></div>";
?>
</div>
<?php

$sql="select * from category order by categoryid asc";


$tquery=$conn->query($sql);
$tnum=$tquery->num_rows-1;

$sql="select * from category order by categoryid asc limit 1, $tnum";


$cquery=$conn->query($sql);
while($trow=$cquery->fetch_array()){
?>
<div id="<?php echo $trow['catname']; ?>" class="tab-pane fade"
style="margin-top:20px;">
<?php

$sql="select * from product where categoryid='".


$trow['categoryid']."'";
$pquery=$conn->query($sql);
$inc=4;
while($prow=$pquery->fetch_array()){
$inc = ($inc == 4) ? 1 : $inc+1;
if($inc == 1) echo "<div class='row'>";
?>
<div class="col-md-3">
<div class="panel panel-
default">
<div class="panel-
heading text-center">
<b><?php
echo $prow['productname']; ?></b>
Food Ordering System

</div>
<div class="panel-
body">
<img
src="<?php if($prow['photo']==''){echo "upload/noimage.jpg";} else{echo $prow['photo'];} ?>"
height="225px;" width="100%">
</div>
<div class="panel-
footer text-center">
&#x20A8;
<?php echo number_format($prow['price'], 2); ?>
</div>
</div>
</div>
<?php
if($inc == 4) echo "</div>";
}
if($inc == 1) echo "<div class='col-md-3'></div><div
class='col-md-3'></div><div class='col-md-3'></div></div>";
if($inc == 2) echo "<div class='col-md-3'></div><div
class='col-md-3'></div></div>";
if($inc == 3) echo "<div class='col-md-
3'></div></div>";
?>
</div>
<?php
}
?>
</div>

</div>
</body>
<footer><center>Thanks to Neovic | Brought To You By code-projects.org</center></footer>
</html>
Order.php:

<?php include('header.php'); ?>


<body>
<?php include('navbar.php'); ?>
<div class="container">
<h1 class="page-header text-center">ORDER</h1>
<form method="POST" action="purchase.php">
<table class="table table-striped table-bordered">
<thead>
<th class="text-center"><input type="checkbox" id="checkAll"></th>
<th>Category</th>
<th>Product Name</th>
<th>Price</th>
<th>Quantity</th>
</thead>
<tbody>
<?php
$sql="select * from product left join category on
category.categoryid=product.categoryid order by product.categoryid asc, productname asc";
$query=$conn->query($sql);
$iterate=0;
while($row=$query->fetch_array()){
Food Ordering System

?>
<tr>
<td class="text-center"><input
type="checkbox" value="<?php echo $row['productid']; ?>||<?php echo $iterate; ?>"
name="productid[]" style=""></td>
<td><?php echo $row['catname']; ?></td>
<td><?php echo $row['productname']; ?
></td>
<td class="text-right">&#x20A8; <?php echo
number_format($row['price'], 2); ?></td>
<td><input type="text" class="form-control"
name="quantity_<?php echo $iterate; ?>"></td>
</tr>
<?php
$iterate++;
}
?>
</tbody>
</table>

<div class="row">
<div class="col-md-3">
<input type="text" name="customer" class="form-control"
placeholder="Customer Name" required>
</div>
<div class="col-md-2" style="margin-left:-20px;">
<button type="submit" class="btn btn-primary"><span
class="glyphicon glyphicon-floppy-disk"></span> Save</button>
</div>
</div>
</form>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#checkAll").click(function(){
$('input:checkbox').not(this).prop('checked', this.checked);
});
});
</script>
</body>
</html>

Product.php:

<?php include('header.php'); ?>


<body>
<?php include('navbar.php'); ?>
<div class="container">
<h1 class="page-header text-center">PRODUCTS CRUD</h1>
<div class="row">
<div class="col-md-12">
<select id="catList" class="btn btn-default">
<option value="0">All Category</option>
Food Ordering System

<?php
$sql="select * from category";
$catquery=$conn->query($sql);
while($catrow=$catquery->fetch_array()){
$catid = isset($_GET['category']) ? $_GET['category'] : 0;
$selected = ($catid == $catrow['categoryid']) ? " selected" : "";
echo "<option$selected value=".$catrow['categoryid'].">".
$catrow['catname']."</option>";
}
?>
</select>
<a href="#addproduct" data-toggle="modal" class="pull-right btn btn-
primary"><span class="glyphicon glyphicon-plus"></span> Product</a>
</div>
</div>
<div style="margin-top:10px;">
<table class="table table-striped table-bordered">
<thead>
<th>Photo</th>
<th>Product Name</th>
<th>Price</th>
<th>Action</th>
</thead>
<tbody>
<?php
$where = "";
if(isset($_GET['category']))
{
$catid=$_GET['category'];
$where = " WHERE product.categoryid = $catid";
}
$sql="select * from product left join category on
category.categoryid=product.categoryid $where order by product.categoryid asc, productname asc";
$query=$conn->query($sql);
while($row=$query->fetch_array()){
?>
<tr>
<td><a href="<?php if(empty($row['photo']))
{echo "upload/noimage.jpg";} else{echo $row['photo'];} ?>"><img src="<?php if(empty($row['photo']))
{echo "upload/noimage.jpg";} else{echo $row['photo'];} ?>" height="30px" width="40px"></a></td>
<td><?php echo $row['productname']; ?
></td>
<td>&#8369; <?php echo
number_format($row['price'], 2); ?></td>
<td>
<a href="#editproduct<?php echo
$row['productid']; ?>" data-toggle="modal" class="btn btn-success btn-sm"><span class="glyphicon
glyphicon-pencil"></span> Edit</a> || <a href="#deleteproduct<?php echo $row['productid']; ?>" data-
toggle="modal" class="btn btn-danger btn-sm"><span class="glyphicon glyphicon-trash"></span>
Delete</a>
<?php include('product_modal.php');
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
Food Ordering System

</div>
<?php include('modal.php'); ?>
<script type="text/javascript">
$(document).ready(function(){
$("#catList").on('change', function(){
if($(this).val() == 0)
{
window.location = 'product.php';
}
else
{
window.location = 'product.php?category='+$(this).val();
}
});
});
</script>
</body>
</html>

Purchase.php:

<?php
include('conn.php');
if(isset($_POST['productid'])){

$customer=$_POST['customer'];
$sql="insert into purchase (customer, date_purchase) values ('$customer', NOW())";
$conn->query($sql);
$pid=$conn->insert_id;

$total=0;

foreach($_POST['productid'] as $product):
$proinfo=explode("||",$product);
$productid=$proinfo[0];
$iterate=$proinfo[1];
$sql="select * from product where productid='$productid'";
$query=$conn->query($sql);
$row=$query->fetch_array();

if (isset($_POST['quantity_'.$iterate])){
$subt=$row['price']*$_POST['quantity_'.$iterate];
$total+=$subt;

$sql="insert into purchase_detail (purchaseid, productid, quantity) values


('$pid', '$productid', '".$_POST['quantity_'.$iterate]."')";
$conn->query($sql);
Food Ordering System

}
endforeach;

$sql="update purchase set total='$total' where purchaseid='$pid'";


$conn->query($sql);
header('location:sales.php');
}
else{
?>
<script>
window.alert('Please select a product');
window.location.href='order.php';
</script>
<?php
}

Sales.php:

<?php include('header.php'); ?>


<body>
<?php include('navbar.php'); ?>
<div class="container">
<h1 class="page-header text-center">SALES</h1>
<table class="table table-striped table-bordered">
<thead>
<th>Date</th>
<th>Customer</th>
<th>Total Sales</th>
<th>Details</th>
</thead>
<tbody>
<?php
$sql="select * from purchase order by purchaseid desc";
$query=$conn->query($sql);
while($row=$query->fetch_array()){
?>
<tr>
<td><?php echo date('M d, Y h:i A',
strtotime($row['date_purchase'])) ?></td>
<td><?php echo $row['customer']; ?></td>
<td class="text-right">&#8369; <?php echo
number_format($row['total'], 2); ?></td>
<td><a href="#details<?php echo
$row['purchaseid']; ?>" data-toggle="modal" class="btn btn-primary btn-sm"><span class="glyphicon
glyphicon-search"></span> View </a>
Food Ordering System

<?php include('sales_modal.php'); ?>


</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</body>
</html>

Вам также может понравиться