-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront.py
180 lines (162 loc) · 6 KB
/
front.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
from back import *
import pywebio.output as pwo
from pywebio.input import *
from main import *
def in_info_f():
pwo.clear()
arr = input_group("Insert Contact Information",[
input('Mail_ID', name='name'),
input('Address', name='addrs'),
input('Mobile Number 1', name='m1'),
input('Mobile Number 2', name='m2'),
input('Designation', name='desig')])
isSuccessful = in_info(str(arr['name']), str(arr['addrs']), str(arr['m1']), str(arr['m2']), str(arr['desig']))
if(isSuccessful == -1):
img=open("something-went-wrong_f.gif",'rb').read()
pwo.put_image(img)
else:
img=open("inset_successful_f.gif",'rb').read()
pwo.put_image(img)
pwo.put_buttons(['Home Page'], onclick = [home_page])
def in_player_f():
pwo.clear()
arr = input_group("Insert Player Information",[
input('Player_ID', name='1'),
input('Fee_Structure_ID', name='2', type=NUMBER),
input('Mail_ID', name='3'),
input('Height', name='4'),
input('Name', name='5'),
input('Position', name = '6'),
input('Birth_Date', name = '7', type=DATE),
input('Password', name='8', type = PASSWORD),
input('Attendance', name='9'),
input('Player_Status', name='10')])
arr['11'] = 0
isSuccessful = in_player(arr['1'], arr['2'], arr['3'], arr['4'], arr['5'], arr['6'], arr['7'], arr['8'], arr['9'], arr['10'], arr['11'])
if(isSuccessful == -1):
img=open("something-went-wrong_f.gif",'rb').read()
pwo.put_image(img)
else:
img=open("inset_successful_f.gif",'rb').read()
pwo.put_image(img)
pwo.put_buttons(['Home Page'], onclick = [home_page])
def in_trainer_f():
pwo.clear()
arr = input_group("Insert Trainer Information",[
input('Trainer_ID', name='1'),
input('Mail_ID', name='2'),
input('Salary_Structure_ID', name='3', type=NUMBER),
input('Name', name='4'),
input('Password', name='5', type = PASSWORD),
input('Attendance', name='6', type = FLOAT)])
isSuccessful = in_trainer(arr['1'], arr['2'], arr['3'], arr['4'], arr['5'], arr['6'])
if(isSuccessful == -1):
img=open("something-went-wrong_f.gif",'rb').read()
pwo.put_image(img)
else:
img=open("inset_successful_f.gif",'rb').read()
pwo.put_image(img)
pwo.put_buttons(['Home Page'], onclick = [home_page])
def del_contact_info_f():
pwo.clear()
s = input("Insert Primary key: ")
del1 = del_contact_info(s)
if(del1 == -1):
img=open("something-went-wrong_f.gif",'rb').read()
pwo.put_image(img)
else:
img=open("delete_successful_f.gif",'rb').read()
pwo.put_image(img)
pwo.put_buttons(['Home Page'], onclick = [home_page])
def del_player_info_f():
pwo.clear()
s = input("Insert Primary key: ")
del1 = del_player_info(s)
if(del1 == -1):
img=open("something-went-wrong_f.gif",'rb').read()
pwo.put_image(img)
else:
img=open("delete_successful_f.gif",'rb').read()
pwo.put_image(img)
pwo.put_buttons(['Home Page'], onclick = [home_page])
def del_trainer_info_f():
pwo.clear()
s = input("Insert Primary key: ")
del1 = del_trainer_info(s)
if(del1 == -1):
img=open("something-went-wrong_f.gif",'rb').read()
pwo.put_image(img)
else:
img=open("delete_successful_f.gif",'rb').read()
pwo.put_image(img)
pwo.put_buttons(['Home Page'], onclick = [home_page])
def show_info_f():
pwo.clear()
txt = show_info()
pwo.put_markdown(""" # Contact Information""")
pwo.put_table(txt)
pwo.put_buttons(['Home Page'], onclick = [home_page])
def show_player_f():
pwo.clear()
txt = show_player()
pwo.put_markdown(""" # Player""")
pwo.put_table(txt)
pwo.put_buttons(['Home Page'], onclick = [home_page])
def show_trainer_f():
pwo.clear()
txt = show_trainer()
pwo.put_markdown(""" # Trainer""")
pwo.put_table(txt)
pwo.put_buttons(['Home Page'], onclick = [home_page])
def search_player_f():
pwo.clear()
p_id=int(input("Enter Player_ID"))
ans=search_player(p_id);
if(ans!=-1):
pwo.put_markdown(""" # Player Information""")
pwo.put_table(ans)
elif ans==-1:
img=open("something-went-wrong_f.gif",'rb').read()
pwo.put_image(img)
pwo.put_buttons(['Home Page'], onclick = [home_page])
def search_contact_f():
pwo.clear()
mail_id=input("Enter Mail_ID")
ans=search_contact(mail_id);
if(ans!=-1):
pwo.put_markdown(""" # Contact Information""")
pwo.put_table(ans)
elif ans==-1:
img=open("something-went-wrong_f.gif",'rb').read()
pwo.put_image(img)
pwo.put_buttons(['Home Page'], onclick = [home_page])
def query1_f():
pwo.clear()
txt = query1()
pwo.put_markdown(""" # List all the player names of team who has scored highest points among other teams.""")
pwo.put_table(txt)
pwo.put_buttons(['Home Page'], onclick = [home_page])
def query2_f():
pwo.clear()
txt = query2()
pwo.put_markdown(""" # Find all player's names who played the highest matches.""")
pwo.put_table(txt)
pwo.put_buttons(['Home Page'], onclick = [home_page])
def query3_f():
pwo.clear()
txt = query3()
pwo.put_markdown(""" # List Date and Court Number for the matches won by team "Panthers".""")
pwo.put_table(txt)
pwo.put_buttons(['Home Page'], onclick = [home_page])
def query4_f():
pwo.clear()
txt = query4()
pwo.put_markdown(""" # List all the player's names who played on 22 nd January, 2001 at court No. 12.""")
pwo.put_table(txt)
pwo.put_buttons(['Home Page'], onclick = [home_page])
def query5_f():
pwo.clear()
txt = query5()
pwo.put_markdown(""" # Find the Average Age of all Player. """)
pwo.put_table(txt)
pwo.put_buttons(['Home Page'], onclick = [home_page])