You are on page 1of 65

ONLINE FOOD ORDERING SYSTEM

OGELEKA, CHINEDU NIICHOLAS

15010301016

BEING A PROJECT SUBMITTED IN THE DEPARTMENT OF COMPUTER SCIENCE


AND MATHEMATICS, COLLEGE OF BASIC AND APPLIED SCIENCES
IN PARTIAL FUFILLMENT OF THE REQUIREMENTS FOR THE
AWARD OF DEGREE OF BACHELOR OF SCIENCE
MOUNTAIN TOP UNIVERSITY, IBAFO,
OGUN STATE, NIGERIA

2019

i
CERTIFICATION

This Project titled, ONLINE FOOD ORDERING SYSTEM prepared and submitted by
OGELEKA CHINEDU NICHOLAS in partial fulfilment of the requirements for the degree
of BACHELOR OF SCIENCE (Computer Science), is hereby accepted.

(Signature and Date)

Dr. Akinyemi I. O.
Supervisor

(Signature and Date)

Dr. Akinyemi I. O.

Head of Department

Accepted as partial fulfilment of the requirements for the degree of BACHELOR OF

SCIENCE (Computer Science)

(Signature and Date)

Prof. Akinwade A. I.

Dean, College of Basic and Applied Sciences

ii
DEDICATION

This project is dedicated to God Almighty

iii
ACKNOWLEDGEMENTS

The success and outcome of this project goes to the Almighty God for wisdom,

understanding and divine help to me from the beginning to the completion of this work. I

specially appreciate my major supervisor Dr. Akinyemi I. O. who took keen interest in my

project work and guided me all along, and taking the pains out of no time to attend to me. My

gratitude goes to Dean, College of Basic and Applied Sciences Prof. Akinwade A. I. for his

teachings, guidance, counsel and fatherly support in ensuring the successful completion of

this research God bless you Sir. My heart-felt gratitude goes to the Head of Department

Computer Science and Mathematics Dr. Akinyemi I. O. for his fatherly role, and owe deep

gratitude for the efforts, constant encouragement, guidance and support of all staff members

of the department of Computer Science and Mathematics: Dr. Oyetunji M. O., Dr. Adamu O.

B, Dr. Alaba O. B., Dr. Mathew O. A., Dr. (Mrs.) Kasali F. A., Dr. (Mrs.) Olaniyan O. O.,

Dr. Peter A. I., Dr. Okunoye O. B., Dr. Ojesanmi O. A., Dr. (Mrs.) Florence A. O., Mr.

Taiwo A., and other members of staff.

I acknowledge the constant support of my mentors who had contributed to my academic

achievement. They include Pastor Olumide A., Dr. Asogwa K. K my dad Pastor Ogeleka S. I

pray God would continue to increase their knowledge. I will forever be grateful to my parents

Mr. and Mrs. Ogeleka. who sacrificed wealth and enjoyable moments of their lives for the

sake of my success; and my siblings – Festus, Stella, Emmanuel, Favour an Joy for their

prayers and support and my great uncle brother blessing three gbosa for you. I would also

like to appreciate Mr and Mrs Omolade for their great support both finically and prayer wise.

I would not forget to remember all the students in the Department of Computer Science and

Mathematics, and Mountain Top University colleague and friends for their prayers, support,

and help in one way or the other for making my stay a worthwhile one, I say God bless you

all richly. God bless them all greatly.

iv
Table of Contents

CERTIFICATION II

DEDICATION III

ACKNOWLEDGEMENTS IV

LIST OF TABLES IX

ABSTRACT XI

CHAPTER ONE 1

INTRODUCTION 1

1.1 BACKGROUND TO THE STUDY 1

1.2 STATEMENT OF THE PROBLEM 1

1.3 SCOPE OF THE STUDY 2

1.4 AIM AND OBJECTIVES OF STUDY 2

1.5 SIGNIFICANCE OF STUDY 2

1.6 LIMITATIONS 3

1.7 DEFINITION OF TERMS 3

CHAPTER TWO 4

LITERATURE REVIEW 4

2.1 INTRODUCTION 4

2.2 COMPONENTS OF FOOD ORDERING SYSTEMS 5

2.2.1 HARDWARE 5

2.2.2 SOFTWARE 6

2.2.3 DATA 6

2.2.4 PROCEDURES 6

2.2.5 PEOPLE 6

v
2.2.6 DATABASE 6

2.3 E-COMMERCE 7

2.4 TYPES OF FOOD ORDERING SYSTEM 8

2.5 TYPES OF INFORMATION SYSTEM 10

2.5.1 TRANSACTION PROCESSING SYSTEM (TPS) 10

2.5.2 MANAGEMENT INFORMATION SYSTEM (MIS) 11

2.5.3 DECISION-SUPPORT SYSTEMS (DSS) 11

2.5.4 EXECUTIVE SUPPORT SYSTEM (ESS) 11

2.6 ADVANTAGES OF FOOD ORDERING SYSTEMS 11

2.7 LIMITATIONS OF FOOD ORDERING SYSTEM 12

CHAPTER THREE 13

RESEARCH METHODOLOGY 13

3.1 INTRODUCTION 13

3.2 SYSTEM ANALYSIS AND STUDY 13

3.2.1 ORAL INTERVIEW 13

3.2.2 STUDY OF MANUALS 14

3.2.3 EVALUATION OF FORMS 14

3.3 THE EXISTING SYSTEM 14

3.4 PROBLEM OF EXISTING SYSTEM 14

3.5 OBJECTIVES OF THE PROPOSED SYSTEM 15

3.6 JUSTIFICATION FOR THE NEW SYSTEM 15

3.7 REQUIREMENTS DETERMINATION 16

3.7.1 REQUIREMENTS ANALYSIS 16

3.8 OUTPUT DESIGN 17

vi
3.9 SYSTEM IMPLEMENTATION 17

3.10 INPUT DESIGN 18

3.11 SYSTEM TESTING 18

3.12 DATABASE STRUCTURE 18

CHAPTER FOUR 22

SYSTEM DESIGN, ANALYSIS AND IMPLEMENTATION 22

4.1 SYSTEM DESIGN OBJECTIVES 22

4.2 FUNCTIONAL REQUIREMENTS 23

4.3 NON-FUNCTIONAL REQUIREMENTS 23

4.4 DATABASE DESIGN 23

4.4.1 ENTITIES 24

4.4.2 TABLE ATTRIBUTE DESCRIPTION (PHYSICAL DESIGN) 25

4.5 SYSTEM IMPLEMENTATION 27

4.5.1 SYSTEM USERS ADMINISTRATOR 28

4.5.2 HARDWARE PLATFORM 29

4.5.3 SOFTWARE PLATFORM 29

4.5.4 SYSTEM EXECUTION SEQUENCE 29

4.5.4.1 USER’S ENVIRONMENT 30

4.5.4.2 ADMINISTRATOR ENVIRONMENT 34

CHAPTER FIVE 41

SUMMARY, CONCLUSION AND RECOMMENDATION 41

5.1 SUMMARY 41

5.2 CONCLUSION 41

5.3 RECOMMENDATIONS 42

vii
5.4 LIMITATIONS TO STUDY 42

References 43

Appendix 45

viii
LIST OF TABLES

Tables Page

4.1: Showing Admin details 25


4.2: Showing customer details 25
4.3: Showing food details 26
4.4: Showing Order details 26
4.5: Showing Categories of food details 27

ix
LIST OF FIGURES

