Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 37

``

Table of Contents
1.0 Introduction:..............................................................................................................................1

1.1 Objective:...............................................................................................................................1

1.2 Scope:....................................................................................................................................1

2.0 Assumptions:.............................................................................................................................1

2.1 Single Restaurant:..................................................................................................................1

2.2 Web-based Application:........................................................................................................1

2.3 Internet connectivity:.............................................................................................................2

2.4 Secure Payments:...................................................................................................................2

2.5 Appropriate Authentication:..................................................................................................2

2.6 Valid Data Input:...................................................................................................................2

2.7Adequate Stock Data:.............................................................................................................2

2.8 Delivery Staff Availability:...................................................................................................2

2.9 Staff and Customer Privacy:..................................................................................................3

2.10 Hardware and Software Prerequisites:.................................................................................3

2.11 Regular Data Backups:........................................................................................................3

2.12 Local rules and Regulations:...............................................................................................3

3.0 Pseudocode and flowchart:........................................................................................................3

3.1 Pseudocode:...........................................................................................................................3

3.2 Flow Chart:..........................................................................................................................12

4.0 Programing Concepts with the source code:...........................................................................12

4.1 Functions:............................................................................................................................12

4.2 Conditional Statements:.......................................................................................................12

4.3 Loops:..................................................................................................................................12

4.4 File Handling:......................................................................................................................12


4.5 User Input and Output:........................................................................................................12

4.6 Lists and Strings:.................................................................................................................13

4.7 Error Handling:....................................................................................................................13

4.8 Data Validation:...................................................................................................................13

4.9 Random Number Generation:..............................................................................................13

4.10 Menu System:....................................................................................................................13

4.11 Modularity:........................................................................................................................13

5.0 Additional features source code with explanation:..................................................................14

5.1 Staff Password Encryption:.................................................................................................14

5.2 Staff Role and Privileges:....................................................................................................16

5.3 Category and Item Removal:...............................................................................................17

5.4 Order Timestamp:................................................................................................................19

6.0 Input & Outputs.......................................................................................................................21

6.1 Main Screen:........................................................................................................................21

6.2 Admin Screen:.....................................................................................................................22

6.3 Add Category:......................................................................................................................23

6.4 Add Item Category-wise:.....................................................................................................24

6.5 Display All Records:............................................................................................................25

6.6 Add Staff:.............................................................................................................................26

6.7 Delete Staff:.........................................................................................................................27

6.8 Delivery Staff Login:...........................................................................................................28

6.9 View and Select Order for Delivery:...................................................................................29

6.10 Customer login:.................................................................................................................30

6.11 Register a New Customer:.................................................................................................31

7.0Conclusion:...............................................................................................................................32
7.1 Summery:.............................................................................................................................32

7.2 Acknowledgments:..............................................................................................................32

References:....................................................................................................................................33

1.0 Introduction:
The internet Ordering Management System (OOMS) is a piece of software created to make
managing internet orders for restaurants and other businesses easier. The system intends to make
managing many components of the ordering process easy and smooth for administrators,
delivery personnel, and consumers.

1.1 Objective:
The Online Ordering Management System's goal is to simplify the order management process by
facilitating rapid and accurate order processing, handling payments, and monitoring order
fulfilment. The system aims to increase the company's operational effectiveness while also
improving the overall client experience.

1.2 Scope:
The following features are included in the OOMS's scope:

 Administrators may handle staff member information, track orders, manage client
payments, and manage categories and goods.
 Delivery personnel may see and choose orders for delivery, change delivery statuses, and
gather customer feedback.
 Customers may explore product categories and products, place orders, pay for them, and
check the progress of their orders.

2.0 Assumptions:
2.1 Single Restaurant: A single restaurant or other similar food company is the target
market for the online ordering management system. It makes the assumption that each institution
would have its own unique set of features and data management.
2.2 Web-based Application: The system anticipates that its user interface will be accessed
online. Users will communicate with the system using a typical web browser, including
administrators, delivery personnel, and consumers.

2.3 Internet connectivity: In order to access and utilize the Online Ordering Management
System efficiently, users are expected to have a reliable internet connection.

