From e897bdbd4d47855a561381bec08b6b0ce3b6a77e Mon Sep 17 00:00:00 2001 From: Sonia312 <101570119+Sonia312@users.noreply.github.com> Date: Sun, 15 May 2022 10:58:22 +0530 Subject: [PATCH 1/6] Create Team27PANACEA --- Team27PANACEA | 1 + 1 file changed, 1 insertion(+) create mode 100644 Team27PANACEA diff --git a/Team27PANACEA b/Team27PANACEA new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Team27PANACEA @@ -0,0 +1 @@ + From 316a5b7b2d6fc22548b001fbcb9794c3ca2a5b95 Mon Sep 17 00:00:00 2001 From: Sonia312 <101570119+Sonia312@users.noreply.github.com> Date: Sun, 15 May 2022 11:25:46 +0530 Subject: [PATCH 2/6] Rename README.md to Team27_PANACEA/README.md --- README.md => Team27_PANACEA/README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README.md => Team27_PANACEA/README.md (100%) diff --git a/README.md b/Team27_PANACEA/README.md similarity index 100% rename from README.md rename to Team27_PANACEA/README.md From 98b6099ad9463ded6cab1ef2ec8a515e5634adfc Mon Sep 17 00:00:00 2001 From: Sonia312 <101570119+Sonia312@users.noreply.github.com> Date: Sun, 15 May 2022 11:30:36 +0530 Subject: [PATCH 3/6] Add files via upload Team Mavericks medical application(PANACEA) Team Members - Nandini Wani, Radhika Fadnavis, Sonia Dessai One py file and one csv file uploaded --- Team27_PANACEA/loop.csv | 9 + Team27_PANACEA/loopfinal (1).py | 325 ++++++++++++++++++++++++++++++++ 2 files changed, 334 insertions(+) create mode 100644 Team27_PANACEA/loop.csv create mode 100644 Team27_PANACEA/loopfinal (1).py diff --git a/Team27_PANACEA/loop.csv b/Team27_PANACEA/loop.csv new file mode 100644 index 0000000..8051eea --- /dev/null +++ b/Team27_PANACEA/loop.csv @@ -0,0 +1,9 @@ +0,1,2,3,4,5 +accufine 20mg,ISOTRETINOIN 20 mg,Acne,250.0,200.0,105 +acnesol gel 20gm,CLINDAMYCIN 1%W/W,Acne,80.0,64.0,100 +atrest 12.5mg,TETRABENAZINE 12.5MG,ADHD,154.04,123.23,100 +betacap 20mg,PROPRANOLOL 20MG,Hypertension,30.0,24.0,100 +brintop 5% topical solution,MINOXIDIL 5%,Hair Loss,750.0,600.0,100 +caladerm lotion,ALOE VERA+CALAMINE+LIGHT LIQUID PARAFFIN+VITAMIN E,Dry Skin,178.0,142.4,100 +ibrex 120mg,FEXOFENADINE HYDROCHLORIDE 120 mg,Allergy,70.0,56.0,100 +zywet eye drops,POLYETHYLENE GLYCOL 0.4%+PROPYLENE GLYCOL 0.3%,Dry Eye,218.7,174.96,100 diff --git a/Team27_PANACEA/loopfinal (1).py b/Team27_PANACEA/loopfinal (1).py new file mode 100644 index 0000000..44560f7 --- /dev/null +++ b/Team27_PANACEA/loopfinal (1).py @@ -0,0 +1,325 @@ +import csv +import pandas as pd + +def verify(usrid,pwrd): #creating function verify for checking correct userid and password. + a=False + if ((usrid=="panacea123") and (pwrd=="pan@119")): + a=True + return (a) + +''' +class cust: + name="" #creating a class named cust to store customer details. + Cnum="" + Cmail="" +''' +#---------------------------------------------------------------------------- + +print("-"*27,"WELCOME TO PANACEA","-"*27) +ver = False +while (not ver): + uid=input("Enter user id: ") #Taking inputs for user id and password. + pwd=input("Enter password: ") + ver=verify(uid,pwd) # calling of function. + if ver==False: + print("Invalid User name or password") #message printed if either of password or user id is worng. + +#while (ver): +class bst: # using the concept of binary search tree to sort the data + def __init__(self,val): + self.val=val + self.lc=None + self.rc=None + def addc(self,val): + if val==self.val: + return + elif valordernum: # checking if amount of medicines available is more than oredered number of medicines + print("Number of medicines is insufficient!!") + med() + else: + ordernum-=order + mrp_price=order*ordered_list2[ind][3] + totalprice=order*ordered_list2[ind][4] + csvdf.iloc[ind,5]=ordernum + df2=pd.DataFrame([[ordered_list2[ind][0],ordered_list2[ind][1],ordered_list2[ind][2],ordered_list2[ind][3],ordered_list2[ind][4],order,mrp_price,totalprice]]) + global df1,t + df1=pd.concat([df1,df2],ignore_index=True) + t+=1 + def optsel(): + opt=int(input("Enter 1-To order more medicines\n2-To final the order : ")) + if opt==1: + med() + elif opt==2: + print("") + else: # Checks if the option selected exists + print("Wrong option selected. Re-enter option\n") + optsel() + optsel() + else: + print("This medicine is not present in the inventory. Re-enter the medicine name") + med() + med() + x1=0 + x2=1 + final_price=0 + discount_price=0 + while(x2<=t): + final_price+=df1.iloc[x2,7] + x2+=1 + bfinal_price=final_price + if final_price>1000: + final_price=0.9*final_price + sgst=0.18*final_price + cgst=0.09*final_price + final_price=final_price+sgst+cgst + global csvdf + csvdf.to_csv("C:\Sonia\Cummins Assignments\loop.csv",index=False) + +#NANDINI------------------------------------------------------------------- + print("-"*85)#printing of E-BILL. + print("\t\t\t E-BILL GENERATED \t\t\t") + print("-"*85) + import datetime as dt + dt_India = dt.datetime.utcnow() + dt.timedelta(hours=5, minutes=30) + Indian_time = dt_India.strftime('%d-%b-%y %H:%M:%S') + max_len = len(max(['Indian Time'], key=len)) + print(Indian_time)#printing date and time of purchasing. + print("NAME :",Cname,"\t\t\t PhNo :",Cnum)#printing name,phone number and email of customer. + print("EMAIL ID :",Cmail) + print("-"*85) + df1.rename(columns={0:'| ITEM |',1:1,2:2,3:'| MRP |',4:'| BEST_PRICE |',5:'| QUANTITY |',6:6,7:7},inplace=True) + print(df1.loc[1:,['| ITEM |','| QUANTITY |','| MRP |','| BEST_PRICE |']].to_markdown()) #printing items,quantity,price of the items purchased. + print("-"*85) + print("<","-"*22,"AMOUNT IN INR","-"*20,">") + print("TOTAL AMOUNT : {:.2f}".format(bfinal_price))#printing total price,discount price and final price(by adding sgst and cgst). + if discount_price!=0: + print("DISCOUNT(10%): {:.2f}".format(discount_price)) + print("CGST(9%) : {:.2f}".format(cgst)) + print("SGST(18%): {:.2f}".format(sgst)) + print("FINAL AMOUNT(INCLUDING TAXES): {:.2f}".format(final_price)) + print("-"*85) + print("PAYMENT OPTIONS :")# payment options-later or now. + print("ENTER 1 FOR : LATER OPTION") + print("ENTER 2 FOR : NOW OPTION") + ch=int(input("PLEASE ENTER THE ABOVE CHOICE :")) + pay="" + if ch==1 : + print("YOUR AMOUNT WILL BE STORED FOR LATER PAY") + else : + print("PAYMENT OPTIONS")# options for now payment. + print("ENTER\n1 FOR: CASH\n2 FOR: DEBIT/CREDIT CARD\n3 FOR: GOOGLE PAY\PAYTM\PHONE PAY\n4 FOR: ANY OTHER OPTION") + pay=int(input("ENTER YOUR PAYMENT MODE: ")) +#print("pay value",pay) + if pay==1: + payment="CASH" + elif pay==2: + payment="DEBIT/CREDIT CARD" + elif pay==3: + payment="GOOGLE PAY\PAYTM\PHONE PAY" + elif pay==4: + payment="ANY OTHER OPTION" + else : + payment="LATER OPTION" + import smtplib + df=df1.loc[1:,['| ITEM |','| QUANTITY |','| MRP |','| BEST_PRICE |']] #sending email to buyer regarding their purchased items and payment status using smtplib library. + s=smtplib.SMTP_SSL("smtp.gmail.com",465) + s.login("medipanacea@gmail.com","loop@3004") + subject="YOUR PANACEA ORDER CONFIRMATION AND PAYMENT DETAILS" + if payment=="LATER OPTION" : #message-if payment option selected is later. + Text="Hello,\nThanks for confirming your order with PANACEA of medicines.\nYour order summary :\n{}\nTotal Payable Amount:{:.2f}\nPAYMENT STATUS :{}\nPlease pay your bill within 30 days ".format(df.to_string(),final_price,payment) + else : #message-if payment option selected is now. + Text="Hello,\nThanks for confirming your order with PANACEA of medicines\nYour order summary\n{}\nTotal Payable Amount:{:.2f}\nPAYMENT STATUS :{}".format(df.to_string(),final_price,payment) + message='Subject: {}\n\n{}'.format(subject,Text) + s.sendmail("medipanacea@gmail.com",Cmail,message) + s.quit() + first_input() #calling of function first_input to diaplay menu and enter choice. + + elif (c==2): # if choice entered is 2. + def med_add(): #creating a function med_add to MODIFYING ITEM QUANTITY IN INVENTORY. + csvdf=pd.read_csv("C:\Sonia\Cummins Assignments\loop.csv") + medicines=csvdf["0"].tolist() + val=csvdf.values + medicine2=val.tolist() + mt=tree(medicines) + ordered_list=mt.order() + mt2=tree(medicine2) + ordered_list2=mt2.order() + y=input("Medicine Name : ") + y=y.lower() + z=mt.search(y) + if z==True: + ind=ordered_list.index(y) + ordernum=csvdf.iloc[ind,5] + order=int(input("Enter the amount to be added : ")) + ordernum+=order # Adds more medidine in the inventory + csvdf.iloc[ind,5]=ordernum + print("QUANTITY AFTER ADDITION OF MORE MEDICINES IS",ordernum) + csvdf.to_csv("C:\Sonia\Cummins Assignments\loop.csv",index=False) + else: + print("\nNo medicine with such name found") + med_add() + def optsel(): + opt=int(input("Enter 1-To add quantity of more medicines\n2-To go to menu : ")) + if opt==1: + med_add() + elif opt==2: + first_input() + else: + print("Wrong option selected. Re-enter option\n") + optsel() + optsel() + med_add() + elif c==3: #if choice entered is 3. + def new_item(): #creating a function new_item() to add new medicines in inventory. + med_name=input("New Medicine Name : ") + med_name=med_name.lower() + med_content=input("New Medicine Content : ") + med_e=input("What is the medicine used for : ") + med_mrp=int(input("Medicine mrp : ")) + med_bp=int(input("Medicine best price : ")) + med_qty=int(input("Medicine quantity : ")) + l=[med_name,med_content,med_e,med_mrp,med_bp,med_qty] + csvdf=pd.read_csv("C:\Sonia\Cummins Assignments\loop.csv") + val=csvdf.values + medicine2=val.tolist() + medicine2.append(l) + mt2=tree(medicine2) + ordered_list2=mt2.order() + df=pd.DataFrame(ordered_list2) + df.to_csv("C:\Sonia\Cummins Assignments\loop.csv",index=False) + def optsel(): + opt=int(input("Enter 1-To add more medicines\n2-To go to menu : ")) + if opt==1: + new_item() + elif opt==2: + first_input() + else: + print("Wrong option selected. Re-enter option\n") + optsel() + optsel() + new_item() + elif c==4: #if choice entered is 4. + csvdf=pd.read_csv("C:\Sonia\Cummins Assignments\loop.csv") + print(csvdf) #printing of mediciens present in inventory. + first_input() #calling of function first_input to diaplay menu and enter choice. + elif c==5: #if choice entered is 5. + def del_item(): # creating function del_item to delete data from inventory. + csvdf=pd.read_csv("C:\Sonia\Cummins Assignments\loop.csv") + medicines=csvdf["0"].tolist() + val=csvdf.values + medicine2=val.tolist() + mt=tree(medicines) + ordered_list=mt.order() + mt2=tree(medicine2) + ordered_list2=mt2.order() + y=input("Medicine Name : ") + y=y.lower() + z=mt.search(y) + if z==True: + n=ordered_list.index(y) + csvdf=csvdf.drop(n) + val=csvdf.values + medicine2=val.tolist() + mt2=tree(medicine2) + ordered_list2=mt2.order() + df11=pd.DataFrame(ordered_list2) + df11.to_csv("C:\Sonia\Cummins Assignments\loop.csv",index=False) + print("\nMedicine data deleted.\n") + else: + print("\nNo medicine with such name found") + del_item() + def optsel(): + opt=int(input("Enter 1-To delete more medicines\n2-To go to menu : ")) + if opt==1: + del_item() + elif opt==2: + first_input() + else: + print("Wrong option selected. Re-enter option\n") + optsel() + optsel() + del_item() + elif c==6: #if choice entered is 6. + exit #program will get terminated. + else: + print("\nWrong option selected. Re-enter option") # if the enetered choice is invalid it will display this message. + first_input() #calling of function first_input to diaplay menu and enter choice. + +first_input() From 6a27620b98b3940fee3b70a23f71b2ffb3dbea39 Mon Sep 17 00:00:00 2001 From: Sonia312 <101570119+Sonia312@users.noreply.github.com> Date: Sun, 15 May 2022 11:53:54 +0530 Subject: [PATCH 4/6] Update loopfinal (1).py --- Team27_PANACEA/loopfinal (1).py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Team27_PANACEA/loopfinal (1).py b/Team27_PANACEA/loopfinal (1).py index 44560f7..5e42402 100644 --- a/Team27_PANACEA/loopfinal (1).py +++ b/Team27_PANACEA/loopfinal (1).py @@ -90,7 +90,7 @@ def first_input(): df3=pd.DataFrame([[Cname,Cmail,Cnum,None,None,None,None,None]]) #creating dataframe df3 df1=pd.concat([df1,df3],ignore_index=True) #concatinating dataframe df1 and df3. -#SONIA------------------------------------------------------------------ + def med(): global csvdf @@ -152,7 +152,7 @@ def optsel(): global csvdf csvdf.to_csv("C:\Sonia\Cummins Assignments\loop.csv",index=False) -#NANDINI------------------------------------------------------------------- + print("-"*85)#printing of E-BILL. print("\t\t\t E-BILL GENERATED \t\t\t") print("-"*85) From 5ff73530bc8bbbd9e1d3111a8a4b6a891ee81218 Mon Sep 17 00:00:00 2001 From: Sonia Dessai <101570119+Sonia312@users.noreply.github.com> Date: Sun, 12 Mar 2023 12:32:19 +0530 Subject: [PATCH 5/6] Create README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..b7974ba --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Buffer_3.0 +Buffer 3.0 Repository to submit your projects + +Project made using python language which stores the data of medicines available and its amount. + +It accepts orders from the customer and binary search tree is used to search the given medicine data. The generated bill is displayed on console as well as sent to the customers through mails with an option to pay right now or later. + +By using Binary Search tree, the searching process becomes less time consuming hence efficiency of code increased. Also used pandas Dataframes to store the medicine data imported from CSV and for bill generation after the order has been confirmed. + From 641feea0976cf41c0e2ba3af4766d313ea9773bb Mon Sep 17 00:00:00 2001 From: Sonia Dessai <101570119+Sonia312@users.noreply.github.com> Date: Sun, 12 Mar 2023 12:32:56 +0530 Subject: [PATCH 6/6] Update README.md --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index b7974ba..fe5577b 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,5 @@ # Buffer_3.0 Buffer 3.0 Repository to submit your projects -Project made using python language which stores the data of medicines available and its amount. -It accepts orders from the customer and binary search tree is used to search the given medicine data. The generated bill is displayed on console as well as sent to the customers through mails with an option to pay right now or later. - -By using Binary Search tree, the searching process becomes less time consuming hence efficiency of code increased. Also used pandas Dataframes to store the medicine data imported from CSV and for bill generation after the order has been confirmed.