Figure page

2.1: Context Level Data Flow Diagram of Online Ordering System 5


3.1: Software Development Life Cycle 13
4.1: Database logical design for a food ordering system 24
4.2: Administration use case diagram 28
4.3: Customer use case diagram 29
4.4: Screenshot showing the home page of the food ordering system 30
4.5: Screenshot showing the user dashboard of the food ordering system 31
4.6: Screenshot showing the order list of the food ordering system 32
4.7: Screenshot showing the logout page of the food ordering system 33
4.8: Screenshot showing the Administrator page of the food ordering system 34
4.9: Screenshot showing the Add new food category of the food ordering system 35
4.10: Screenshot showing the page to add food of the food ordering system 36
4.11: Screenshot showing the Menu list of the food ordering system 37
4.12: Screenshot showing the Order list of the food ordering system 38
4.13 showing the page to edit food item food ordering system 39
4.12: Screenshot showing the Order list information 40

x
ABSTRACT
The online food ordering system offers clients comfort. It overcomes the traditional queuing
system's disadvantages. This scheme improves food intake compared to tourists. This system
therefore increases the speed and standardization of the customer taking the order. It offers a
better platform for communication. The details of the user are recorded electronically. The
online food ordering system set up menu online and the customers easily places the order
with a simple click. Also, with a food menu online you can easily track the orders, maintain
customer's database and improve your food delivery service. This system allows the user to
select the desired food items from the displayed menu. The user orders the food items. The
payment can be made online or pay-on-delivery system. The user’s details are maintained
confidential because it maintains a separate account for each user. An id and password are
provided for each user. Therefore, it provides a more secured ordering.

The structured methodologies have been chosen to develop the Online Fast Food Restaurant
Ordering System. The structured design methodology adopts a formal step-by-step approach
to the System Development Life Cycle that moves logically from one phase to the next. The
methodology used involved system analysis, system design, system development, and system
testing. The system design will achieved using HTML, CSS AND JavaScript for the frontend
and PHP and MySQL for backend design.

It was concluded that the online food ordering system automates these processes of ordering
food online, thus reducing the time wasted as well as the errors that are involved in the
manual process. Online food ordering system is one the best innovation that has taken place
in the restaurant company and those companies that have not yet embraced online food
ordering system ought to lose out.

xi
CHAPTER ONE

INTRODUCTION

1.1 Background to the Study

It is well known around the world that, to start a small-scale business in today’s market and
survive the competition from already established and settled owners is extremely difficult. In
the current state of time, when people are busy with their daily activities, most people are
finicky when it comes to ordering food. The patrons of nowadays are not only attracted
because ordering online is very convenient but also because they have visibility into the
price, items offered and very abridged navigation for the order.

This study proposes an online food ordering system, designed specifically for college
cafeterias, but just as applicable in any food delivery industry. The key advantage of my
ordering system is that the ordering process for the restaurant and the customers is greatly
simplified. When the users (customers) visit the ordering webpage, they are presented with an
updated menu and interactive, after choosing what you want the item is added to the order list
which can be reviewed, this provides visual confirmation of what was selected and items in
the cart are, what was intended.

The system also greatly reduces the stress load on the restaurants end, as the whole process of
ordering is automated. Once a customer places an order on the webpage, it is stored into the
database and the retrieved in real-time, whit a desktop application and admin login on the
restaurant’s end. Inside the application, food ordered are displayed, alongside the delivery
details and corresponding options, in a brief and easy to read manner. This makes restaurant
employees access the orders quickly as they are placed and produce the required items within
a short period of time without delay and confusion.

1.2 Statement of the Problem

The major problem connected with the recent system which is done manually leading to long
queue of customers increase the work load on the employees which brings about the
following problems.

i. Increase in cost effectiveness due to customers seeking more ways to


purchasing products.

1
ii. The vendors need to purchase all the products in order to sell to end user.
The manual method of going to their local food sales outlets to purchase
food is becoming obsolete and more tasking.
iii. Time wastage when at the end of the day the buyer has to walk around to
buy food stuff he/she needs to purchase on the store.

1.3 Scope of the Study

In this project a fast food research will be conducted in MTU cafeteria and other restaurants
where it will be taken as a case study to enable customers order for food and get delivered
accordingly and also reduce long queues of customers at the counter ordering for food and
reduce the work load on the employees.

1.4 Aim and Objectives of Study

This research outlines a framework job for a fresh scheme to be created and introduced onto
the market for peak use and to establish an avenue through the web where consumers can log
in to the severe and make a selection of whatever food they like and then pay through the
internet. The following are the objectives:

i. Time conversation where products and services offered would provide the
customer with all the different categories of available products that they can
choose and select from.
ii. Increase service velocity, volume of sales and client satisfaction
iii. This will provide a user friendly environment between the customer and employee
thus increasing the efficiency of the food ordering system.
iv. It will also help for easy retrieval of orders made by the customers.

1.5 Significance of Study

Given the fast growth of computer technology in almost all operating areas and its use in data
leadership, it has become essential to look into the development of online ordering system for
firms to meet up with demands of the customers. The food ordering and distribution scheme
will therefore assist clients and management to: advertise accessible food in their business
Reduce the workload in the current scheme Reduce time-waste in information processing
Create an internet purchase and delivery platform Keep precise records of purchase order and

2
delivery Limitations Because of time and economic limitations, the software created covers
only aspect of food ordering.

1.6 Limitations

Due to time and financial constraints, the software that is developed covers only aspect of
food ordering.

1.7 Definition of Terms

a. Food: Any nutritious substance that people or animals eat or drink, or that plant
absorbs, in order to maintain life and growth.
b. Menu: A list of dishes that are accessible in a restaurant or food that can be served
in a restaurant or at a meal, such as "a dinner party menu," "politics and sport are on
the menu tonight."
c. Ordering System: This is called a set of thorough techniques used in ordering
process handling.
d. Online Food Ordering: Online food ordering services are websites with interactive
menus that enable clients to place orders with local restaurants and food
cooperatives.
e. Restaurant: (Eating location) is a location where clients sell food and beverages.
f. Customer: Sometimes referred to as a customer, buyer or purchaser) is the
recipient of goods, services, products or ideas acquired for financial or other
valuable consideration from a seller, vendor or distributor.
g. Technology: It is the study of resource mobilization methods or processes (such as
data) to achieve goals that benefit man and his environment.

3
CHAPTER TWO

LITERATURE REVIEW

2.1 Introduction

Ordering system has been a piece of doing business for a long time, and has created close by
innovation to give amazing methods for capturing, tracking and transporting client's requests.
Propelled ordering system can traverse different landmasses to track and encourage
worldwide requests, shipments and returns of a wide scope of product offerings and customer
sections. Ordering system captures request information from client administration
representatives or from clients straightforwardly, stores information in a focal database and
sends request data to the accounting and shipping divisions if relevant.

In our age time, computer has rotated into a key part to our day by day life due to the
progression innovation of World Wide Web that turns into a web that permit every single
client associated with theirs' computer for data sharing all through the entire world. The
World Wide Web completed an incredible commitment to a great deal of big business which
utilize this component for data sharing inside the endeavour and furthermore outside the
undertaking (Kapchnaga, R, 2014).

From the advantage of World Wide Web, a great deal of inexpensive food industry applies a
framework known as Online Ordering System to help their business forms. Internet Ordering
System is a procedure that enable client to arrange their preferred sustenance online by means
of the web by utilizing an internet browser that introduced in their separate PC or PDA.
Actualizing this framework can help inexpensive food industry to take care of the issue that
they face while utilizing the customary nourishment requesting forms.

