Projects Report Harshit

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

ONLINE FOOD ODERING SYSTEM

A PROJECT REPORT

submitted to

Mrs. Preeti

by

Harshit Kumar

In partial fulfilment for award the degree of

MASTER OF COMPUTER APPLICATIONS

GANGA INSTITUTE OF TECHNOLOGY &


MANAGEMENT,

JHAJJAR, HARYANA,124104
JUNE 2022

1
GANGA INSTITUTE OF TECHNOLOGY & MANAGEMENT,
JHAJJAR, HARYANA

CERTIFICATE

This is to certify that Harshit Kumar 21MCA018 student of Ganga Institute of

Technology and Management, Kablana, Jhajjar, Haryana has successfully

undertaken internship at Ganga Institute of Technology and Management,

Kablana, Jhajjar, Haryana from 28/03/2022 to 23/06/2022.

The title of his project is “ONLINE FOOD ODERING SYSTEM”,

Under the guidance of Mrs. Preeti

We wish him/her an excellent and successful professional carrier ahead!

Project Guide
Mrs. Preeti
GITAM

2
GANGA INSTITUTE OF TECHNOLOGY &
MANAGEMENT

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Certificate of Completion

This is to certify that the project entitled “ONLINE FOOD ODERING SYSTEM”
carried out by Harshit Kumar, a student of MASTER OF COMPUTER
APPLICATION 2ND SEMESTER.

Ganga Institute of Technology and Management, Kablana, Jhajjar, is a


satisfactory account of the Bonafede work under my supervision, is recommended
towards the end of his/her 2nd semester of
MCA (MASTER OF COMPUTER APPLICATIONS).

Project In charge Harshit Kumar


Mrs. Preeti MCA (2nd SEM)
21MCA018

HOD (CSE)
Mr. Jetinder Singh

3
DECLARATION BY THE CANDIDATE

FOOD ODERING SYSTEM” is an authenticated work carried out by me at Ganga


Institute of Technology and Management for the partial fulfilment of the award
of the degree of MCA and this work has not been submitted for similar purpose
anywhere else.

July 2022 Harshit Kumar

Place: Ganga Institute of Technology and Management 21MCA018

MCA (2nd Sem)

I am Harshit Kumar here by declare that the project work entitled “ONLINE FOOD ORDERING
SYSTEM.

4
ACKNOWLEDGEMENT

Many individuals have contributed to this project report with their advice, interest,
time and support. They are the wind beneath my wings. I thank God for making
everything possible. I would specially like to thanks my worthy guide Mrs.Preeti.
Assistant Professor (CSE) Ganga Institute of Technology and Management who
supervised me to complete this project. Her technical advice, ideas and
constructive criticism contributed to the success of this report. She suggested
me many ideas and solved my puzzles when I was in need.
Her motivation and help have been of great inspiration to me.
I would also like to thanks my respected MR. Jatinder Singh (HOD, CSE) and
faculty members of CSE department for providing me the opportunities, support
and the necessary help to complete this project work.

The success and final outcome of this project required a lot of guidance and
assistance from many people and I am extremely fortunate to have got this all
along the completion of my project work. Whatever I have done is only due to
such guidance and assistance and I would not forget to thank them.

I respect and thank my teachers, for giving me an opportunity to do the project


work and providing all support and. I am extremely grateful to them for providing
such a nice support and guidance though having busy schedule.

I owe my profound gratitude to our project guide Mr., who took keen interest on
my project work and guided us all along, by providing all the necessary
information for developing a good website.

Harshit Kumar
21MCA018
MCA (2nd Sem)

5
CONTENTS

1. Introduction 5
1.1 Overview
1.2 Objectives
1.3 Tools

2. Requirement analysis 12
2.1 System environment
2.2 Preliminary investigation
2.3 Functional Requirement
2.4 System Requirement Specification
2.5 Design

3. Project overview 25
3.1System Designing
3.2 Code Designing
3.3 Input Designing

4. ER diagram 15
5. (DFD) Data flow diagram 14
6. Coding Segment 20
7. HTML 21
8. CSS 22
9. Page view 24
10.Testing 33
11.Coding 51
12.Conclusion 105

6
Introduction of the Project Online Food Ordering System:

The "Online Food Ordering System" has been developed to override the problems
prevailing in the practicing manual system. This software is supported to eliminate
and, in some cases, reduce the hardships faced by this existing system. Moreover,
this system is designed for the particular need of the company to carry out operations
in a smooth and effective manner.

The application is reduced as much as possible to avoid errors while entering the
data. It also provides error message while entering invalid data. No formal knowledge
is needed for the user to use this system. Thus, by this all it proves it is user-friendly.
Online Food Ordering System, as described above, can lead to error free, secure,
reliable and fast management system. It can assist the user to concentrate on their
other activities rather to concentrate on the record keeping. Thus, it will help
organization in better utilization of resources.

Every organization, whether big or small, has challenges to overcome and managing
the information of Category, Food Item, Order, Payment, Confirm Order. Every Online
Food Ordering System has different Food Item needs; therefore, we design exclusive
employee management systems that are adapted to your managerial requirements.
This is designed to assist in strategic planning and will help you ensure that your
organization is equipped with the right level of information and details for your future
goals. Also, for those busy executives who are always on the go, our systems come
with remote access features, which will allow you to manage your workforce anytime,
at all times. These systems will ultimately allow you to better manage resources.

Abstract of the Project Online Food Ordering System:

The purpose of Online Food Ordering System is to automate the existing


manual system by the help of computerized equipment’s and full-fledged computer
software, fulfilling their requirements, so that their valuable data/information can be
stored for a longer period with easy accessing and manipulation of the same. The
required software and hardware are easily available and easy to work with.

7
Online Food Ordering System, as described above, can lead to
error free, secure, reliable and fast management system. It can assist the
user to concentrate on their other activities rather to concentrate on the
record keeping. Thus, it will help organization in better utilization of
resources. The organization can maintain computerized records without
redundant entries. That means that one need not be distracted by
information that is not relevant, while being able to reach the information.

The aim is to automate its existing manual system by the help of computerized
equipment’s and full-fledged computer software, fulfilling their requirements, so that
their valuable data/information can be stored for a longer period with easy accessing
and manipulation of the same. Actually, this project describes how to manage for good
performance and better services for the clients.

Objective of Project on Online Food Ordering System:

The main objective of the Project on Online Food Ordering System is to


manage the details of Food Item, Category, Customer, Order, Confirm Order. It
manages all the information about Food Item, Payment, Confirm Order, Food Item.
The project is totally built at administrative end and thus only the administrator is
guaranteed the access. The purpose of the project is to build an application program
to reduce the manual work for managing the Food Item, Category, Payment,
Customer. It tracks all the details about the Customer, Order, Confirm Order.

Functionalities provided by Online Food Ordering System are as follows:

• Provides the searching facilities based on various factors. Such as Food


Item, Customer, Order, Confirm Order
• Online Food Ordering System also manage the Payment details online for
Order details, Confirm Order details, Food Item.
• It tracks all the information of Category, Payment, Order etc
• Manage the information of Category
• Shows the information and description of the Food Item, Customer
• To increase efficiency of managing the Food Item, Category

8
• It deals with monitoring the information and transactions of Order.
• Manage the information of Food Item
• Editing, adding and updating of Records is improved which results in proper
resource management of Food Item data.
• Manage the information of Order
• Integration of all records of Confirm Order.

Scope of the project Online Food Ordering System: -


It may help collecting perfect management in detail. In a very short time, the
collection will be obvious, simple and sensible. It will help a person to know the
management of passed year perfectly and vividly. It also helps in current all works
relative to Online Food Ordering System. It will be also reduced the cost of collecting
the management & collection procedure will go on smoothly.

Our project aims at Business process automation, i.e., we have


tried to computerize various processes of Online Food Ordering System.

• In computer system the person has to fill the various forms & number of
copies of the forms can be easily generated at a time.
• In computer system, it is not necessary to create the manifest but we can
directly print it, which saves our time.
• To assist the staff in capturing the effort spent on their respective working
areas.
• To utilize resources in an efficient manner by increasing their productivity
through automation.
• The system generates types of information that can be used for various
purposes.
• It satisfies the user requirement
• Be easy to understand by the user and operator
• Be easy to operate
• Have a good user interface
• Be expandable
• Delivered on schedule within the budget.

9
Reports of Online Food Ordering System:

• It generates the report on Food Item, Category, Payment


• Provide filter reports on Customer, Order, Confirm Order
• You can easily export PDF for the Food Item, Payment, Order
• Application also provides excel export for Category, Customer,
Confirm Order
• You can also export the report into csv format for Food Item, Category,
Confirm Order

Modules of Online Food Ordering System:

• Food Item Management Module: Used for managing the Food Item details.
• Confirm Order Module: Used for managing the details of Confirm Order
• Payment Module: Used for managing the details of Payment
• Category Management Module: Used for managing the information and
details of the Category.
• Customer Module: Used for managing the Customer details
• Order Module: Used for managing the Order information’s
• Login Module: Used for managing the login details
• Users Module: Used for managing the users of the system

Input Data and Validation of Project on Online Food Ordering System

• All the fields such as Food Item, Customer, Confirm Order are validated and
does not take invalid values
• Each form for Food Item, Category, Payment cannot accept blank value
fields
• Avoiding errors in data
• Controlling amount of input
• Integration of all the modules/forms in the system.
• Preparation of the test cases.

10
• Preparation of the possible test data with all the validation checks.
• Actual testing done manually.
• Recording of all the reproduced errors.
• Modifications done for the errors found during testing.
• Prepared the test result scripts after rectification of the errors.
• Functionality of the entire module/forms.
• Validations for user input.
• Checking of the Coding standards to be maintained during coding.
• Testing the module with all the possible test data.
• Testing of the functionality involving all type of calculations etc.
• Commenting standard in the source files.

The software quality plan we will use the following SQA Strategy:

• In the first step, we will select the test factors and rank them. The
selected test factors such as reliability, maintainability, portability
or etc., will be placed in the matrix according to their ranks.
• The second step is for identifying the phases of the development
process.
The phase should be recorded in the matrix.
• The third step is that identifying the business risks of the software
deliverables. The risks will be ranked into three ranks such as
high, medium and low.