2.4 Secure Payments: In order to guarantee the security and privacy of client payment
information, the system presupposes that payment processing will be carried out through external
payment gateways or APIs in a secure manner.

2.5 Appropriate Authentication: The system presupposes that each user will have a
special login ID and password to access their individual accounts. There will be adequate
authentication procedures in place to prevent unauthorized access.

2.6 Valid Data Input: When users place orders, update delivery statuses, or carry out any
other operations, the system expects that they are providing valid and suitable data input. To
reduce mistakes and guarantee data integrity, sufficient data validation mechanisms will be put in
place.

2.7Adequate Stock Data: The system presupposes that the restaurant will keep up-to-date
records of its stock levels for each item. It is believed that stock availability will be verified when
consumers submit purchases in order to avoid overselling.
2.8 Delivery Staff Availability: It is anticipated that the restaurant will have delivery
personnel on site to handle delivery requests. The system depends on delivery personnel to
coordinate deliveries and update order statuses.

2.9 Staff and Customer Privacy: The system is based on the premise that staff and
customer data will be handled with the utmost discretion and won't be shared or revealed without
the appropriate authorization or in compliance with legal requirements.

2.10 Hardware and Software Prerequisites: The system presupposes that the hardware
and software resources needed to operate the program will fulfil the minimal requirements to
guarantee seamless functioning.

2.11 Regular Data Backups: The system anticipates that routine data backups will be
carried out in order to prevent data loss in the event of unanticipated system failures or accidents.

2.12 Local rules and Regulations: It is believed that all local rules and ordinances
pertaining to data protection, payment processing, and online business operations will be
complied with by the restaurant and the Online Ordering Management System.

3.0 Pseudocode and flowchart:


3.1 Pseudocode:
# Import required modules

import datetime

import random

# Define symbolic constants for file names


CATEGORY_FILE = "categories.txt"

ITEM_FILE = "items.txt"

CUSTOMER_FILE = "customers.txt"

ORDER_FILE = "orders.txt"

PAYMENT_FILE = "payments.txt"

DELIVERY_FILE = "deliveries.txt"

STAFF_FILE = "staff.txt"

# Function to handle administrator login

function admin_login():

input admin_username

input admin_password

if admin_username == "admin" and admin_password == "admin":

print "Admin login successful."

call admin_menu()

else:

print "Invalid username or password."

# Function to display the admin menu

function admin_menu():

while true:

print "Admin Menu"

print "1. Add Category"


print "2. Add Item Category-wise"

print "3. Modify Item"

print "4. Display Orders"

print "5. Display Payments"

print "6. Display Items"

print "7. Display Categories"

print "8. Add Staff"

print "9. Delete Staff"

print "10. Logout"

input choice

if choice == 1:

call add_category()

else if choice == 2:

call add_item()

else if choice == 3:

call modify_item()

else if choice == 4:

call display_orders()

else if choice == 5:

call display_payments()

else if choice == 6:
call display_items()

else if choice == 7:

call display_categories()

else if choice == 8:

call add_staff()

else if choice == 9:

call delete_staff()

else if choice == 10:

print "Logged out from admin menu."

break

else:

print "Invalid choice. Please try again."

# Function to add a new category

function add_category():

input category_name

if category_exists(category_name):

print "Category already exists."

else:

write category_name to CATEGORY_FILE

print "Category added successfully."

# Function to check if a category already exists


function category_exists(category_name):

open CATEGORY_FILE as file

for each line in file:

if line.strip() == category_name:

return true

return false

# Function to add a new item

function add_item():

input category_name

input item_name

input item_price

input item_stock

if category_exists(category_name):

write item details to ITEM_FILE

print "Item added successfully."

else:

print "Category does not exist."

# Function to modify an item

function modify_item():

input item_name
input new_price

input new_stock

if item_exists(item_name):

read items from ITEM_FILE

for each item in items:

if item name matches item_name:

update item price and stock

write updated items to ITEM_FILE

print "Item modified successfully."

return

else:

print "Item does not exist."

# Function to check if an item exists

function item_exists(item_name):