The framework extraordinarily disentangles the nourishment requesting process for both
client and eatery contrast with the past. The client can put in a request all over the place and
anyplace at whatever point web association is accessible for them. Clients access to the site
and pick the sustenance that they incline toward from the online menu show then clients need
to pick whether the sustenance is conveyed to them or it will be bundled for pick up and the
instalment technique will be upon conveyed or get and ultimately it will demonstrate all the
request subtleties to the client for twofold checking and affirmation.

4
Then again, the framework likewise enormously relieves the work burden on the café's end.
When clients have put in a request by means of the web, the information will send to the café
database and spot in a line continuously. Likewise, the information will be show on the PC
screen alongside the relating choice. It permits café worker effectively deal with the requests
consecutively, produce the vital thing with a negligible deferral and help diminish human
blunder.

Figure 1 Context Level Data Flow Diagram of Online Order System

2.2 Components of Food Ordering Systems

These are complete Information Technology subsystems that reserve the spot Information
System operational; they are good in nature and the failure of one part may influence the task
of the others with in the system. They comprise of PC assets, information, individuals, and
procedures utilized in the modern business enterprise.

2.2.1 Hardware

O'Brien (2001) characterizes hardware as individual physical gadgets and material utilized in
data processing. In particular, it incorporates machines like computers as well as information
media that is every single substantial item on which information are recorded from sheets of
paper to magnetic disk. Others incorporate keyboard, mouse, printers, scanners and so forth.

5
2.2.2 Software

Rochester (1996) attest that software incorporates all information processing instructions and
it contains various sorts of programs that empower the hardware to carryout various
assignments. Software is additionally arranged into system software and Applications
software. System software is concerned with keeping the computer system working while
Application software is the general purpose or written for a specific task like stock control. It
may be written using a programming language or more general purpose piece of software
such as database.

2.2.3 Data

Rochester (1996) defined data as all the raw and unprocessed facts that can be used easily.
Cleary Without information, no database system can exist. The fundamental factor is based
on the handling requirements of an organization and data requirements. Data elements and
relationships must be defined precisely and the definitions in the data dictionary must be
recorded accurately.

2.2.4 Procedures

These are set of guidance about how to join the above components so as to process the data
and produce the ideal yield. They comprise of the route how to sign on to the DBMS,
utilization of various structures and controls all through the task.

2.2.5 People

According to O’Brien (2001), these are required for the operation of all information systems.
They include end-users and information system specialists. End-users are people who use an
Information System. They include system analysts, programmers, computer operators and
others. People, are probably the component that most influence the success or failure of
information systems

2.2.6 Database

The Database Management System (DBMS) is a software package intended to describe,


manipulate, collect and handle information in a database, according to techopedia.com

6
(2016).
A DBMS generally manipulates the data itself, the data format, field names, record structure
and file structure. It also lays down guidelines for validating and manipulating this
information. A DBMS relieves users of information maintenance framing programs. Query
languages of the fourth generation, such as SQL, are used to communicate with a database
together with the DBMS package. In addition, the Database Management System (DBMS) of
the IBM Corporation is essentially nothing more than a computerized data-keeping system.
DBMS is also a set of related software applications that provide a systematic way for end-
users and application programmers to create and manage databases.

Database consumers use Data Definition Languages (DDL) and Data Manipulation
Languages (DML) through database management systems to indicate their demands to the
database. The database management system will certainly provide an interface between the
programs of the user and the database content. During the creation and subsequent
maintenance of the data base contents, the DML and the DDL are used for the following, add
new files, increase the database, delete the absolute records, adjust data, and increase the
database capacity, connect the data items and many others.

2.3 E-Commerce

Electronic commerce or e-commerce according to Garret (1996) is the exchange of goods and
services by means of the internet or other computer networks. Buyers and vendors operate on
networked pcs in ecommerce. Electronic commerce also uses communication networks to
share company data, maintain company relationships and conduct company operations. It
involves business-to-business relationships, customer-to-customer relationships, as well as
business-to-customer relationships. Business-to-business segment presently dominates e-
commerce, while customer-oriented segment lags considerably behind and present estimates
place it at less than 10% of complete volume, although all are experiencing exponential
development (Vladimir, 1998). E-commerce provides comfort to buyers. They can visit
various vendors ' World Wide Web (www) sites 24/7 to compare rates and create purchases
without having to leave their homes or offices.

7
E-commerce provides vendors a way of cutting expenses and expanding their markets. They
don't have to construct employees or keep a shop or print and distribute the catalogue of mail
order. Sellers have the ability to market their products or services worldwide because they
sell over the worldwide internet and are not restricted by a store's physical place.

However, e-commerce also has some drawbacks. Customers are unwilling to purchase online
certain products. For instance, online furniture companies have mostly failed because clients
want to test the convenience of a costly product like a sofa before buying it.

Many people are also considering shopping for a social experience, such as going to a shop or
shopping mall with friends or family, an experience they cannot get online. It is also
important to reassure customers that credit card transactions are secure and that their privacy
is respected.

E-commerce not only expands the choice of products and services for clients, but also creates
fresh and compelling businesses established business to develop internet strategies.

2.4 Types of Food Ordering System

i. Market place online Ordering system


This is where most restaurant owners start. Deliveroo, EatNow, Menulog, Uber Eats,
Foodpanda etc. are marketplace ordering systems. These platforms can be considered
similar to those such as eBay and Etsy. Generally speaking, these companies will first
reach you. You will be able to upload your menu online and start accepting orders
immediately. They also promote and market large amounts to drive traffic to their
website to generate sales for their stores.
These services will start with most restaurant owners but soon come to this realization
and start looking for alternative solutions. That said, though it's not a bad thing at all.
Ideally, with all the marketing that these companies do, they can generate some new
customers you might not have had otherwise.
ii. Self-Service/Self-Ordering In Restaurant
In the restaurant sector, self-service or self-ordering relates to the restaurant taking
client orders by implementing various kinds of techniques such as the internet and
many others. Self-service or self-ordering is effective when applied to restaurants in

8
many other nations. Most investors have been shown to profit from the use of self-
service or self-demanding technology.

Odesser-Torpey (2008) has been saying that most Americans hate waiting for an order.
Consequently, they prefer self-service technology that can be in the form of phone calls, text
messaging, web and kiosk. The client usually prefers self-service in ordering and transaction
while minimizing miscommunication due to velocity and comfort. He also stated that to order
innovation, self-activated terminals are more probable to be used in the future. Implementing
alternative ordering can improve the size of the check, free counter personnel to serve clients,
and remove cash handling from the service equation.

Bhatnagar (2006) stated that the kiosk innovation and the computerized table top ordering
screen will force the restaurant sector to re-jigger the restaurant with a frequently used
acronym of quick service restaurant. Customers can search for recipes or receive data from
the internet and kiosk. The internet and kiosk also place orders and receive credit card or
debit card payment. As a consequence, erroneous order and lengthy queue can be avoided,
order employees can be arranged elsewhere and concentrate on accelerating shipping orders.
On the other side, a table-top touch screen order scheme can take orders from customers and
manage other requests from customers such as refill beverages, call a waiter, and pay by
credit card and debit card.

Bytes, a Canterbury-based restaurant has been effectively standing apart from rivals due to
internet self-service ordering and payment concepts being applied. The scheme used in Bytes
enables clients to place an order via the touch screen and the order is directed to the bar or
kitchen. The system also provides games after orders are placed by a client while clients will
be supplied with internet access in the future. The ordering of the touch screen decreases the
waiter's need. The system also offers customer habits and preferences database, generates
management reports, performs assessment, and enables for instant updating of the menu.
(Brickers from 2006).

The online food ordering scheme can be applied to fast food restaurants in Nigeria based on
research. This is because the scheme can enhance effectiveness in the workplace, boost
restaurant revenues and decrease improper ordering. As a consequence, investing in the
scheme is worthwhile, allowing it to shorten the return on investment.

9
The scheme should also be backed by the taste and services of food origin to keep the
allegiance and satisfaction of the clients. Widespread implementation of the food ordering
scheme, however, can trigger the influx of labor due to the removal of waiters in the
restaurant sector. Even the scheme is essential to implement, but there is still some danger in
other variables, such as a notion of direct interaction and restaurant design, to be regarded in
order to ensure the system's achievement.

Gan (Gan, 2002) suggested developing an internet fast-food restaurant ordering scheme that
would enable clients to place orders anywhere at any time. The system enables client order
management and promotion advertising. It enables kitchen employees to view data about
ordering, management of fast food raw materials and employees to search for data about
client shipment and profile. This system helps decrease queue problems during peak hours,
accelerate food preparation and boost quantities of customers. As a consequence, fast food
restaurant's market share can be increased and improves the investor's return on investment.

De Leon (De Leon, 2008) stated that a good internet food ordering scheme should include
several elements. System should be easy to navigate, not clustered, and easy to order
(Sharma, 2007), designed with experts looking to optimize the capacity of the search engine
and accessible 24 hours. Also, the system should have a secure payment gateway to safeguard
credit card data for their clients, quickly and readily maintain track of orders and sales history
and produce a detailed sales report (Sharma, 2007).

2.5 Types of Information System

Information System is a combination of people, hardware, and software, devices of


communication, network and data resources that process data and information for a specific
purpose (can be stored, retrieved, transformed information). The characteristics are;

2.5.1 Transaction Processing System (TPS)

This is a computerized system that performs and records routine daily transactions necessary
for business conduct. TPSs are information systems that process data resulting from business
transactions occurring. Example: system of payroll; instructions for production.

10
2.5.2 Management Information System (MIS)

These relate primarily to internal information sources. MIS usually collects and summarizes
data from transaction processing systems into a series of management reports. MIS therefore
provides information for an organization's management. MIS information helps managers
monitor the organization and direct it.

2.5.3 Decision-Support Systems (DSS)

These are specifically designed to assist management in making decisions in situations where
there is uncertainty about the potential outcomes of those decisions. DSS includes tools and
techniques to assist in collecting relevant information and analysing options and alternatives.
DSS often involves using complex tablets and databases to create Finley et al "what - if"
models.

2.5.4 Executive Support System (ESS)

This is intended to assist senior management in making strategic decisions. It collects


analyses and summarizes the business ' key internal and external information. A good way to
think about an ESS is to imagine the senior management team in an aircraft cockpit with the
instrument panel showing them the current status of all the key business activities. Usually,
ESS involves lots of data analysis and modelling tools such as analysing "what-if" to help
make strategic decisions. Stair, (1996).

2.6 Advantages of Food Ordering Systems

i) Convenience; One advantage of ordering food online, is the convenience. Being able to
make all your orders on the Internet means you can do it any time of the day or night at
home, or while you are on your lunch break at the office. Customers on the go can even make
orders on their smartphones or tablets. There is no need for lengthy phone calls or visits to a
restaurant, with just a few minutes and a click of the mouse, you will have all your food
ordered and delivered. Diane, (1993).

ii) Enhanced productivity: Errors are reduced and your customers have a hassle free
ordering system. Workers can continue with their designated jobs with no distractions.
Workers can focus on customers in your restaurant and ensure they have the best service.

11
iii) Simplicity: It's very handy. The food will be ordered, supplied and eaten. There is no
struggle in the house to remember ingredients or try to pore over recipes and create lists of
foodstuffs. Food distribution systems are ideal for busy people who have no time every week
to shop. Food delivery systems are also beneficial for those who, like the elderly or the
disabled, cannot get out of the house to shop.

2.7 Limitations of Food Ordering System

i) Live Help: when you order food online, you usually can’t ask a live person questions about
ingredient used in cooking the food, the day the food was cooked, or anything else you're
concerned about.

ii) Limited Menu: The menu decisions are another disadvantage for food distribution
technologies. The food ordering system deliver a restricted amount of dishes. The menu will
change every few weeks or months, but if you stick to the system for more than a few
months, the menu items will be repetitive.

iii) Hidden Fees: Many food ordering sites advertise low rates to attract your attention, and
then add fees and surcharges for a much less competitive deal.

12
CHAPTER THREE

RESEARCH METHODOLOGY

3.1 Introduction

The methodology process, techniques, tool that were used to attain the specific objective of
the Food ordering system. The development was based on the water fall model. It involved
the requirement determination, requirement analysis, system design, implementation, testing
and validation. The approach below describes the sequence of steps involved.

Figure 3.1: Software Development Life Cycle

3.2 System Analysis and Study

This was carried out on the existing system. It helped in showing the down side of the
existing system. The methods I used to collect information about the existing system is
shown below.

3.2.1 Oral Interview


The data collection interview technique can be described as a systematic manner of gathering
data or information from a respondent by requesting questions straight from the respondent

13
and also gathering information for understanding purposes. The oral interview was conducted
between the Mountain Top University (MTU) investigator and student. Reliable facts have
been obtained based on the question posed to the students by the researcher which help the
researcher in starting the work and also helped in the area of solution presentation of the new
design.

3.2.2 Study of Manuals


Manuals and reports were acquired and studied based on fast food facilities and a lot of data
was acquired about the scheme to be manufactured.

3.2.3 Evaluation of Forms


Some needed and accessible forms have been obtained. These include the fast food order type
of the restaurant menu, etc. These elements contributed to the design of the new scheme

3.3 The Existing System

The current scheme turns out to be a non-computerized operating system if all activities are
performed manually by the waiter carrying paper and the customer's order is taken down or
ordered over the counter. This leads to errors because the waiter may not comprehend what
the client had ordered to serve a distinct menu for him / her. This might be so awkward
because of the customer might not take it lightly with the waiter which may lead to
misunderstanding.

3.4 Problem of Existing System

Because the fast food restaurants use manual means, it is very hard to meet the customers '
requirements and wishes. Most of the issues are:
1. Mistakes are produced when customer
2. Orders are placed. The method of purchasing order from clients is very tedious. This
makes delivering products on time impossible.
3. It leads to incomprehension between clients and staff.

14
4. The system of record keeping is poor. Consequently, losses of essential documents were
recorded in the past. In addition, protecting the file system from unauthorized access is a
defiled solution issue.
5. There is a waste of unnecessary time transmitting data through the authority ladder.
Management is sometimes looking for a copy of the customer’s order form and this may take
a lot of time to obtain it.

6. It causes reduction of production flow.

These are the major problems facing the existing system and would be corrected with the
help of the proposed system.

3.5 Objectives of the Proposed System


The suggested scheme is created to handle fast-food restaurant ordering operations. It enables
record orders submitted by the client. To help the business process of the restaurant to
achieve the goals, the scheme should contain the following features:

1. To enable the client to place an order, view the order and make adjustments before
submitting their order and enable them to create payment by credit card or debit card.
s
2. To provide a promotional and menu-enabled interface.
3. To avoid interface that displays details of customer orders to front-end and kitchen
staff to deliver customer orders s
4. Tools that produce reports that can be used to make decisions
5. A tool that allows the management to modify the food information such as price, add
a new menu and many others as well as tools for managing user, system menu and
promotion records.

3.6 Justification for the New System


The new system's aim is to tackle all the issues that plague the current system. This scheme
will automatically or interactively analyse and store data. It's going to use PHP-MYSQL.
This will be like this: a report is produced through the monitor that conforms to the specific
information the management needs. This will involve the input of needed information and
fast food ordering and delivery recording, and then a report will be produced.

15
There will also be some other characteristics of the suggested scheme such as:

1. Accuracy of information handling


2. The quantity of paper job is going to be decreased considerably.
3. Fast rate of operation as in the availability and delivery of the ordered food on time.
4. Flexibility (that is, at any moment it can be accessed).
5. In case of data loss.
6. Easy way to back up or duplicate information in CDs. Better system for storage and
quicker recovery.
7. Errors in the reports will be minimized considerably.

3.7 Requirements Determination

The requirement assurance included the accumulation of data about how the framework
ought to work. The prerequisites assurance action was the most troublesome piece of
frameworks examination. It included assembling and reporting of the genuine and genuine
prerequisites for the framework being created. In here the scientist was fundamentally
thinking and endeavouring to address the inquiry,

"What should the framework do?" This data was utilized to recognize the users‟ necessities
and the framework details.

3.7.1 Requirements Analysis

The essential objective of this stage was to make a point by point Functional Specification
characterizing the full arrangement of framework abilities to be actualized, alongside going
with information and procedure models representing the data to be overseen and the
procedures to be upheld by the new framework

It included examination of the gathered information. Models, for example, Data Flow
Diagrams (DFD) and Entity Relationship Diagrams (ERD's) were utilized to show individual
procedures and information separately. Under here necessities were delegated useful and non-
functional prerequisites, the assurance and examination of necessities helped the specialist to
accomplish his second target.

16
3.8 Output Design

This demonstrated the utilization of framework hypothesis to item advancement by


characterizing the engineering, segments, modules, interfaces and information for a
framework to fulfil determined necessities. The objective of configuration stage was not
simply to create a structure for the framework; rather it was to locate the most ideal plan
inside the impediments forced by the prerequisites and the physical just as the social
advancement in which the framework was to work Stair.

The yield configuration procedure was partitioned into sensible, applied and physical
structure. In Logical structure; the sensible model of the framework was created
demonstrating all the indispensable advances the framework improvement experienced. Here,
the specialist utilized case apparatuses like stream graphs and information stream charts.
Theoretical structure was a depiction of the proposed framework as far as a lot of coordinated
thoughts and ideas about what it ought to do, carry on, and resemble, that was justifiable by
the clients in the way expected. The Physical structure was the physical acknowledgment of
coherent plan. Tables, structures and reports were made and connections characterized among
these tables and security compels set amid the physical plan the specialist made an
interpretation of the normal mappings into real database structures. In here the analyst
accomplished his third target.

3.9 System Implementation

This included assembling or building different components of a framework for instance


MySQL for database Xampp Server for facilitating the site pages. This is the phase wherein
the genuine framework was perceived. The specialized engineering characterized in the
structure stage was the gauge for building up the framework. The interface product structured
utilizing HTML and Java content dialects. This is on the grounds that these dialects gave
gigantic agreeable UIs; that is anything but difficult to learn and reasonable. The database
was planned in MYSQL basing on Xampp Server programming. MYSQL gives an abnormal
state of security to the database, that is, confirmation which can either be amid the signing in
to the database or on DML directions, for example, erase, include or even alter, it additionally
diminishes repetition. In here the specialist accomplished his fourth target.

17
3.10 Input Design

This was the input acknowledgment of input structure. Tables, structures and reports were
made and connections characterized among these tables and security compels set. Amid the
physical plan the scientist made an interpretation of the schemas into genuine database
structures and as of now, he needed to outline:

 Entities to tables.
 Relationship to foreign key constraints.
 Attribute to column primary unique identifiers to primary key constraints.
 Unique identifier to unique key constraint.
 Attributes to columns.

3.11 System Testing

This included testing the framework so as to address blunders or expel abandons that
rose. This stage included testing the source code to ensure that it delivered the normal and
wanted outcomes when exposed to a lot of predefined conditions. It was subdivided into
three noteworthy stages, that is, unit trying, framework testing and client
acknowledgment testing

Under unit testing, specific parts of the source code were tested. Emphasis was put on the
website database connections to ensure that information sent by a user from the web page
form reaches the systems database. System testing involved putting the entire software
to test in order to find out whether or not the functional requirements of the system had
been efficiently and effectively integrated and satisfied

Finally, User acceptance testing was done; this was a key factor for the success of the
system performance. The system under consideration was tested for user acceptance by
constantly keeping in touch with the system users that is, the airline customers and staff.

3.12 Database Structure

The system was used by different customers to order food and different food stands to
update food menu. And indeed the orders were reserved and food were delivered on time.
This helped to achieve his last objective.

18
Table 3.1: ADMIN TABLE

Column Name Data Type Nullable Size


Admin_id Int No 12

Name Varchar Yes 100

Username Varchar Yes 60

Password Varchar Yes 60

Email Varchar Yes 100

Last_login Datetime Yes 60

Role Varchar Yes 60

Status Tinyint Yes 1

Table 3.2: CUSTOMER TABLE

Column Name Data Type Nullable Size

Customer_id Int No 1

Name Varchar Yes 100

Address Varchar Yes 100

Email Varchar Yes 60

Contact Varchar Yes 60

Password Varchar Yes 60

19
Table 3.3: FOOD TABLE

Column Name Data Type Nullable Size

Food_id Int Yes 11

Categoryid Int Yes 11

Foodname Varchar Yes 100

Foodprice Double Yes 100

Foodimage Varchar Yes 255

Created_by Varchar Yes 100

Created_date Datetime Yes

Updated_by Varchar Yes 100

Updated_date Datetime Yes

Order_id Int No 11

Table 3.4: ORDER TABLE

Column Name Data Type Nullable Size

Order_id Int Yes 11

Quantity Int Yes 11

Food_id Int Yes 11

Order_date Datetime Yes

20
Customer_id Int Yes 11

Table 3.5: CATEGORY TABLE

Column Data Type Nullable Size


Name

Category_id Int Yes 11

Categoryname Varchar Yes 250

Created_by Varchar Yes 255

Created_date Datetime Yes

Updated_by Varchar Yes 200

Updated_date Datetime Yes

21
CHAPTER FOUR

SYSTEM DESIGN, ANALYSIS AND IMPLEMENTATION

This segment portrays the tools that were utilised to create and actualise the framework.
These incorporate the context diagram, level zero, and one data flow chart. These apparatuses
helped in designing the framework and concocting the fundamental idea and rationale of the
framework. When data frameworks improvement advanced to the design activities, the
researcher who was in the meantime frameworks examiner and software engineer
concentrated on the inquiry, "How does the framework do what it should do.

4.1 System Design Objectives

The Food Ordering System is a software application to assist to assist restaurant with
transaction related to making food reservation, which includes buying food, and delivering it
to the required destination. From the view point the food ordering system provides the
following

1. The system should increase the rate of sales in the cafeteria.

2. The system should make it easy for customers to check the menu and know the total
amount of food.

3. The system should decrease the queue in the cafeteria.

4. The system should maintain customer information in case of emergency.

5. The system should reduce effort of frustration for customers in getting food.

The system has been developed on the following requirements;

22
4.2 Functional Requirements

The following requirements were captured for the intended use of the system.

1. User account: The registered user can directly do the ordering of food and if there is
a new user he/she have to register or he only sees the login and registration page.
2. Creation of new user account: When there is a new customer he should fill the form
containing field like Name, Address, and Matric No.., and also Email address and
Password.
3. Checking Availability: To check the available food, the user should scan or check
through the menu list.
4. Ordering of Food: After providing all information the system will ask user for
confirmation. After confirming the information, the food will be ordered.

4.3 Non-Functional Requirements

The application was designed to fulfil the following non-functional requirements.

1. Performance Requirements: Performance of the system is dependent on the


bandwidth of the internet and also the hardware itself.
2. Security Requirements: There is only one authorized person who can see the
confidential Information. The information of the customer is only available for the
administrator.
3. Software Quality Attributes: The system is user friendly, interoperable and flexible

4.4 Database Design

Attributes and data types, as well as the relationships among them were defined basing on the
user requirements. It also involves the construction of a suitable data model for the system.

23
4.4.1 Entities

a. Customer
The person getting food from the restaurant (online platform).
b. Category details
The categories of food available for purchase.
c. Food
The details of the available food.
d. Order details
The details of the food order and the customer details.
e. Admin
Information about

Figure 4.1 showing the data base logical design for a food ordering system

24
4.4.2 Table Attribute Description (Physical Design)

Table 4.1: showing Admin details

Column Name Data Type Nullable Size


Admin_id Int No 12

Name Varchar Yes 100

Username Varchar Yes 60

Password Varchar Yes 60

Email Varchar Yes 100

Last_login Datetime Yes 60

Role Varchar Yes 60

Status Tinyint Yes 1

Table 4.2: showing customer details table

Column Name Data Type Nullable Size

Customer_id Int No 1

Name Varchar Yes 100

Address Varchar Yes 100

Email Varchar Yes 60

Contact Varchar Yes 60

Password Varchar Yes 60

25
Table 4.3: Showing food table details

Column Name Data Type Nullable Size

Food_id Int Yes 11

Categoryid Int Yes 11

Foodname Varchar Yes 100

Foodprice Double Yes 100

Foodimage Varchar Yes 255

Created_by Varchar Yes 100

Created_date Datetime Yes

Updated_by Varchar Yes 100

Updated_date Datetime Yes

Order_id Int No 11

Table 4.4: Showing order details

Column Name Data Type Nullable Size

Order_id Int Yes 11

Quantity Int Yes 11

Food_id Int Yes 11

Order_date Datetime Yes

Customer_id Int Yes 11

26
Table 4.5: Showing categories of food details

Column Data Type Nullable Size


Name

Category_id Int Yes 11

Categoryname Varchar Yes 250

Created_by Varchar Yes 255

Created_date Datetime Yes

Updated_by Varchar Yes 200

Updated_date Datetime Yes

4.5 System Implementation

The Food ordering system (FOS) provides the following types of easy-to-use, interactive, and
intuitive graphical and telephonic interfaces.

i. The FOS provides an easy-to-use, intuitive Graphical User Interface (GUI) as part of
the Administrator’s working desktop environment.

ii. The FOS also provide an interactive Graphical User Interface, for the general
customers.

The system working scenario is as follows:

i. The customer should register himself/herself in order to see the menu list and order
food as well.

ii. The customer will need to input all the required particular details during the
registration process.

27
iii. Upon successful login, the customer will be registered officially to the web service
and he can login using his username and password.

4.5.1 SYSTEM USERS ADMINISTRATOR

This is the person charged with responsibility of updating System Content

Login/Logout

Add/delete/Modify/
Food details

Add/delete/Modify/
Category details

Administrator View all ordered food

Figure 4. 2 Administrator use case diagram

28
Customer (Registered user)

The person who accesses the system from the user point of view

Home page

Login & register

Order food

Customer or end user


View menu

Figure 4. 3 Customer use case diagram

4.5.2 Hardware Platform

The implementation requirements depend on the system specifications. These are the
hardware and software requirements that the system runs on. The system supports all Pentium
III clients and above computers, operating systems, Linux, Windows NT, Mac with 512 MB
of RAM, at least 10GB of hard disk space and a 550 MHZ of the processor speed.

4.5.3 Software Platform

The client computer must have internet connectivity to have access to the web server through
TCP/IP. The system should be installed on any server computer running on either Linux or
windows architecture. The server should have at least 10 GB of RAM and I Terabyte of
storage space and running on processor speed of at least 10 GHz.

4.5.4 System Execution Sequence

This is divided into two, User’s environment and Administrator environment

29
4.5.4.1 User’s Environment

a) Welcome Page

