How to develop Projects Using PHP and Mysql
Part 10
Project Content Wise-Module 2
1️⃣ Event Management System
Module 2: Book the Event
Purpose:
Allows users to browse and book events as well as view detailed
information about each event.
Functionalities:
✅ View the list of upcoming events with
title, date, time, venue, and description.
✅ View detailed
information about a single event.
✅ Book an event by
providing user details (e.g., name, email, number of seats).
✅ Cancel a booked event
(if allowed).
Project Structure:
/events/
│
├── event_list.php # List all available events
├── view_event.php # Display detailed info for a single
event
├── book_event.php # Book a selected event
├── cancel_booking.php # Cancel a booking (if permitted)
├── my_bookings.php # View events booked by the user
Database Tables:
1. events
CREATE TABLE events (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255) NOT NULL,
description TEXT,
event_date DATETIME NOT NULL,
location VARCHAR(255) NOT NULL,
organizer_id INT,
image
VARCHAR(255),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (organizer_id) REFERENCES
users(id) ON DELETE SET NULL
);
2. bookings
CREATE TABLE bookings (
id INT AUTO_INCREMENT PRIMARY KEY,
event_id INT NOT NULL,
user_id INT NOT NULL,
seats INT DEFAULT 1,
booking_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
status ENUM('Booked', 'Cancelled') DEFAULT 'Booked',
FOREIGN KEY (event_id) REFERENCES
events(id) ON DELETE CASCADE,
FOREIGN KEY (user_id) REFERENCES users(id) ON
DELETE CASCADE
);
2️⃣ Blood Donation Management System
Module 2: Requester Management
Purpose:
Handles registration and management of blood requesters, including their
personal details and blood request information.
Functionalities:
✅ Register blood requesters with name,
email, contact, blood group needed, and reason
✅ View list of all blood
requesters
✅ Edit or update requester
details
✅ Delete requester records
if required
Project Structure:
/requesters/
├── register.php # Register a new requester
├── edit_requester.php # Edit existing requester details
├── delete_requester.php # Delete a requester
├── requester_list.php # Display list of all requesters
Database Table:
CREATE TABLE requesters (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL,
blood_group ENUM('A+', 'A-', 'B+', 'B-', 'O+',
'O-', 'AB+', 'AB-') NOT NULL,
contact VARCHAR(15),
reason TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
🔮 Astrology Management
System
Module 2: Contact
Astrologer (User Module)
Purpose:
Allows users to contact astrologers for consultations by submitting their
personal details and concerns.
Functionalities:
✅ Submit a contact request to an astrologer
✅ View list of contact
requests (for admin or astrologer)
✅ Delete contact requests
(if needed)
Project Structure:
Functionalities:
✅ Users can submit a contact request to an
astrologer with a message and preferred date/time
✅ Admins/Astrologers can
view all contact requests
✅ Admins/Astrologers can
update the status (Pending, Approved, Rejected)
✅ Admins/Astrologers can
send a reply message to the user
✅ Admins can delete
unnecessary contact requests
Project Structure:
/contact_astrologer/
├── contact_form.php # User contact form
├── contact_list.php # Admin/astrologer view of all
requests
├── update_status.php # Update status or reply
├── delete_contact.php # Delete a contact request
Database Table:
CREATE TABLE contact_requests (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
contact VARCHAR(15),
astrologer_id INT,
preferred_date DATE,
preferred_time TIME,
message TEXT,
status ENUM('Pending', 'Approved', 'Rejected')
DEFAULT 'Pending',
reply TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (astrologer_id) REFERENCES
astrologers(id)
);
__________________________________________________________________________________
4️⃣ Hospital
Management System
Module 2: Add Doctor
Details
Purpose:
Allows hospital staff to add and manage doctor details.
✅ Functionalities:
- ✅ Add doctor
details
- ✅ Edit doctor
details
- ✅ Delete
doctor records
📁 Project Structure:
│── /doctors/
│ ├── add_doctor.php # Add doctor
│ ├── edit_doctor.php # Edit doctor details
│ ├── delete_doctor.php # Delete doctor
│ ├── doctor_list.php # List all doctors
🧾 Database Table:
CREATE TABLE doctors (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
specialization VARCHAR(255) NOT NULL,
qualification VARCHAR(255),
contact VARCHAR(15),
gender ENUM('Male', 'Female', 'Other') NOT NULL,
experience INT, -- in years
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
5️⃣ Hotel Booking System
🛏️ Room Management Module
Module 2: Add Rooms and
Check Availability
Purpose: Allows admins to manage hotel rooms and users to check room
availability.
✅ Functionalities:
- ✅ Add room to
a hotel
- ✅ Edit room
details
- ✅ Delete room
- ✅ List all
rooms in a hotel
- ✅ Check room
availability by date
🗂 Project Structure:
│── /rooms/
│ ├── add_room.php # Add room to a hotel
│ ├── edit_room.php # Edit room details
│ ├── delete_room.php # Delete a room
│ ├── room_list.php # List all rooms per hotel
│ ├── check_availability.php # Check room availability by date
🗃 Suggested Database
Tables:
🛏️ 1. Create rooms_tbl
CREATE TABLE rooms_tbl (
id INT AUTO_INCREMENT PRIMARY KEY,
hotel_id INT NOT NULL,
room_number VARCHAR(50) NOT NULL,
room_type VARCHAR(100) NOT NULL,
price DECIMAL(10,2) NOT NULL,
status VARCHAR(20) DEFAULT 'Available', --
Available, Booked, Maintenance
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (hotel_id) REFERENCES
hotels_tbl(id) ON DELETE CASCADE
);
📅 2. Create bookings_tbl
(for checking room availability)
CREATE TABLE bookings_tbl (
id INT AUTO_INCREMENT PRIMARY KEY,
room_id INT NOT NULL,
user_id INT NOT NULL,
check_in_date DATE NOT NULL,
check_out_date DATE NOT NULL,
status VARCHAR(20) DEFAULT 'Confirmed', --
Confirmed, Cancelled, Pending
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (room_id) REFERENCES
rooms_tbl(id) ON DELETE CASCADE
-- Optionally: FOREIGN KEY (user_id)
REFERENCES users_tbl(id)
);
🔍 3. Query to check room
availability:
Check available rooms for
a hotel between two dates (e.g., '2025-05-01' to '2025-05-05'):
SELECT * FROM rooms_tbl
WHERE hotel_id = 1
AND status = 'Available'
AND id NOT IN (
SELECT room_id FROM bookings_tbl
WHERE status = 'Confirmed'
AND (
(check_in_date <= '2025-05-05' AND
check_out_date >= '2025-05-01')
)
);
6️⃣ Online Job Portal System
Module 2: Add Job Seeker Details
🧩 Purpose:
Job seekers can register and manage their profiles for applying to jobs.
✅ Functionalities:
- ✅ Add job
seeker details
- ✅ Edit job
seeker details
- ✅ Delete job
seeker accounts
- ✅ List all job
seekers
🗂 Project Structure:
│── /job_seekers/
│ ├── add_job_seeker.php # Add job seeker
│ ├── edit_job_seeker.php # Edit job seeker details
│ ├── delete_job_seeker.php # Delete job seeker
│ ├── job_seeker_list.php # List all job seekers
🗃 Database Table for Job
Seekers:
CREATE TABLE job_seekers (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL,
phone VARCHAR(15),
gender VARCHAR(10),
dob DATE,
qualification VARCHAR(100),
experience VARCHAR(100),
skills TEXT,
resume VARCHAR(255), -- path to uploaded
resume file
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
7️⃣ Online Service Management System
✅ Module 2: Add Customer Requests
Purpose:
Allows users/customers to submit service requests and lets admins view them.
Functionalities:
- ✅ Submit new
service request
- ✅ View list of
service requests
- ✅ Update
status (e.g., Pending, In Progress, Completed)
Project Structure:
│── /requests/
│ ├── add_request.php # Submit new request
│ ├── request_list.php # List all service requests
│ ├── update_request.php # Update request status/details
Database Table:
CREATE TABLE service_requests (
id INT AUTO_INCREMENT PRIMARY KEY,
customer_name VARCHAR(255) NOT NULL,
contact_email VARCHAR(255) NOT NULL,
service_type VARCHAR(255),
description TEXT,
status VARCHAR(50) DEFAULT 'Pending',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
✅ Module 3: Assign Technician to
Request
Purpose:
Allows admin to assign available technicians to customer service requests.
Functionalities:
- ✅ Assign
technician to request
- ✅ View
assigned tasks
- ✅ Reassign or
update technician
Project Structure:
│── /assignments/
│ ├── assign_technician.php # Assign a technician to request
│ ├── assignment_list.php # List all assignments
│ ├── update_assignment.php # Update/reassign technician
Database Table:
CREATE TABLE technician_assignments (
id INT AUTO_INCREMENT PRIMARY KEY,
request_id INT,
technician_id INT,
assigned_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (request_id) REFERENCES
service_requests(id),
FOREIGN KEY (technician_id) REFERENCES
technicians(id)
);
✅ Module 4: Customer Management
Purpose:
Manage customer details who request services.
Functionalities:
- ✅ Add new
customer
- ✅ Edit
customer info
- ✅ Delete
customer
Project Structure:
│── /customers/
│ ├── add_customer.php # Add customer
│ ├── edit_customer.php # Edit customer
│ ├── delete_customer.php # Delete customer
│ ├── customer_list.php # List all customers
Database Table:
CREATE TABLE customers (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL,
phone VARCHAR(15),
address TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
✅ Module 5: Service Reports &
History
Purpose:
Admin and technicians can view service history and generate reports.
Functionalities:
- ✅ View service
history
- ✅ Filter by
date, technician, or status
- ✅ Export as
PDF/CSV (optional)
Project Structure:
│── /reports/
│ ├── service_history.php # View service reports
│ ├── generate_report.php # Export report (PDF/CSV)
8️⃣ Blog Application
✅ Module 2: Comment System
🎯 Purpose:
Allow users to interact with blog posts by adding, viewing, and managing
comments.
Functionalities:
- ✅ Add comment
to a blog post
- ✅ View all
comments on a blog post
- ✅ Admin/user
can delete inappropriate comments
Project Structure:
│── /comments/
│ ├── add_comment.php # Submit a new comment
│ ├── comment_list.php # Show all comments for a blog post
│ ├── delete_comment.php # Delete comment (by admin or owner)
Database Table:
CREATE TABLE comments (
id INT AUTO_INCREMENT PRIMARY KEY,
blog_id INT NOT NULL,
user_id INT NOT NULL,
comment TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (blog_id) REFERENCES blogs(id) ON
DELETE CASCADE,
FOREIGN KEY (user_id) REFERENCES users(id) ON
DELETE CASCADE
);
✅ Module 3: 👍
Like / 👎
Dislike Feature
🎯 Purpose:
Enable users to react to blog posts with likes or dislikes, increasing
engagement and feedback.
Functionalities:
- ✅ Like a blog
post
- ✅ Dislike a
blog post
- ✅ Toggle
between like and dislike
- ✅ View
like/dislike count on each post
Project Structure:
│── /reactions/
│ ├── like_dislike.php # Handle like/dislike requests
│ ├── reaction_count.php # Get like/dislike count for blog
Database Table:
CREATE TABLE reactions (
id INT AUTO_INCREMENT PRIMARY KEY,
blog_id INT NOT NULL,
user_id INT NOT NULL,
reaction ENUM('like', 'dislike') NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
UNIQUE(blog_id, user_id), -- one reaction per user per blog
FOREIGN KEY (blog_id) REFERENCES blogs(id) ON
DELETE CASCADE,
FOREIGN KEY (user_id) REFERENCES users(id) ON
DELETE CASCADE
);
Like/Dislike Logic (Basic
Explanation):
- If
the user clicks like, insert/update the reaction to like.
- If
the user clicks dislike, insert/update the reaction to dislike.
- If
the user clicks the same button again (e.g., likes a blog they already
liked), it removes the reaction.
9️⃣ Online Learning Platform
✅ Module 2: Add Lessons / Course
Content
🎯 Purpose:
Allow teachers to add video lessons or structured content under each course.
Functionalities:
- ✅ Add lessons
(video, text, PDF, etc.) to courses
- ✅ Edit lesson
details
- ✅ Delete
lessons
- ✅ View lessons
as a list under each course
- ✅ Maintain
lesson order (sequence)
Project Structure:
│── /lessons/
│ ├── add_lesson.php # Add a lesson to a course
│ ├── edit_lesson.php # Edit lesson content
│ ├── delete_lesson.php # Delete a lesson
│ ├── lesson_list.php # List all lessons in a course
│ ├── view_lesson.php # View single lesson
Database Table:
CREATE TABLE lessons (
id INT AUTO_INCREMENT PRIMARY KEY,
course_id INT NOT NULL,
title VARCHAR(255) NOT NULL,
content TEXT, -- lesson description or HTML
content
video_url VARCHAR(255), -- YouTube or local
storage path
file_url VARCHAR(255), -- for PDFs or extra
files
lesson_order INT DEFAULT 1, -- for
sequencing
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (course_id) REFERENCES
courses(id) ON DELETE CASCADE
);