11
Features of the project Online Food Ordering System:

• Product and Component based


• Creating & Changing Issues at ease
• Query Issue List to any depth
• Reporting & Charting in more comprehensive way
• User Accounts to control the access and maintain security
• Simple Status & Resolutions
• Multi-level Priorities & Severities.
• Targets & Milestones for guiding the programmers
• Attachments & Additional Comments for more information
• Robust database back-end
• Various level of reports available with a lot of filter criteria’s It contains
better storage capacity.
• Accuracy in work.
• Easy & fast retrieval of information.
• Well-designed reports.
• Decrease the load of the person involve in existing manual system.
• Access of any information individually.
• Work becomes very speedy.
• Easy to update information

Software Requirement Specification


The Software Requirements Specification is produced at the culmination of the
analysis task. The function and performance allocated to software as part of system
engineering are refined by establishing a complete information description, a detailed
functional and behavioural description, an indication of performance requirements
and design constraints, appropriate validation criteria, and other data pertinent to
requirements.

The proposed system has the following requirements:

• System needs store information about new entry of Food Item.

12
• System needs to help the internal staff to keep information of Category and
find them as per various queries.

• System needs to maintain quantity record.


• System needs to keep the record of Customer.
• System needs to update and delete the record.
• System also needs a search area.
• It also needs a security system to prevent data.

Identification of need:

The old manual system was suffering from a series of drawbacks. Since whole
of the system was to be maintained with hands the process of keeping, maintaining
and retrieving the information was very tedious and lengthy. The records were never
used to be in a systematic order. there used to be lots of difficulties in associating any
particular transaction with a particular context. If any information was to be found it
was required to go through the different registers, documents there would never exist
anything like report generation. There would always be unnecessary consumption of
time while entering records and retrieving records. One more problem was that it was
very difficult to find errors while entering the records. Once the records were entered
it was very difficult to update these records.

The reason behind it is that there is lot of information to be maintained and


have to be kept in mind while running the business. For this reason, we have provided
features Present system is partially automated (computerized), actually existing
system is quite laborious as one has to enter same information at three different
places.

Following points should be well considered:

• Documents and reports that must be provided by the new system: there can
also be few reports, which can help management in decision-making and cost
controlling, but since these reports do not get required attention, such kind of
reports and information were also identified and given required attention.
• Details of the information needed for each document and report.
• The required frequency and distribution for each document.

13
• Probable sources of information for each document and report.
• With the implementation of computerized system, the task of keeping records
in an organized manner will be solved. The greatest of all is the retrieval of
information, which will be at the click of the mouse. So the proposed system
helps in saving the time in different operations and making information flow
easy giving valuable reports.

Feasibility Study:
After doing the project Online Food Ordering System, study and analysing all
the existing or required functionalities of the system, the next task is to do the
feasibility study for the project. All projects are feasible - given unlimited resources
and infinite time.
Feasibility study includes consideration of all the possible ways to provide a solution
to the given problem. The proposed solution should satisfy all the user requirements
and should be flexible enough so that future changes can be easily done based on
the future upcoming requirements.

A. Economic Feasibility
This is a very important aspect to be considered while developing a project.
We decided the technology based on minimum possible cost factor.
• All hardware and software cost has to be borne by the organization.
• Overall, we have estimated that the benefits the organization is going to receive
from the proposed system will surely overcome the initial costs and the later on
running cost for system.

B. Technical Feasibility
This included the studied of function, performance and constraints that
may affect the ability to achieve an acceptable system. For the feasibility study,
we studied complete functionality to be provided in the system, as described in
the System Requirement Specification (SRS), and checked if everything was
possible using different type of frontend and backend.

C. Operational Feasibility

14
No doubt the proposed system is fully GUI based that is very user friendly and
all inputs to be taken all self-explanatory even to a layman. Besides, a proper training
has been conducted to let know the essence of the system to the users so that they
feel comfortable with new system. As far our study is concerned the clients are
comfortable and happy as the system has cut down their loads and doing.

System Design of Online Food Ordering System

In this phase, a logical system is built which fulfils the given requirements. Design
phase of software development deals with transforming the client’s requirements into
a logically working system. Normally, design is performed in the following in the
following two steps:

1. Primary Design Phase:


In this phase, the system is designed at block level. The blocks are created on
the basis of analysis done in the problem identification phase. Different blocks
are created for different functions emphasis is put on minimizing the information
flow between blocks. Thus, all activities which require more interaction are kept
in one block.
2. Secondary Design Phase:
In the secondary phase the detailed design of every block is performed.

The general tasks involved in the design process are the following:

1. Design various blocks for overall system processes.


2. Design smaller, compact and workable modules in each block.
3. Design various database structures.
4. Specify details of programs to achieve desired functionality.
5. Design the form of inputs, and outputs of the system.
6. Perform documentation of the design.
7. System reviews.

User Interface Design


User Interface Design is concerned with the dialogue between a user and the

computer. It is concerned with everything from starting the system or logging into the

15
system to the eventually presentation of desired inputs and outputs. The overall flow

of screens and messages is called a dialogue

The following steps are various guidelines for User Interface Design:

1. The system user should always be aware of what to do next.

2. The screen should be formatted so that various types of information,

instructions and messages always appear in the same general display area.

3. Message, instructions or information should be displayed long enough to allow

the system user to read them.

4. Use display attributes sparingly.

5. Default values for fields and answers to be entered by the user should be

specified.

6. A user should not be allowed to proceed without correcting an error.

7. The system user should never get an operating system message or fatal

error.

Preliminary Product Description:

The first step in the system development life cycle is the preliminary
investigation to determine the feasibility of the system. The purpose of the preliminary
investigation is to evaluate project requests. It is not a design study nor does it include
the collection of details to describe the business system in all respect. Rather, it is the
collecting of information that helps committee members to evaluate the merits of the
project request and make an informed judgment about the feasibility of the proposed
project.

Analysts working on the preliminary investigation should


accomplish the following objectives:

16
• Clarify and understand the project request Determine the size of
the project.
• Assess costs and benefits of alternative approaches.
• Determine the technical and operational feasibility of alternative
approaches.
• Report the findings to management, with recommendations
outlining the acceptance or rejection of the proposal.

• Benefit to Organization

The organization will obviously be able to gain benefits such as savings in


operating cost, reduction in paperwork, better utilization of human resources and more
presentable image increasing goodwill.

• The Initial Cost

The initial cost of setting up the system will include the cost of hardware
software (OS, add-on software, utilities) & labor (setup & maintenance). The same
has to bear by the organization.

• Running Cost
Besides, the initial cost the long-term cost will include the running cost for the
system including the AMC, stationary charges, cost for human resources, cost for
update/renewal of various related software.

• Need for Training

The users along with the administrator need to be trained at the time of
implementation of the system for smooth running of the system. The client will provide
the training site.

We talked to the management people who were managing the financial issues
of the center, the staff who were keeping the records in lots of registers and the
reporting manager regarding their existing system, their requirements and their
expectations from the new proposed system. Then, we did the system study of the

17
entire system based on their requirements and the additional features they wanted to
incorporate in this system.

Reliable, accurate and secure data was also considered to be a complex task
without this proposed system. Because there was no such record for keeping track of
all the activities, which was done by the Online Food Ordering System on the daily
basis.

The new system proposed and then developed by me will ease the task of the
organization in consideration. It will be helpful in generating the required reports by
the staff, which will help them to track their progress and services.

Thus, it will ease the task of Management to a great extent as all the major
activities to be performed, are computerized through this system.

Project Category

Relational Database Management System (RDBMS): This is an RDBMS based


project which is currently using MySQL for all the transaction statements. MySQL is
an opensource RDBMS System.

Brief Introduction about RDBSM:

A relational database management system (RDBMS) is a database management


system (DBMS) that is based on the relational model as invented by E. F. Codd, of
IBM's San Jose Research Laboratory. Many popular databases currently in use are
based on the relational database model.

RDBMSs have become a predominant choice for the storage of information in new
databases used for financial records, manufacturing and logistical information,
personnel data, and much more since the 1980s. Relational databases have often
replaced legacy hierarchical databases and network databases because they are
easier to understand and use. However, relational databases have been challenged
by object databases, which were introduced in an attempt to address the object
relational impedance mismatch in relational database, and XML databases.

18
Implementation Methodology:
Model View Controller or MVC as it is popularly called, is a software
design pattern for developing web applications. A Model View Controller
pattern is made up of the following three parts:

• Model - The lowest level of the pattern which is responsible for maintaining
data.
• View - This is responsible for displaying all or a portion of the data to the user.
• Controller - Software Code that controls the interactions between the Model
and View.

MVC is popular as it isolates the application logic from the user interface layer and
supports separation of concerns. Here the Controller receives all requests for the
application and then works with the Model to prepare any data needed by the View.
The View then uses the data prepared by the Controller to generate a final
presentable response. The MVC abstraction can be graphically represented as
follows.
MVC (Model View Controller Flow) Diagram

DATA FLOW DIAGRAMS

19
Project Planning:

Software project plan can be viewed as the following:

1) Within the organization: How the project is to be implemented? What are


various constraints (time, cost, staff)? What is market strategy?

2) With respect to the customer: Weekly or timely meetings with the customer
with presentation on status reports. Customers feedback is also taken and
further modification and developments are done. Project milestones and
deliverables are also presented to the customer.

For a successful software project, the following steps can be followed:

• Select a project o Identifying project’s aims and

objectives o Understanding requirements and

specification o Methods of analysis, design and

20
implementation o Testing techniques o

Documentation

• Project milestones and deliverables

• Budget allocation o Exceeding limits within

control

• Project Estimates

o Cost o

Time

o Size of

code

o Duration

• Resource Allocation o Hardware o Software

o Previous relevant project information o

Digital Library

• Risk Management o Risk avoidance o Risk

detection

• Coding Segment

21
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>

<body>
The content of the document......
</body>

</html>

Basic Tags in HTML.

• <html> … </html> — The root element. ...


