A comprehensive web-based appointment management system for hospitals and laboratories, built with PHP and MySQL. This system allows patients to book appointments with doctors and schedule laboratory tests online.
- User Registration & Authentication: Secure patient registration and login system
- Doctor Appointments: Search and book appointments by department/specialty
- Laboratory Tests: Schedule various laboratory tests online
- Appointment Management: View, modify, and cancel existing appointments
- Profile Management: Update personal information and medical history
- Schedule Management: Set availability and manage appointment slots
- Patient Records: Access patient information and appointment history
- Department Assignment: Work within specific medical departments
- User Management: Manage doctors, patients, and staff accounts
- Department Management: Add and manage medical departments
- Laboratory Test Management: Configure available laboratory tests
- System Monitoring: Track appointments and system usage
- Backend: PHP 7.4+
- Database: MySQL 5.7+
- Frontend: HTML5, CSS3, JavaScript
- Libraries: jQuery, DataTables
- Security: Session-based authentication, SQL injection protection
Before running this application, make sure you have:
- PHP 7.4 or higher
- MySQL 5.7 or higher
- Web server (Apache/Nginx)
- Composer (optional, for dependency management)
-
Clone the repository
git clone https://github.com/yourusername/online-appointment-system.git cd online-appointment-system -
Set up the database
- Create a MySQL database named
oapp - Import the database schema (you'll need to create this from the existing tables)
- Update database credentials in
master/db.php
- Create a MySQL database named
-
Configure the application
// Edit master/db.php with your database credentials $server = "localhost"; $dbname = "oapp"; $user = "your_username"; $pwd = "your_password";
-
Set up the web server
- Point your web server to the project directory
- Ensure PHP has write permissions for session management
-
Access the application
- Open your browser and navigate to the project URL
- Register as a new patient or use existing credentials
The system uses the following main tables:
users- User authentication and rolespatients- Patient informationdoctors- Doctor profiles and specialtiesdepartments- Medical departmentsappointments- Appointment schedulinglab_test- Available laboratory testslab_bookings- Laboratory test bookingsschedules- Doctor availability schedules
- Session-based authentication
- SQL injection protection using
mysqli_real_escape_string() - Password hashing (recommended for production)
- Input validation and sanitization
- CSRF protection (recommended enhancement)
├── index.php # Main landing page
├── login.php # User authentication
├── dashboard.php # User dashboard
├── patientreg.php # Patient registration
├── doc_reg.php # Doctor registration
├── book.php # Appointment booking
├── schedule.php # Schedule management
├── lab.php # Laboratory test management
├── process.php # Form processing and business logic
├── master/
│ └── db.php # Database configuration
├── css/ # Stylesheets
├── js/ # JavaScript files
└── images/ # Static images
- Register a new account at
/patientreg.php - Login with your credentials
- Search for doctors by department
- Book appointments based on available slots
- Schedule laboratory tests as needed
- Login with admin-provided credentials
- Set your availability schedule
- View and manage patient appointments
- Access patient records
- Login with admin credentials
- Manage departments and laboratory tests
- Register new doctors
- Monitor system usage
For production deployment, consider using environment variables for sensitive data:
// Example configuration
$server = $_ENV['DB_HOST'] ?? 'localhost';
$dbname = $_ENV['DB_NAME'] ?? 'oapp';
$user = $_ENV['DB_USER'] ?? 'oapp';
$pwd = $_ENV['DB_PASS'] ?? '';- Enable HTTPS in production
- Implement password hashing (bcrypt recommended)
- Add rate limiting for login attempts
- Implement proper CSRF protection
- Use prepared statements for all database queries
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Database credentials are hardcoded (should use environment variables)
- Limited input validation in some forms
- No password hashing implemented
- Missing CSRF protection
- Implement password hashing
- Add email notifications
- Mobile-responsive design improvements
- API endpoints for mobile app
- Advanced reporting and analytics
- Integration with payment gateways
- Multi-language support
- Advanced search and filtering
For support and questions, please open an issue in the GitHub repository or contact the development team.
Note: This is a student project developed for the MCS-044 course at IGNOU. For production use, additional security measures and testing are recommended.