This appears when the URL of Chop-easy is typed in any browser. While on this page
customers are required to register or login.

Figure 4.4 showing the home page a food ordering system

30
b) User Dashboard

After a successful login the customer is being directed to the user dashboard section where
the user can view the menu list and also order food and log out.

Figure 4.5 showing the user dashboard for the food ordering system

31
c) Order List

This section shows the list of previously and currently ordered food. It contains the list of the
ordered food as well as the amount spent for each food on the menu, it also contains the
quantity of the particular meal purchased and the date and time of purchase.

Figure 4.6 showing the order list for the food ordering system

32
d) Logout page

When the user clicks on the logout button, he or she is redirected back to the home page.

Figure 4.7 showing the logout page for the food ordering system

33
4.5.4.2 Administrator Environment

This is restricted environment; it is used by the administrator to change system content. It’s
accessed by clicking on administrator link on the system menu. Access to this environment
requires an admin password. Once the correct admin password is entered the person will have
access to modify/ delete and all control of the system.

e) Administrator Password Interface

Figure 4.8 showing the administrators food ordering system

34
f) Administrators Home Interface

This is the administrator’s home interface; it’s accessed when a correct admin password is
entered in the interface above. Once on this interface the administrator can add category, edit
food details, add food price, update menu list, upload food pictures, change database
passwords and control every aspect of the system.

Figure 4.8 showing the administrator’s login food ordering system

35
g) Add Category Interface

This interface is used by the administrator to add category of food in the system. categories
added here can then available for ordering by the customer. In here the administrator can add
a new category or update an existing category.

Figure 4.10 showing the add new food category page for the food ordering system

36
h) Add Food Interface

This form is used by the administrator to add food to the menu list to the system. Food added
here is displayed to the user menu list, and available for ordering by the customer. In here the
administrator can add the food name, or food category, price and the administrator can also
upload images of the food.

Figure 4.11 showing the page to add food to the menu list food ordering system

37
i) Food List

This interface is used by the administrator to update the food on the menu list added food as
well as delete food from the menu list.

Figure 4.12 interface showing the menu list of the food ordering system

38
Figure 4.13 showing the page to edit food item food ordering system

39
j) Order Information Interface

This interface is used by the administrator to view ordered food. This interface gives a record
of what has been ordered, the customer that ordered and the time the user ordered.

Figure 4.14 showing the ordered list food ordering system

40
CHAPTER FIVE

SUMMARY, CONCLUSION AND RECOMMENDATION

5.1 Summary