• <head> … </head> — The document head. ...
• <title> … </title> — The page title. ...
• <body> … </body> — The page's content. ...
• <h1> … </h1> — A section heading. ...
• <p> … </p> — A paragraph. ...
• <a> … </a> — A link. ...
• <img> — An image.
<h2> </h2> This is second biggest heading Heading 2

<h3> </h3> This is the next heading Heading 3

<h4> </h4> This is another heading Heading 4

<h5> </h5> This is the second smallest heading Heading 5

<h6> </h6> This is the smallest heading Heading 6

<b> </b> This makes text bold Bold text

22
HTML

HTML or Hyper Text Markup Language is the standard markup language used to create
web pages.

HTML was created in 1991 by Tim Berners-Lee at CERN in Switzerland. It was designed to
allow scientists to display and share their research.

HTML is written in the form of HTML elements consisting of tags enclosed in angle brackets
(like <html>). HTML tags most commonly come in pairs like <h1> and </h1>, although some
tags represent empty elements and so are unpaired, for example <img>. The first tag in a pair
is the start tag, and the second tag is the end tag (they are also called opening tags and closing
tags).

The purpose of a web browser is to read HTML documents and compose them into visible or
audible web pages. The browser does not display the HTML tags, but uses the tags to interpret
the content of the page. HTML describes the structure of a website semantically along with
cues for presentation, making it a markup language rather than a programming language.

HTML elements form the building blocks of all websites. HTML allows images and objects to
be embedded and can be used to create interactive forms. It provides a means to create
structured documents by denoting structural semantics for text such as headings, paragraphs,
lists, links, quotes and other items. It can embed scripts written in languages such as Java Script
which affect the behavior of HTML web pages.

HTML is descriptive markup language. Library of various markup languages is defined in


various browsers.

HTML 5

HTML5 will be the new standard for HTML. The previous version of HTML, HTML 4.01,
came in 1999. The web has changed a lot since then. HTML5 is still a work in progress.
However, the major browsers support many of the new HTML5 elements and APIs.
HTML5 is cooperation between the World Wide Web Consortium (W3C) and the Web
Hypertext Application Technology Working Group (WHATWG).

23
WHATWG was working with web forms and applications, and W3C was working with
XHTML 2.0. In 2006, they decided to cooperate and create a new version of HTML.
Some rules for HTML5 were established:
a) New features should be based on HTML, CSS, DOM, and JavaScript
b) Reduce the need for external plug-ins (like Flash)
c) Better error handling
d) More markup to replace scripting
e) HTML5 should be device independent
f) The development process should be visible to the public

Cascading Style Sheets (CSS) is a style sheet language used for describing the look and
formatting of a document written in a markup language. While most often used to style web
pages and user interfaces written in HTML and XHTML, the language can be applied to any
kind of XML document, including plain XML, SVG and XUL. CSS is a cornerstone
specification of the web and almost all web pages use CSS style sheets to describe their
presentation.

CSS can also allow the same markup page to be presented in different styles for different
rendering methods, such as on-screen, in print, by voice (when read out by a speech-based
browser or screen reader) and on Braille-based, tactile devices. It can also be used to allow the
web page to display differently depending on the screen size or device on which it is being
viewed. While the author of a document typically links that document to a CSS file, readers
can use a different style sheet, perhaps one on their own computer, to override the one the
author has specified.

Cost estimation of the project:

Software cost comprises a small percentage of overall computer-based system cost.


There are a number of factors, which are considered, that can affect the ultimate cost
of the software such as - human, technical, Hardware and Software availability etc.

24
The main point that was considered during the cost estimation of project was its
sizing. In spite of complete software sizing, function point and approximate lines of
code were also used to "size" each element of the Software and their costing.

The cost estimation done by me for Project also depend upon the baseline metrics
collected from past projects and these were used in conjunction with estimation
variables to develop cost and effort projections.

We have basically estimated this project mainly on two bases -

1) Effort Estimation - This refers to the total man-hours required for the
development of the project. It even includes the time required for doing documentation
and user manual.

2) Hardware Required Estimation - This includes the cost of the PCs and the
hardware cost required for development of this project.

Tools/Platform, Hardware and Software Requirement specifications:

Software Requirements:

Name of component Specification


Operating System Windows 98, Windows XP, Windows7,
Linux
Language HTML, CSS
Database SQL lite Server
Browser Any of Mozilla, Opera, Chrome etc.
Framework .NET DATABASE
Web Technologies Html, CSS, JavaScript

Hardware Requirements:
Name of component Specification
Processor Intel i3 (10th Generation)

25
RAM 8 GB
Hard disk 512 GB (SSD)
Monitor 14” colour monitor
Keyboard 122 keys

Project Profile

There has been continuous effort to develop tools, which can ease the process
of software development. But, with the evolving trend of different programming
paradigms today’s software developers are really challenged to deal with the
changing technology. Among other issues, software re-engineering is being regarded
as an important process in the software development industry. One of the major tasks
here is to understand software systems that are already developed and to transform
them to a different software environment. Generally, this requires a lot of manual effort
in going through a program that might have been developed by another programmer.
This project makes a novel attempt to address the issue of program analysis and
generation of diagrams, which can depict the structure of a program in a better way.
Today, UML is being considered as an industrial standard for software engineering
design process. It essential provides several diagramming tools that can express
different aspects/ characteristics of program such as

Use cases: Elicit requirement from users in meaningful chunks. Construction planning
is built around delivering some use cases in each interaction basis for system testing.

Class diagrams: shows static structure of concepts, types and class. Concepts how
users think about the world; type shows interfaces of software components; classes
show implementation of software components.

Interaction diagrams: shows how several objects collaborate in single use case.

Package diagram: show group of classes and dependencies among them.

State diagram: show how single object behaves across many use cases.

Activity diagram: shows behaviour with control structure. Can show many objects
over many uses, many object in single use case, or implementations methods
encourage parallel behaviour, etc.

26
The end-product of this project is a comprehensive tool that can parse any
vb.net program and extract most of the object-oriented features inherent in the
program such as polymorphism, inheritance, encapsulation and abstraction.

What is UML?

UML stands for Unified Modelling Language is the successor to the wave of
Object Oriented Analysis and Design (OOA&D) methods that appeared in the late
80’s. It most directly unifies the methods of Booch, Rumbaugh (OMT) and Jacobson.
The UML is called a modelling language, not a method. Most methods consist at
least in principle, of both a modelling language and a process. The Modelling
language is that notation that methods used to express design.

Notations and meta-models:

The notation is the graphical stuff; it is the syntax of the modelling language. For
instance, class diagram notation defines how items are concepts such as class,
association, and multiplicity is represented. These are:

Class Diagram: The class diagram technique has become truly central within object-
oriented methods. Virtually every method has included some variation on this
technique. Class diagram is also subject to the greatest range of modelling concept.
Although the basic elements are needed by everyone, advanced concepts are used
less often. A class diagram describes the types of objects in the system and the
various kinds of static relationship that exist among them. There are two principal
kinds of static relationship:

• Association
• Subtype
Class diagram also show the attributes and operations of a class and the constraints
that apply to the way objects are connected.

Association: Association represent between instances of class. From the conceptual


perspective, association represents conceptual relations between classes. Each
association has two roles. Each role is a direction on the association. A role also has
multiplicity, which is a indication of how many object may participate in the given
relationship.

27
Generalization: A typical example of generalization evolves the personal and
corporate customer of a business. They have differences but also many similarity.
The similarities can be placed in generalization with personal customer and corporate
customer sub type.

Aggregation: aggregation is the part of relationship. It is like saying a car has engine
and wheels as its parts. This sounds good, but difficult thing is considering, what is
the difference is aggregation and association.

Interaction: interaction diagrams are models that describes how groups of objects
collaboration in some behaviour.

Typically, an interaction diagram captures the behaviour a single use cases.


The diagram shows a number of example objects and the messages that are passed
between these objects in use cases. These are following approaches with simple use
case that exhibits the following behaviour.

Objects can send a message to another. Each message is checks with given
stock item. There are two diagrams: Sequence and Collaboration diagram.

Package Diagram: One of the oldest questions in software methods is: how do you
break down a large system into smaller systems? It becomes difficult to understand
and the changes we make to them.

Structured methods used functional decomposition in which the overall system


was mapped as a function broken down into sub function, which is further broken
down into sub function and so forth. The separation of process data is gone, functional
decomposition is gone, but the old question is still remains. One idea is to group the
classes together into higher-level unit. This idea, applied very loosely, appears in
many objects. In UML, this grouping mechanism is package. The term package
diagram for a diagram that shows packages of classes and the dependencies among
them.

28
A dependency exists between two elements if changes to the
definition of one element may cause to other. With classes, dependencies
exist for various reasons: one class sends a message to another; one
class has another as part of its data; one class mentions another as a
parameter to an operation. A dependency between two packages exists;
and any dependencies exist between any two classes in the package.

State diagram: State diagram are a familiar technique to describe the

behaviour of a system. They describe all the possible states a particular


object can get into and how the objects state changes as a result of
events that reach the objects. In most OO technique, state diagrams are
drawn for a single class to show the lifetime behaviour of a single object.
There are many forms of state diagram, each with slightly different
semantics. The most popular one used in OO technique is based on
David Harrel’s state chart.

29
A basic diagram of the Online Food Ordering System.

30
PERT CHART (Program Evaluation Review Technique)

PERT chart is organized for events, activities or tasks. It is a scheduling device that
shows graphically the order of the tasks to be performed. It enables the calculation of
the critical path. The time and cost associated along a path is calculated and the path
requires the greatest amount of elapsed time in critical path.

Design Database Part Code database Part

Integrate and Test

Design GUI part Code GUI Part

Implementation

Write User Manual

Specification

PERT Chart representation


GANTT CHART

It is also known as Bar chart is used exclusively for scheduling purpose. It is a project
controlling technique. It is used for scheduling. Budgeting and resourcing planning. A
Gantt is a bar chart with each bar representing activity. The bars are drawn against a
time line. The length of time planned for the activity. The Gantt chart in the figure
shows the Gray parts is slack time that is the latest by which a task has been finished.

31
GANTT CHART REPRESENTATION

Use Case Model of the Project:

The use case model for any system consists of “use cases”. Use cases
represent different ways in which the system can be used by the user. A simple way
to find all the use case of a system is to ask the questions “What the user can do using
the system?” The use cases partition the system behaviour into transactions such that
each transaction performs some useful action from the users’ point of view.

The purpose of the use case to define a piece of coherent behaviour without
revelling the internal structure of the system. A use case typically represents a
sequence of interaction between the user and the system. These interactions consist
of one main line sequence is represent the normal interaction between the user and

32
the system. The use case model is an important analysis and design artifact (task).
Use cases can be represented by drawing a use case diagram and writing an
accompany text elaborating the drawing.

In the use case diagram, each use case is represented by an ellipse with the
name of use case written inside the ellipse. All the ellipses of the system are enclosed
with in a rectangle which represents the system boundary. The name of the system
being module appears inside the rectangle. The different users of the system are
represented by using stick person icon. The stick person icon is normally referred to
as an Actor. The line connecting the actor and the use cases is called the
communication relationship. When a stick person icon represents an external system,
it is annotated by the stereo type<<external system>>.

Dataflow Diagram:

Data flow diagram is the starting point of the design phase that functionally
decomposes the requirements specification. A DFD consists of a series of bubbles
joined by lines. The bubbles represent data transformation and the lines represent
data flows in the system. A DFD describes what data flow rather than how they are
processed, so it does not hardware, software and data structure.

A data-flow diagram (DFD) is a graphical representation of the "flow" of


data through an information system. DFDs can also be used for the visualization of
data processing (structured design). A data flow diagram (DFD) is a significant
modelling technique for analysing and constructing information processes. DFD
literally means an illustration that explains the course or movement of information
in a process. DFD illustrates this flow of information in a process based on the inputs
and outputs. A DFD can be referred to as a Process Model.

The data flow diagram is a graphical description of a system’s data and how to

Process transforms the data is known as Data Flow Diagram (DFD).

Unlike details flow chart, DFDs don’t supply detail descriptions of modules that
graphically describe a system’s data and how the data interact with the system. Data
flow diagram number of symbols and the following symbols are of by DeMarco.

33
process

Data store

Source/sink

Data Flow
D eM a
rco&Yourdons
ym bols
Gane&Sarsonsymbo
ls

There are seven rules for construct a data flow diagram.

i) Arrows should not cross each other.


ii) Squares, circles and files must wears names. iii) Decomposed data
flows must be balanced. iv) No two data flows, squares or circles
can be the same names. v) Draw all data flows around the outside
of the diagram.
vi) Choose meaningful names for data flows, processes & data stores.
vii) Control information such as record units, password and validation requirements
are not penitent to a data flow diagram.

Additionally, a DFD can be utilized to visualize data processing or a structured design.

This basic DFD can be then disintegrated to a lower-level diagram demonstrating


smaller steps exhibiting details of the system that is being modelled.

On a DFD, data items flow from an external data source or an internal data store to
an internal data store or an external data sink, via an internal process. It is common
practice to draw a context-level data flow diagram first, which shows the interaction
between the system and external agents, which act as data sources and data sinks.
On the context diagram (also known as the Level 0 DFD’), the system's interactions
with the outside world are modelled purely in terms of data flows across the system
boundary. The context diagram shows the entire system as a single process, and
gives no clues as to its internal organization.

34
This context-level DFD is next "exploded", to produce a Level 1 DFD that shows
some of the detail of the system being mode led. The Level 1 DFD shows how the
system is divided into sub-systems (processes), each of which deals with one or
more of the data flows to or from an external agent, and which together provide all
of the functionality of the system as a whole. The level 1 DFD is further spreader
and split into more descriptive and detailed description about the project as level 2
(DFD). The level 2 DFD can be a number of data flows which will finally show the
entire description of the software project.

About ER Diagram:

Entity Relationship Diagram

E-R Model is a popular high level conceptual data model. This model and its
variations are frequently used for the conceptual design of database application and
many database design tools employ its concept.

A database that confirms to an E-R diagram can be represented by a collection of


tables in the relational system. The mapping of E-R diagram to the entities are:

• Attributes

• Relations o Many-to-many o Many-to-one o One-to-many o One-to-

one

• Weak entities

• Sub-type and super-type

The entities and their relationships between them are shown using the following
conventions.

• An entity is shown in rectangle.


• A diamond represents the relationship

• among number of entities.

35
• The attributes shown as ovals are connected to the entities or
relationship by lines.

• Diamond, oval and relationships are labelled.

• Model is an abstraction process that hides super details while


highlighting details relation to application at end.
• A data model is a mechanism that provides this abstraction for database
application.
• Data modelling is used for representing entities and their relationship in
the database.
• Entities are the basic units used in modelling database entities can have
concrete existence or constitute ideas or concepts.
• Entity type or entity set is a group of similar objects concern to an
organization for which it maintains data,
• Properties are characteristics of an entity also called as attributes.
• A key is a single attribute or combination of 2 or more attributes of an
entity set is used to identify one or more instances of the set.
• In relational model we represent the entity by a relation and use tuples
to represent an instance of the entity.
• Relationship is used in data modelling to represent in association
between an entity set.
• An association between two attributes indicates that the values of the
associated attributes are independent.
Security Testing of the Project

Testing is vital for the success of any software. no system design is ever perfect. Testing is
also carried in two phases. first phase is during the software engineering that is during the
module creation. second phase is after the completion of software. this is system testing which
verifies that the whole set of programs hanged together.

White Box Testing:

In this technique, the close examination of the logical parts through the software are tested by
cases that exercise species sets of conditions or loops. all logical parts of the software checked

36
once. errors that can be corrected using this technique are typographical errors, logical
expressions which should be executed once may be getting executed more than once and
error resulting by using wrong controls and loops. When the box testing tests all the
independent part within a module a logical decision on their true and the false side are
exercised, all loops and bounds within their operational bounds were exercised and internal
data structure to ensure their validity were exercised once.

Black Box Testing:

This method enables the software engineer to device sets of input techniques that fully
exercise all functional requirements for a program. black box testing tests the input, the output
and the external data. it checks whether the input data is correct and whether we are getting
the desired output.

Alpha Testing:

Acceptance testing is also sometimes called alpha testing. Be spoke systems are developed
for a single customer. The alpha testing proceeds until the system developer and the customer
agree that the provided system is an acceptable implementation of the system requirements.

Beta Testing:

On the other hand, when a system is to be marked as a software product, another process
called beta testing is often conducted. During beta testing, a system is delivered among a
number of potential users who agree to use it. The customers then report problems to the
developers. This provides the product for real use and detects errors which may not have been
anticipated by the system developers.

Unit Testing:

Each module is considered independently. it focuses on each unit of software as


implemented in the source code. it is white box testing.

Integration Testing:

Integration testing aims at constructing the program structure while at the same constructing
tests to uncover errors associated with interfacing the modules. modules are integrated by
using the top-down approach.

37
Validation Testing:

Validation testing was performed to ensure that all the functional and performance
requirements are met.

System Testing:

It is executing programs to check logical changes made in it with intention of finding errors. a
system is tested for online response, volume of transaction, recovery from failure etc.
System testing is done to ensure that the system satisfies all the user requirements.

Implementation and Software Specification Testings

Detailed Design of Implementation

This phase of the systems development life cycle refines hardware and software
specifications, establishes programming plans, trains users and implements extensive testing
procedures, to evaluate design and operating specifications and/or provide the basis for
further modification.

Technical Design

This activity builds upon specifications produced during new system design, adding detailed
technical specifications and documentation.

Test Specifications and Planning

This activity prepares detailed test specifications for individual modules and programs, job
streams, subsystems, and for the system as a whole.

Programming and Testing

This activity encompasses actual development, writing, and testing of program units or
modules.

User Training

This activity encompasses writing user procedure manuals, preparation of user training
materials, conducting training programs, and testing procedures.

38
Acceptance Test

A final procedural review to demonstrate a system and secure user approval before a
system becomes operational.

Installation Phase

In this phase the new Computerized system is installed, the conversion to new procedures is
fully implemented, and the potential of the new system is explored.

System Installation

The process of starting the actual use of a system and training user personnel in its
operation.

Review Phase

This phase evaluates the successes and failures during a systems development project, and
to measure the results of a new Computerized Tran system in terms of benefits and savings
projected at the start of the project.

Development Recap

A review of a project immediately after completion to find successes and potential problems
in future work.

Post-Implementation Review

A review, conducted after a new system has been in operation for some time, to evaluate
actual system performance against original expectations and projections for cost-benefit
improvements. Also identifies maintenance projects to enhance or improve the system.

THE STEPS IN THE SOFTWARE TESTING

The steps involved during Unit testing are as follows:

a. Preparation of the test cases.


b. Preparation of the possible test data with all the validation checks.

39
c. Complete code review of the module.
d. Actual testing done manually.
e. Modifications done for the errors found during testing.
f. Prepared the test result scripts.

The unit testing done included the testing of the following items:

1. Functionality of the entire module/forms.


2. Validations for user input.
3. Checking of the Coding standards to be maintained during coding.
4. Testing the module with all the possible test data.
5. Testing of the functionality involving all type of calculations etc.

6. Commenting standard in the source files.

After completing the Unit testing of all the modules, the whole system is integrated with all its
dependencies in that module. While System Integration, We integrated the modules one by
one and tested the system at each step. This helped in reduction of errors at the time of the
system testing.

The steps involved during System testing are as follows:

• Integration of all the modules/forms in the system.


• Preparation of the test cases.
• Preparation of the possible test data with all the validation checks.
• Actual testing done manually.
• Recording of all the reproduced errors.
• Modifications done for the errors found during testing.
• Prepared the test result scripts after rectification of the errors.

The System Testing done included the testing of the following items:

1. Functionality of the entire system as a whole.


2. User Interface of the system.
3. Testing the dependent modules together with all the possible test data scripts.
4. Verification and Validation testing.
5. Testing the reports with all its functionality.

40
After the completion of system testing, the next following phase was the Acceptance
Testing. Clients at their end did this and accepted the system with appreciation. Thus,
we reached the final phase of the project delivery.

There are other six tests, which fall under special category. They are described below:

• Peak Load Test: It determines whether the system will handle the
volume of activities that occur when the system is at the peak of its
processing demand. For example, test the system by activating all
terminals at the same time.
• Storage Testing: It determines the capacity of the system to store
transaction data on a disk or in other files.
• Performance Time Testing: it determines the length of time system
used by the system to process transaction data. This test is conducted
prior to implementation to determine how long it takes to get a response
to an inquiry, make a backup copy of a file, or send a transmission and
get a response.
• Recovery Testing: This testing determines the ability of user to recover
data or restart system after failure. For example, load backup copy of
data and resume processing without data or integrity loss.
• Procedure Testing: It determines the clarity of documentation on
operation and uses of system by having users do exactly what manuals
request. For example, powering down system at the end of week or
responding to paper-out light on printer.
• Human Factors Testing: It determines how users will use the system
when processing data or preparing reports.

41
System Analysis:

System analysis is a process of gathering and interpreting facts, diagnosing


problems and the information about the Online Food Ordering System to recommend
improvements on the system. It is a problem solving activity that requires intensive
communication between the system users and system developers. System analysis
or study is an important phase of any system development process. The system is
studied to the minutest detail and analyzed. The system analyst plays the role of the
interrogator and dwells deep into the working of the present system. The system is
viewed as a whole and the input to the system are identified. The outputs from the
organizations are traced to the various processes. System analysis is concerned with
becoming aware of the problem, identifying the relevant and decisional variables,
analyzing and synthesizing the various factors and determining an optimal or at least
a satisfactory solution or program of action. A detailed study of the process must be
made by various techniques like interviews, questionnaires etc. The data collected by
these sources must be scrutinized to arrive to a conclusion. The conclusion is an
understanding of how the system functions. This system is called the existing system.
Now the existing system is subjected to close study and problem areas are identified.
The designer now functions as a problem solver and tries to sort out the difficulties
that the enterprise faces. The solutions are given as proposals. The proposal is then
weighed with the existing system analytically and the best one is selected. The
proposal is presented to the user for an endorsement by the user. The proposal is
reviewed on user request and suitable changes are made. This is loop that ends as
soon as the user is satisfied with proposal. Preliminary study is the process of
gathering and interpreting facts, using the information for further studies on the
system. Preliminary study is problem solving activity that requires intensive
communication between the system users and system developers. It does various
feasibility studies. In these studies a rough figure of the system activities can be
obtained, from which the decision about the strategies to be followed for effective
system study and analysis can be taken.

Existing System of Online Food Ordering System:


In the existing system the exams are done only manually but in proposed system
we have to computerize the exams using this application.

42
• Lack of security of data.
• More man power.
• Time consuming.
• Consumes large volume of pare work.
• Needs manual calculations.
• No direct role for the higher officials

Proposed System of Online Food Ordering System:


The aim of proposed system is to develop a system of improved facilities. The
proposed system can overcome all the limitations of the existing system. The system
provides proper security and reduces the manual work.
• Security of data.
• Ensure data accuracies.
• Proper control of the higher officials.
• Minimize manual data entry.
• Minimum time needed for the various processing.
• Greater efficiency.
• Better service.
• User friendliness and interactive.
• Minimum time required.

Data Dictionary:

This is normally represented as the data about data. It is also termed as metadata
some times which gives the data about the data stored in the database. It defines each
data term encountered during the analysis and design of a new system.
Data elements can describe files or the processes.

Following are some major symbols used in the data dictionary

• = equivalent to
• + and
• [] either/ or
• () Optional entry

43
Following are some rules, which defines the construction of data
dictionary entries:

1. Words should be defined to understand for what they need and not the
variable need by which they may be described in the program.
2. Each word must be unique. We cannot have two definitions of the same
client.
3. Aliases or synonyms are allowed when two or more enters shows the
same meaning. For example, a vendor number may also be called as
customer number.
4. A self-defining word should not be decomposed. It means that the
reduction of any information in to subpart should be done only if it is really
required that is it is not easy to understand directly.
Data dictionary includes information such as the number of records in file, the
frequency a process will run, security factor like pass word which user must enter
to get excess to the information.

Screenshot of the Project


Online Food Ordering
System

44
Our Service: -

Food Catering, Desert Ordering, Food delivery.

45
Our Services and food Quality: -

The term food quality represents the sum of all properties and
attributes of a food item that are acceptable to the customer. These
food quality attributes include appearance, including size, shape,
gloss, colour, and consistency, texture, flavour, and nutritional
content.

46
contact us more information and
Contact Us: - Please
other information and reviews our services…

47
Code of the Project :-
Online Food Ordering
System

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

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Online Food DeliverY Service in India | MY_web_Meal.com | MY
ProJct...</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" media="screen and (max-width: 1170px)"
href="css/phone.css">
<link
href="https://fonts.googleapis.com/css?family=Baloo+Bhai|Bree+Serif&display=sw
ap" rel="stylesheet">
<link rel="icon" type="image/x-icon" href="./img/rest.logo.png">
</head>

<body>
<nav id="navbar">
<div id="logo">
<img src="./img/sft enG.jpeg" alt="MyOnlineMeal.com">
</div>

48
<ul>
<li class="item"><a href="#home">Home</a></li>
<li class="item"><a href="#services-container">Services</a></li>
<li class="item"><a href="#client-section">Our Clients</a></li>
<li class="item"><a href="#contact">Contact Us.</a></li>
</ul>
</nav>

<section id="home">
<h1 class="h-primary"><u>Welcome to Online Web-Meal.</u></h1>
<p>Greetings of the DaY---Welcome to Food menu. </p>
<p><u>Please Order ur Food. </u></p>
<button class="btn">Order Now</button>
</section>

<section id="services-container">
<h3 class="h-primary center"><u>Our Services</u></h3>
<div id="services">
<div class="box">
<img src="img/1.png" alt="">
<h2 class="h-secondary center">Food CaterinG.</h2>
<p class="center">ONLINE FOOD ORDER SYSTEM is mainly designed
primarily function for use in the food delivery industry. This system will
allow hotels and restaurants to increase online food ordering such type of
business. The customers can be selected food
menu items just few minutes. In the modern food industries
allows to quickly and easily delivery on customer place. Restaurant employees
then use these orders through an easy to delivery on customer place easy find
out navigate graphical
interface for efficient processing.</p>
</div>
<div class="box">
<img src="img/2.png" alt="">
<h2 class="h-secondary center">Desert OrderinG.</h2>
<p class="center">A Restaurant is a gathering place for many
people to taste the favorite foods are in there. The restaurant which visited
many people sure will increase the attraction of them to visit it. However,
what happens when a restaurant is famous
still uses a service without technology, such as making
orders using pens and paper, inspects the food stocks manually, and delivering
orders to the kitchen using manpower, and more. Therefore, it designed a
system that can accelerate
the ordering and processing food in the restaurant. This
system replaces the use of pen and paper with digital devices such as
tablets/smartphones based on Android.</p>
</div>
<div class="box">
<img src="img/3.png" alt="">

49
<h2 class="h-secondary center">Food DeleverY.</h2>
<p class="center"> food delivery is a courier service in which
a restaurant, store, or independent food-delivery company delivers food to a
customer. Ypu can order through website or mobile app, or through a food
ordering company. The delivered items can
include sides, drinks, desserts, or grocery items and are
typically delivered in boxes or bags. The delivery person will normally drive
a car, but in bigger cities where homes and restaurants are closer .They may
use bikes or car or
motorized scooters. </p>
</div>
</div>
</section>
<section id="client-section">
<h3 class="h-primary center"><u>Our Clients</u></h3>
<div id="clients">
<div class="client-item">
<img src="./img/client1.jpeg" alt="Our Client">
</div>
<div class="client-item">
<img src="./img/client2.jpeg" alt="Our Client">
</div>

<div class="client-item">
<img src="./img/client3.jpeg" alt="Our Client">
</div>
<div class="client-item">
<img src="./img/client4.jpeg" alt="Our Client">
</div>
</div>

</section>

<section id="contact">
<h3 class="h-primary center"><u>Contact Us</u></h3>
<div id="contact-box">
<form action="">
<div class="form-group">
<label for="name">Name: </label>
<input type="text" name="name" id="name"
placeholder="Enter your name">
</div>
<div class="form-group">
<label for="email">Email: </label>
<input type="email" name="name" id="email"
placeholder="Enter your email">
</div>
<div class="form-group">

50
<label for="phone">Phone Number: </label>
<input type="phone" name="name" id="phone"
placeholder="Enter your phone">
</div>
<div class="form-group">
<label for="message">Message: </label>
<textarea name="message" id="message" cols="30"
rows="10"></textarea>
</div>
</form>
</div>
</section>

<footer>
<div class="center">
Copyright &copy; www.MY_web_Meal.com... All rights are reserved!
</div>
</footer>
</body>

</html>

<!DOCTYPE html>

<html>

<head>

{% load staticfiles %}

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1"> <meta


http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<title>{% block title %}FoodApp{% endblock title %}</title>

<link rel="stylesheet" type="text/css" href="{% static


'webapp/css/bootstrap.min.css'%}">

<link href="/static/webapp/css/style.css" rel="stylesheet" type="text/css" media="all"


/>

<link rel='stylesheet'
href='https://maxcdn.bootstrapcdn.com/fontawesome/4.5.0/css/font-
awesome.min.css' >

51
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrapglyphicons.css"
rel="stylesheet">

<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,700'
rel='stylesheet' type='text/css'>

<link href='http://fonts.googleapis.com/css?
family=Lobster+Two:400,400italic,700,700italic' rel='stylesheet' type='text/css'>

<!--Animation-->

<script src="/static/webapp/js/wow.min.js"></script>

<link href="static/webapp/css/animate.css" rel='stylesheet' type='text-center/css' />

</head>

<body>

<nav class="navbar navbar-expand-lg navbar-light bg-dark">

<div class="container-fluid">

<div class="navbar-collapse collapse w-100 dual-collapse2 order-1 order-md-0">

<ul class="navbar-nav ml-auto text-center">

<li class="nav-item active">

<a class="nav-link text-light" href="{% url 'index' %}"><font


size="3">&nbsp; <strong>Home</strong> </font></a>

</li>

<li class="nav-item">

<a class="nav-link text-light" href="{% url 'mmenu' %}"><font


size="3">&nbsp;<strong>Menu </strong></font></a>

</li>

<li class="nav-item">

<a class="nav-link text-light" href="{% url 'orderlist' %}"><font


size="3">&nbsp;<strong>Orders</strong></font></a>

</li>

52
</ul>

</div>

<div class="mx-auto my-2 order-0 order-md-1 position-relative">

<a class="mx-auto" href="#">

<img src="/static/webapp/images/logo.png" style="height: 90px;width:


170px;" alt="Home" class="rounded-circle img-responsive">

</a>

<button class="navbar-toggler" type="button" data-toggle="collapse"


datatarget=".dual-collapse2">

<span class="navbar-toggler-icon"></span>

</button>

</div>

<div class="navbar-collapse collapse w-100 dual-collapse2 order-2 order-md-2">

<ul class="navbar-nav mr-auto text-center">

{% if request.user.is_authenticated %}

<li class="nav-item">

<a class="nav-link text-light " href="{% url 'logout' %}"><font size="3">


&nbsp;<span aria-hidden="true"></span><strong>LogOut </strong> </font></a>

</li>

<li class="nav-item">

<a class="nav-link text-light " href="{%url 'rprofile' %}"><font size="3">


&nbsp;<span aria-hidden="true"></span><strong>Profile</strong></font></a>

</li>

{% else %}

<li class="nav-item">

<a class="nav-link text-light " href="{% url 'rlogin' %}"><font


size="3">&nbsp;<span aria-hidden="true"></span>
<strong>LogIn</strong></font></a>

53
<script type="text/javascript" src="{%static 'webapp/js/jquery.min.js'%}">

</script>

<script type="text/javascript" src="{%static 'webapp/js/bootstrap.min.js'%}"></script>

<script> new

WOW().init();

</script>

<script src="/static/webapp/js/simpleCart.min.js"> </script>

<script type="text/javascript" src="/static/webapp/js/move-top.js"></script>

<script type="text/javascript" src="/static/webapp/js/easing.js"></script>

</body>

</html>

{% for field in form %}

<div class="form-group">

<div class="col-sm-offset-2 col-sm-12">

<span class="text-danger small">{{ field.errors }}</span>

</div>

<label class="control-label col-sm-4">{{ field.label_tag }}</label>

<div class="col-sm-7">{{ field }}</div>

</div>

{% endfor %}

<!DOCTYPE html>

<html>

<head>

{% load staticfiles %}

<meta charset="UTF-8">

54
<h2><strong>Register Now<br/>and<br/>Order Online</strong></h2>

</div>

<br>

<button type="button" class="btn btn-success btn-lg"><strong><a href="{% url


'register'%}" class="text-light">Register</a></strong></button>

</div>

<div class="col">

<div class="col4 text-light">

<h1 style="font-style:italic; font-family:sans-serif; "><strong>Be a


Partner</strong></h1>

<h2><strong>Join Us Today<br/>and<br>Increase Your Sale</strong></h2>

</div>

<br>

<button type="button" class="btn btn-success btn-lg"><strong><a href="{% url


'rregister'%}" class="text-light">Join Us</a></strong></button>

</div>

</div>

</div>

</div>

</div> <div

class="cont

ent">

<div class="ordering-section" id="Order">

<div class="container">

<div class="ordering-section-head text-center wow bounceInRight" data-


wowdelay="0.4s">

<h3>Ordering food was never so easy</h3>

55
<div class="dotted-line">

<h4>Just 4 steps to follow </h4>

</div>

</div>

<div class="i-am-center">

<div class="row ">

<div class="col-sm-2 col-md-2">

<div class="thumbnail borders text-light">

<p>Choose <span>Your Restaurant</span></p>

</div>

</div>

<div class="col-sm-2 col-md-2 ">

<div class="thumbnail borders text-light">

<p>Order <span>Your Cuisine</span></p>

</div>

</div>

<div class="col-sm-2 col-md-2">

<div class="thumbnail borders text-light" >

<p>Pay <span> online </span></p>

<label></label>

</div>

</div>

<div class="col-sm-2 col-md-2">

<div class="thumbnail borders text-light">

<p>Enjoy <span>your food </span></p>

<label></label>

56
</a>

</div>

</div>

<br>

<div class="col-md-4 ">

<div class="thumbnail">

<a href="">

<img src="/static/webapp/images/restaurent-4.jpg" class="img-responsive" alt="" />

</a>

</div>

</div>

<br>

<div class="col-md-4 ">

<div class="thumbnail">

<a href="">

<img src="/static/webapp/images/restaurent-5.jpg" class="img-responsive" alt="" />

</a>

</div>

</div>

<br>

<div class="col-md-4 ">

<div class="thumbnail">

<a href="">

<img src="/static/webapp/images/restaurent-6.jpg" class="img-responsive" alt="" />

</a>

57
</div>

</div>

</div>

</div>

<br>

<br>

<div class="container col-md-9">

<div class="top-cuisine-head">

<h3>Top Cuisines</h3>

</div>

<div class="row">

<div class="col-md-4 ">

<div class="thumbnail">

<a href="">

<img src="/static/webapp/images/cuisine1.jpg" class="img-responsive"


alt="" />

</a>

</div>

<div class="caption border col-sm-4">

<h5 class="text-secondary"><strong>Pizza</strong></h5>

</div>

</div>

<div class="col-md-4 mb-3">

<div class="thumbnail">

58
<a href="">

<img src="/static/webapp/images/cuisine2.jpg" class="img-responsive"


alt="" />

</a>

</div>

<div class="caption border col-sm-4">

<h5 class="text-secondary"><strong>Burger</strong></h5>

</div>

</div>

<div class="col-md-4 ">

<div class="thumbnail">

<a href="">

<img src="/static/webapp/images/cuisine3.jpg" class="img-responsive"


alt="" />

</a>

</div>

<div class="caption border col-sm-6">

<h5 class="text-secondary"><strong>Dough Nut</strong></h5>

</div>

</div>

<div class="col-md-4 mb-3">

<div class="thumbnail">

<a href="">

<img src="/static/webapp/images/cuisine4.jpg" class="img-responsive"


alt="" />

</a>

</div>

59
<div class="caption border col-sm-4">

<h5 class="text-secondary"><strong>Curry</strong></h5>

</div>

</div>

<div class="col-md-4 ">

<div class="thumbnail">

<a href="">

<img src="/static/webapp/images/cuisine5.jpg" class="img-responsive"


alt="" />

</a>

</div>

<div class="caption border col-sm-4">

<h5 class="text-secondary"><strong>trips</strong></h5>

</div>

</div>

<div class="col-md-4 ">

<div class="thumbnail">

<a href="">

<img src="/static/webapp/images/cuisine6.jpg" class="img-responsive"


alt="" />

</a>

</div>

<div class="caption border col-md-6">

<h5 class="text-secondary"><strong>Frawn Rice</strong></h5>

</div>

</div>

<div class="col-md-4 ">

60
<div class="row">

<div class="col-sm-12 col-md-6 col-md-offset-3">

<div class="panel panel-default">

<div class="panel-body">

<br>

<br>

<br>

<br>

<h3 class="col-sm-4 col-md-offset-4">Log In</h3>

{% if error_message %}

<p><strong>{{ error_message }}</strong></p>

{% endif %}

<br>

<form class="form-horizontal" role="form" action="#" method="post"


enctype="multipart/form-data"> {% csrf_token %}

<div class="form-group">

<label class="control-label col-sm-2" for="id_username">

Username:

</label>

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

<input id="id_username" maxlength="30" name="username" type="text">

</div>

</div>

<div class="form-group">

<label class="control-label col-sm-2" for="id_password"> Password:

</label>

<div class="col-sm-7">

61
<input id="id_password" maxlength="30" name="password" type="password">

</div>

</div>

<div class="form-group">

<div class="col-sm-offset-2 col-sm-10">

<button type="submit" class="btn btn-success">Submit</button>

</div>

</div>

</form>

</div>

<div class="panel-footer">

Don't have an account? <a href="{% url 'register' %}">Click here</a> to register.

</div>

</div>

</div>

</div>

</div>

<br>

<br>

{% endblock %}

{% extends 'webapp/base.html'%}

{% block title %}Menu{% endblock %}

{% block body %}

<div class="container">

62
<h1 class="text-info mb-2"><font size="6"><strong>{{rname}}</strong></font></h1>

<p>

<font size="3"><b>Info : </b><a class="text-success"><strong>{{rinfo|


safe}}</strong></a>

<br/>

<b>Location: </b><a class="text-success"><strong>{{rlocation}}</strong></a>

<br>

<b >Min Order:</b> <a class="text-success">&#x20b9;{{rmin}}</a>

</font>

</p>

</div>

<br>

<div class="container">

<input type="button" class="btn btn-success btn-lg pull-right" onclick="storearray();"


value="Checkout"/>

</div>

<div class="container ">

<h3 class="text-danger"><font size="5"><strong>Menu</strong></font></h3>

<br>

<table class="table table-hover table-bordered">

<thead>

<th>Item Name</th>

<th>Category</th>

<th>Price</th>

<th>Add</th>

</thead>

63
{% for x in items %}

<tr>

<td>{{x.0}}</td>

<td>{{x.1}}</td>

<td>&#x20b9; {{x.2}}</td>

{% if x.4 == "Open" %}

{% if x.5 > 0 %}

<td>

<div class="form-group" style="width:40%;">

<div class="input-group-btn">

<button id="down" class="btn btn-default"

onclick="if(document.querySelector('#itemno{{x.3}}').innerHTML>0){

document.querySelector('#itemno{{x.3}}').innerHTML--;

minuscounter('{{x.3}}');

}">

<span class="glyphicon glyphicon-minus"></span></button>

</div>

<span id='itemno{{x.3}}'> 0 </span>

<div class="input-group-btn"> <button

id="up" class="btn btn-default"

onclick="

if(document.querySelector('#itemno{{x.3}}').innerHTML<{{x.5}}){

document.querySelector('#itemno{{x.3}}').innerHTML++;

pluscounter('{{x.3}}');

}"><span class="glyphicon glyphicon-plus"></span></button>

</div>

64
<th>Price</th>

</thead>

{% for x in items %}

<tr><td>{{x.0}}</td><td>{{x.1}}</td><td>&#x20b9; {{x.2}}</td></tr>

{% endfor %}

</table>

<br>

<span><b>Total price: </b></span><span> &#x20b9; {{totalprice}}

</span>

<br>

<br>

<form action="" method="POST">

{% csrf_token %}

<span><strong>Delivery Address:</strong></span>

<br>

<br>

<div><input type="text" name="address" style="width:60%; height: 60px;"


required/></div>

<input type="hidden" name="oid" value="{{oid}}">

<br>

<input type="submit" class="btn btn-success btn-lg" value="Order" name="submit">

</form>

</div>

{% endblock %}

65
</div>

{% endfor %}

{% endblock %}

{% extends 'webapp/base.html'%}

{% block title %}orderplaced{% endblock %}

{% block body %}

<div class="container">

<br>

<h1 class="text-center"><strong>Thank You For Placing Order</strong></h1>

<br>

<h2 class="text-center"><strong>Waiting for Confirmation</strong></h2>

<br>

<br> <h3

class="te

xt-

center">

<a

href="{%

url

'restuara

nt'%}"><

strong>

Go

back</str

66
ong></a

></h3>

</div>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

{% endblock%}

{% extends 'webapp/base.html'%}

{% block title %}Profile{% endblock %}

{% block body %}

<br>

<div class="container col-md-8">

<div class="row">

<div class=" col-md-11 toppad">

<div class="panel panel-info">

<div class="panel-heading">

67
<h3 class="panel-title text-info "><strong>{{user.customer.f_name}}
{{user.customer.l_name}}</strong></h3>

</div>

<br>

<div class="panel-body">

<div class="row">

<div class=" col-md-9 col-lg-9 ">

<table class="table table-user-information">

<tbody>

<tr>

<td>User Name:</td>

<td>{{user.username}}</td>

</tr>

<tr>

<td>First Name:</td>

<td>{{user.customer.f_name}}</td>

</tr>

<tr>

<td>Last Name:</td>

<td>{{user.customer.l_name}}</td>

</tr>

<tr>

<td>City:</td>

<td>{{user.customer.city}}</td>

</tr>

68
<td>Address:</td>

<td>{{user.customer.address}}</td>

</tr>

<tr>

<td>Email:</td>

<td><a href="#">{{user.email}}</a></td>

</tr>

<tr>

<td>Phone Number:</td>

<td>{{user.customer.phone}}

</td>

</tr>

</tbody>

</table>

<div class="container">

<div class="row">

<div class="col">

<a class="btn btn-success btn-lg" href="{% url 'cupdate' user.id %}">Edit</a>

</div>

<!--<div class="col">

<a class="btn btn-success btn-lg" href="{%url 'ccreate' %}">Complete profile</a>

</div>-->

</div>

</div>

69
Business logic

from django.contrib.auth.forms import UserCreationForm

from django import forms from .models import

User,Customer,Restaurant,Item,Menu

class CustomerSignUpForm(forms.ModelForm):

password =

forms.CharField(widget=forms.PasswordInput) class Meta:

model = User

fields=['username','email','password'

] def save(self, commit=True): user

= super().save(commit=False)

user.is_customer=True

if commit:

user.save()

return user

class RestuarantSignUpForm(forms.ModelForm):

password =

forms.CharField(widget=forms.PasswordInput) class Meta:

model =User

fields=['username','email','password'

] def save(self,commit=True): class

Customer(models.Model):

user =
models.OneToOneField(settings.AUTH_USER_MODEL,on_delete=models.CASCADE)

70
f_name = models.CharField(max_length=20,blank=False)

l_name = models.CharField(max_length=20,blank=False)

city = models.CharField(max_length=40,blank=False)

phone = models.CharField(max_length=10,blank=False)

address = models.TextField()
def __str__(self):

return self.user.username

class Restaurant(models.Model):

user =
models.OneToOneField(settings.AUTH_USER_MODEL,on_delete=models.CASCADE)
rname = models.CharField(max_length=100,blank=False)

info = models.CharField(max_length=40,blank=False)

min_ord = models.CharField(max_length=5,blank=False)
location = models.CharField(max_length=40,blank=False)

r_logo = models.FileField(blank=False)

REST_STATE_OPEN = "Open"

REST_STATE_CLOSE = "Closed"

