A web-based hotel booking system based on Deliverable 1 by Mouad Ben lahbib (300259705).
- User-friendly interface for searching and booking hotel rooms
- Multi-criteria search filters (Dates, Capacity, Area, Chain, Rating, Price, etc.)
- Customer registration and login
- Customer booking management (view bookings)
- Employee portal with separate login
- Employee functionalities:
- Check-in guests (convert booking to renting)
- Direct room rental without prior booking
- CRUD operations for Hotel Chains, Hotels, Rooms, Employees, Customers (limited), Contacts
- Dashboard displaying key information and database views
- Responsive design
- PHP (Tested on 8.x)
- MySQL (Tested on 5.7+ / MariaDB 10.x+)
- Apache (or compatible web server like Nginx)
- HTML5, CSS3, JavaScript (ES6)
- Bootstrap 5.3
- Font Awesome 6
- PDO for database connections
Tested Environment:
- Windows OS
- XAMPP (with Apache, MariaDB/MySQL, PHP 8.x)
Prerequisites:
- XAMPP installed and running (Apache & MySQL services started).
- A web browser.
Steps:
-
Place Project Files:
- Copy the entire
eHotelsproject folder (excluding the.gitandnon_submissiondirectories if present) into your XAMPP'shtdocsdirectory (typicallyC:\xampp\htdocs\).
- Copy the entire
-
Configure Database Connection:
- Open the file
config/database.phpusing a text editor. - Ensure the variables match the default XAMPP MySQL settings:
private $host = '127.0.0.1'; // Or 'localhost' private $db_name = 'ehotels'; // You will create this database name private $username = 'root'; // Default XAMPP username private $password = ''; // Default XAMPP password is empty
- (If your XAMPP MySQL uses a different username or password, update accordingly.)
- Save the
config/database.phpfile.
- Open the file
-
Create Database via phpMyAdmin:
- Open your web browser and go to
http://localhost/phpmyadmin. - Click on the "Databases" tab.
- In the "Create database" field, enter the database name specified in
config/database.php(e.g.,ehotels). - Select
utf8mb4_unicode_cias the collation. - Click "Create".
- Open your web browser and go to
-
Import Schema & Data via phpMyAdmin:
- In phpMyAdmin, click on the database name you just created (e.g.,
ehotels) in the left-hand sidebar. - Click on the "Import" tab near the top.
- Under "File to import", click "Browse..." or "Choose File".
- Navigate to the
eHotels/sql/directory inside yourhtdocsfolder. - Import the following files one by one, in this exact order:
- Select
database_schema.sqland click "Go" (or "Import"). Wait for success. - Click "Import" again, select
database_population.sql, and click "Go". Wait for success. - Click "Import" again, select
create_views.sql, and click "Go". Wait for success. - Click "Import" again, select
create_indexes.sql, and click "Go". Wait for success. - Click "Import" again, select
triggers.sql, and click "Go". Wait for success.
- Select
- Note: Ensure each import completes successfully before proceeding to the next.
- In phpMyAdmin, click on the database name you just created (e.g.,
-
Access the Application:
- Open your web browser and navigate to the project directory URL.
- Example: If you placed the folder as
eHotelsinhtdocs, the URL will likely behttp://localhost/eHotels/orhttp://127.0.0.1/eHotels/.
-
Login Credentials (from population script):
- Customer: Please use the registration page to create a customer account.
- Employee: Please use the registration page to create an employee account.
/config- Database configuration/css- Stylesheet files/employee- PHP files for employee-specific functionality/hotel- PHP files for hotel management/hotel_chain- PHP files for hotel chain management/images- Image assets/includes- Common PHP components (header, footer)/js- JavaScript files/sql- Essential SQL setup files (database_schema.sql,database_population.sql,create_views.sql,create_indexes.sql,triggers.sql)index.php- Main entry point / homepagelogin.php- User login pagelogout.php- User logout scriptmy_bookings.php- Customer booking view pageprocess_booking.php- Handles the booking submissionREADME.md- This fileregister.php- Customer registration pagesearch.php- Room search page
- The application uses sessions to manage user login state.
- Error messages should appear at the top of the page if issues occur.
- Database errors are logged to the PHP error log.
- Mouad Ben lahbib (300259705)
This application is based on a database design project by Mouad.
All Rights Reserved.