-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYOGA_RISING _APPLICATION.py
160 lines (149 loc) · 5.9 KB
/
YOGA_RISING _APPLICATION.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
import pyfiglet
import mysql.connector
from tkinter import *
from PIL import Image,ImageTk
from tkinter import ttk
W=''
def STYLES(x):
res=pyfiglet.figlet_format(x,font="digital")# Use standard,digital,bubble,etc fonts.
print("*"*80)
print(res)
print("*"*80)
def Registera():
W.destroy()
from USER import User_Login as J1
J1.Register()
Main()
def admin():
STYLES(" WELCOME TO YOGA RISING APPLICATION")
print("\t\t\t ADMIN LOGIN ")
while True:
from ADMIN import admin_login as M1
if (M1.Authorization_Login())==True: #if admin_module_login.Authorization_Login()==True:
while True:
print("*"*80)
print("\t\t\t 1.TABLE LOGIN")
print("\t\t\t 2.TABLE-DISEASES")
print("\t\t\t 3.TABLE-CENTRES")
print("\t\t\t 4.EXIT")
print("*"*80)
ch=int(input("ENTER THE CHOICE \t:\t"))
print("*"*80)
if ch==1:
STYLES(" LOGIN TABLE")
while ch<3:
print("*"*80)
print("\t\t\t 1. DISPLAYING OF RECORDS")
print("\t\t\t 2. INSERTION OF RECORDS")
print("\t\t\t 3. EXIT")
print("*"*80)
ch=int(input("ENTER THE CHOICE\t:\t"))
print("*"*80)
if ch==1:
M1.DisplayRec_Login()
if ch==2:
M1.Insertion_Login()
else:
continue
if ch==2:
from ADMIN import admin_diseases as M2
STYLES(" DISEASES TABLE")
while ch<4:
print("*"*80)
print("\t\t\t 1.INSERTION OF RECORDS")
print("\t\t\t 2.UPDATION OF RECORDS")
print("\t\t\t 3.DELETION OF RECORDS")
print("\t\t\t 4.EXIT")
print("*"*80)
ch=int(input("ENTER THE CHOICE\t:\t"))
print("*"*80)
if ch==1:
M2.Insertion_Diseases()
if ch==2:
M2.Updation_Diseases()
if ch==3:
M2.Deletionmain_Diseases()
else:
continue
if ch==3:
from ADMIN import admin_centres as M3
STYLES(" CENTRES TABLE")
while ch<4:
print("*"*80)
print("\t\t\t 1.INSERTION OF RECORDS")
print("\t\t\t 2.UPDATION OF RECORDS")
print("\t\t\t 3.DELETION OF RECORDS")
print("\t\t\t 4.EXIT")
print("*"*80)
ch=int(input("ENTER THE CHOICE\t:\t"))
print("*"*80)
if ch==1:
M3.Insertion_Centres()
if ch==2:
M3.Updation_Centres()
if ch==3:
M3.Deletionmain_Centres()
else:
continue
if ch==4:
break
STYLES(" STAY HEALTHY AND KEEP VISITING YOGA RISING APPLICATION")
break
def Author_Login():
conn=mysql.connector.connect(host="localhost",user="root",
password="tiger",database="project")
cur=conn.cursor()
print("*"*80)
u=input("ENTER THE USERNAME \t:\t")
p=input("ENTER THE PASSWORD \t:\t")
print("*"*80)
query="select username,password from login where username='{}' and password='{}'".format(u,p)
cur.execute(query)
records=cur.fetchall()
if records==[]:
print("\t\t Login failed! Try Again")
print("*"*80)
else:
print("\t\t Successfully Login!! Go ahead")
print("*"*80)
return True
def user():
STYLES(" WELCOME TO YOGA RISING APPLICATION")
W.destroy()
while True:
if Author_Login()==True:
from USER import User_Choices as M5
M5.User_Searching()
break
def Main():
global W
W=Tk()
W.geometry("840x540")
W.configure(bg="#FFA500")
W.title("INITIAL SCREEN")
image=Image.open("Yon.jpg")
R=image.resize((460,250))
R2=ImageTk.PhotoImage(R)
Lb=Label(W,image=R2)
Lb.place(x=190,y=74)
L1=Label(W,text=" Y O G A R I S I N G A P P L I C A T I O N ",bg="light green",font=("TIMES NEW ROMAN",24,"bold"))
L1.pack(fill=BOTH,padx=0,pady=0)
image1=Image.open("YO.jpg")
Ra=image1.resize((160,250))
Rb=ImageTk.PhotoImage(Ra)
Lb1=Label(W,image=Rb)
Lb1.place(x=10,y=80)
i=Image.open("GA.png")
Ri=i.resize((160,250))
Rj=ImageTk.PhotoImage(Ri)
Lbi=Label(W,image=Rj)
Lbi.place(x=670,y=80)
F=Frame(height=200,bg="#FF7F50",width=700,border=1)
F.place(x=68,y=345)
Ls=Label(W,text="CHOOSE YOUR CHOICE OUT OF THE THREE ",bg="#A52A2A",font=("TIMES NEW ROMAN",24,"bold"))
Ls.place(x=78,y=355)
B1=Button(F,text="ADMIN LOGIN ",relief=GROOVE,bg="Red",fg="black",command=admin,font=("Arial",15,"bold")).place(x=30,y=100)
B2=Button(F,text="USER REGISTER",relief=GROOVE,bg="Red",fg="black",command=Registera,font=("Arial",15,"bold")).place(x=230,y=100)
B3=Button(F,text="USER LOGIN",relief=GROOVE,bg="Red",fg="black",command=user,font=("Arial",15,"bold")).place(x=460,y=100)
W.mainloop()
Main()