open ITEM_FILE as file

for each line in file:

item_parts = line.strip().split(",")

if item_parts[1] == item_name:

return true

return false
# Function to display all categories

function display_categories():

open CATEGORY_FILE as file

for each line in file:

print line.strip()

# Function to display all items

function display_items():

open ITEM_FILE as file

for each line in file:

item_parts = line.strip().split(",")

if len(item_parts) == 4:

category = item_parts[0]

name = item_parts[1]

price = item_parts[2]

stock = item_parts[3].strip()

print "Category:", category, "Name:", name, "Price:", price, "Stock:", stock

else:

print "Invalid item format:", line.strip()

# Function to display all orders

function display_orders():

open ORDER_FILE as file


for each line in file:

order_parts = line.strip().split(",")

print "Order ID:", order_parts[0], "Customer Name:", order_parts[1], "Delivery Address:",


order_parts[2], "Order Status:", order_parts[3]

# Function to display all payments

function display_payments():

open PAYMENT_FILE as file

for each line in file:

payment_parts = line.strip().split(",")

print "Order ID:", payment_parts[0], "Payment Amount:", payment_parts[1]

# Function to add a new staff member

function add_staff():

input staff_id

input staff_password

if staff_id_exists(staff_id):

print "Staff ID already exists."

else:

write staff details to STAFF_FILE

print "Staff member added successfully."


# Function to check if a staff ID already exists

function staff_id_exists(staff_id):

open STAFF_FILE as file

for each line in file:

staff_parts = line.strip().split(",")

if staff_parts[0] == staff_id:

return true

return false

# Main program loop

while true:

display_menu()

input choice

if choice == 1:

call admin_login()

else if choice == 2:

call staff_login()

else if choice == 3:

call customer_login()

else if choice == 4:

call register_customer()

else if choice == 5:
print "Thank you for using the Online Ordering Management System. Goodbye!"

break

else:

print "Invalid choice. Please try again."

3.2 Flow Chart:

4.0 Programing Concepts with the source code:


4.1 Functions: Functions are blocks of code that perform a specific task. In the code, we can
see multiple functions like admin_login(), add_category(), add_item(), etc. Each function
serves a specific purpose, making the code more organized and modular.
4.2 Conditional Statements: Conditional statements are used to make decisions in the code
based on certain conditions. The if and else statements are used in functions like admin_login()
and modify_item() to check conditions and perform different actions accordingly.

4.3 Loops: Loops are used to repeat a block of code multiple times. In the code, we have a
while loop that serves as the main program loop. It keeps the program running until the user
chooses to exit.

4.4 File Handling: The program uses file handling to read and write data from/to text files.
Functions like category_exists(), add_category(), item_exists(), etc., use file handling to check
for existing data and update data in the files.

4.5 User Input and Output: The code utilizes user input to gather information and user
choices. Functions like input() and print() are used to interact with the user.

4.6 Lists and Strings: Lists and strings are used to store and manipulate data. For example,
order details are stored as comma-separated strings in the ORDER_FILE, and the code uses
string splitting to extract and process this data.

4.7 Error Handling: While the code does not explicitly show error handling, real-world
programs would include mechanisms to handle errors and exceptions gracefully. This can
prevent the program from crashing and provide more meaningful error messages to users.
4.8 Data Validation: The code contains some basic data validation checks, like checking if a
staff ID or category already exists before adding new data. This prevents duplicate entries and
maintains data integrity.

4.9 Random Number Generation: The random module is used to generate a random
number for creating a unique order ID.

4.10 Menu System: The code demonstrates how to create a simple menu system using a
while loop and if-else statements. Users can select options from the menu to perform various
tasks.

4.11 Modularity: The code is organized into functions, each serving a specific purpose. This
follows the principle of modularity, which makes the code easier to understand, maintain, and
debug.
5.0 Additional features source code with explanation:
5.1 Staff Password Encryption:
Modify the `add_staff()` function and `validate_staff_credentials()` function to encrypt and
decrypt staff passwords using a secure hashing algorithm like SHA-256.

import hashlib

# Function to add a new staff member

def add_staff():