REST_STATE_CHOICES =(

(REST_STATE_OPEN,REST_STATE_OPEN),

(REST_STATE_CLOSE,REST_STATE_CLOSE)

status =
models.CharField(max_length=50,choices=REST_STATE_CHOICES,default=REST_STAT
E_OPEN,blank=False) approved =

models.BooleanField(blank=False,default=True)

def __str__(self): return

self.rname

71
class Item(models.Model):

id = models.AutoField(primary_key=True)

fname = models.CharField(max_length=30,blank=False) category =

models.CharField(max_length=50,blank=False)

def __str__(self): return

self.fname

class Menu(models.Model):

id = models.AutoField(primary_key=True)

item_id = models.ForeignKey(Item,on_delete=models.CASCADE) r_id

= models.ForeignKey(Restaurant,on_delete=models.CASCADE) price

= models.IntegerField(blank=False) quantity =

models.IntegerField(blank=False,default=0)

def __str__(self):

return self.item_id.fname+' - '+str(self.price)

class Order(models.Model):

id = models.AutoField(primary_key=True)

total_amount = models.IntegerField(default=0) timestamp

= models.DateTimeField(auto_now_add=True) delivery_addr

= models.CharField(max_length=50,blank=True) orderedBy

= models.ForeignKey(User ,on_delete=models.CASCADE)

r_id = models.ForeignKey(Restaurant
,on_delete=models.CASCADE)

72
ORDER_STATE_WAITING = "Waiting"

ORDER_STATE_PLACED = "Placed"

ORDER_STATE_ACKNOWLEDGED = "Acknowledged"

ORDER_STATE_COMPLETED = "Completed"

ORDER_STATE_CANCELLED = "Cancelled"

ORDER_STATE_DISPATCHED = "Dispatched"

ORDER_STATE_CHOICES = (

(ORDER_STATE_WAITING,ORDER_STATE_WAITING),

(ORDER_STATE_PLACED, ORDER_STATE_PLACED),

(ORDER_STATE_ACKNOWLEDGED, ORDER_STATE_ACKNOWLEDGED),

(ORDER_STATE_COMPLETED, ORDER_STATE_COMPLETED),

(ORDER_STATE_CANCELLED, ORDER_STATE_CANCELLED),

(ORDER_STATE_DISPATCHED, ORDER_STATE_DISPATCHED)

status =
models.CharField(max_length=50,choices=ORDER_STATE_CHOICES,default=ORDER_S
TATE_WAITING)

def __str__(self):

return str(self.id) +' '+self.status

class orderItem(models.Model):

id = models.AutoField(primary_key=True)

item_id = models.ForeignKey(Menu ,on_delete=models.CASCADE)

ord_id = models.ForeignKey(Order,on_delete=models.CASCADE) quantity =

models.IntegerField(default=0)

73
def __str__(self):

return str(self.id)

from django.shortcuts import render, redirect,get_object_or_404

from django.contrib.auth import authenticate, login,logout

from .forms import


CustomerSignUpForm,RestuarantSignUpForm,CustomerForm,RestuarantForm

from django.contrib.auth.decorators import login_required from collections

import Counter from django.urls import reverse from django.db.models

import Q from .models import

Customer,Restaurant,Item,Menu,Order,orderItem,User

#### ---------- General Side -------------------#####

# Showing index page

def index(request): return

render(request,'webapp/index.html',{})

def orderplaced(request):

return render(request,'webapp/orderplaced.html',{})

# Showing Restaurants list to Customer

def restuarent(request):

r_object = Restaurant.objects.all()

query = request.GET.get('q')

if query:

74
r_object=Restaurant.objects.filter(Q(rname__icontains=query)).distinct()

return render(request,'webapp/restaurents.html',{'r_object':r_object})

return render(request,'webapp/restaurents.html',{'r_object':r_object})

# logout

def Logout(request):

if request.user.is_restaurant:

logout(request)

return redirect("rlogin")

else:

logout(request)

return redirect("login")

#### -----------------Customer Side---------------------- ######

# Creating Customer Account

def customerRegister(request): form

=CustomerSignUpForm(request.POST or None)

if form.is_valid():

user = form.save(commit=False)

username = form.cleaned_data['username']

password = form.cleaned_data['password']

user.is_customer=True

user.set_password(password) user.save()

user =

75
authenticate(username=username,password

=password)

if user is not None:

if user.is_active:

login(request,user)

return redirect("ccreate")

context ={

'form':form

return render(request,'webapp/signup.html',context)

# Customer Login

def customerLogin(request):

if request.method=="POST":

username = request.POST['username'] password =

request.POST['password'] user =

authenticate(username=username,password=password)

if user is not None:

if user.is_active:

login(request,user)

return redirect("profile")

else:

return render(request,'webapp/login.html',
{'error_message':'Your account disable'})

else:

return render(request,'webapp/login.html',{'error_message': 'Invalid


Login'})

return render(request,'webapp/login.html')

76
# customer profile view

def customerProfile(request,pk=None):

if pk:

user = User.objects.get(pk=pk)

else:

user=request.user

return render(request,'webapp/profile.html',{'user':user})

#Create customer profile

def createCustomer(request): form =

CustomerForm(request.POST or None)

if form.is_valid():

instance = form.save(commit=False)

instance.user = request.user

instance.save()

return redirect("profile")

context={

'form':form,

'title':"Complete Your profile"

return render(request,'webapp/profile_form.html',context)

# Update customer detail

def updateCustomer(request,id):

form = CustomerForm(request.POST or None,instance=request.user.customer)

if form.is_valid():

form.save()

77
return redirect('profile')

context={

'form':form,

'title':"Update Your profile"

return render(request,'webapp/profile_form.html',context)

def restuarantMenu(request,pk=None):

menu = Menu.objects.filter(r_id=pk)

rest = Restaurant.objects.filter(id=pk)

items =[]

for i in menu:

item = Item.objects.filter(fname=i.item_id)

for content in item:

temp=[]

temp.append(content.fname)

temp.append(content.category)

temp.append(i.price)

temp.append(i.id)

temp.append(rest[0].status)

temp.append(i.quantity)

items.append(temp)

context = {

'items' : items,

'rid' : pk,

'rname': rest[0].rname,

78
'rmin' : rest[0].min_ord,

'rinfo' : rest[0].info,

'rlocation':rest[0].location,

return render(request,'webapp/menu.html',context)

@login_required(login_url='/login/user/')

def checkout(request):

if request.POST:

addr = request.POST['address']

ordid = request.POST['oid']

Order.objects.filter(id=int(ordid)).update(delivery_addr = addr,

status=Order.ORDER_STATE_PLACED)

return redirect('/orderplaced/')

else:

cart = request.COOKIES['cart'].split(",") cart =

dict(Counter(cart)) items = [] totalprice = 0 uid =

User.objects.filter(username=request.user) oid

= Order()

oid.orderedBy = uid[0]

for x,y in cart.items():

item = [] it =

Menu.objects.filter(id=int(x))

if len(it):

oiid=orderItem()

oiid.item_id=it[0]

oiid.quantity=int(y)

79
oid.r_id=it[0].r_id oid.save()

oiid.ord_id =oid oiid.save()

totalprice +=

int(y)*it[0].price

item.append(it[0].item_id.fname)

it[0].quantity = it[0].quantity - y

it[0].save()

item.append(y)

item.append(it[0].price*int(y))

items.append(item)

oid.total_amount=totalprice

oid.save()

context={

"items":items,

"totalprice":totalprice,

"oid":oid.id

return render(request,'webapp/order.html',context) ####### -------------------


Restaurant Side ------------------- #####

# creating restuarant account

def restRegister(request): form

=RestuarantSignUpForm(request.POST or None)

if form.is_valid():

user = form.save(commit=False) username =

form.cleaned_data['username'] password =

form.cleaned_data['password'] user.is_restaurant=True

80
user.set_password(password) user.save() user =

authenticate(username=username,password=password)

if user is not None:

if user.is_active:

login(request,user)

return redirect("rcreate")

context ={

'form':form

return render(request,'webapp/restsignup.html',context)

# restuarant login

def restLogin(request):

if request.method=="POST":

username = request.POST['username'] password =

request.POST['password'] user =

authenticate(username=username,password=password)

if user is not None:

if user.is_active:

login(request,user)

return redirect("rprofile")

else:

return render(request,'webapp/restlogin.html',
{'error_message':'Your account disable'})

else:

return render(request,'webapp/restlogin.html',{'error_message': 'Invalid


Login'})

return render(request,'webapp/restlogin.html')

81
# restaurant profile view

def restaurantProfile(request,pk=None):

if pk:

user = User.objects.get(pk=pk)

else:

user=request.user

return render(request,'webapp/rest_profile.html',{'user':user})

# create restaurant detail

@login_required(login_url='/login/restaurant/')

def createRestaurant(request): form=RestuarantForm(request.POST or

None,request.FILES or None)

if form.is_valid():

instance = form.save(commit=False)

instance.user = request.user

instance.save()

return redirect("rprofile")

context={

'form':form,

'title':"Complete Your Restaurant profile"

return render(request,'webapp/rest_profile_form.html',context)

#Update restaurant detail

@login_required(login_url='/login/restaurant/')

def updateRestaurant(request,id):

82
form = RestuarantForm(request.POST or None,request.FILES or
None,instance=request.user.restaurant)

if form.is_valid():

form.save()

return redirect('rprofile')

context={

'form':form,

'title':"Update Your Restaurant profile"

return render(request,'webapp/rest_profile_form.html',context)

# add menu item for restaurant

@login_required(login_url='/login/restaurant/')

def menuManipulation(request):

if not request.user.is_authenticated:

return redirect("rlogin")

rest=Restaurant.objects.filter(id=request.user.restaurant.id);

rest=rest[0]

if request.POST:

type=request.POST['submit']

if type =="Modify":

menuid = int(request.POST['menuid'])

memu= Menu.objects.filter(id=menuid).\

update(price=int(request.POST['price']),quantity=int(request.POST['quantity']))

elif type == "Add" :

83
itemid=int(request.POST['item'])

item=Item.objects.filter(id=itemid)

item=item[0]

menu=Menu()

menu.item_id=item menu.r_id=rest

menu.price=int(request.POST['price'])

menu.quantity=int(request.POST['quantity']

menu.save()

else:

menuid = int(request.POST['menuid'])

menu = Menu.objects.filter(id=menuid)

menu[0].delete()

menuitems=Menu.objects.filter(r_id=rest)

menu=[]

for x in menuitems:

cmenu=[]

cmenu.append(x.item_id)

cmenu.append(x.price)

cmenu.append(x.quantity)

cmenu.append(x.id)

menu.append(cmenu)

menuitems = Item.objects.all()

items = []

for y in menuitems: citem = []

citem.append(y.id)

citem.append(y.fname)

84
items.append(citem)

context={

"menu":menu,

"items":items,

"username":request.user.username,

return render(request,'webapp/menu_modify.html',context)

def orderlist(request):

if request.POST:

oid = request.POST['orderid']

select =

request.POST['orderstatus'] select

= int(select) order =

Order.objects.filter(id=oid)

if len(order):

x = Order.ORDER_STATE_WAITING

if select == 1:

x = Order.ORDER_STATE_PLACED

elif select == 2:

x = Order.ORDER_STATE_ACKNOWLEDGED

elif select == 3:

x = Order.ORDER_STATE_COMPLETED

elif select == 4:

x = Order.ORDER_STATE_DISPATCHED

elif select == 5:

x = Order.ORDER_STATE_CANCELLED

85
else:

x = Order.ORDER_STATE_WAITING

order[0].status = x

order[0].save()

orders = Order.objects.filter(r_id=request.user.restaurant.id).order_by('-timestamp')

corders = []

for order in orders:

user =

User.objects.filter(id=order.orderedBy.id) user

= user[0] corder = []

if user.is_restaurant:

corder.append(user.restaurant.rname)

corder.append(user.restaurant.info)

else:

corder.append(user.customer.f_name)

corder.append(user.customer.phone)

items_list = orderItem.objects.filter(ord_id=order)

items = []

for item in items_list:

citem = [] citem.append(item.item_id)

citem.append(item.quantity) menu =

Menu.objects.filter(id=item.item_id.id)

citem.append(menu[0].price*item.quantity)

menu = 0

86
items.append(citem)

corder.append(items)

corder.append(order.total_amount)

corder.append(order.id)

x = order.status

if x == Order.ORDER_STATE_WAITING:

continue

elif x == Order.ORDER_STATE_PLACED:

x=1

elif x == Order.ORDER_STATE_ACKNOWLEDGED: x = 2

elif x == Order.ORDER_STATE_COMPLETED:

x=3

elif x == Order.ORDER_STATE_DISPATCHED:

x=4

elif x == Order.ORDER_STATE_CANCELLED:

x=5

else:

continue

corder.append(x)

corder.append(order.delivery_addr)

corders.append(corder)

context = {"orders" : corders,}

return render(request,"webapp/order-list.html",context)

87
Conclusion of the Project Online Food Ordering System:

Our project is only a humble venture to satisfy the needs to manage their project
work. Several user-friendly coding has also adopted. This package shall prove to be a
powerful package in satisfying all the requirements of the school. The objective of
software planning is to provide a framework that enables the manger to make
reasonable estimates made within a limited time frame at the beginning of the software
project and should be updated regularly as the project progresses.

At the end it is concluded that we have made effort on following points…

• A description of the background and context of the project and its relation to
work already done in the area.
• Made statement of the aims and objectives of the project.
• The description of Purpose, Scope, and applicability.
• We define the problem on which we are working in the project.
• We describe the requirement Specifications of the system and the actions that
can be done on these things.
• We understand the problem domain and produce a model of the system, which
describes operations that can be performed on the system.
• We included features and operations in detail, including screen layouts.
• We designed user interface and security issues related to system.
• Finally the system is implemented and tested according to test cases.

Future Scope of the Project:

In a nutshell, it can be summarized that the future scope of the project circles
around maintaining information regarding:

• We can add printer in future.


• We can give more advance software for Online Food Ordering System
including more facilities
• We will host the platform on online servers to make it accessible worldwide
• Integrate multiple load balancers to distribute the loads of the system

88
• Create the master and slave database structure to reduce the overload of the
database queries
• Implement the backup mechanism for taking backup of codebase and database
on regular basis on different servers

The above-mentioned points are the enhancements which can be done to increase
the applicability and usage of this project. Here we can maintain the records of Food
Item and Category. Also, as it can be seen that now-a-days the players are versatile,
i.e. so there is a scope for introducing a method to maintain the Online Food Ordering
System. Enhancements can be done to maintain all the Food Item, Category,
Customer, Order, Confirm Order.

We have left all the options open so that if there is any other future requirement
in the system by the user for the enhancement of the system then it is possible to
implement them. In the last we would like to thanks all the persons involved in the
development of the system directly or indirectly. We hope that the project will serve its
purpose for which it is develop there by underlining success of process.

Limitation of Project on Online Food Ordering System

Although I have put my best efforts to make the software flexible, easy to operate
but limitations cannot be ruled out even by me. Though the software presents a
broad range of options to its users some intricate options could not be covered into it;
partly because of logistic and partly due to lack of sophistication. Paucity of time was
also major constraint; thus it was not possible to make the software fool proof and
dynamic. Lack of time also compelled me to ignore some part such as storing old
result of the candidate etc.

Considerable efforts have made the software easy to operate even for the people
not related to the field of computers but it is acknowledged that a layman may find it
a bit problematic at the first instance. The user is provided help at each step for his
convenience in working with the software.

89
List of limitations which is available in the Online Food Ordering System:

• Excel export has not been developed for Food Item; Category due
to some criticality.
• The transactions are executed in off-line mode, hence on-line data
for Customer, Order capture and modification is not possible.
• Off-line reports of Food Item, Confirm Order, Customer cannot be
generated due to batch mode execution.

90

You might also like