PHP Bus Booking System
Overview
The PHP Bus Booking System is a web-based application designed to streamline the process of booking bus tickets online. The system aims to provide users with a simple and efficient way to search for bus schedules, reserve seats, and manage bookings. Administrators can manage bus routes, schedules, and reservations seamlessly.
This system is built entirely using PHP, ensuring a dynamic and robust backend for managing the booking process.
Features
User Features
- Search Bus Schedules: Users can search for available buses based on routes and schedules.
- Seat Selection: Interactive seat selection for booking.
- Online Booking: Reserve and confirm bus tickets in a few clicks.
- Booking Management: View, update, or cancel bookings.
- Email Notifications: Receive booking confirmation and updates via email.
- Responsive Design: Accessible on both desktop and mobile devices.
Admin Features
- Bus Management: Add, update, or delete bus details.
- Route Management: Define and manage routes and schedules.
- Booking Management: View and manage all customer bookings.
- Reporting: Generate reports on bookings, routes, and schedules.
Tech Stack
- Language: PHP (100%)
- Database: MySQL (for storing booking data, user details, bus schedules, etc.)
- Frontend: HTML, CSS, and JavaScript (for responsive and interactive design)
- Email API: PHP mailer for sending email notifications.
Prerequisites
To run the system, ensure the following software is installed:
- PHP (>=7.4): For running the backend.
- MySQL: Database for managing data.
- Web Server: Apache or Nginx.
- Composer: For managing PHP packages and dependencies (optional but recommended).
Installation and Setup
1. Clone the Repository
git clone https://github.com/karimshaban01/booking_system.git
cd booking_system
2. Configure the Database
- Create a new database in MySQL:
sql CREATE DATABASE bus_booking_system; - Import the database schema:
- Locate the
bus_booking_schema.sqlfile in the repository. - Import it into your MySQL database:
bash mysql -u your_username -p bus_booking_system < bus_booking_schema.sql
- Locate the
- Update the database credentials in the configuration file:
php // Example: config/DatabaseConfig.php $DB_HOST = 'localhost'; $DB_NAME = 'bus_booking_system'; $DB_USER = 'your_username'; $DB_PASSWORD = 'your_password';
3. Set Up the Web Server
- Place the repository in your web server's root directory:
- For Apache:
/var/www/html/booking_system - For Nginx:
/usr/share/nginx/html/booking_system
- For Apache:
- Start the web server:
bash sudo service apache2 start
4. Run the Application
- Open your browser and navigate to
http://localhost/booking_system.
File Structure
Here’s an overview of the key directories and files in the repository:
booking_system/
├── index.php # Main entry point for the application
├── admin/ # Admin panel for managing the system
│ ├── buses.php # Bus management
│ ├── routes.php # Route management
│ ├── bookings.php # Booking management
├── user/ # User-facing application
│ ├── search.php # Search for buses
│ ├── booking.php # Booking functionality
│ ├── confirmation.php # Booking confirmation
├── assets/ # CSS, JavaScript, and image files
├── config/ # Configuration files (database, email settings)
├── bus_booking_schema.sql # Database schema
├── README.md # Documentation
└── LICENSE # License information
Usage
For Users
- Search for Buses: Enter the desired route and date to find available buses.
- Select Seats: Choose your preferred seats from the available options.
- Confirm Booking: Enter your details and confirm the booking.
- Manage Booking: Use the booking ID to view, update, or cancel your reservation.
For Admins
- Log In: Access the admin panel using your credentials.
- Manage Buses: Add, edit, or delete bus details.
- Manage Routes: Define and update bus routes and schedules.
- View Bookings: Monitor and manage customer bookings.
- Generate Reports: Download reports for operational insights.
Contribution Guidelines
We welcome contributions to improve the system. Here's how you can contribute:
- Fork the repository.
- Create a new branch:
bash git checkout -b feature-name - Make your changes and commit them:
bash git commit -m "Description of changes" - Push the changes to your fork:
bash git push origin feature-name - Create a pull request to the
mainbranch.
License
This project is licensed under the MIT License.
Support
If you encounter any issues or have suggestions for improvement, feel free to:
- Open an issue in the GitHub Issues section.
- Contact me directly via email or through the contact form on the application.
Built With
- hack
Log in or sign up for Devpost to join the conversation.