Author: Dylan Holmwood
Student Number: D21124331
Date: 14, December 2023
Module: Open-source Software (OSSW4604)
Lecturer: Dr. Ali Malik
This project implements a simple web application for ordering sandwiches online. Users can customize their sandwiches by selecting bread, filling, toppings, and condiments. The order details are processed using PHP and stored in a MariaDB database using SQL.
- Homepage (index.html)
- Order Confirmation (process_order.php)
- Styles (styles.css)
- Technologies Used
- File Structure
- Usage
- Database Setup
- Known Issues
- Acknowledgments
- Contact Information
- Project Status
The index.html
file serves as the homepage for TUD Sandwich Shop. Users can submit sandwich orders through a form. The form captures details such as customer name, choice of bread, filling, toppings, and condiments.
The process_order.php
file handles form submissions from index.html
. It retrieves user preferences, calculates the order total using PHP, and stores the details in a MariaDB database using an SQL statement.
The styles.css
file provides styling for HTML pages, ensuring a visually appealing and responsive design.
- HTML: Used for structuring the webpage and capturing user input.
- CSS: Responsible for styling and ensuring a user-friendly interface.
- PHP: Powers the server-side logic for processing orders.
- MariaDB: A relational database management system storing order details.
- SQL: Utilized to create and manage the database schema.
|-- index.html |-- process_order.php |-- styles.css |-- tud_logo.png
- Create a MariaDB database named
TUD_Sandwich_Shop
. - Execute the SQL script in
database.sql
to set up necessary tables. - Use the following SQL statement to create the table and necessary fields: -- Table structure for the 'orders' table CREATE TABLE orders ( id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), bread VARCHAR(50), filling VARCHAR(50), topping VARCHAR(50), condiment VARCHAR(50), price DECIMAL(5, 2) );
- Open
index.html
in a web browser. - Complete the sandwich order form.
- Submit the form to place an order.
- Orders with special characters may not be processed correctly.
- Users cannot select more than one topping/condiment (option to select more should be added).
- User cannot see how much the sandwich will cost until submit the form.
- Thanks to Dr. Ali Malik for guidance.
For questions or issues, contact D21124331@mytudublin.ie
This project is actively maintained.