After studying the method involved in student ordering food in Mountain Top University
(MTU), it was discovered that this method is associated with many problems. A new system
was developed to overcome some of the major problems. The new system was built using the
water fall model and was coded in visual studio code environment, using major web
development languages HTML, CSS and JavaScript for the development of the frontend and
PHP and MySQL for the backend and database management. Also the web app was tested to
ensure smooth operation of the new system

5.2 Conclusion

Before modern computing, the ordering system was done using manual means. This meant
that a person about to order had to spend a lot of unnecessary time waiting in queues in order
to food from the cafeteria. The manual process of ordering was also prone to human errors,
which lead to a lot of dissatisfaction amongst customers. Nowadays competition is so fierce
between restaurants that there are lot of discounts and a lot of luxuries given to customers that
will give an edge to that particular restaurant. The online food ordering system automates
these processes of ordering food online, thus reducing the time wasted as well as the errors
that are involved in the manual process. People will argue that online ordering system are
expensive, and create unfair competition between other restaurants that don’t have them.
From the researchers view, online food ordering system is one the best innovation that has
taken place in the restaurant company and those companies that have not yet embraced online
food ordering system ought to lose out, they may sight, additional costs, maintenance cost
and the cost of development as their drawbacks but as Henry R. Luce, put it "Business is a
continuous dealing with the future, more than any other occupation ; it is a continuous
calculation, an instinctive exercise in foresight". World Wide Web and the Internet is here
and restaurant companies for the future will seize this opportunity develop online food
ordering system and prosper.

41
5.3 Recommendations

The researcher recommends the following about the system:

• The researcher recommends that the administrators and staff should be trained on how
to use the system, thus enabling them to understand the functionality of the entire
system.

• More research on this system is required to fully identify and eliminate some of the
weaknesses and integrate it with banks to enable online payment

i. There is need for the system upgrade as user’s requirements change. User
requirements differ with time, therefore, it is of great help for the system to be flexible
enough.

ii. Other researchers can use this project report as a basis during future study of food
ordering system.

iii. Owing to the ease and comfort of Food Ordering Systems, local restaurant which are
not on the system should be encouraged to compensate the system.

iv. The framework should be produced affordable to promote patronization of the


scheme by customers

v. However, a lot of system access is protected by a username and password, the entire
computer system should be shielded from unauthorized individuals in order to prevent
misuse and system component harm.

vi. Users should closely select distinctive usernames and very powerful passwords to
prevent system safety breaches, so they should not have brief passwords, using the
names of their colleagues or families as passwords.

vii. In case of hardware or software malfunction, backups should be done frequently to


avoid data loss.

5.4 Limitations to Study

i. Time Constraints.

ii. Scarcity of previous works

42
References

Anderson, R.G. (1978), “Data processing and Management Information Systems”


McDonald and Evans Ltd.

Bhatnagar, P. (2006, march 28). Dinning Trends: self-service=Quick-service.

Brickers, J. (2006, July 24). Is Fast Casual Self-Service at the Tripping Ponit?

De Leon, E. (2008, August 23). Best Online Food Ordering System. Restaurant Checklist.

Diane (1993) Computer Reservation Systems: “Action Needed to Better Monitor the CRS
Industry and Eliminate CRS Biases”, DIANE Publishing Company.
ISBN1568069774

Gan, C.C. (2002). Online Fast Food Restaurant Ordering Systems.

Henry R. Luce (2001) “The Rise of the American News Media” The Johns Hopkins
University Press (July 12, 2001)

Hobbs, N. (2004, march 26). Restaurant Customer Ordering.

Kapchnaga, R, (2014). Food Ordering System Using Mobile Phone (Doctoral dissertation,
UTAR).

Kroc, Ray (1977). Grinding it out: The Making of McDonald’s. Chicago: Contemporary
Books.

Nathaniel, R., Bashe, C. J., Oaks, M. R., Crago, R. P., Fox, P. E., Haddad, J. A., & Phelps,
B. E. (1966). U.S. Patent No. 3,245,039. Washington, DC: U.S. Patent and
Trademark Office.

O'Brien, Jerraya, A. A., K., & Ismail, T. B. (2001). Linking system design tools and
hardware design tools. In Computer Hardware Description Languages and their
Applications (pp. 345-351). North-Holland.

Purname, J., & Wibowo, A.Y. (2007). Wireless Application for Ordering Management
System in a Restaurant.

43
Sharma, I. (2007, June 22). How Online Food Ordering System helps you run more
efficiently.

Stair, A. T. (1996). MSX design parameters driven by targets and backgrounds. Johns
Hopkins Apl Technical Digest, 17(1), 11.

Techopedia.com.(2017). database.m[online]https://www.techopedia.com/definition/1185/d
atabase-db.

44
Appendix

Source Code for food ordering system

REGISTRATION AND LOGIN

<?php
session_start();
if(isset($_SESSION['id']) ){
header("Location:dashboard.php");
die();
}

if(isset($_SESSION['admin'])){
header("Location:admin-cp.php");
die();
}
?>
<!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">
<meta support="Niush" domain=".tk" status="live">
<title>Chop-easy</title>
<link rel="stylesheet" href="dist/css/bootstrap.min.css">
</head>
<body >
<div class="container">
<br/>
<h1>Chop-easy</h1>
<hr/>

<?php
if(isset($_GET['user']) && $_GET['user'] == 'off'){
?>
<div class="alert alert-warning" role="alert">
User Logged Out.
</div>
<?php } ?>

<?php
if(isset($_GET['login'])){
?>
<div class="alert alert-danger" role="alert">
Login Error !!
</div>
<?php } ?>

45
<?php
if(isset($_GET['register'])){
if($_GET['register'] == 'success'){
?>
<div class="alert alert-success" role="alert">
Register Successful !! Login to Continue.
</div>
<?php
}else{
?>
<div class="alert alert-danger" role="alert">
Registration Failed !!
</div>
<?php
}
}
?>
<?php
if(isset($_GET['email'])){
if($_GET['email'] == 'taken'){
?>
<div class="alert alert-danger" role="alert">
Opps. Email already used !!!
</div>
<?php
}
}
?>

<div class="container">
<div class="row">
<div class="col-sm">
<div class="card">
<div class="card-header">
<h4>Login</h4>
</div>

<div class="card-body">
<form id="login" action="logincheck.php" method="POST">
<div class="form-group">
<label for="email">Email: </label>
<input type="text" class="form-control" placeholder="Email"
id="email" name="email" required/>
</div>

<div class="form-group">
<label for="password">Password: </label>

46
<input type="password" class="form-control"
placeholder="Password" id="password" name="password" required/>
</div>

<input class="btn btn-success" type="submit" value="Login"/>


</form>
</div>

<div class="card-footer">
<a href="admin.php">Login as Admin ?</a>
</div>
</div>
</div>

<div class="col-sm">
<div class="card">
<div class="card-header">
<h4>Register as a new Customer:</h4>
</div>

<div class="card-body">
<form id="register" action="registercheck.php" method="POST">
<div class="form-group">
<label for="name">Name: </label>
<input type="text" class="form-control" placeholder="Full
Name" id="name" name="name" required/>
</div>

<div class="form-group">
<label for="address">Hostel: </label>
<input type="text" class="form-control" placeholder="Hostel"
id="address" name="address" required/>
</div>

<div class="form-group">
<label for="contact">Matric Number: </label>
<input type="text" class="form-control" placeholder="Matric
Number" id="contact" name="contact" required/>
</div>
<div class="form-group">
<label for="email">Email: </label>
<input type="text" class="form-control" placeholder="Email"
id="email" name="email" required/>
</div>
<div class="form-group">
<label for="password">Password: </label>
<input type="password" class="form-control"
placeholder="Password" id="password" name="password" required/>
</div>

47
<input class="btn btn-success" type="submit"
value="Register"/>
</form>
</div>
</div>
</div>
</div>
</div>

</div>

<br/>
<div class="card-footer">
<h4>&copy; Chop-easy</h4>

</div>
</body>
</html>

REGISTRATION CHECK

<?php
require 'database.php';

$name=isset($_POST['name']) && !empty(trim($_POST['name'])) ?


htmlspecialchars(trim($_POST['name'])):null;
$address=isset($_POST['address']) && !empty(trim($_POST['address'])) ?
htmlspecialchars(trim($_POST['address'])):null;
$contact=isset($_POST['contact']) && !empty(trim($_POST['contact'])) ?
htmlspecialchars(trim($_POST['contact'])):null;
$email=isset($_POST['email']) && !empty(trim($_POST['email'])) ?
htmlspecialchars(trim($_POST['email'])):null;
$password=isset($_POST['password']) && !empty(trim($_POST['password'])) ?
md5(trim($_POST['password'])):null;

//echo $name.$username.$password;

if($password != null && $email != null && $name != null && $address != null
&& $contact != null){
$select_query = "SELECT * FROM tbl_customer WHERE email='${email}'";
$search_user = $db->query($select_query);
$search_result = $search_user->fetch_assoc();

if($db->affected_rows > 0){


header("Location: index.php?register=taken&email=exist");
die();

48
}

$insert_query = "INSERT INTO


tbl_customer(name,email,address,contact,password)
VALUES('${name}','${email}','${address}','${contact}','${password}')";
$insert_user = $db->query($insert_query);

if($db->affected_rows > 0){


header("Location:index.php?register=success");
}else{
header("Location:index.php?register=failed");
die();
}
}else{
header("Location:index.php?register=failed_empty");
die();
}
$db->close();
?>

LOGIN CHECK
<?php
require 'database.php';

$email=isset($_POST['email']) && !empty(trim($_POST['email'])) ?


htmlspecialchars(trim($_POST['email'])):null;
$password=isset($_POST['password']) && !empty(trim($_POST['password'])) ?
md5(trim($_POST['password'])):null;

if($password !== null && $email !== null){


$select_query = "SELECT * FROM tbl_customer WHERE email='${email}' AND
password='${password}'";
$search_user = $db->query($select_query);
$search_result = $search_user->fetch_assoc();

if($db->affected_rows > 0){


$user_id = $search_result['customer_id'];
$email = $search_result['email'];
$name = $search_result['name'];
$address = $search_result['address'];
session_start();
$_SESSION['id']=$user_id;
$_SESSION['name']=$name;
$_SESSION['email']=$email;

49
$_SESSION['address'] = $address;

header("Location: dashboard.php");
die();
}else{
header("Location:index.php?login=failed");
die();
}
}else{
header("Location:index.php?login=failed_empty");
die();
}
$db->close();
?>

CHECK ORDER

<?php
require 'database.php';

$food_id=isset($_POST['food_id']) && !empty(trim($_POST['food_id'])) ?


htmlspecialchars(trim($_POST['food_id'])):null;
$customer_id=isset($_POST['customer_id']) &&
!empty(trim($_POST['customer_id'])) ?
htmlspecialchars(trim($_POST['customer_id'])):null;
$quantity=isset($_POST['quantity']) && !empty(trim($_POST['quantity'])) ?
trim($_POST['quantity']):null;
$orderdate = date('Y-m-d H:i:s');

//echo $name.$username.$password;

if($quantity != null && $customer_id != null && $food_id != null){


$insert_query = "INSERT INTO tbl_order
(quantity,food_id,orderdate,customer_id)
VALUES('${quantity}','${food_id}','${orderdate}','${customer_id}')";
$insert_order = $db->query($insert_query);

if($db->affected_rows > 0){


header("Location:dashboard.php?order=success");
}else{
echo mysqli_error($db);
die();
header("Location:dashboard.php?order=failed");
die();
}
}else{
header("Location:dashboard.php?order=failed_empty");
die();
}

50
$db->close();
?>

DASHBOARD
<?php
require 'database.php';

session_start();
if(!isset($_SESSION['email']) && !isset($_SESSION['id']) ){
header("Location:index.php?login=failed");
die();
}

if(isset($_SESSION['admin'])){
header("Location:admin-cp.php");
die();
}
?>

<!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">
<meta support="Niush" domain=".tk" status="live">
<title>Admin Dashboard</title>
<link rel="stylesheet" href="dist/css/bootstrap.min.css">
</head>
<body>
<br/>
<div class="container">
<h4>Welcome, <?=$_SESSION['name'];?></h4>

<div class="row">
<div class="col-sm">
<h4>User Dashboard</h4>
</div>
<div class="pull-right col-l">
<a href="vieworder.php" class="btn btn-success">View Orders</a>
<a href="logout.php"><button class="btn btn-danger">Logout</button></a>
</div>
</div>
<hr/>

<?php
if(isset($_GET['order'])){
if($_GET['order'] == 'success'){

51
?>
<div class="alert alert-success" role="alert">
Order Successfully Placed !!
</div>
<?php
}else{
?>
<div class="alert alert-danger" role="alert">
Order Failed !!
</div>
<?php
}
}
?>

<?php
$select_query = "SELECT tbl_food.food_id, tbl_food.foodname,
tbl_food.foodprice, tbl_food.foodimage, tbl_category.categoryname FROM
tbl_food JOIN tbl_category WHERE tbl_food.categoryid =
tbl_category.category_id ORDER BY categoryid";
$search_posts = $db->query($select_query);
?>

<div class="card-footer">
<h2>Food List</h2>
</div>
<table class="table">
<thead class="thead-light">
<tr>
<th scope="col">Name</th>
<th scope="col">Category</th>
<th scope="col">Price</th>
<th scope="col">Image</th>
<th scope="col">Quantity</th>
<th scope="col">Order</th>
</tr>
</thead>
<tbody>
<?php
while($search_result = $search_posts->fetch_assoc()){
echo '<form action="ordercheck.php" method="POST">';
echo '<tr>';
echo '<td>';
echo '<input type="hidden" name="food_id" value="'.
$search_result['food_id'] .'">';
echo '<input type="hidden" name="customer_id" value="'.
$_SESSION['id'] .'">';
echo $search_result['foodname'];

52
echo '</td>';

echo '<td>';
echo $search_result['categoryname'];
echo '</td>';

echo '<td>';
echo $search_result['foodprice'];
echo '</td>';

echo '<td>';

if($search_result['foodimage'] != null){

?>
<img src="<?=$search_result['foodimage']?>" width="120px"/>
<?php
}else{
echo 'NULL';
}
echo '</td>';

echo '<td>';

?>

<input type="number" name="quantity" value="1" min="1">


<?php
echo '</td>';

echo '<td>';

?>
<input class="btn btn-success" onclick="return confirm('Place The
Order ?');" type="submit" value="Order">
</form>
<?php
echo '</td>';

echo '</tr>';
}
?>
</tbody>
</table>

<br/>
<div class="card-footer">
<h4>&copy; Chop-Easy</h4>

53
</div>
</body>
</html>

54

You might also like