staff_id = input("Enter staff ID: ")

staff_password = input("Enter staff password: ")

# Encrypt the staff password

encrypted_password = hashlib.sha256(staff_password.encode()).hexdigest()

if staff_id_exists(staff_id):

print("Staff ID already exists.")

else:

# Append the new staff member to the staff.txt file with encrypted password

with open(STAFF_FILE, "a") as file:

file.write(staff_id + "," + encrypted_password + "\n")

print("Staff member added successfully.")

# Function to validate staff credentials


def validate_staff_credentials(staff_id, staff_password):

# Encrypt the input password for comparison

encrypted_password = hashlib.sha256(staff_password.encode()).hexdigest()

with open(STAFF_FILE, "r") as file:

staff_records = file.readlines()

for record in staff_records:

record_parts = record.strip().split(",")

if record_parts[0] == staff_id and record_parts[1] == encrypted_password:

return True

return False

```
5.2 Staff Role and Privileges:
Add staff role and privileges to distinguish between administrators and delivery staff. Modify
the `add_staff()` function to include a staff role as an additional input.

# Function to add a new staff member with role and privileges

def add_staff():

staff_id = input("Enter staff ID: ")

staff_password = input("Enter staff password: ")

staff_role = input("Enter staff role (1 - Admin, 2 - Delivery Staff): ")

# Encrypt the staff password

encrypted_password = hashlib.sha256(staff_password.encode()).hexdigest()

if staff_id_exists(staff_id):

print("Staff ID already exists.")

else:

# Append the new staff member to the staff.txt file with encrypted password and role

with open(STAFF_FILE, "a") as file:

file.write(f"{staff_id},{encrypted_password},{staff_role}\n")

print("Staff member added successfully.")

5.3 Category and Item Removal:


Add the ability to delete categories and items. Modify the `delete_category()` and
`delete_item()` functions accordingly.
# Function to delete a category

def delete_category():

category_name = input("Enter the category name to delete: ")

# Check if the category exists

if category_exists(category_name):

updated_categories = []

with open(CATEGORY_FILE, "r") as file:

categories = file.readlines()

for category in categories:

if category.strip() != category_name:

updated_categories.append(category)

with open(CATEGORY_FILE, "w") as file:

file.writelines(updated_categories)

print("Category deleted successfully.")

else:

print("Category does not exist.")

# Function to delete an item

def delete_item():
item_name = input("Enter the item name to delete: ")

# Check if the item exists

if item_exists(item_name):

updated_items = []

with open(ITEM_FILE, "r") as file:

items = file.readlines()

for item in items:

item_parts = item.strip().split(",")

if item_parts[1].strip() != item_name:

updated_items.append(item)

with open(ITEM_FILE, "w") as file:

file.writelines(updated_items)

print("Item deleted successfully.")

else:

print("Item does not exist.")

5.4 Order Timestamp:


Add a timestamp to each order when it is placed. Modify the `place_order()` function to
include the order timestamp.

import datetime
# Function to place an order

def place_order():

customer_name = input("Enter your name: ")

delivery_address = input("Enter your delivery address: ")

items = []

while True:

item_name = input("Enter the item name (or 'done' to finish): ")

if item_name.lower() == "done":

break

else:

items.append(item_name)

order_id = generate_order_id()

order_status = "Pending"

order_timestamp = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")

# Write the order details to the orders.txt file

with open(ORDER_FILE, "a") as file:

order_data = f"{order_id},{customer_name},{delivery_address},{order_status},
{order_timestamp},{','.join(items)}\n"

file.write(order_data)
# Update the stock quantity in the items.txt file

# ... (existing code for updating stock)

print("Order placed successfully.")


6.0 Input & Outputs
6.1 Main Screen:
The Online Ordering Management System's (OOMS) main screen acts as the system's entry
point and offers users three login choices based on their roles: admin, delivery staff, and
customer. To access their allocated functionality, users are required to input their appropriate
credentials. When a user logs in, the home page changes into a menu interface with choices
specific to their function in the system, like adding categories and goods, managing orders and
delivery, making payments, and more. From this point, users may easily access the capabilities
of the system, supporting the effective administration of online orders, payments, and delivery.
6.2 Admin Screen:
The Online Ordering Management System's Admin Menu offers a wide range of choices and
features that are only available to administrators. The menu displays a number of tasks after a
successful admin login, including controlling order deliveries, adding staff members, deleting
staff members, adding new categories, adding items to existing categories, changing item
information, showing all records, finding a specific record, and displaying all records. Each
choice does a specific administrative duty, giving administrators the ability to effectively manage
the data, categories, goods, personnel, and orders in the system. The Admin Menu guarantees
administrators have complete control over the essential features of the platform, enabling
simplified operations and improved organization.
6.3 Add Category:

Administrators can add new categories for goods in the system by using the "Add Category"
feature of the Online Ordering Management System. The administrator logs in using their
credentials and goes to the admin menu to start the procedure. The administrator is requested to
input the name of the new category after choosing the "Add Category" option. To prevent
duplication, the system then determines whether the category already exists. The "categories.txt"
file, which acts as the database for category information, is added with the category if it is not
already there. A success message that states the category has been added successfully is shown.
This function makes categorising objects into various groups easier and allows for both
improved system administration and navigation.
6.4 Add Item Category-wise:
The Online Ordering Management System's "Add Item Category-wise" function lets
administrators add new goods while assigning them to particular categories. The administrator
enters the category name, item name, item price, and item stock while utilising this function. The
system then checks to see if the requested category already exists before adding the new item to
the items.txt file and assigning it to the requested category. Customers' browsing and selection
processes are made easier thanks to the procedure, which makes sure that things are
appropriately arranged inside their respective categories. The system improves the overall
effectiveness of organising and displaying the available products by correlating things with
categories, improving the online ordering process for both customers and delivery personnel.
6.5 Display All Records:

The "Display All Records" feature in the Online Ordering Management System provides
administrators with a comprehensive view of various records stored within the system. When
selected from the admin menu, the system presents a sub-menu with options to display orders,
payments, items, categories, and an option to go back to the main admin menu. Each option
allows the administrator to access specific information related to the corresponding record type.
For example, the "Display Orders" option lists all the orders made by customers, showing details
such as order ID, customer name, delivery address, order status, and the items ordered. Similarly,
the "Display Payments" option shows a list of all payments made by customers, displaying the
corresponding order ID and payment amount. The "Display Items" and "Display Categories"
options provide administrators with an overview of all available items and categories, including
their respective details like name, price, and stock quantity. The option to "Go Back" allows the
administrator to return to the main admin menu, enabling them to perform further tasks and
efficiently manage the online ordering system. The "Display All Records" feature offers valuable
insights into the system's data, enabling administrators to monitor and maintain various records
effectively.
6.6 Add Staff:
An essential component of the Online Ordering Management System that enables administrators
to add new staff members to the system is the "Add Staff" tool. The system first asks the
administrator to input the staff ID and staff password before moving on with adding staff. In
order to prevent duplication, the system then checks to see if the staff ID already exists in the
database. The system continues by adding the new employee's information, including the staff ID
and password, to the "staff.txt" file, which acts as the staff data storage medium, if the staff ID is
unique. In order to prevent unauthorized users from tampering with staff data, the "Add Staff"
prewire makes sure that only authorized administrators may access this function with the
appropriate login credentials.
6.7 Delete Staff:
Administrators can delete staff members from the Online Ordering Management System by
using the "Delete Staff" option. An admin must enter the staff ID of the employee they desire to
delete in order to start the deletion procedure. The system initially checks the staff records to see
if the staff ID is there. The system updates the staff.txt file by deleting the appropriate staff
member's entry from the list of staff if the staff ID is located. The system then shows a success
message indicating that the employee has been successfully removed. The system will produce
an error warning if the specified staff ID does not match any records that already exist and that
staff ID does not exist. By limiting access to authorized administrators and preserving data
integrity throughout the deletion process, the "Delete Staff" prewire assures the correct operation
and security of the system.
6.8 Delivery Staff Login:
utilizing their own staff ID and password, delivery staff members may log in to the Online
Ordering Management System (OOMS) utilizing the delivery staff login option. The delivery
crew may monitor and choose orders for delivery, update delivery statuses, and collect customer
feedback after successfully logging in. These functions are suited to their position. The login
credentials are checked against the staff records kept in the "staff.txt" file to guarantee security
and data integrity. The staff ID and password supplied are checked against the staff records
already in existence by the system using the "validate_staff_credentials" function. The delivery
crew is given access to the Delivery Crew Menu if the credentials match, allowing them to
effectively handle their allocated orders and alter order statuses. Only authorized delivery
workers are able to access the assigned functionality since the system gives suitable feedback in
the event of erroneous or invalid credentials.
6.9 View and Select Order for Delivery:
Delivery staff members can access and examine a list of pending orders that are prepared for
delivery using the "View and Select Order for Delivery" option in the Online Ordering
Management System. Delivery personnel may examine the order data, including the order ID,
client name, delivery address, and order status, after logging in with their staff credentials. With
the help of this tool, delivery personnel may effectively manage their delivery schedule and
allocate themselves to particular orders to complete. The delivery employee accepts
responsibility for the order's delivery to the consumer by choosing it. Additionally, the system
makes sure that delivery crew only sees pending orders, allowing them to concentrate only on
those that need immediate attention. The tool improves overall order fulfilment efficiency and
streamlines the delivery process, resulting in a smooth and successful online ordering experience
for both consumers and delivery personnel.
6.10 Customer login:
Registered clients can access their accounts by entering their username and password in the
Customer Login section of the Online Ordering Management System. Customers that
successfully log in have access to personalized features including seeing available categories and
goods, placing purchases, processing payments, and looking over previous transactions. Input
validation occurs during the login process to guarantee the validity of credentials and the safety
of user accounts. When customers are requested to do so, they must provide their login and
password. The system then compares this data to the records of the already registered customers.
The system gives access to the customer's dashboard and displays the available alternatives if the
submitted credentials match. When a user enters incorrect credentials, the system notifies them
of the issue and asks them to try again. By providing a personalized and secure platform for users
to make orders and manage their online purchasing habits, this feature improves the user
experience.
6.11 Register a New Customer:
People can create new customer accounts in the Online Ordering Management System by using
the "Register a New Customer" option. Users must register with a distinct username and a strong
password in order to use this service. After a successful registration, the system securely
maintains the user's login information for subsequent logins. With the help of this tool, new
clients may enjoy an individualised and simple ordering procedure where they can see the
available categories and goods, place orders, make payments, and quickly monitor their orders.
In order to provide a quick and easy purchase procedure for new customers, the "Register a New
Customer" function improves the overall user experience and fosters client interaction with the
online platform.
7.0Conclusion:
7.1 Summery:
Users can connect with an online ordering platform using the Online Ordering Management
System (OOMS), a complete program. Administrators, delivery personnel, and consumers may
all handle different facets of the online ordering process using the system's features. With their
unique login information, users may manage staff members, manage item categories and items,
place orders, pay for them, and update the status of their orders, among other activities.

The system was created with security in mind, and sensitive data is protected by employee
password encryption. In order to distinguish between administrators and delivery personnel, staff
roles and rights have also been added, guaranteeing proper access control.

The simple management of categories and objects enables administrators to create new
categories and items as well as delete existing ones as needed. Delivery personnel may see
orders, choose which ones to deliver, check the status of deliveries, and collect customer
feedback. Customers may easily log in, examine the categories and products that are offered,
place orders, and pay for their purchases.

7.2 Acknowledgments:

We would like to thank everyone who helped with the creation of the Online Ordering
Management System. A special thank you to the development team for their devotion and labor
of love in producing a system that works and is easy to use. We also appreciate the input and
assistance from our users and stakeholders, which enabled us to enhance and improve the
system.

We also want to express our gratitude to the open-source community for supplying helpful tools
and libraries that facilitated the integration of different system elements.
Finally, we would like to express our gratitude to the mentors and project managers who
provided us with advice and encouragement during the development process. Their knowledge
and experience were crucial in creating the current system.

References:

You might also like