# Bus Ticket Booking Website
A full-fledged **Bus Ticket Booking System** built using **PHP**, **Apache**, and **MySQL**, designed to streamline the process of booking bus tickets online. This application provides separate modules for both **users** and **administrators**, ensuring a complete and dynamic booking experience.
---
## ✨ Key Features
### For Users:
- **Search Buses**: Enter source, destination, and travel date to view available buses.
- **Select Seats**: Choose from available seat numbers visually.
- **Book & Pay**: Proceed with the booking and confirm via a simulated payment gateway.
- **Download Tickets**: Receive a downloadable ticket with booking details post-payment.
### For Admin:
- **Add/Edit Buses**: Add new buses, update or remove existing ones.
- **Manage Schedules**: Set routes, dates, and available seats.
- **Special Trips**: Add extra buses for holidays, festivals, or special events.
- **Monitor Bookings**: View all ticket bookings and track system activity.
---
## 🛠️ Tech Stack Used
| Layer | Technology |
|--------------|--------------------------|
| Frontend | HTML, CSS, JavaScript, Bootstrap |
| Backend | PHP |
| Database | MySQL |
| Server | Apache (via XAMPP/LAMP) |
| Others | PHPMyAdmin |
*Bootstrap is used for responsive and modern UI components, while JavaScript adds interactivity, such as seat selection and form validations.*
---
## 📂 Project Structure
/bus-ticket-booking/ ├── index.php # Landing page ├── user/ │ ├── search.php # Bus search page │ ├── book.php # Booking process │ ├── seat_selection.php # Choose seats (JS for interactivity) │ └── ticket.php # View/download ticket ├── admin/ │ ├── dashboard.php # Admin dashboard │ ├── add_bus.php # Add bus & schedule │ ├── manage_trips.php # Edit/delete trips │ └── special_trips.php # Add special buses ├── assets/ │ ├── css/ # Custom and Bootstrap CSS │ ├── js/ # JavaScript files for UI interactivity ├── db/ │ └── connection.php # DB connection script └── README.md
---
## ⚙️ How to Run Locally
1. **Install XAMPP/LAMP**:
- Download and install [XAMPP](https://www.apachefriends.org/) (for Windows/Linux/macOS).
2. **Clone the Repository**:
```bash
git clone https://github.com/yourusername/bus-ticket-booking.git
-
Move to htdocs Folder (if using XAMPP):
mv bus-ticket-booking /xampp/htdocs/
-
Import Database:
- Open
phpMyAdminathttp://localhost/phpmyadmin. - Create a new database (e.g.,
bus_booking). - Import the provided SQL file (e.g.,
bus_booking.sql).
- Open
-
Configure Database:
-
Edit
db/connection.phpto match your database credentials:$conn = new mysqli("localhost", "root", "", "bus_booking");
-
-
Start the Server:
- Open XAMPP Control Panel → Start Apache and MySQL.
- Visit
http://localhost/bus-ticket-bookingin your browser.
- Integrate a real payment gateway (like Razorpay or PayPal).
- Add email notifications for booking confirmations.
- Use AJAX for real-time seat updates.
- Add user authentication and booking history.
- Improve UI further with Bootstrap components and better UX.
This project is licensed under the MIT License – feel free to use, modify, and distribute it with credit.
---