Professional Documents
Culture Documents
################KALYANPUR KANPUR###############################
################SESSION: 2022-2023##############################
import os
import platform
import mysql.connector
mydb = mysql.connector.connect(host = "localhost", user = "yourusername", password =
"your_password")
mycursor=mydb.cursor()
mycursor.execute(P)
(1001,'T-Dolo(650)','Micro-Labs',12,'01/09/2022','02/03/2023'),
(1002,'C-Evian(400)','Defi-Labs',20,'27/12/2022','02/05/2023'),
(1003,'T-Zerodol','Contra-Labs',42,'14/08/2022','12/01/2023'),
(1004,'Pantip(40)','Sci-Labs',17,'12/01/2022','27/07/2023'),
(1005,'Carca(25)','Eren-Labs',10,'04/12/2022','06/05/2023'),
(1006,'Thyronorm','Kaisen-Labs',99,'19/06/2022','05/08/2023'),
(1007,'C-Omez(20)','Vixen-Labs',61,'18/01/2022','16/09/2022'),
(1008,'Montair-LC','Ultra-Labs',58,'23/05/2022','29/06/2023'),
(1009,'T-Meftal-SPAS','Zen-Labs',14,'06/06/2022','03/02/2023
'),
(1010,'Gudcef(200)','Spy-Labs',52,'11/04/2022','25/04/2023')"""
mycursor.execute(R)
K="""CREATE TABLE customer(Customer_Id varchar(30), Customer_Name varchar(30), PhoneNo
varchar(30),Age varchar(30), Gender varchar(30), Membership varchar(30))"""
mycursor.execute(K)
(103,'Yoichi Isagi','+919475837465',17,'Male','Diamond'),
(104,'Hinata Hyuga','+919783546789',19,'Female','Premium')"""
mycursor.execute(M)
mydb.commit()
def MedicineInsert():
values(?,?,?,?,?,?)', (Id,Name,Company,Cost,Manufacture_Date,Expiration_Date))
mydb.commit()
def customerInsert():
Customer_Id=input("Enter the Customer number : ")
mydb.commit()
def MedicineView():
print("Select the search criteria : ")
print("3. All")
ch=int(input("\nEnter the choice : "))
if ch==1:
s=input("Enter Medicine ID : ")
mycursor.execute('select * from product where Id=?',(s))
res=mycursor.fetchall()
print("\nDetails of the Specified Medicine areas follows:")
return
elif ch==2:
s=input("Enter Medicine Name : ")
mycursor.execute('select * from product where Name=?',(s))
res=mycursor.fetchall()
return
elif ch==3:
mycursor.execute('SELECT * FROM product;')
r=mycursor.fetchall()
for i in r:
print(i)
def viewCustomer():
print("Select the search criteria : ")
print("3. All")
ch=int(input("\nEnter the choice : "))
if ch==1:
s=int(input("Enter customer ID : "))
mycursor.execute('select * from customer where Customer_Id=?',(s))
res=mycursor.fetchall()
print("\nDetails of the Specified Customer areas follows:")
return
elif ch==2:
s=input("Enter Customer Name : ")
mycursor.execute('select * from customer where Customer_Name=?',(s))
res=mycursor.fetchall()
print("\nDetails of the Specified Customer areas follows:")
return
elif ch==3:
sql="select * from customer"
mycursor.execute(sql)
res=mycursor.fetchall()
for x in res:
print(x)
def CustomerPurchase():
sql="select * from product"
mycursor.execute(sql)
res=mycursor.fetchall()
for x in res:
print(x)
cost=0.0
ch='y'
while(ch=='y'):
res=mycursor.fetchall()
tsum=0
for x in res:
cost=float(x[0])
print (cost)
cc=q1*cost
print(cc)
tsum=tsum+cc
ch=input("Want to purchase more meds:")
if (ch=='Yes'):
res=mycursor.fetchall()
for x in res:
cost=float(x[0])
print (cost)
ccc=q2*cost
print(ccc)
gsum=tsum+ccc
print("""
)))T H A N K Y O U F O R P U R C H A S I N G !(((
""")
def removeMedicine():
return
def Exit():
Exit=input("Are you sure? ")
if (Exit== 'Yes'):
mycursor.execute('DROP TABLE product, customer;')
mydb.commit()
print("""
~~*~~*~~{G O O D B Y E !}~~*~~*~~
""")
exit()
print("""
#***************WOODBINE GARDENIA SCHOOL**********************
#*
**************PHARMACY MANAGEMENT SYSTEM**********************
####################KALYANPUR KANPUR#############################
###################SESSION: 2022-2023#############################
""")
print("""
\C O N G R A T U L A T I O N S!!! /
\ /
\C O N N E C T I O N E S T A B L I S H E D !/
\ /
""")
print("""
""")
try:
except ValueError:
exit("\nHey!That's Not A Number") #Error Message
else:
print("\n") #Print New Line
if(userInput == 1):
MedicineInsert()
elif (userInput==2):
MedicineView()
elif (userInput==3):
CustomerPurchase()
elif (userInput==4):
removeMedicine()
elif (userInput==5):
customerInsert()
elif (userInput==6):
viewCustomer()
elif (userInput==7):
Exit()
else:
MenuSet()
def script():
sc=True
while (sc==True):
restart = input("\nWould You Like To Restart The System? ")
exit()
sc=script()
OUTPUT OF THE PROJECT:
Finally, we conclude our work and present the output of the Project.
MAIN SCREEN:
ADDING MEDICINES:
VIEWING MEDICINE:
VIEWING MEDICINE DETAILS USING MEDICINE ID:
MEDICINE STOCK DETAILS:
PURCHASE OF MEDICINES:
DELETING MEDICINE RECORD USING MEDICINE ID:
ENTERING NEW CUSTOMER RECORD:
VIEWING DETAILS OF THE CUSTOMER USING CUSTOMER
NAME:
VIEWING CUSTOMER ENTRIES IN THE SYSTEM:
TERMINATING THE SYSTEM:
MYSQL DATABASE AND TABLES USED IN THIS
PROJECT: