Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

INDEX

Sl No. Topic Page No:


1 Abstract 02
2 Introduction 02
3 Project Description 02
4 Project Profile 03
5 System Flow Diagram 03
6 Database Definition 04
7 Database Schema 04
8 Source Code 05
9 Screenshots 14
10 Future Enhancement 17
11 Conclusion 17
12 Bibliography 17

GROUP MEMBER LIST:

1. Urmimala Patra(16500216005)
2. Soham Surai(16500216013)

3. Rudradeep Kundu(16500216022)
4.Riya Saha(16500216023)
5. Rintesh Ghosh(16500216024)

1|Page
Abstract:
ONLINE FOOD ORDER 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 labor 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:
It is known globally that, in today’s market, it is extremely difficult to start a new small-scale business and
live-through the competition from the well-established and settled owners. In fast paced time of today,
when everyone is squeezed for time, the majority of people are finicky when it comes to placing a food
order. The customers of today are not only attracted because placing an order online is very convenient but
also because they have visibility into the items offered, price and extremely simplified navigation for the
order. It governs the B2B and B2C model.

Online ordering system that I am proposing here, greatly simplifies the ordering process for both the
customer and the restaurant. System presents an interactive and up-to-date menu with all available
options in an easy to use manner. Customer can choose one or more items to place an order. At the
end, customer gets order confirmation details. Once the order is placed it is entered in the database and
retrieved in pretty much real time. This allows Restaurant Employees to quickly go through the orders as they
are received and process all orders efficiently and effectively with minimal delays and confusion.

Project Description:

Project Title Online Food Ordering System

Project Guide Mr. Sudipto Basak

Front End HTML,CSS,javascript

Back End MySQL Database,PHP

Project Duration JULY-DECEMBER 2019

2|Page
Project Profile:
In order to design a web site, the relational database must be designed first. Conceptual design can be
designed i to two parts.
1) Data model
2) Process model
The data model focuses on what data should be stored in the database while the process model deals
with how the data is processed. To put this on the context of the relational database, the data model is
used to design the relational tables. The process model is used to design the queries that will access
and perform operations on those tables.

System Flow Diagram:

3|Page
Database Definition:
In this section, basic structure of the tables composing the database for the project is shown
along with information about primary and foreign key.

Database Schema:

Registration:

FOOD ORDER

4|Page
Restaurant

Source Code:

Home.php:
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="style1.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" charset="utf-
8"></script>
</head>
<body>
<div class="food"><h1><center>FOOD ODERING <br/>SYSTEM</center></h1></div>
<a href="login.php"><input type="submit" name="login" value="LOGIN"
class="logbtn_home" ></a>
<a href="signup.php"><input type="submit" name="signup" value="SIGNUP"
class="logbtn_home2" ></a>

</body>
</html>

5|Page
6|Page
Signup.php:

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

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="style1.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" charset="utf-
8"></script>
</head>
<body>
<form action="signup.php" class="signup-form" method="post">
<h1>Sign up</h1>
<?php include('errors.php');?>
<div class="tb">
<input type="text" name="name" placeholder="Full name">
</div>

<div class="tb">
<input type="text" name="username" placeholder="Username">
</div>
<div class="tb">
<input type="password" name="password" placeholder="Password">
</div>
<div class="tb">
<input type="text" name="mobno" placeholder="Mobile No">
</div>

<div class="tb">
<input type="email" name="email" placeholder="Email">
</div>
<input type="submit" name="submit" class="signupbtn" value="Sign up">
<div class="home_text">
<br/><a href="home.php"><h3>HOME</h3></a></div>
</form>
</body>
</html>

7|Page
Register.php:

<?php

$username="";
$email="";
$errors=array();

$db=mysqli_connect('localhost','root','','newfood');

if(isset($_POST['submit'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$email = $_POST['email'];
$name = $_POST['name'];
$mobno = $_POST['mobno'];
if(empty($username)){
array_push($errors, "Username is required");
}

if(empty($password)){
array_push($errors, "Password is required");
}

if(empty($name)){
array_push($errors, "Full name is required");
}

if(empty($email)){
array_push($errors, "Email is required");
}

if(empty($mobno)){
array_push($errors, "Mobile No. is required");
}

if(count($errors)==0){
$sql = "INSERT INTO registration(username,password,name,email,mobno)
VALUES
('$username','$password','$name','$email','$mobno') ";
mysqli_query($db, $sql);
header("location:login.php");
}

?>

8|Page
Login.php:

<?php

$username="";
$email="";
$errors=array();

$db=mysqli_connect('localhost','root','','newfood');

if(isset($_POST['submit'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$email = $_POST['email'];
$name = $_POST['name'];
$mobno = $_POST['mobno'];
if(empty($username)){
array_push($errors, "Username is required");
}
if(empty($password)){
array_push($errors, "Password is required");
}
if(empty($name)){
array_push($errors, "Full name is required");
}
if(empty($email)){
array_push($errors, "Email is required");
}

if(empty($mobno)){
array_push($errors, "Mobile No. is required");
}

if(count($errors)==0){
$sql = "INSERT INTO registration(username,password,name,email,mobno)
VALUES
('$username','$password','$name','$email','$mobno') ";
mysqli_query($db, $sql);

header("location:login.php");

?>

9|Page
Prcess.php:

<?php

$username="";
$password="";
$errors=array();
$db=mysqli_connect('localhost','root','','newfood');
session_start();

if(isset($_POST['login']))
{
if(empty($_POST['username']) || empty($_POST['password']))
{
array_push($errors, "Username/Password is required");
}
else
{
$username=$_POST['username'];
$password=$_POST['password'];
$query="SELECT * FROM registration WHERE username='$username' AND password =
'$password'";
$result=mysqli_query($db,$query);
$row= mysqli_fetch_array($result);
if($row>0){
$_SESSION['name']=$row['name'];
header("location:dashboard.php");

}
else
{
array_push($errors, "Invalid username/password");
}
}
}
?>

10 | P a g e
Dashboard.php:

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

<html lang="en" dir="ltr">


<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="style1.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" charset="utf-
8"></script>
</head>
<body>

<form action="dashboard.php" class="dashboard" method="post">


<h1>Dashboard</h1>

<center> <?php include('welcome.php');?></center>


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

<br/><br/><center><p><strong><h3>Select your preferred


location.</h3></strong></p><select name="loc"></center>
<option selected>Select location</option>
<?php
$db=mysqli_connect('localhost','root','','newfood');
$query4="SELECT location FROM restaurant group by location";
$result4=mysqli_query($db,$query4);
while($row4= mysqli_fetch_array($result4)){
$loc=$row4['location'];
echo "<option>$loc</option>";

}
?>
</select>

<br/><br/><br/><br/><center><p><strong><h3>Select your restaurant


to order.</h3></strong></p><select name="res"></center>

<option selected>Select restaurant</option>


<?php
$db=mysqli_connect('localhost','root','','newfood');
$query5="SELECT rname FROM restaurant";
$result5=mysqli_query($db,$query5);
while($row5= mysqli_fetch_array($result5)){

11 | P a g e
$r=$row5['rname'];
echo "<option>$r</option>";

}
?>
</select>
<span data-placeholder="Select Restaurant"></span>
</div>

<br/><br/> <br/><br/><input type="submit" name ="go" class="logbtn" value="Go">


</form>
</body>
</html>

Menu.php:
<?php
$res="";
$loc="";

$errors=array();
$db=mysqli_connect('localhost','root','','newfood');

if(isset($_POST['go']))
{
if($_POST['res']=="Select restaurant" || $_POST['loc']=="Select location")
{
array_push($errors, "Please select the loctaion and restaurant");
}
else
{
$res=$_POST['res'];
$loc=$_POST['loc'];
$query="SELECT * FROM restaurant WHERE rname='$res' AND location =
'$loc'";
$result=mysqli_query($db,$query);
$row= mysqli_fetch_array($result);
if($row>0){
session_start();
$_SESSION['rname']=$row['rname'];

$_SESSION['rid']=$row['rid'];
header("location:foodorder.php");

12 | P a g e
}
else array_push($errors, "Not available");
{

}
}
?>

FoodOrder.php:

<html lang="en" dir="ltr">


<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="style1.css">

</head>
<body>

<form action="" class="dashboard" method="post" name="f">


<h1>Order Your Food</h1>
<center><?php include('welcome.php');?></center>

<center><?php include('welcome1.php');?></center>

<?php
$db=mysqli_connect('localhost','root','','newfood');
$query1="SELECT * FROM food WHERE rid='$rid'";
$result1=mysqli_query($db,$query1);
while($row1= mysqli_fetch_array($result1)){
$food=$row1['fname'];
$price=$row1['price'];
echo "<br/>";
echo "<center><input type='checkbox' name='food' value='$price'>$food<br/></center>";
echo "<center><h4>Rs.$price</h4></center>";
echo "<center><input type='number' name='qty' placeholder='Enter Quantity' ></center>";
}
?>

13 | P a g e
<br/><input type="submit" name ="order" class="logbtn" value="Place your order"
onclick="myFunction()">

14 | P a g e
br/><center><?php echo ' <a href="dashboard.php?dashboard">Back to
Dashboard</a>';?></center>
</form>
<script type="text/javascript">
function Redirect() {
window.location="dashboard.php";
}
function myFunction(){
var food = document.f.food;
var texts = document.getElementsByName("qty");
var i;
var checkedValue=parseInt(0, 10);
for (i = 0; i < food.length; i++) { if
(food[i].checked) {
quantity=parseInt(texts[i].value,10);
cost=parseInt(food[i].value,10);
checkedValue=checkedValue+(cost*quantity);
}
}
if(checkedValue==0){
alert("Please select your order");}
else{
if (confirm("\nThank you for Your order"+"\nYour Total amount is=Rs. "+checkedValue+"\nYou can
logout now")) {
Redirect();
}
}
}
</script>
</body>
</html>

LogOut.php:

<?php session_start();
if(isset($_GET['logout']))
{
session_destroy();
header("location:home.php");
}

?>

15 | P a g e
Style1.css
*{
margin: 0;
padding: 0;
text-decoration: none;
font-family: montserrat;
box-sizing: border-box;
}

body{
min-height: 100vh;
background: url(bg2.jpg) no-repeat;
background-size: cover;
}

.login-form{
width: 400px;
background: rgb(0, 0, 0);
background: rgba(255, 255, 255, 0.5);
height: 580px;
padding: 80px 40px;
border-radius: 10px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
}

.login-form h1{
color: #FF0000;
text-align: center;
margin-bottom: 60px;
}

.tb{
border-bottom: 2px solid #adadad;
position: relative;
margin: 30px 0;
}

.tb input{
font-size: 15px;
color: #333;
border: none;
width: 100%;
outline: none;
background: none;
padding: 0 5px;
height: 40px;
}

.tb span::before{
content: attr(data-placeholder);
position: absolute;
top: 50%;
left: 5px;
color: #adadad;
16 | P a g e
transform: translateY(-50%);

z-index: -1;
transition: .5s;
}

.tb span::after{
content: '';
position: absolute;
width: 0%;
height: 2px;
transition: .5s;
}

.focus + span::before{
top: -5px;
}
.focus + span::after{
width: 100%;
}

.logbtn{
font-size: 15px;
display: block;
width: 100%;
height: 50px;
border: none;
background: linear-gradient(120deg,#e67e22,#e74c3c,#e67e22);
background-size: 200%;
color: #fff;
outline: none;
cursor: pointer;
transition: .5s;

.logbtn:hover{
background-position: right;
}

.bottom-text{
margin-top: 60px;
text-align: center;
font-size: 18px;
color: white;
color: #FF0000;
}
.home_text{
argin-top: 60px;
text-align: center;
font-size: 20px;
17 | P a g e
color: #FF0000;
}
.signup-form{
width: 400px;
background: rgb(0, 0, 0);
background: rgba(255, 255, 255, 0.5);
height: 620px;
padding: 80px 40px;

border-radius: 10px;
position: absolute;
left: 50%;

top: 50%;
transform: translate(-50%,-50%);
}
.signup-form h1{
color: #e67e22;
text-align: center;

}
.signupbtn{
font-size: 15px;
display: block;
width: 100%;
height: 50px;
border: none;
background: linear-gradient(120deg,#e67e22,#e74c3c,#e67e22);
background-size: 200%;
color: #fff;
outline: none;
cursor: pointer;
transition: .5s;
}

.error{
width: 90%;
margin: 0px auto;
padding: 6px;
border: 1px solid #a94442;
color: #a94442;
background: #f2dede;
border-radius: 5px;
text-align: left;
}

.dashboard{
width: 400px;
background: rgb(0, 0, 0);
18 | P a g e
background: rgba(255, 255, 255, 0.3);
height: 500px;
padding: 80px 40px;
border-radius: 10px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
}
.dashboard h1{
color: #FF0000;
text-align: center;
margin-bottom: 20px;
}

.logbtn_home{
display: inline-block;
position: absolute;
top: 60%;
left: 47%;
padding: 15px 25px;
font-size: 24px;
cursor: pointer;
text-align: center;
text-decoration: none;
outline: none;
color: #f1f1f1;

background-color: #FF0000;
border: none;
border-radius: 15px;
box-shadow: 0 9px #999;
}

.logbtn_home:hover {background-color: #3e8e41}

.logbtn_home:active {
background-color: #FF0000;
box-shadow: 0 5px #666;
transform: translateY(4px);}

.logbtn_home2{
display: inline-block;
position: absolute;
top: 70%;
left: 46.8%;
padding: 15px 25px;
font-size: 24px;
cursor: pointer;
text-align: center;
text-decoration: none;
19 | P a g e
outline: none;
color: #f1f1f1;
background-color: #FF0000;
border: none;
border-radius: 15px;
box-shadow: 0 9px #999;
}

.logbtn_home2:hover {background-color: #3e8e41}

.logbtn_home2:active {
background-color: #FF0000;
box-shadow: 0 5px #666;
transform: translateY(4px);
}
.food{
position: absolute;
top: 30.5%;
left: 25%;
font-size:50px;

color: #f1f1f1;

}
a:link {
color: red;
}

a:visited {
color: green;
}

a:hover {
color: hotpink;
}

a:active {
color: blue;
}

20 | P a g e
Screenshots:
Home Page:

Sign up:

21 | P a g e
Login Page:

Dashboard:

22 | P a g e
Food Order page:

23 | P a g e
Future Enhancement:_
Implementation of different payment gateways and wallets including international debit/credit
cards
Add more browser security features. Support for more browsers
Server will be more stable such that multiple transactions can be executed simultaneously
Conclusion:
Therefore, conclusion of the proposed system is based on user’s need and is user centered. The system
is developed in considering all issues related to all user which are included in this system. Wide range of
people can use this if they have a minimum knowledge of how to operate a computer. Various issues
related to Mess/Tiffin Service will be solved by providing them a full-fledged system. Thus,
implementation of Online Food Ordering system is done to help and solve one of the important
problems of people

Bibliography :
At the time of development of the project, some of the outside sources from where help was taken is
mentioned underneath.
Database Management System: 1)SQL
For Programming: 2)pHp
Websites: https://www.w3schools.com/php/ https://www.tutorialspoint.com/php/
Books: Web Technology and Design by C.Xavier

24 | P a g e
25 | P a g e

You might also like