Hospitl Management
Hospitl Management
Hospitl Management
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(
"create table if not exists user_data(username varchar(30) primary key,password varchar(30)
default'000')")
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(
row = mycursor.fetchall()
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
""")
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)
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)
elif b == 2:
print("""
1. Doctor Details
2. Nurse Details
3. Others
""")
if c == 1:
"','" + age + "','" + add + "','" + cont + "','" + fees + "','" + ms + "')")
mysql.commit()
print("SUCCESSFULLY ADDED")
elif c == 2:
ms) + "')")
mysql.commit()
print("SUCCESSFULLY ADDED")
elif c == 3:
mysql.commit()
print("SUCCESSFULLY ADDED")
# to delete data
elif b == 3:
print("""
1. Doctor Details
2. Nurse Details
3. Others
""")
if c == 1:
mycursor.execute(
row = mycursor.fetchall()
print(row)
p = input(
if p == "y":
mycursor.execute(
mysql.commit()
print("SUCCESSFULLY DELETED!!")
else:
print("NOT DELETED")
elif c == 2:
mycursor.execute(
row = mycursor.fetchall()
print(row)
p = input(
if p == "y":
mycursor.execute(
mysql.commit()
print("SUCCESSFULLY DELETED!!")
else:
print("NOT DELETED")
elif c == 3:
mycursor.execute(
row = mycursor.fetchall()
print(row)
p = input(
if p == "y":
mycursor.execute(
mysql.commit()
print("SUCCESSFULLY DELETED!!")
else:
print("NOT DELETED")
elif b == 4:
break
elif a == 2:
print("""
3. Discharge Summary
4. Exit
""")
if b == 1:
mycursor.execute(
row = mycursor.fetchall()
for i in row:
b=0
v = list(i)
"ADDRESS", "CONTACT"]
d = dict(zip(k, v))
print(d)
elif b == 2:
mycursor.execute(
for i in mycursor:
v = list(i)
'ADDRESS', 'CONTACT']
print(dict(zip(k, v)))
print("""
====================================
!!!!!!!Registered Successfully!!!!!!
====================================
""")
# dischare process
elif b == 3:
mycursor.execute(
row = mycursor.fetchall()
print(row)
bill = input(
if bill == "y":
mycursor.execute(
mysql.commit()
elif b == 4:
break
# SIGN OUT
elif a == 3:
break
else:
break
Output