Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 55

PROJECT ON

HOSPITAL MANAGEMENT SYSTEM

Submitted by : Yash Bhimanai


Class : XII-A
Roll No :
Subject : Information Pratices
Guided BY : Shruti ma’am
Sanskartirth
Gyanpeeth,Surat
ACKNOWLEDGEMENT

I am grateful to our beloved Principal, Vice – Principal


and Educators for all the support and inspiration they
have given me for the completion of this project. On
the whole, I would like to give my thanks to my school
for its blessings and show my gratitude to my parents
for encouraging me to complete this assignment
successfully.

Place:-Surat
Date:- 31-01-2022

Signature of the Student


CERTIFICATE

Certified to be bonafied record for the project work of


Master/Miss YASH BHIMANI of Class–XII SCIENCE at Sanskartirth
Gyanpeeth, Surat during the academic year 2021-22.

Submitted to the ALL INDIA SENIOR SCHOOL CERTIFICATE


EXAMINATION

conducted by CBSE, DELHI held at Sanskartirth Gyanpeeth, Surat


by the candidate bearing the RollNumber _.

Principal StaffIn-Charge

SchoolSeal Examiner
INDEX

Sr. Description Page


No No.
.
01 INTRODUCTION 04
02 HARDWARE AND SOFTWARE REQUIREMENT 05
03 SCREENSHOT OF PYTHON 06
04 MYSQL TABLES 13
05 PYTHON CODING 14
06 BIBLIOGRAPHY 25
INTRODUCTION

"Hospital Management System "is a software system where the

management of entire hospital is computerized. This project is useful for the


Hospital to Maintain Databases of different field in their hospital .The Hospital
Management System is designed using Python as front end and Mysql as the
secured backend database.
In this project the details are maintained like Patient details,Doctors
details,Staff details,Medicine details.You can Search/edit Whenever You

Want..

This proposed system will be interactive ,faster and user-friendly for any
user.Using The Hospital Management System.
HARDWARE AND SOFTWARE REQUIREMENTS

1.)OPERATING SYSTEM : WINDOWS 7 AND ABOVE


2.)PROCESSOR : I3 and AMD 3
3.) RAM :4GB+

SOFTWARE REQUIREMENTS:

1.)Windows OS
2.)Front-end : python idle 3.7
3.)Back- end : my sql command line client 8.0
4.)Supporting tools : ms word 2007 and paint
HARDWARE REQUIREMENTS:
1.)250 mb ram
2.)1 Gb hardisk
OBJECTIVES OF THE PROJECT

The objective of this project is to let the students apply the programming knowledge
into a real- world situation/problem and exposed the students how programming
skills helps in developing a good software.
• Write programs utilizing modern software tools.
• Apply object oriented programming principles effectively when developing
small to medium sized projects.
• Write effective procedural code to solve small to medium sized problems.
• Students will demonstrate a breadth of knowledge in Informatics Practices, as
exemplified in the areas of systems, theory and software development.
• Students will demonstrate ability to conduct a research or applied Informatics
practices project, requiring writing and presentation skills which exemplify
scholarly style in Informatics Practices..
CONCEPT OF SOFTWARE USE TO WRITING APPLICATION

Python Programming Language :

Introduction to Python :
Python is an interpreted, object-oriented, high-level programming language
with dynamic semantics. Its high-level built in data structures, combined with
dynamic typing and dynamic binding, make it very attractive for Rapid
Application Development, as well as for use as a scripting or glue language to
connect existing components together.

Why we consider writing Software Application in Python :


Python is one of the top 10 popular programming languages. Python is a
general purpose and high level programming language. You can use Python for
developing desktop GUI applications, websites and web applications. Also,
Python, as a high level programming language, allows you to focus on core
functionality of the application by taking care of common programming tasks.

1) Readable and Maintainable Code


While writing a software application, you must focus on the quality of its
source code to simplify maintenance and updates. The syntax rules of Python
allow you to express concepts without writing additional code. At the same
time, Python, unlike other programming languages, emphasizes on code
readability, and allows you to use English keywords instead of punctuations.
Hence, you can use Python to build custom applications without writing
additional code. The readable and clean code base will help you to maintain
and update the software without putting extra time and effort.

2) Multiple Programming Paradigms :


Like other modern programming languages, Python also supports several
programming paradigm. It supports object oriented and structured
programming fully. Also, its language features support various concepts in
functional and aspect-oriented programming.

3) Compatible with Major Platforms and Systems :


At present, Python is supports many operating systems. You can even use
Python interpreters to run the code on specific platforms and tools. Also,
Python is an interpreted programming language. It allows you to you to run the
same code on multiple platforms without recompilation. The feature makes it
easier for you to make changes to the code without increasing development
time.

4) Robust Standard Library :


Its large and robust standard library makes Python score over other
programming languages. The standard library allows you to choose from a
wide range of modules according to your precise needs. Each module further
enables you to add functionality to the Python application without writing
additional code.

5) Many Open Source Frameworks and Tools :


As an open source programming language, Python helps you to curtail
software development cost significantly. You can even use several open source
Python frameworks, libraries and development tools to curtail development
time without increasing development cost. You even have option to choose
from a wide range of open source Python frameworks and development tools
according to your precise needs. For instance, you can simplify and speedup
web application development by using robust Python web frameworks like
Django, Flask, Pyramid, Bottle and Cherrypy. Likewise, you can accelerate
desktop GUI application development using Python GUI frameworks and
toolkits like PyQT, PyJs, PyGUI, Kivy, PyGTK and WxPython.

6) Simplify Complex Software Development :


Python is a general purpose programming language. Hence, you can use the
programming language for developing both desktop and web applications.
Also, you can use Python for developing complex scientific and numeric
applications. Python is designed with features to facilitate data analysis and
visualization. You can take advantage of the data analysis features of Python to
create custom big data solutions without putting extra time and effort

7) Adopt Test Driven Development :


