Repository navigation
Expand file tree
/
Copy pathbanking_pro.py
More file actions
626 lines (522 loc) · 29.1 KB
/
Copy pathbanking_pro.py
File metadata and controls
626 lines (522 loc) · 29.1 KB
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
from tkinter import *
import tkinter.messagebox as tmsg #to import message box
from PIL import Image, ImageTk # pillow library to vieww images
import os
import re
from tkinter import ttk
import shelve
from tkinter.ttk import Combobox #to import combobox
root = Tk()
root.title("BANKING PROJECT")
root.geometry("600x600")
#list of districts for combobox
ls = ['Ahmednagar','Akola','Amravati','Aurangabad','Beed','Bhandara','Buldhana','Chandrapur','Dhule','Gadchiroli',
'Gondia','Hingoli','Jalgaon','Jalna','Kolhapur','Latur','Mumbai City','Mumbai Suburban','Nagpur','Nanded',
'Nandurbar','Nashik','Osmanabad','Palghar','Parbhani','Pune','Raigad','Ratnagiri','Sangli','Satara','Sindhudurg',
'Solapur','Thane','Wardha','Washim','Yavatmal']
#func for combobox
def comboclick(event):
pass
#
# count = 0
def submit():
username = namevalue.get()
name = namevalue.get()
age = agevalue.get()
gender = gendervalue.get()
password = passwordvalue.get()
adharcard = adharcardvalue.get()
address = addressvalue.get()
phone = phonevalue.get()
email = emailvalue.get()
account_type = accountvalue.get()
date_var = datevalue.get()
month_var = monthvalue.get()
year_var = yearvalue.get()
all_accounts = os.listdir()
if username == "" or age == "" or gender == "" or password == "" or adharcard == "" or address==""\
or phone =="":
tmsg.showerror("Error","All feilds are required!")
return
for adharcard_check in all_accounts:
if adharcard_check == adharcard:
tmsg.showwarning("Alert","Account already exists!")
return
else:
new_file = open(name, "w")
new_file.write(username + '\n')
new_file.write(password + '\n')
new_file.write(age + '\n')
new_file.write(gender + '\n')
new_file.write(adharcard + '\n')
new_file.write(phone + '\n')
new_file.write(address + '\n')
new_file.write(email + '\n')
new_file.write(account_type + '\n')
new_file.write(date_var + '/' )
new_file.write(month_var +'/' )
new_file.write(year_var)
new_file.write('0')
new_file.close()
tmsg.showinfo("Congratulations!","Your account has been succesfully created")
break
# global count
# # we inintialized values of variables in from entrybox
# name = namevalue.get()
# address = addressvalue.get()
# phone = phonevalue.get()
# email = emailvalue.get()
# age = agevalue.get()
# adharcard = adharcardvalue.get()
# password = passwordvalue.get()
# gender = gendervalue.get()
# account_type = accountvalue.get()
# date_var = datevalue.get()
# month_var = monthvalue.get()
# year_var = yearvalue.get()
# all_accounts = os.listdir()
#
#
# #else:
# #with open("accounts.txt","a") as f:
# #f.write(f'name = {name}\n,address = {address}\n,phone = {phone}\n,email = {email}\n,age = {age}\n,'
# # f'adharcard = {adharcard}\n,password = {password}\n,gender ={gender}\n,account type = {account_type},\n')
# #tmsg.showinfo("CONGRATULATIONS","YOUR ACCOUNT HAS SUCCESSFULLY CREATED")
#
# # if name.isalpha() or phone.isdigit() or address.isalnum() or age.isdigit() or adharcard.isdigit():
# # with open("accounts.txt","a") as f:
# # f.write(f'name = {name},address = {address},phone = {phone},email = {email},'
# # f'DOB = {datevalue.get()}/{monthvalue.get()}/{yearvalue.get()},age = {age},'
# # f'adharcard = {adharcard},password = {password}\n,gender ={gender},account type = {account_type},\n')
# # tmsg.showinfo("CONGRATULATIONS","YOUR ACCOUNT HAS SUCCESSFULLY CREATED")
# # else :
# # tmsg.showerror("ERROR",'YOU HAVE GIVEN THE WRONG INPUT PLEASE CHECK AGAIN')
#
# #validtions or exception handling for our code
#
#
# if name =="" or address == "" or phone == "" or email == "" or age == "" or adharcard == "" or password ==""\
# or gender == "" or account_type=="" or date_var == "" or month_var=="" or year_var =="":
# tmsg.showerror("Alert","NO Arguement are given plzz check again")
# # if name.isalpha() or phone.isdigit() or address.isalnum() or age.isdigit() or adharcard.isdigit():
# # return True
# # else:
# # tmsg.showwarning("Alert!", "Wrong arguements are given please check again!")
# elif len(phone) > 10:
# tmsg.showwarning("PHONE NO.LIMIT EXCEEDED",'Mobile number must be less than 10 digit no.')
# elif len(phone) < 10:
# tmsg.showwarning("INCOMPLETE NUMBER","Your mobile no. must be less than 10")
# elif len(adharcard) > 12:
# tmsg.showwarning("INCORRECT ADHAR-NO.","Your entered adharcard no. is incorrect please check again")
# elif len(adharcard) < 12:
# tmsg.showwarning("INCORRECT ADHAR-NO.","Your entered adharcard no. is incorrect please check again")
# elif len(date_var) < 2:
# tmsg.showwarning("INCORRECT DATE","Please check your date again")
# elif len(date_var) > 2:
# tmsg.showwarning("INCORRECT DATE","Please check your date again")
# elif len(month_var) > 2:
# tmsg.showwarning("INCORRECT MONTH","Please check your date again")
# elif len(date_var) < 2:
# tmsg.showwarning("INCORRECT DATE","Please check your date again")
# elif len(year_var) > 4:
# tmsg.showwarning("INCORRECT YEAR","Please check your year again")
# elif len(year_var) < 4:
# tmsg.showwarning("INCORRECT DATE","Please check your date again")
# else:
# with open("accounts.txt","a") as f:
# f.write(f'no of entries = {count} \n ,name = {name},address = {address},phone = {phone},email = {email},'
# f'DOB = {datevalue.get()}/{monthvalue.get()}/{yearvalue.get()},age = {age},'
# f'adharcard = {adharcard},password = {password}\n,gender ={gender},account type = {account_type},\n \n')
# tmsg.showinfo("CONGRATULATIONS","YOUR ACCOUNT HAS SUCCESSFULLY CREATED")
#
# # #we are using adharcard value to differentiate our users..
# # for adharcard_check in all_accounts:
# # if adharcard == adharcard_check:
# # tmsg.showerror("ALERT-SAME ACCOUNT DETECTED","Account already exists")
# # return
# # elif len(phone) > 10:
# # tmsg.showerror("PHONE NO.LIMIT EXCEEDED",'Mobile number must be less than 10 digit no.')
# # elif len(phone) < 10:
# # tmsg.showerror("INCOMPLETE NUMBER","Your mobile no. must be less than 10")
# # elif len(adharcard) > 12:
# # tmsg.showerror("INCORRECT ADHAR-NO.","Your entered adharcard no. is incorrect please check again")
# # elif len(adharcard) < 12:
# # tmsg.showerror("INCORRECT ADHAR-NO.","Your entered adharcard no. is incorrect please check again")
# # elif len(date_var) < 2:
# # tmsg.showerror("INCORRECT DATE","Please check your date again")
# # elif len(date_var) > 2:
# # tmsg.showerror("INCORRECT DATE","Please check your date again")
# # elif len(month_var) > 2:
# # tmsg.showerror("INCORRECT MONTH","Please check your date again")
# # elif len(date_var) < 2:
# # tmsg.showerror("INCORRECT DATE","Please check your date again")
# # elif len(year_var) > 4:
# # tmsg.showerror("INCORRECT YEAR","Please check your year again")
# # elif len(year_var) < 4:
# # tmsg.showerror("INCORRECT DATE","Please check your date again")
# # else:
# # with open("accounts.txt","a") as f:
# # f.write(f'name = {name},address = {address},phone = {phone},email = {email},'
# # f'DOB = {datevalue.get()}/{monthvalue.get()}/{yearvalue.get()},age = {age},'
# # f'adharcard = {adharcard},password = {password}\n,gender ={gender},account type = {account_type},\n')
# # tmsg.showinfo("CONGRATULATIONS","YOUR ACCOUNT HAS SUCCESSFULLY CREATED")
#
# count +=1
# for adhar_check in all_accounts:
# if adharcardvalue.get()== adhar_check:
# tmsg.showerror("Error","User already exists")
# return False
# else:
# with open("accounts.txt", "a") as f:
# f.write(f'''no of entries = \n ,name = {namevalue.get()},address = {addressvalue.get()},phone = {phonevalue.get()},email = {emailvalue.get()},'
# f'DOB = {datevalue.get()}/{monthvalue.get()}/{yearvalue.get()},age = {agevalue.get()},'
# f'adharcard = {adharcardvalue.get()},password = {passwordvalue.get()}\n,gender ={gendervalue.get()},account type = {accountvalue.get()},\n \n''')
# tmsg.showinfo("CONGRATULATIONS", "YOUR ACCOUNT HAS SUCCESSFULLY CREATED")
# return True
# break
def log_in():
window = Toplevel(root)
window.title("Log-In ACCOUNT")
#window = Tk()
window.state('zoomed')
def show_frame(frame):
frame.tkraise()
window.rowconfigure(0, weight=1)
window.columnconfigure(0, weight=1)
page1 = Frame(window)
page2 = Frame(window)
page3 = Frame(window)
page4 = Frame(window)
global page1_bg_img
for frame in (page1, page2, page3,page4):
frame.grid(row=0, column=0, sticky='nsew')
# ==================page-1 code========================================
page1_bg_img = ImageTk.PhotoImage(file="bg2.jpg")
bg_page1 = Label(page1, image=page1_bg_img)
bg_page1.pack()
frame1_title = Label(page1, text='Selct the above options for respective log-in', font='times 35')
frame1_title.pack(fill='both', expand=True, anchor="nw")
frame1_btn = Button(page1, text='User Log-In', font='times 25', width=30, height=2,
command=lambda: show_frame(page2))
frame1_btn.place(x=600, y=250)
frame1_btn = Button(page1, text='Admin Log-In', font='times 25', width=30, height=2,
command=lambda: show_frame(page3))
frame1_btn.place(x=600, y=380)
# ==================page-2 code (User login)======================================
global bg_img,user_img,adhar_img,log_user_img,pass_lock_img,loginbutton_img,exitbutton_img,backbutton_page2_img
# =============== Images =================
bg_img = ImageTk.PhotoImage(file="account_bg.jpg")
user_img = PhotoImage(file="user_image.png")
adhar_img = PhotoImage(file="adhar_card.png")
log_user_img = PhotoImage(file="man_user.png")
pass_lock_img = PhotoImage(file="pass_lock.png")
loginbutton_img = PhotoImage(file="login.png")
exitbutton_img = PhotoImage(file="exit.png")
backbutton_page2_img = PhotoImage(file="backimage_button.png")
# ===============to set bg image user login page ==================
bg = Label(page2, image=bg_img)
bg.pack()
title = Label(page2, text="User Log-In", font="Impact 45 ", bg="yellow", relief=SUNKEN, borderwidth=8)
title.place(x=0, y=0, relwidth=1) # relwidth is used to adjust text according to the window
# =============login frame============================
Login_frame = Frame(page2, bg='white')
Login_frame.place(x=500, y=145)
# user logo on top image in user login form
user_logo = Label(Login_frame, image=user_img, borderwidth=0).grid(row=0, columnspan=4, pady=40)
# ===============================Labels and text==================================
# adding user_image to the user name
user_lbl = Label(Login_frame, text="USERNAME:", image=log_user_img, compound=LEFT,
font='comicsans 15 bold', bg="white").grid(row=1, column=0, pady=5)
#===========================initailizing our variables ==========================
global txtuservar,txtadharvar,txtpassvar
txtuservar = StringVar()
txtadharvar = StringVar()
txtpassvar = StringVar()
txtuser = Entry(Login_frame, bd=5, relief=SUNKEN,textvariable = txtuservar, font="Lucida 20 bold").grid(row=1, column=2, padx=10)
adhar_lbl = Label(Login_frame, text="ADHARCARD:", image=adhar_img, compound=LEFT,
font='comicsans 15 bold', bg="white").grid(row=2, column=0, pady=5)
txtadhar = Entry(Login_frame, bd=5, relief=SUNKEN,textvariable = txtadharvar, font="Lucida 20 bold").grid(row=2, column=2, padx=10)
pass_lbl = Label(Login_frame, text="PASSWORD:", image=pass_lock_img, compound=LEFT,
font='comicsans 15 bold', bg="white").grid(row=3, column=0, pady=5)
txtpass = Entry(Login_frame, bd=5, relief=SUNKEN,textvariable = txtpassvar, font="Lucida 20 bold").grid(row=3, column=2, padx=10)
# ========================Buttons=========================================
login_btn = Button(Login_frame, image=loginbutton_img,command=lambda: show_frame(page4),borderwidth=0, background="white")
login_btn.grid(row=4, column=2, pady=40)
exit_btn = Button(Login_frame, image=exitbutton_img, command=exit, borderwidth=0, background="white")
exit_btn.grid(row=4, column=0, pady=40)
# =======================creating back button to swith through frames=============================
frame2_btn = Button(page2, image=backbutton_page2_img, borderwidth=0, background="yellow",
command=lambda: show_frame(page1))
frame2_btn.place(x=10, y=8)
# ==================page-3 code (Admin log-in)=========================================
global admin_name_logo,admin_main_logo,wlc_admin,backbutton_img,admin_login_button,bg_img_admin
# ====================images admin frame ===============================
admin_name_logo = ImageTk.PhotoImage(file="admin1.png")
admin_main_logo = PhotoImage(file="adminuser.png")
wlc_admin = PhotoImage(file="welcome1.png")
backbutton_img = PhotoImage(file="backimage_button.png")
admin_login_button = ImageTk.PhotoImage(file="admin_login_button1.png")
# ======================to set bg image for admin login page================
bg_img_admin = ImageTk.PhotoImage(file="account_bg.2.jpg")
bg_admin = Label(page3, image=bg_img_admin)
bg_admin.pack()
admin_title = Label(page3, text="Admin Log-In", font="Impact 45 ", bg="yellow", relief=SUNKEN,
borderwidth=8)
admin_title.place(x=0, y=0, relwidth=1) # relwidth is used to adjust text according to the window
# ================creating admin frame in page 3======================
admin_frame = Frame(page3, bg='white')
admin_frame.place(x=520, y=110)
# =================Labels and Entry widgets for admin form=================
wlc_lbl = Label(admin_frame, image=wlc_admin, bg="white").grid(row=0, columnspan=4)
admin_logo = Label(admin_frame, image=admin_name_logo, bg="white").grid(row=1, columnspan=4)
admin_user_logo = Label(admin_frame, image=admin_main_logo, bg="white").grid(row=2, columnspan=4)
admin_lbl_id = Label(admin_frame, text="ADMIN-ID:", image=log_user_img, compound=LEFT,
font='comicsans 15 bold', bg="white").grid(row=3, column=0)
entry_admin_lbl_id = Entry(admin_frame, bd=5, relief=SUNKEN, font="Lucida 20 bold").grid(row=3, column=1, padx=7,
pady=4)
admin_lbl_password = Label(admin_frame, text="PASSWORD:", image=pass_lock_img, compound=LEFT,
font='comicsans 15 bold', bg="white").grid(row=4, column=0, pady=2)
entry_admin_lbl_password = Entry(admin_frame, bd=5, relief=SUNKEN, font="Lucida 20 bold").grid(row=4, column=1,
padx=7)
# ===================================Button for admin login==================
admin_button = Button(admin_frame, image=admin_login_button, borderwidth=0, background="white")
admin_button.grid(row=5, columnspan=4)
# =======================creating back button to swith through frames=============================
frame3_btn = Button(page3, image=backbutton_img, borderwidth=0, background="yellow",
command=lambda: show_frame(page1))
frame3_btn.place(x=10, y=8)
#=========================page 4 =====================================================
title1 = Label(page4, text="Welcome to our page 4", font="Impact 45 ", bg="yellow", fg="orange", relief=SUNKEN,
borderwidth=8)
title1.place(x=0, y=0, relwidth=1) # relwidth is used to adjust text according to the window
page4btn1 = Button(page4, text='Personal-Details', font='times 25', width=25, height=2).place(x=25, y=160)
page4btn2 = Button(page4, text='Deposit', font='times 25', width=25, height=2).place(x=25, y=260)
page4btn3 = Button(page4, text='Withdraw', font='times 25', width=25, height=2).place(x=25, y=360)
page4btn4 = Button(page4, text='Check-Balance', font='times 25', width=25, height=2).place(x=25, y=460)
showvalues = Frame(page4,bg = "azure",width = 900 , height = 900)
showvalues.place(x = 500,y = 100)
def user_login():
all_accounts = os.listdir()
login_adharcard = adharcardvalue.get()
login_password = passwordvalue.get()
if txtuservar.get()=="" or txtadharvar.get() == "" or txtpassvar.get()=="":
tmsg.showerror("Alert","all feilds are required!")
for adhar_check in login_adharcard:
if adhar_check == login_adharcard:
file = open(login_adharcard, "r")
file_data = file.read()
file_data = file_data.split('\n')
password = file_data[1]
if login_password == password:
Label(page4,text = "Dashboard",font = "Impact 45 ").place(x = 320 , y= 10)
wlc = Label(page4,text = "welcome user " ,font = 'comicsans 12 green')
wlc.place(x = 400, y = 300)
else:
tmsg.showerror("Error","No account found please return!")
show_frame(page1)
#===================== Function for the validation of phone number ==============
# def validate_phone(user_phone):
# if user_phone.isdigit():
# return True
# elif user_phone == "":
# return True
# else:
# tmsg.showwarning("Alert!","Only digits are allowed please check your phone number again")
# return False
#=================== CALL BACK FUCTIONS ========================
#
# #================== Function for the validation of the adharcard=================
# def validate_adhar(user_adhar):
# if user_adhar.isdigit():
# return True
# elif user_adhar == "":
# return True
# else:
# tmsg.showwarning("Alert!","Only digits are allowed please check your phone number again")
# return False
#
# #============Function for the valiation of the email(We use regular expressions)===============
# def isValidEmail(user_email):
# if len(user_email) > 7:
# if re.match("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$",user_email) !=None:
# return True
# else:
# tmsg.showwarning("Alert!","Invalid Email please check your email again")
# return False
# else:
# tmsg.showwarning("Alert!", "Invalid Email please check your email again")
# return False
#
# #============================Validations for all the fields ============================
# def validateAllFields():
# if namevalue.get()=="" or addressvalue.get()==""or phonevalue.get()==""or agevalue.get()=="" or \
# adharcardvalue.get()=="" or passwordvalue.get()=="" or \
# datevalue.get()=="" or monthvalue.get()=="" or yearvalue.get()=="":
# tmsg.showerror("Error!","All fields are required")
# elif emailvalue.get()=="":
# status = isValidEmail(emailvalue.get())
# if (status):
# return True
# else:
# with open("accounts.txt", "a") as f:
# f.write(f'no of entries = \n ,name = {namevalue.get()},address = {addressvalue.get()},phone = {phonevalue.get()},email = {emailvalue.get()},'
# f'DOB = {datevalue.get()}/{monthvalue.get()}/{yearvalue.get()},age = {agevalue.get()},'
# f'adharcard = {adharcardvalue.get()},password = {passwordvalue.get()}\n,gender ={gendervalue.get()},account type = {accountvalue.get()},\n \n')
# tmsg.showinfo("CONGRATULATIONS", "YOUR ACCOUNT HAS SUCCESSFULLY CREATED")
#================================================ MAIN GUI ============================================
def create_acc():
# def validate_name(user_name):
# if user_name.isalnum():
# return True
# print("Successful")
# else:
# tmsg.showwarning("Invalid Input!", "Please Enter the correct name")
# print("Unsucessful")
global namevalue,addressvalue,phonevalue,emailvalue,agevalue,adharcardvalue,passwordvalue,gendervalue,accountvalue
global datevalue,monthvalue,yearvalue
# We created new window using toplevel function
#new window name is register_screen
register_screen = Toplevel(root)
register_screen.geometry("750x600")
register_screen.title("CREATE ACCOUNT")
re_frame1 = Frame(register_screen,width = 700,height = 100,highlightbackground = 'grey',highlightthickness = 2,relief = SUNKEN,bg = "CadetBlue1")
Label(re_frame1,text = 'Get Your ONLINE-BANK Account in a few minutes with GROW-MORE.\n',font = 'comicsans 15 bold',bg = "CadetBlue1").place(x = 40,y = 20)
Label(re_frame1,text = 'With Grow-more we provide our best services and safety Banking for you '
'your family.',font = ' comicsans 8 italic',bg = "CadetBlue1").place(x = 40 , y = 60)
re_frame1.pack(pady = 2,fill = X)
re_frame2 = Frame(register_screen, width=700, height=600, highlightbackground='grey', highlightthickness=2,
relief=SUNKEN, bg="azure")
#combobox
mycombo = ttk.Combobox(register_screen,value = ls)
mycombo.current(0)
mycombo.bind("<<comboboxsselected>>",comboclick)
mycombo.place(x = 252,y = 187)
#Labels
Label(re_frame2, text='NAME:', font='comicsans 10 bold', bg="azure").place(x= 40,y=10)
Label(re_frame2, text='ADDRESS:', font='comicsans 10 bold', bg="azure").place(x=40, y=40)
Label(re_frame2, text='DISTRICT:', font='comicsans 10 bold', bg="azure").place(x=40, y=70)
Label(re_frame2, text='PHONE-NO:', font='comicsans 10 bold', bg="azure").place(x=40, y=100)
Label(re_frame2, text='GENDER:', font='comicsans 10 bold', bg="azure").place(x=40, y=130)
Label(re_frame2, text='DOB:', font='comicsans 10 bold', bg="azure").place(x=40, y=160)
Label(re_frame2, text='E-MAIL:', font='comicsans 10 bold', bg="azure").place(x=40, y=190)
Label(re_frame2, text='AGE:', font='comicsans 10 bold', bg="azure").place(x=40, y=220)
Label(re_frame2, text='ADHARCARD:', font='comicsans 10 bold', bg="azure").place(x=40, y=250)
Label(re_frame2, text='PASSWORD:', font='comicsans 10 bold', bg="azure").place(x=40, y=280)
Label(re_frame2, text='ACCOUNT-TYPE:', font='comicsans 10 bold', bg="azure").place(x=40, y=310)
#Entry box variables
namevalue = StringVar()
addressvalue = StringVar()
phonevalue = StringVar()
emailvalue = StringVar()
agevalue = StringVar()
adharcardvalue = StringVar()
passwordvalue = StringVar()
gendervalue = StringVar()
accountvalue = StringVar()
datevalue = StringVar()
monthvalue = StringVar()
yearvalue = StringVar()
#Entry box
Entry_name = Entry(re_frame2,textvariable =namevalue,font="comicsans 10 bold")
Entry_name.place(x=250,y= 10)
Entry_address = Entry (re_frame2,textvariable =addressvalue,font="comicsans 10 bold")
Entry_address.place(x=250,y= 40)
Entry_phone = Entry (re_frame2,textvariable =phonevalue,font="comicsans 10 bold")
Entry_phone.place(x=250,y= 100)
Entry_email = Entry (re_frame2, textvariable=emailvalue, font="comicsans 10 bold")
Entry_email.place(x=250,y= 190)
Entry_age = Entry (re_frame2,textvariable =agevalue,font="comicsans 10 bold")
Entry_age.place(x=250,y= 220)
Entry_adhar = Entry (re_frame2,textvariable =adharcardvalue,font="comicsans 10 bold")
Entry_adhar.place(x=250,y= 250)
Entry_password = Entry (re_frame2,textvariable =passwordvalue,show = "*",font="comicsans 10 bold")
Entry_password.place(x=250,y= 280)
Entry_date = Entry (re_frame2,textvariable = datevalue,font= 'Lucida 10 bold',width = 2)
Entry_date.place(x = 250,y = 160) #dd
Entry_month = Entry (re_frame2,textvariable = monthvalue, font='Lucida 10 bold', width=2)
Entry_month.place(x=275, y=160) #mm
Entry_year = Entry (re_frame2,textvariable = yearvalue, font='Lucida 10 bold', width=4)
Entry_year.place(x=300, y=160) #yy
#============== NAME VALIDATION FUNCTION================
# valid_name = register_screen.register(validate_name)
# Entry_name.config(validate = "key",validatecommand = (validate_name,'%P'))
#
# #================ PHONE VALIDATION FUNCTION================
# #validations (We have to create a callback function)
# valid_phone = register_screen.register(validate_phone)
#
# # %P = passes the input value to callback function
# Entry_phone.config(validate = "key",validatecommand = (validate_phone,'%P'))
#
# #================ ADHARCARD VALIDATION FUNCTION==============
# valid_adhar = register_screen.register(validate_adhar)
# Entry_adhar.config(validate = "key",validatecommand = (validate_adhar,'%P'))
gendervalue.set("male")
#Radio button for gender
r1 = Radiobutton(re_frame2,text = 'male', variable = gendervalue, value = "male", bg="azure")
r2 = Radiobutton(re_frame2,text = 'female',variable = gendervalue,value = "female", bg="azure")
r1.place(x = 249, y = 130)
r2.place(x = 320 , y = 130)
#Radio button for account type
accountvalue.set("saving")
r3 = Radiobutton(re_frame2,text = 'CURRENT', variable = accountvalue, value = "current", bg="azure")
r4 = Radiobutton(re_frame2,text = 'SAVING',variable = accountvalue,value = "saving", bg="azure")
r3.place(x = 249, y = 310)
r4.place(x = 350 , y = 310)
#
# Button(re_frame2, text="SUBMIT", font="comicsans 12",bg = "green",fg = "white",
# width=20, command=submit).place(x=249, y=350)
Button(re_frame2, text="SUBMIT",command = submit, font="comicsans 12",bg = "green",fg = "white",
width=20).place(x=249, y=350)
re_frame2.pack(fill = 'both')
#==============================main window frame of the first page========================
mframe1 = Frame (root,width = 700,height = 100,highlightbackground = 'grey',highlightthickness = 2,relief = SUNKEN,bg = "green")
Label(mframe1,text = " Grow more ",font = 'Lucida 40 bold',bg = 'green',fg = 'white').place(x = 44,y = 10)
Label(mframe1,text = " Since 1992 ",font = 'Lucida 10 bold',bg = 'green').place(x = 60,y = 70)
mframe1.pack(padx = 20,pady = 5,fill = 'both')
#=====================changing Image of main window=========================
#image Tk used to import jpg images in tk window
img1=ImageTk.PhotoImage(Image.open("img1.jpg"))
img1 = Image.open("img1.jpg")
img1= img1.resize((400,300))
img1 = ImageTk.PhotoImage(img1)
img2=ImageTk.PhotoImage(Image.open("img2.png"))
img2 = Image.open("img2.png")
img2= img2.resize((400,300))
img2 = ImageTk.PhotoImage(img2)
img3=ImageTk.PhotoImage(Image.open("img3.png"))
img3 = Image.open("img3.png")
img3= img3.resize((400,300))
img3 = ImageTk.PhotoImage(img3)
img4=ImageTk.PhotoImage(Image.open("img4.jpg"))
img4 = Image.open("img4.jpg")
img4= img4.resize((400,300))
img4 = ImageTk.PhotoImage(img4)
#Create a label
l=Label(root,font="bold")
l.pack()
#take a variable
x=1
#create a function for moving a picture
def move():#name anything but meaningful
global x
if x==4:
x=0
if x==1:
l.config(image=img1)#by writing this line first picture will appear
elif x==2:
l.config(image=img2)
elif x==3:
l.config(image=img3)
elif x==4:
l.config(image=img4)
#you can do it for thousands of images
#now increase the count by one
x+=1
#set images to work automatically by "after" feature in tkinter
#after view image one by one after the given time i.e 2000 mil sec.
root.after(2000,move)
move()
Button(root,text = 'Create Account',bg = 'yellow green',command = create_acc).place(x = 100,y = 434)
Button(root,text = 'Log-In',bg = 'yellow green',command = log_in).place(x = 230,y = 434)
root.mainloop()