Professional Documents
Culture Documents
Ex NO.:
12 DATE:
MINI PROJECT
AIM:
ALGORITHM:
1. Database Configuration:
- availability of room for patient: To track room availability, including the total number of
rooms, rooms available, and rooms reserved.
- Populate the Admin and RoomCheck tables with initial data to ensure system functionality.
- Set up a database trigger to automatically update room availability in the RoomCheck table when
a booker books a room.
- Define several key functions to handle different aspects of the GUI and Hosiptal
management system:
- admin_login: This function is responsible for the admin login process, where admin
credentials are checked, and access to room and booker details is granted upon successful
authentication.
- book_room: This function manages the bookers room booking process. It collects and
validates patients (name, phone number, email, number of days, and room number), saving the
details to the Booker table if the room number is within the specified range.
- Set the window title and size to ensure an appealing and user-friendly interface.
- Define and position GUI components, including labels, buttons, and entry fields, within the
main tkinter window (root). This design ensures a clear and visually pleasing user experience.
- Implement the admin login functionality in the admin_login function. When triggered, it opens
a separate window for admin login, allowing administrators to log in using their username and
password. Upon successful login, access to room and booker details is granted.
- Develop the check_room_availability function, which allows users to inquire about room
availability. If rooms are available, the function calls the book_room function, prompting booker to
book a room for patient. It also provides feedback about room availability to the booker.
- Implement the booking process for patient within the book_patient function. When called, it
creates a dedicated window for guests to enter their information, such as name, phone number,
email, number of days, and room number. The function validates the room number to ensure it falls
within the allowable range (1-10) before saving the patient details to the Booker table.
- Start the primary tkinter event loop (root.mainloop()) to initiate the GUI application. This
event loop is responsible for handling user interactions, ensuring smooth system operation.
PROGRAM/ QUERIES:
while (True):
print("""
================================
Welcome To CityHospital
================================
""")
import mysql.connector
mysql = mysql.connector.connect(
mycursor = mysql.cursor()
mycursor.execute("use city_hospitals")
mycursor.execute(
mycursor.execute(
mycursor.execute(
# creating table for storing the username and password of the user
mycursor.execute(
while (True):
print("""
1. Sign In
2. Registration
""")
if r == 2:
print("""
=======================================
!!!!!!!!!!Register Yourself!!!!!!!!
=======================================
""")
mycursor.execute(
"')") mysql.commit()
print("""
============================================
============================================
""")
elif r == 1:
print("""
==================================
==================================
""")
un = input("Enter Username!!:")
ps = input("Enter Password!!:")
mycursor.execute(
for i in row:
a = list(i)
if a[0] == str(ps):
while (True):
print("""
1.Administration
2.Patient(Details)
3.Sign Out
""")
if a == 1:
print("""
3. Delete a member
4. Make an exit
""")
# details
if b == 1:
print("""
1. Doctors Details
2. Nurse Details
3. Others
""")
if c == 1:
mycursor.execute(
row = mycursor.fetchall()
for i in row:
b=0
v = list(i)
"MONTHLY_SALARY"]
d = dict(zip(k,
v)) print(d)
# displays nurses
details elif c == 2:
mycursor.execute(
row = mycursor.fetchall()
for i in row:
v = list(i)
d = dict(zip(k,
v)) print(d)
# displays worker
details elif c == 3:
mycursor.execute(
row = mycursor.fetchall()
for i in row:
v = list(i)
"ADDRESS", "CONTACT""MONTHLY_SALARY"]
d = dict(zip(k,
v)) print(d)
print("""
1. Doctor Details
2. Nurse Details
3. Others
""")
SAMPLE INPUT/OUTPUT:
Thus the Hosiptal Management System model has been executed and Output generated
successfully.