You can use Python to create prototype of the software application rapidly.
Also, you can build the software application directly from the prototype simply
by refactoring the Python code. Python even makes it easier for you to
perform coding and testing simultaneously by adopting test driven
development (TDD) approach
8)Python GUI - Tkinter:
Tkinter is standard library in python for creating Graphical User Interface(GUI)
for Desktop
applications. With the help of Tkinter developing desktop applications is not a
tough task
The primary GUI toolkit we will be using Tk, which is python’s deafult GUI
library. We'll access Tk
from its Python interface called Tkinter
GUI Programming in Python
There are many ways to develop GUI based program in python. These
differernt ways are given
below:
• Tkinter
In python, Tkinter is a standard GUI package. Tkinter is python’s default GUI
module and also the
most common way that is used for GUI programming in python. Note that
TKinter is a set of
wrappers that implement the Tk widgets as python classes.
• What is Tkinter ?
Tkinter in python helps in creating GUI applications with minimum hassle.
Among various GUI
Frameworks, Tkinter is the only Framework that is built-in into Python’s
Standard
Library.
An important feature in favour of TKinter is that it is cross-platform, so the
same code can
easily work on Windows, macOS, and Linux.
Tkinter is a lightweight module
It is simple to use
• What are Tcl , Tk and Tkinter ?
As mentioned, Tkinter is Python’s default Gui Library, which is nothing but a
wrapper
module on top of the Tk toolkit.
Tkinter is based upon the Tk toolkit, and which was originally designed for the
Tool
Command Language (Tcl). As Tk is very popular thus it has been ported to a
variety of other
scripting languages, including Perl (Perl/Tk), Ruby(Ruby/Tk), Python(Tkinter)
Python with Tkinter provides us a fastest and efficient way in order to build
useful
applications that would have taken much time if you had to program directly
C/C++ with the help
of native OS system libraries.
Advantages of Tkinter
• Layer approach
The Layered approach used in designing Tkinter gives TKinter all the
advantages of the Tk
library. Therefore, at the time of creation, Tkinter inherited from their benefits
of a GUI
toolkit that had been given time to mature. This makes early versions of
TKinter a lot more
stable and reliable than if it had been rewritten from scratch.
Moreover, the conversation from Tcl/Tk so that Tk programmers can learn to
use Tkinter very
easily.
Accessibility
Learning Tkinter is very intuitive and therefore quick and painless.
SOURCE CODE
LOGIN PAGE
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
import menuPage as mp
import mysql.connector as co
def jk():
mp.page(
def ok():
uname = e1.get()
password = e2.get()
if (uname == '' and password == ''):
messagebox.showinfo('', 'Blank not allowed')
elif (uname == 'admin' and password == '123'):
messagebox.showinfo('', 'LOGIN SUCCESS')
tk.destroy
mp.page()
else:
messagebox.showinfo('', 'Incorrect Username and Password')
tk = Tk()
w = 700
h = 400
geometry="%dx%d+%d+%d"%(w,h,320,150)
tk.geometry(geometry)
tk.config(bg = "light green")
global e1
global e2
global er
Label(tk, text='username',font=('arial black',20),bg = "light green",fg = 'black').place(x=80, y=100)
Label(tk, text='password',font=('arial black',20),bg = "light green",fg = 'black').place(x=80, y=150)
Button(tk, text='Login', command=ok, height=3, width=13).place(x=300, y=200)
e1 = Entry(tk,font=('arial black',20))
e1.place(x=250, y=100)
e2 = Entry(tk,font=('arial black',20))
e2.place(x=250, y=150)
e2.config(show='*')
def openLogin():
return tk.mainloop
IMPORT LOGIN PAGE
import login as l

l.openLogin()
MENU PAGE
from tkinter import *
import newadmission as newd
import doctor as doc_t
import staff
import medicine
import about
def newadd():
newd.openPage()
def doct():
doc_t.thirdpage()
def sta_f():
staff.fourthpage()
def b_d():
medicine.sixthpage()
def abou_t():
about.seventhpage()
def page():
root = Toplevel()
w = root.winfo_screenwidth()
h = root.winfo_screenheight()
geometry="%dx%d+%d+%d"%(w,h,0,0)
root.geometry(geometry)
root.config(bg = "white")
new = PhotoImage(file='new.gif')
doctor = PhotoImage(file='doctor.png')
bed = PhotoImage(file='pharm1.png')
staff = PhotoImage(file='staff2.png')
about = PhotoImage(file='about.png')
# image buttons
newptbt = Button(root, image=new,borderwidth=0,height = 200,width = 200,command = newadd)
newptbt.place(x=190, y=135)
docbt = Button(root, image=doctor,borderwidth=0,height = 200,width = 200,command=doct)
docbt.place(x=555, y=135)
stbt = Button(root, image=staff,borderwidth=0,height = 200,width = 200,command=sta_f)
stbt.place(x=920, y=135)
bedbt = Button(root, image=bed,borderwidth=0,height = 200,width =
200,command=b_d,bg='white')
bedbt.place(x=373, y= 425)
aboutbt = Button(root, image=about,borderwidth=0,height = 200,width = 200,command=abou_t)
aboutbt.place(x=737, y= 425)
headLabel = Label(root,text=" HOSPITAL MANAGEMENT SYSTEM ",font=('arial
black',50),fg='red',bg='light green')
headLabel.place(x= 0,y = 20)
prBtn = Label(root,text="New Admission",font=('arial black',15),bg = "white")
prBtn.place(x= 205,y = 365)
docBtn = Label(root,text="Doctors",font=('arial black',15),bg = "white")
docBtn.place(x= 605,y = 365)
stBtn = Label(root,text="Staff",font=('arial black',15),bg = "white")
stBtn.place(x= 990,y = 365)
bedBtn = Label(root,text="Medical store",font=('arial black',15),bg = "white")
bedBtn.place(x= 404,y = 640)
aboutBtn = Label(root,text="About",font=('arial black',15),bg = "white")
aboutBtn.place(x=798 ,y = 640)

return root.mainloop()
PATIENT DETAILS PAGE
from tkinter import *
from tkinter import ttk
import pandas as pd
import mysql.connector as co

def openPage():
def search_doctor():
sc=Tk()
w = sc.winfo_screenwidth()
h = sc.winfo_screenheight()
geometry = "%dx%d+%d+%d" % (w, h, 0, 0)
sc.geometry(geometry)
sc.title('Search Patient')
# entry box for search customer
sc_box=Entry(sc,font=('arial',15))
sc_box.grid(row=0,column=1,padx=10,pady=10)
sc_label=Label(sc,text='Search Patient ',font=('arial',15))
sc_label.grid(row=1,column=0,padx=10,pady=10)
def update():
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
sql2 =""" UPDATE patient2 set p_name=%s,p_age=%s,p_gender=%s,p_height=
%s,p_weight=%s ,p_problem=%s,p_phoneno=%s WHERE p_id=%s """
u1=pid.get()
u2=pname.get()
u3=page.get()
u4=pgender.get()
u5=pheight.get()
u6= pweight.get()
u7= pproblem.get()
u8 = pphone.get()
inputs=(u1,u2,u3,u4,u5,u6,u7,u8)
c.execute(sql2 ,inputs)
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
con.commit()
sc.destroy()
def edit_now(id,index):
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
sql2 = "SELECT* FROM patient2 WHERE p_id= %s"
name2 = (id, )
result =c.execute(sql2, name2)
result=c.fetchall()
index +=1
# LABEL FOR ENTRY
Label(sc, text="Patient Appointment No:",font=('arial',15)).grid(row=index+1,
column=0, sticky=W,pady=5)
Label(sc, text="Patient Name:",font=('arial',15)).grid(row=index+2, column=0,
sticky=W,pady=5)
Label(sc, text="Patient Name:", font=('arial', 15)).grid(row=index + 3, column=0,
sticky=W,pady=5)
Label(sc, text="Patient Gender:",font=('arial',15)).grid(row=index+4, column=0,
sticky=W,pady=5)
Label(sc, text="Patient Height:",font=('arial',15)).grid(row=index+5, column=0,
sticky=W, pady=5)
Label(sc, text="Patient Weight:",font=('arial',15)).grid(row=index+6, column=0,
sticky=W, pady=5)
Label(sc, text="Patient Problem:",font=('arial',15)).grid(row=index+7, column=0,
sticky=W, pady=5)
Label(sc, text="Patient Phone:",font=('arial',15)).grid(row=index+8, column=0,
sticky=W,pady=5)
# for entry boxes
global pid
pid = Entry(sc,font=('arial',15))
pid.grid(row=index+1, column=1, pady=5)
pid.insert(0, result[0][0])
global pname
pname = Entry(sc,font=('arial',15))
pname.grid(row=index+2, column=1, pady=5)
pname.insert(0, result[0][1])
global page
page = Entry(sc,font=('arial',15))
page.grid(row=index+3, column=1, pady=5)
page.insert(0, result[0][2])
global pgender
pgender = Entry(sc,font=('arial',15))
pgender.grid(row=index+4, column=1, pady=5)
pgender.insert(0, result[0][3])
global pheight
pheight = Entry(sc,font=('arial',15))
pheight.grid(row=index+5, column=1, pady=5)
pheight.insert(0, result[0][4])
global pweight
pweight = Entry(sc,font=('arial',15))
pweight.grid(row=index+6, column=1, pady=5)
pweight.insert(0, result[0][5])
global pproblem
pproblem = Entry(sc,font=('arial',15))
pproblem.grid(row=index+7, column=1, pady=5)
pproblem.insert(0, result[0][6])
global pphone
pphone = Entry(sc,font=('arial',15))
pphone.grid(row=index+8, column=1, pady=5)
pphone.insert(0, result[0][7])
save_rec=Button(sc,text='Update Record',command=update,font=('arial',15))
save_rec.grid(row=index+9,column=1)

def search_now():
selected=vc.get()
if selected =="Search by...":
test=Label(sc,text='Blank Filed')
test.grid(row=3,column=0)
if selected=="ID NO":
sql = "SELECT* FROM patient2 WHERE p_id=%s"
if selected=="Patient Name":
sql = "SELECT* FROM patien2 WHERE p_name =%s"
searched = sc_box.get()
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
name = (searched,)
result = c.execute(sql, name)
result = c.fetchall()
if not result:
result = 'record not found'
searched_label=Label(sc,text=result,font=('arial black',40))
searched_label.grid(row=2,colum=0,padx=10,columnspan=2)
else:
for index ,x in enumerate(result):
num=0
index+=2
id_reference=str(x[0])

edit_button=Button(sc,text='Edit',command=lambda:edit_now(id_reference,index),font=('arial',15))
edit_button.grid(row=index,column=num)

for y in x :

searched_label=Label(sc,text=y,font=('arial',15))
searched_label.grid(row=index,column=num+1)
num+=2
#drop down box
Label(sc,text='Input Here',font=('arial',15)).grid(row=0,column=0)
vc=ttk.Combobox(sc,font=('arial',15), value=["Search by...","ID NO","Patient Name",])
vc.current(0)
vc.grid(row=0,column=2)
op=Button(sc, text="Search Pateint",font=('arial',15), command=search_now)
op.grid(row=1, column=0,padx=0)
sc.mainloop()
def po_cd():
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
sql = "INSERT INTO
patient2(p_id,p_name,p_age,p_gender,p_height,p_weight,p_problem,p_phoneno) VALUES(%s,%s,
%s,%s,%s,%s,%s,%s)"
er=(pid.get(), pname.get(), page.get(), pgender.get(), pheight.get(), pweight.get(),
pproblem.get(), pphone.get())
c.execute(sql, er)
con.commit()
def clr_fil():
pid.delete(0, END)
pname.delete(0, END)
page.delete(0, END)
pgender.delete(0, END)
pheight.delete(0, END)
pweight.delete(0, END)
pproblem.delete(0, END)
pphone.delete(0, END)
def list_pat():
rt = Tk()
rt.title('PATIENT LIST')
w = rt.winfo_screenwidth()
h = rt.winfo_screenheight()
geometry = "%dx%d+%d+%d" % (w, h, 0, 0)
rt.geometry(geometry)
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
df = pd.read_sql(' SELECT * FROM patient2', con)
frame=Frame(rt)
frame.pack(fill=BOTH,expand=1)
canv_as=Canvas(frame)
canv_as.pack(side=LEFT,fill=BOTH,expand=1)
sbar1=ttk.Scrollbar(frame,orient=VERTICAL,command=canv_as.yview)
sbar1.pack(side=RIGHT,fill=Y)
canv_as.configure(yscrollcommand=sbar1.set)
canv_as.bind('<Configure>',lambda e: canv_as.configure(scrollregion=canv_as.bbox('all')))
second_frame=Frame(canv_as)
canv_as.create_window((0,0),window=second_frame,anchor='nw')
l2 = Label(second_frame, text=df, font=("consolas", 24), bg='white', fg="black")
l2.pack()
rt.mainloop()
fd = Toplevel()
w = fd.winfo_screenwidth()
h = fd.winfo_screenheight()
geometry="%dx%d+%d+%d"%(w,h,0,0)
fd.geometry(geometry)
title_label = Label(fd, text=" ENTER PATIENT DETAILS ", font=("arial black", 50), fg="red",
bg="light green")
title_label.grid(row=0, column=0,pady=10)
#label adding frame for entry and label
frame2=LabelFrame(fd)
frame2.grid(row=1,column=0,pady=20)
Label(frame2, text="Patient Appointment No:",font=('arial',25)).grid(row=1, column=0, sticky=W,
padx=80,pady=5)
Label(frame2, text="Patient Name:",font=('arial',25)).grid(row=2, column=0, sticky=W,
padx=80,pady=5)
Label(frame2, text="Patient Age:",font=('arial',25)).grid(row=3, column=0, sticky=W,
padx=80,pady=5)
Label(frame2, text="Patient Gender:",font=('arial',25)).grid(row=4, column=0, sticky=W,
padx=80,pady=5)
Label(frame2, text="Patient Height(cm):",font=('arial',25)).grid(row=5, column=0, sticky=W,
padx=80,pady=5)
Label(frame2, text="Patient Weight(kg):",font=('arial',25)).grid(row=6, column=0, sticky=W,
padx=80,pady=5)
Label(frame2, text="Patient Problem:",font=('arial',25)).grid(row=7, column=0, sticky=W,
padx=80,pady=5)
Label(frame2, text="Patient Phone:",font=('arial',25)).grid(row=8, column=0, sticky=W,
padx=80,pady=5)
#entry
pid = Entry(frame2,font=('arial',25))
pid.grid(row=1, column=1, pady=5,padx=10)
pname = Entry(frame2,font=('arial',25))
pname.grid(row=2, column=1, pady=5,padx=10)
page = Entry(frame2,font=('arial',25))
page.grid(row=3, column=1, pady=5,padx=10)
pgender = Entry(frame2,font=('arial',25))
pgender.grid(row=4, column=1, pady=5,padx=10)
pheight = Entry(frame2,font=('arial',25))
pheight.grid(row=5, column=1, pady=5,padx=10)
pweight = Entry(frame2,font=('arial',25))
pweight.grid(row=6, column=1, pady=5,padx=10)
pproblem = Entry(frame2,font=('arial',25))
pproblem.grid(row=7, column=1, pady=5,padx=10)
pphone = Entry(frame2,font=('arial',25))
pphone.grid(row=8, column=1, pady=5,padx=10)
####adding a frame1 for buttons
frame1 = LabelFrame(fd)
frame1.grid(row=2,column =0)
add_customer_button = Button(frame1, text="Add Patient ",font=('arial',17), command=po_cd,
padx=40, pady=10)
add_customer_button.grid(row=1, column=2)
clear_fields_button = Button(frame1, text="Clear field",font=('arial',17), command=clr_fil,
padx=40, pady=10)
clear_fields_button.grid(row=1, column=3)
but1=Button(frame1, text="Patient list",font=('arial',17) ,command=list_pat, padx=40, pady=10)
but1.grid(row=1, column=0)
but2=Button(frame1, text="Search/Edit Patient",font=('arial',17) ,command=search_doctor,
padx=10, pady=10)
but2.grid(row=1, column=1)
return fd.mainloop()
DOCTOR DETAILS PAGE
from tkinter import *
from tkinter import ttk
import pandas as pd
import mysql.connector as co

def thirdpage():
# for creating table in mysql
def search_doctor():
sc=Tk()
w = sc.winfo_screenwidth()
h = sc.winfo_screenheight()
geometry = "%dx%d+%d+%d" % (w, h, 0, 0)
sc.geometry(geometry)
sc.title('Search Doctor')
# entry box for search customer
sc_box=Entry(sc,font=('arial',15))
sc_box.grid(row=0,column=1,padx=10,pady=10)
sc_label=Label(sc,text='Search Doctor',font=('arial',15))
sc_label.grid(row=1,column=0,padx=10,pady=10)
#Button(sc, text="EXIT", command=sc.destroy).grid(row=12, column=0)
def update():
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
sql2 =""" UPDATE doctor2 SET d_name=%s,d_age=%s,d_dept=%s,d_phone=%s WHERE
d_id=%s """
u1=did1.get()
u2=dname1.get()
u3=dage1.get()
u4=ddept1.get()
u5=dphn1.get()
inputs=(u1,u2,u3,u4,u5)
c.execute(sql2 ,inputs)
con.commit()
sc.destroy()
def edit_now(id,index):
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
sql2 = "SELECT* FROM doctor2 WHERE d_id= %s"
name2 = (id, )
result =c.execute(sql2, name2)
result=c.fetchall()
print(result)
index +=1
# LABEL FOR ENTRY
lab_1 = Label(sc, text="Doctor ID", font=('arial', 15))
lab_1.grid(row=index+1, column=0, pady=10,sticky=W)
Label(sc, text="First Name", font=('arial', 15)).grid(row=index+2,
sticky=W ,column=0,pady=10)
Label(sc, text="Doctor Age", font=('arial', 15)).grid(row=index+3, sticky=W,column=0,
pady=10)
Label(sc, text="Doctor Department", font=('arial', 15)).grid(row=index+4 ,sticky=W,
column=0, pady=10)
Label(sc, text="Doctor phone number", font=('arial', 15)).grid(row=index+5, sticky=W,
column=0, pady=10)
# for entry boxes
global did1
did1 = Entry(sc,font=('arial',15))
did1.grid(row=index+1, column=1, pady=10)
did1.insert(0,result[0][0])
global dname1
dname1 = Entry(sc, font=('arial ', 15))
dname1.grid(row=index+2, column=1, pady=10)
dname1.insert(0,result[0][1])
global dage1
dage1 = Entry(sc, font=('arial ', 15))
dage1.grid(row=index+3, column=1, pady=10)
dage1.insert(0,result[0][2])
global ddept1
ddept1 = Entry(sc, font=('arial ', 15))
ddept1.grid(row=index+4, column=1, pady=10)
ddept1.insert(0, result[0][3])
global dphn1
dphn1 = Entry(sc, font=('arial ', 15))
dphn1.grid(row=index+5, column=1, pady=10)
dphn1.insert(0,result[0][4])
save_rec=Button(sc,text='Update Record',command=update,font=('arial',15))
save_rec.grid(row=index+6,column=1)
def search_now():
selected=vc.get()
if selected =="Search by...":
test=Label(sc,text='Blank Filed')
test.grid(row=3,column=0)
if selected=="ID NO":
sql = "SELECT* FROM doctor2 WHERE d_id=%s"
if selected=="Doctor Name":
sql = "SELECT* FROM doctor2 WHERE d_name =%s"
searched = sc_box.get()
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
name = (searched,)
result = c.execute(sql,name)
result = c.fetchall()
if not result:
result = 'record not found'
searched_label=Label(sc,text=result,font=('arial black',40))
searched_label.grid(row=2,colum=0,padx=10,columnspan=2)
else:
for index ,x in enumerate(result):
num=0
index+=2
id_reference=str(x[0])

edit_button=Button(sc,text='Edit',command=lambda:edit_now(id_reference,index),font=('arial',15))
edit_button.grid(row=index,column=num)
for y in x :
searched_label=Label(sc,text=y,font=('arial',15))
searched_label.grid(row=index,column=num+1)
num+=2
#drop down box
Label(sc,text='Input Here',font=('arial',15)).grid(row=0,column=0)
vc=ttk.Combobox(sc,font=('arial',15), value=["Search by...","ID NO","Doctor Name"])
vc.current(0)
vc.grid(row=0,column=2)
op=Button(sc, text=" Search Doctor",font=('arial',15), command=search_now)
op.grid(row=1, column=0,padx=0)
sc.mainloop()
def do_cd():
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
op = "INSERT INTO doctor2(d_id,d_name,d_age,d_dept,d_phone) VALUES(%s,%s,%s,%s,
%s)"
value = (did.get(), dname.get(), dage.get(), ddept.get(), dphn.get())
c.execute(op, value)
con.commit()
def clr_fil():
did.delete(0, END)
dname.delete(0, END)
dage.delete(0, END)
ddept.delete(0, END)
dphn.delete(0, END)
def list_doc():
rt=Tk()
w = rt.winfo_screenwidth()
h = rt.winfo_screenheight()
geometry = "%dx%d+%d+%d" % (w, h, 0, 0)
rt.geometry(geometry)
# for frame
# and to create canvas
frame=Frame(rt)
frame.pack(fill=BOTH,expand=1)
canv_as=Canvas(frame)
canv_as.pack(side=LEFT,fill=BOTH,expand=1)
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
df = pd.read_sql(' SELECT * FROM doctor2',con)
#for scrollbar and frame
sbar1=ttk.Scrollbar(frame,orient=VERTICAL,command=canv_as.yview)
sbar1.pack(side=RIGHT,fill=Y)
canv_as.configure(yscrollcommand=sbar1.set)
canv_as.bind('<Configure>',lambda e: canv_as.configure(scrollregion=canv_as.bbox('all')))
second_frame=Frame(canv_as)
canv_as.create_window((0,0),window=second_frame,anchor='nw')
l2 = Label(second_frame, text=df, font=("consolas", 30), bg="white", fg="black")
l2.pack()
rt.mainloop()

hj = Toplevel()
w = hj.winfo_screenwidth()
h = hj.winfo_screenheight()
geometry="%dx%d+%d+%d"%(w,h,0,0)
hj.geometry(geometry)
hj.config(bg = "white")
title_label = Label(hj,text=" ENTER DOCTOR DETAILS ", font=("arial black", 50),
fg="red", bg="light green")
title_label.grid(row=0, column=0 ,pady=20)
frame2=LabelFrame(hj)
frame2.grid(row=1, column=0,pady=20)
# LABEL FOR ENTRY
lab_1=Label(frame2, text="Doctor ID",font=('arial',25))
lab_1.grid(row=1, column=0, sticky=W, padx=80,pady=10)
Label(frame2, text="First Name",font=('arial',25)).grid(row=2, column=0, sticky=W,
padx=80,pady=10)
Label(frame2, text="Doctor Age",font=('arial',25)).grid(row=3, column=0, sticky=W,
padx=80,pady=10)
Label(frame2, text="Doctor Department",font=('arial',25)).grid(row=4, column=0, sticky=W,
padx=80,pady=10)
Label(frame2, text="Doctor phone number",font=('arial',25)).grid(row=5, column=0, sticky=W,
padx=80,pady=10)
# for entry boxes
did = Entry(frame2,font=('arial ',25))
did.grid(row=1, column=1,padx=80, pady=10)
dname = Entry(frame2,font=('arial ',25))
dname.grid(row=2, column=1,padx=80, pady=10)
dage = Entry(frame2,font=('arial ',25))
dage.grid(row=3, column=1,padx=80, pady=10)
ddept = Entry(frame2,font=('arial ',25))
ddept.grid(row=4, column=1,padx=80, pady=10)
dphn = Entry(frame2,font=('arial ',25))
dphn.grid(row=5, column=1,padx=80, pady=10)
frame = LabelFrame(hj)
frame.grid(row=2,column =0,pady=20)
add_customer_button = Button(frame, text="Add Doctor ", font=('arial', 17),
command=do_cd,padx=30,pady=10)
add_customer_button.grid(row=1, column=2)
clear_fields_button = Button(frame, text="Clear Field", font=('arial', 17),
command=clr_fil,padx=5,pady=10)
clear_fields_button.grid(row=1, column=3)
but1=Button(frame, text= " Doctors list ",font=('arial',17),
command=list_doc,padx=5,pady=10)
but1.grid(row=1, column=0)
but3=Button(frame, text= "Search/Edit Doctor", font=('arial',17),
command=search_doctor,padx=5,pady=10)
but3.grid(row=1, column=1)
return hj.mainloop()
STAFF DETAILS PAGE
from tkinter import *
from tkinter import ttk
import pandas as pd
import mysql.connector as co
def fourthpage():
def search_worker():
sc=Tk()
w = sc.winfo_screenwidth()
h = sc.winfo_screenheight()
geometry = "%dx%d+%d+%d" % (w, h, 0, 0)
sc.geometry(geometry)
sc.title('Search Staff')
# entry box for search customer
sc_box=Entry(sc,font=('arial',15))
sc_box.grid(row=0,column=1,padx=10,pady=10)
sc_label=Label(sc,text='Search Staff',font=('arial',15))
sc_label.grid(row=1,column=0,padx=10,pady=10)
#Button(sc, text="EXIT", command=sc.destroy).grid(row=12, column=0)
def update():
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
sql2 =""" UPDATE worker SET w_name=%s,w_age=%s,w_gender=%s,w_work=
%s,w_phone=%s WHERE w_id=%s """
u1=wid.get()
u2=wname.get()
u3=wage.get()
u4=wgender.get()
u5=wwork.get()
u6=wphone.get()
inputs=(u1,u2,u3,u4,u5,u6)
c.execute(sql,inputs)
con.commit()
sc.destroy()
def edit_now(id,index):
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
sql2 = "SELECT* FROM worker WHERE w_id= %s"
name2 = (id, )
result =c.execute(sql2, name2)
result=c.fetchall()
print(result)
index +=1
# LABEL FOR ENTRY
Label(sc, text=" Worker ID: ",font=('arial ',15)).grid(row=index+1, column=0,
sticky=W,pady=10)
Label(sc, text=" Worker Name: ",font=('arial ',15)).grid(row=index+2, column=0,
sticky=W,pady=10)
Label(sc, text=" Worker Age: ",font=('arial ',15)).grid(row=index+3, column=0,
sticky=W, pady=10)
Label(sc, text=" Worker gender: ",font=('arial ',15)).grid(row=index+4, column=0,
sticky=W,pady=10)
Label(sc, text=" Worker Work: ",font=('arial ',15)).grid(row=index+5, column=0,
sticky=W, pady=10)
Label(sc, text=" Worker Phone Number: ",font=('arial ',15)).grid(row=index+6,
column=0, sticky=W, pady=10)
global wid
wid = Entry(sc,font=('arial ',15))
wid.grid(row=index+1, column=1, pady=5)
wid.insert(0,result[0][0])
global wname
wname = Entry(sc,font=('arial ',15))
wname.grid(row=index+2, column=1, pady=5)
wname.insert(0,result[0][1])
global wage
wage = Entry(sc,font=('arial ',15))
wage.grid(row=index+3, column=1, pady=5 )
wage.insert(0,result[0][2])
global wgender
wgender = Entry(sc,font=('arial ',15))
wgender.grid(row=index+4, column=1, pady=5)
wgender.insert(0,result[0][3])
global wwork
wwork = Entry(sc,font=('arial ',15))
wwork.grid(row=index+5, column=1, pady=5)
wwork.insert(0,result[0][4])
global wphone
wphone = Entry(sc,font=('arial ',15))
wphone.grid(row=index+6, column=1, pady=5)
wphone.insert(0,result[0][5])
save_rec=Button(sc,text='Update Record',command=update,font=('arial',15))
save_rec.grid(row=index+7,column=1)
def search_now():
selected=vc.get()
if selected =="Search by...":
test=Label(sc,text='Blank Filed')
test.grid(row=3,column=0)
if selected=="Id No":
sql = "SELECT* FROM worker WHERE w_id=%s"
if selected=="Staff Name":
sql = "SELECT* FROM worker WHERE w_name =%s"
searched = sc_box.get()
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
name = (searched,)
result = c.execute(sql,name)
result = c.fetchall()
if not result:
result = 'record not found'
searched_label=Label(sc,text=result,font=('arial black',40))
searched_label.grid(row=2,colum=0,padx=10,columnspan=2)
else:

for index ,x in enumerate(result):


num=0
index+=2
id_reference=str(x[0])

edit_button=Button(sc,text='Edit',command=lambda:edit_now(id_reference,index),font=('arial',15))
edit_button.grid(row=index,column=num)
for y in x :
searched_label=Label(sc,text=y,font=('arial',15))
searched_label.grid(row=index,column=num+1)
num+=2
#drop down box
Label(sc,text='Input Here',font=('arial',15)).grid(row=0,column=0)
vc=ttk.Combobox(sc,font=('arial',15), value=["Search by...","Id No","Staff Name"])
vc.current(0)
vc.grid(row=0,column=2)
op=Button(sc, text=" Search Staff",font=('arial',15), command=search_now)
op.grid(row=1, column=0,padx=0)
sc.mainloop()
def do_cd():
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
sl = "INSERT INTO worker(w_id,w_name,w_age,w_gender,w_work,w_phone) VALUES(%s,
%s,%s,%s,%s,%s)"
var = (wid.get(), wname.get(), wage.get(), wgender.get(), wwork.get(), wphone.get())
c.execute(sl, var)
con.commit()
def clr_fil():
wid.delete(0, END)
wname.delete(0, END)
wage.delete(0, END)
wgender.delete(0, END)
wwork.delete(0, END)
wphone.delete(0, END)
def list_doc():
rt = Toplevel()
rt.title('Staff LIST')
w = rt.winfo_screenwidth()
h = rt.winfo_screenheight()
geometry = "%dx%d+%d+%d" % (w, h, 0, 0)
rt.geometry(geometry)
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
df = pd.read_sql(' SELECT * FROM worker',con)
frame=Frame(rt)
frame.pack(fill=BOTH,expand=1)
canv_as=Canvas(frame)
canv_as.pack(side=LEFT,fill=BOTH,expand=1)
sbar1=ttk.Scrollbar(frame,orient=VERTICAL,command=canv_as.yview)
sbar1.pack(side=RIGHT,fill=Y)
canv_as.configure(yscrollcommand=sbar1.set)
canv_as.bind('<Configure>',lambda e: canv_as.configure(scrollregion=canv_as.bbox('all')))
second_frame=Frame(canv_as)
canv_as.create_window((0,0),window=second_frame,anchor='nw')
l2 = Label(second_frame, text=df, font=("consolas", 30), fg="black", bg="white")
l2.pack()
rt.mainloop()
hj = Toplevel()
w = hj.winfo_screenwidth()
h = hj.winfo_screenheight()
geometry="%dx%d+%d+%d"%(w,h,0,0)
hj.geometry(geometry)
hj.config(bg = "white")
title_label = Label(hj,text=" ENTER STAFF DETAILS ", font=("arial black", 50),
fg="red", bg="light green")
title_label.grid(row=0, column=0 ,pady=20)
frame=LabelFrame(hj)
frame.grid(row=1, column=0,pady=20)
# LABEL FOR ENTRY
Label(frame, text=" Worker ID: ",font=('arial ',25)).grid(row=1, column=0, sticky=W,
padx=10,pady=10)
Label(frame, text=" Worker Name: ",font=('arial ',25)).grid(row=2, column=0, sticky=W,
padx=10,pady=10)
Label(frame, text=" Worker Age: ",font=('arial ',25)).grid(row=3, column=0, sticky=W,
padx=10,pady=10)
Label(frame, text=" Worker gender: ",font=('arial ',25)).grid(row=4, column=0, sticky=W,
padx=10,pady=10)
Label(frame, text=" Worker Work: ",font=('arial ',25)).grid(row=5, column=0, sticky=W,
padx=10,pady=10)
Label(frame, text=" Worker Phone Number: ",font=('arial ',25)).grid(row=6, column=0,
sticky=W, padx=10,pady=10)
###entry box
# for entry boxes
wid = Entry(frame,font=('arial ',25))
wid.grid(row=1, column=1, pady=5, padx=10)
wname = Entry(frame,font=('arial ',25))
wname.grid(row=2, column=1, pady=5, padx=10)
wage = Entry(frame,font=('arial ',25))
wage.grid(row=3, column=1, pady=5, padx=10)
wgender = Entry(frame,font=('arial ',25))
wgender.grid(row=4, column=1, pady=5, padx=10)
wwork = Entry(frame,font=('arial ',25))
wwork.grid(row=5, column=1, pady=5, padx=10)
wphone = Entry(frame,font=('arial ',25))
wphone.grid(row=6, column=1, pady=5, padx=10)
frame2 = LabelFrame(hj)
frame2.grid(row=2,column =0,pady=20)
add_customer_button = Button(frame2, text="Add Staff ",font=('arial',17),command=do_cd,
padx=20, pady=10)
add_customer_button.grid(row=1, column=4)
search_button = Button(frame2, text="Search/Edit
Staff",font=('arial',17),command=search_worker, padx=20, pady=10)
search_button.grid(row=1, column=2)
clear_fields_button = Button(frame2, text="Clear Field ",font=('arial',17), command=clr_fil,
padx=20, pady=10)
clear_fields_button.grid(row=1, column=3)
Table=Button(frame2, text="Staff List",font=('arial',17),command=list_doc, padx=20, pady=10)
Table.grid(row=1, column=1)
return hj.mainloop()
MEDICINE LIST PAGE
from tkinter import *
import mysql.connector as co
import pandas as pd
from tkinter import ttk
def sixthpage():
root = Toplevel()
w = root.winfo_screenwidth()
h = root.winfo_screenheight()
geometry="%dx%d+%d+%d"%(w,h,0,0)
root.geometry(geometry)
root.config(bg = "white")
def search_doctor():
sc=Tk()
w = sc.winfo_screenwidth()
h = sc.winfo_screenheight()
geometry = "%dx%d+%d+%d" % (w, h, 0, 0)
sc.geometry(geometry)
sc.title('Search Medicine')
# entry box for search customer
sc_box=Entry(sc,font=('arial',15))
sc_box.grid(row=0,column=1,padx=10,pady=10)
sc_label=Label(sc,text='Search Medicine')
sc_label.grid(row=1,column=0,padx=10,pady=10)
def update():
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
sql=""" UPDATE stock SET m_name=%s,dateofexpiry=%s,quantity=%s,price=%s WHERE
mcode=%s """
u1=did1.get()
u2=dname1.get()
u3=dage1.get()
u4=ddept1.get()
u5=dphn1.get()
inputs=(u1,u2,u3,u4,u5)
c.execute(sql,inputs)
con.commit()
sc.destroy()
def edit_now(id,index):
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
sql2 = "SELECT* FROM stock WHERE mcode= %s"
name2 = (id, )
result =c.execute(sql2, name2)
result=c.fetchall()
index +=1
# LABEL FOR ENTRY
Label(sc, text="Serial Number:", font=('arial', 15)).grid(row=index+1, column=0,
sticky=W ,pady=10)
Label(sc, text="Medicine Name:", font=('arial', 15)).grid(row=index+2, column=0,
sticky=W,pady=10)
Label(sc, text="Date of Expiry Of Medicine:", font=('arial', 15)).grid(row=index+3,
column=0, sticky=W,pady=10)
Label(sc, text="Quantity Of Medicine:", font=('arial', 15)).grid(row=index+4, column=0,
sticky=W, pady=10)
Label(sc, text="Price Of Medicine:", font=('arial', 15)).grid(row=index+5, column=0,
sticky=W, pady=10)

# for entry boxes


global did1
did1 = Entry(sc, font=('arial', 15))
did1.grid(row=index+1, column=1, pady=10)
did1.insert(0,result[0][0])
global dname1
dname1 = Entry(sc, font=('arial ', 15))
dname1.grid(row=index+2, column=1, pady=10)
dname1.insert(0,result[0][1])
global dage1
dage1 = Entry(sc, font=('arial ', 15))
dage1.grid(row=index+3, column=1, pady=10)
dage1.insert(0,result[0][2])
global ddept1
ddept1 = Entry(sc, font=('arial ', 15))
ddept1.grid(row=index+4, column=1, pady=10)
ddept1.insert(0, result[0][3])
global dphn1
dphn1 = Entry(sc, font=('arial ', 15))
dphn1.grid(row=index+5, column=1, pady=10)
dphn1.insert(0,result[0][4])
save_rec=Button(sc,text='Update Record',command=update, font=('arial ', 15))
save_rec.grid(row=index+6,column=1)
def search_now():
selected=vc.get()
if selected =="Search by...":
test=Label(sc,text='Blank Filed')
test.grid(row=3,column=0)
if selected=="ID NO":
sql = "SELECT* FROM stock WHERE mcode=%s"
if selected=="Medicine Name":
sql = "SELECT* FROM stock WHERE m_name =%s"
searched = sc_box.get()
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
name = (searched,)
result = c.execute(sql, name)
result = c.fetchall()
if not result:
result = 'record not found'
searched_label=Label(sc,text=result,font=('arial black',40))
searched_label.grid(row=2,colum=0,padx=10,columnspan=2)
else:
for index ,x in enumerate(result):
num=0
index+=2
id_reference=str(x[0])

edit_button=Button(sc,text='Edit',command=lambda:edit_now(id_reference,index),font=('arial',15))
edit_button.grid(row=index,column=num
for y in x :

searched_label=Label(sc,text=y,font=('arial',15))
searched_label.grid(row=index,column=num+1)
num+=2

#drop down box


Label(sc,text='Input Here',font=('arial',15)).grid(row=0,column=0)
vc=ttk.Combobox(sc,font=('arial',15), value=["Search by...","ID NO","Medicine Name"])
vc.current(0)
vc.grid(row=0,column=2)
op=Button(sc, text="Search Medicine",font=('arial',15), command=search_now)
op.grid(row=1, column=0,padx=0)
sc.mainloop()
def sortmedicine():
tk1=Toplevel()
w = tk1.winfo_screenwidth()
h = tk1.winfo_screenheight()
geometry = "%dx%d+%d+%d" % (w, h, 0, 0)
tk1.geometry(geometry)
tk1.title('Medicine List')
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
df=pd.read_sql('select * from stock',con)
frame = Frame(tk1)
frame.pack(fill=BOTH, expand=1)
my_canvas = Canvas(frame)
my_canvas.pack(side=LEFT, fill=BOTH, expand=1)
sbar2 = ttk.Scrollbar(frame, orient=VERTICAL, command=my_canvas.yview)
sbar2.pack(side=RIGHT, fill=Y)
my_canvas.configure(yscrollcommand=sbar2.set)
my_canvas.bind('<Configure>', lambda e:
my_canvas.configure(scrollregion=my_canvas.bbox('all')))
second_frame = Frame(my_canvas)
my_canvas.create_window((0, 0), window=second_frame, anchor='nw')
lab2 = Label(second_frame, text=df, font=('consolas', 30))
lab2.pack()
tk1.mainloop()
def addstock():
tj = Toplevel()
w = tj.winfo_screenwidth()
h = tj.winfo_screenheight()
geometry = "%dx%d+%d+%d" % (w, h, 0, 0)
tj.geometry(geometry)
tj.title("Enter Medicine ")
# create frame for arranging
frame1 = LabelFrame(tj)
frame1.grid(row=1, column=0,padx=100,pady=10)
lab3=Label(tj,text =' ENTER MEDICINE DETAILS ',font=('arial black',50,),bg='light
green',fg='red')
lab3.grid(row=0,column=0 ,pady=20)
mcode=Entry(frame1,font=('arial',25))
mcode.grid(row=1, column=1, pady=5, padx= 80)
m_name=Entry(frame1,font=('arial',25))
m_name.grid(row=2, column=1, pady=5, padx=80)
dateofexpiry=Entry(frame1,font=('arial',25))
dateofexpiry.grid(row=3, column=1, pady=5, padx=80)
quantity=Entry(frame1,font=('arial',25))
quantity.grid(row=4, column=1, pady=5, padx=80)
price=Entry(frame1,font=('arial',25))
price.grid(row=5, column=1, pady=5, padx=80)
Label(frame1, text="Serial Number:", font=('arial', 25)).grid(row=1, column=0,
sticky=W,padx=80, pady=10)
Label(frame1, text="Medicine Name:", font=('arial', 25)).grid(row=2, column=0, sticky=W,
padx=80, pady=10)
Label(frame1, text="Date of Expiry(yyyy-mm-dd):", font=('arial', 25)).grid(row=3, column=0,
sticky=W, padx=80, pady=10)
Label(frame1, text="Quantity Of Medicine:", font=('arial', 25)).grid(row=4, column=0,
sticky=W, padx=80, pady=10)
Label(frame1, text="Price Of Medicine:", font=('arial', 25)).grid(row=5, column=0, sticky=W,
padx=80,pady=10)
# to save the Details of Medicine
def po_cd():
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
sql = "INSERT INTO stock(mcode,m_name ,dateofexpiry ,quantity ,price )VALUES(%s,
%s,%s,%s,%s)"
er = (mcode.get(), m_name.get(), dateofexpiry.get(), quantity.get(), price.get())
c.execute(sql, er)
con.commit()

#for clearing Filed


def clr_fil():
mcode.delete(0, END)
m_name.delete(0, END)
dateofexpiry.delete(0, END)
quantity.delete(0, END)
price.delete(0, END)
#create frame for arranging
frame2=LabelFrame(tj)
frame2.grid(row=2,column=0)
but1 =Button(frame2, text='Add Medicine ',font=('arial',25), command=po_cd)
but1.grid(row=1,column=1)
but1 = Button(frame2, text='Clear Field',font=('arial',25), command=clr_fil)
but1.grid(row=1,column=2)
tj.mainloop()
med = PhotoImage(file='med.png')
medicine = PhotoImage(file='medilist.png')
search=PhotoImage(file='search4.png')
frame1=LabelFrame(root,padx=250,borderwidth=0)
frame1.grid(row=1,column=0)
frame1.config(bg='white')
free_space = Label(frame1, text = "", bg = 'white')
free_space.grid(row=1, column=1)
L1=Label(root,text=' + MEDICAL STORE + ',font=('arial black',50),fg='red',padx=50,bg
= "light green")
L1.grid(row=0,column=0,pady=30
# button for image

but1=Button(frame1,image=medicine,font=('arial',28),command=addstock,height=200,width=200,b
g='white',borderwidth=0)
but1.grid(row=0,column=1,padx=20,pady=20)

but2=Button(frame1,image=med,font=('arial',28),command=sortmedicine,bg='white',borderwidth=0
)
but2.grid(row=0,column=2,padx=50,pady=20)
but3= Button(frame1, image=search, font=('arial', 28), command=search_doctor,
bg='white',borderwidth=0)
but3.grid(row=0, column=3, padx=20, pady=20)
#label for image
l1=Label(frame1, text="Add Medicine", font=('arial', 25),borderwidth=0)
l1.grid(row=1, column=1, padx=20, pady=20)
l2=Label(frame1, text="List of Medicine", font=('arial', 25))
l2.grid(row=1, column=2, padx=50, pady=20)
l3=Label(frame1, text="Search", font=('arial', 25))
l3.grid(row=1, column=3, padx=20,pady=20)
#but3=Button(root,text=df2)
return root.mainloop()
ACKNOWLEDGEMENT PAGE
from tkinter import *
import mysql.connector as co
def seventhpage():
root = Toplevel()
w = root.winfo_screenwidth()
h = root.winfo_screenheight()
geometry="%dx%d+%d+%d"%(w,h,0,0)
root.geometry(geometry)
root.config(bg = "white")
root.title('Acknowledgement')
def thanksgiving():
tk = Tk()
w = 700
h = 400
geometry = "%dx%d+%d+%d" % (w, h, 320, 150)
tk.geometry(geometry)
tk.title('Thank You')
Label(tk, text='I Would Like To Thanks DMP SIR',font=('Lucida
Calligraphy',20,'bold')).pack()
Label(tk, text='Codemy.com(YouTube)',font=('Lucida Calligraphy', 20,'bold')).pack()
Label(tk, text='Ajay Kaushdan(Friend)', font=('Lucida Calligraphy', 20,'bold')).pack()
Label(tk, text='Kevin Monpara(Friend))',font=('Lucida Calligraphy',20,'bold')).pack()
Label(tk, text='Namra Mangukiya(Friend)',font=('Lucida Calligraphy',20,'bold')).pack()
Label(tk, text='Brilliant Minds By Neeru(Youtube)',font=('Lucida Calligraphy',
20,'bold')).pack()
Label(tk, text=' To Make This Project Beautifull',font=('Lucida
Calligraphy',20,'bold')).pack()
tk.mainloop()
def abtp():
tk = Tk()
w = 700
h = 400
geometry = "%dx%d+%d+%d" % (w, h, 320, 150)
tk.geometry(geometry)
tk.title('Project Overview')
Label(tk,text='This project is divided into Four parts, ',font=('Lucida
Calligraphy',20,'bold')).pack()
Label(tk,text='First part tells about the Patient Details,',font=('Lucida
Calligraphy',20,'bold')).pack()
Label(tk,text='Second part tells about the Doctor Details,',font=('Lucida
Calligraphy',20,'bold')).pack()
Label(tk, text='Third part tells about the Staff Details,',font=('Lucida
Calligraphy',20,'bold')).pack()
Label(tk, text='Fourth part about the different ',font=('Lucida Calligraphy',20,'bold')).pack()
Label(tk, text=' types of Medicine Available. ',font=('Lucida Calligraphy',20,'bold')).pack()
tk.mainloop()
def prerequisite():
fd = Toplevel()
w = 500
h = 500
geometry = "%dx%d+%d+%d" % (w, h, 320, 150)
fd.geometry(geometry)
fd.title('Prerequisite For project')
def databas():
con = co.connect(host='localhost', user='root', passwd='beradi')
c = con.cursor()
c.execute("CREATE DATABASE devbera")
def pat():
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
c.execute("CREATE TABLE patient2(p_id INT(4) primary key,p_name VARCHAR(70),
p_age INT(4),p_gender VARCHAR(15),p_height INT(4),p_weight INT(4),p_problem
VARCHAR(250),p_phoneno BIGINT(15))")
def med():
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
c.execute("CREATE TABLE stock(mcode INT(4) primary key,m_name
VARCHAR(82),dateofexpiry DATE,quantity INT(80),price BIGINT(15))")
def doc1():
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
c.execute( "CREATE TABLE doctor2(d_id INT(4) primary key,d_name
VARCHAR(82),d_age INT(4),d_dept VARCHAR(80),d_phone BIGINT(15))")
def worker():
con = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
c = con.cursor()
c.execute("CREATE TABLE worker(w_id INT(4) primary key,w_name
VARCHAR(85),w_age INT(4),w_gender VARCHAR(75),w_work VARCHAR(85),w_phone BIGINT(15))")
but5 = Button(fd, text="Create Database", font=('arial', 17), command=databas, padx=40,
pady=10,height=2, width=20)
but5.pack()
but1=Button(fd,text="Create patient table", font=('arial', 17),command=pat, padx=40,
pady=10,height=2,width=20)
but1.pack()
but2=Button(fd,text='Create Medicine Table',font=('arial', 17),command=med, padx=40,
pady=10,height=2,width=20)
but2.pack()
but3=Button(fd,text='Create Doctor Table',font=('arial',
17),command=doc1,padx=40,pady=10,height=2,width=20)
but3.pack()
but4=Button(fd, text="Create Staff Table", font=('arial', 17), command=worker, padx=40,
pady=10,height=2,width=20)
but4.pack()
fd.mainloop()
## create buttons for frame
lab1=Label(root,text=' Acknowledgement ',font=('arial
black',50),pady=20,fg='red',bg='light green')
lab1.pack()
but1=Button(root,text='Prerequisite For project',font=('arial ',25),command=
prerequisite,bg='white',height=2,width=20,pady=20)
but1.pack()
but2 = Button(root, text='Acknowledgement',font=('arial
',25),command=thanksgiving,bg='white',height=2,width=20,pady=20)
but2.pack()
but3= Button(root,text='Details of Project',font=('arial
',25),command=abtp,bg='white',height=2,width=20,pady=20)
but3.pack()
return root.mainloop()
TO RUN THE CODE PAGE
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
import pandas as pd
import mysql.connector as co
import login as l
global mydb
mydb = co.connect(host='localhost', user='root', passwd='beradi', database='devbera')
l.openLogin()
OUTPUT SCREENSHOT
• Run the Program TO RUN THE CODE.py

• If You login Correctly


• Main Window

• If You Click The New Patient/Existing


• If You Click The Patient List

• If You Click The Search/Edit Button


• If You Click The Doctors Button

• If You Click The Doctors List Button


 If You Click The Search/Edit Doctors Button

• If You Click The Staff Button


 If You Click The Staff List Button

• If You Click The Search/Edit Staff Button


• If You Click The Medical Store Button

• If You Click The Add Medicine Button


 If You Click The List of Medicine Button

• If You Click ‘The Search/ Edit Medicine’ Button


• If You Click ‘The About’ Button\

• If You Click ‘Prerequisite For Project’ Button


• If You Click ‘Acknowledgement’ Button

• If You Click ‘Details Of Project’Button


• Mysql Patient Table Structure

• Mysql Patient Table


• Mysql Doctor Table Structure
• Mysql Doctor Table

• Mysql Staff Table Structure


• Mysql Staff Table

• Mysql Medicine Table Structure


• Mysql Medicine Table

COADING EXECUTION PROCEDURE

1.)Install python from the web.

2.)Keep all Image in same folder where the py. program is exist.

3.)Then run the program file.


BIBLIOGRAPHY

• Informatics Practices With Python & Mysql - Class XII By :


SumitaArora
• Website : https://www.w3resource.com
• www.google.com

• www.youtube.com

x-x-x-x-x

You might also like