forked from Fusion-Pie/Bank-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBank.py
779 lines (500 loc) · 35.6 KB
/
Bank.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
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
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
import string as s
import random as ran
import datetime as dt
import mysql.connector as myconn
import pandas as pd
bank_db = myconn.connect ( #Connecting Database
host="localhost",
user="Pie_Bank",
password="piyush@1234",
database = "pie_bank")
bank_cur = bank_db.cursor() #Creating cursor
class Bank:
bank_name = "Pie Bank Of India"
def CreateUser(self): #Create New User
print("\n-------------------------------------------------------------------------------------------------------------------------------")
self.first_name = input("\nEnter Your First Name: ")
self.last_name = input("Enter Last Name: ")
self.mob_no = input("Enter Mobile No: ")
self.address = input("Enter Address: ")
self.pin = input("Enter Pin: ")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
print("\nYou have to deposit atleast 1000Rs")
self.deposit_amount = int(input("\nEnter Amount To Deposit: "))
print("\n-------------------------------------------------------------------------------------------------------------------------------")
if self.deposit_amount >= 1000:
user.CardGenerator()
self.dt = dt.datetime.now()
self.dt = str(self.dt).split()
query = "Insert into Bank_Users(First_Name,Last_Name,Address,Mobile_No,Card_no,Pin,Balance,Opening_Date,Acc_Status) Values (%s,%s,%s,%s,%s,%s,%s,%s,%s)"
val = (self.first_name,self.last_name,self.address,self.mob_no,self.card_no,self.pin,self.deposit_amount,self.dt[0],'o')
bank_cur.execute(query , val)
bank_db.commit()
query = "Select User_id from Bank_Users where Pin = %s"
val = (self.pin,)
bank_cur.execute(query,val)
result = bank_cur.fetchall()
user.TransactionHistoryFeeder(result[0][0],self.deposit_amount,'ac',self.dt[0])
print("\n\n-------------------------------------------------------------------------------------------------------------------------------")
print("\nCongratulations! Account Created Successfully")
print("\nThank You! For Choosing Us")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
else:
print("\nDeposit amount is low to open an account")
print("\nPlease try again later")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
def AllExistingUser(self): #Show all user from the Databse
bank_cur.execute("Select * from Bank_Users")
result = bank_cur.fetchall()
for i in result:
print(i)
def CheckBalance(self,p): #Checks Balance
query = "Select Balance,First_Name from Bank_Users where Pin = %s"
val = (p,)
bank_cur.execute(query,val)
result = bank_cur.fetchall()
print(f"\nHi! {result[0][1]}, Your available balance is {result[0][0]}Rs")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
def CheckPin(self,p):
query = "Select First_Name from Bank_Users where Pin = %s"
val = (p,)
bank_cur.execute(query,val)
result = bank_cur.fetchall()
print(f"\nHi! {result[0][0]}, Hope you are having a nice day")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
def Deposit(self,p): #Adds Money to account
self.dep_amount = int(input("Please enter the amount to deposit: "))
query ="Select User_id from Bank_Users where pin = %s"
val = (p,)
bank_cur.execute(query,val)
result = bank_cur.fetchall()
query = "Update Bank_Users set Balance = Balance + %s where Pin = %s"
val = (self.dep_amount,p)
bank_cur.execute(query,val)
query = "Update Bank_Users set Balance = Balance + %s where User_id = 1"
val = (self.dep_amount,)
bank_cur.execute(query,val)
bank_db.commit()
date_now = str(dt.datetime.now()).split()[0]
user.TransactionHistoryFeeder(result[0][0],self.dep_amount,'cr',date_now)
print("\n-------------------------------------------------------------------------------------------------------------------------------")
print(f"\n{self.dep_amount} Rs Deposited Successfully")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
def WithDraw(self,p): #Deducts money from account
self.with_amount = int(input("\nPlease enter the amount you want to withdraw: "))
query = "Select Balance,First_Name,User_id from Bank_Users where Pin = %s"
val = (p,)
bank_cur.execute(query,val)
result = bank_cur.fetchall()
if result[0][0] >= self.with_amount:
query = "Update Bank_Users set Balance = Balance - %s where Pin = %s"
val = (self.with_amount,p)
bank_cur.execute(query,val)
bank_db.commit()
date = str(dt.datetime.now()).split()[0]
user.TransactionHistoryFeeder(result[0][2],self.with_amount,'d',date)
print(f"\nHi! {result[0][1]}")
print("\nMoney Withdarwn Successfully")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
else:
print(f"\nHi! {result[0][1]}")
print(f"\nYou don't have enough balance to withdarw {self.with_amount} Rs")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
def PinChange(self,p): #Changes Pin
self.new_pin = input("\nPlease enter new pin: ")
query = "Update Bank_Users set Pin = %s where Pin = %s"
val = (self.new_pin,p)
bank_cur.execute(query,val)
bank_db.commit()
print("\nPin Changed Successfully")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
def CardGenerator(self):
query = "Select Card_no from Bank_Users"
bank_cur.execute(query)
res = bank_cur.fetchall()
n = 16
self.card_no = "".join(ran.choices(s.digits, k = n))
if self.card_no in res[0]:
n = 16
self.card_no = "".join(ran.choices(s.digits, k = n))
c = 0
print("\n-------------------------------------------------------------------------------------------------------------------------------")
print("\nYour Card Number is: ",end = "")
for i in self.card_no:
c += 1
if c == 4:
print(i,end = " ")
c = 0
else:
print(i, end = "")
def Loan(self):
print("\n-------------------------------------------------------------------------------------------------------------------------------")
self.loan_amount = int(input("\nPlease enter the loan amount: "))
self.loan_duration = None
self.total_loan = None
query = "Select Balance from Bank_Users where User_id = 1"
bank_cur.execute(query)
result = bank_cur.fetchall()
if self.loan_amount <= 500000 and result[0][0] > self.loan_amount:
print("\nYou can repay the loan in 60 months (5 years) or less of your choice")
self.loan_duration = int(input("\nPlease enter the no. of months in which you want repay the money: "))
i = 5 #interest(%)
r = round(i/12/100,5) #interest rate per month
EMI = round(self.loan_amount * r * (1+r)**self.loan_duration / ((1+r)**self.loan_duration - 1))
repay_amount = round(EMI * self.loan_duration)
print("\n-------------------------------------------------------------------------------------------------------------------------------")
print(f"\nLoan Amount = {self.loan_amount} Rs \nLoan Duration = {self.loan_duration} months \nInterest(%) = {i} %")
print(f"Total Interest = {round(EMI*self.loan_duration - self.loan_amount)} Rs")
print(f"EMI (Equated Monthly Installment): {EMI} Rs")
print(f"Repay Amount = {repay_amount} Rs")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
res = input("\nDo you want to confirm your loan(y/n): ")
if res == 'y':
con = input("\nDo you have account in our bank(y/n): ")
if con == 'y':
print("\n-------------------------------------------------------------------------------------------------------------------------------")
pin = input("\nPlease enter your pin: ")
user.CheckPin(pin)
query = "Select User_id from Bank_Users where Pin = %s"
val = (pin,)
bank_cur.execute(query,val)
result_id = bank_cur.fetchall()
result_id = result_id[0][0]
query = "Select Loan_Status from Loan_Users where User_id = %s"
val = (result_id,)
bank_cur.execute(query,val)
result_status = bank_cur.fetchall()
if len(result_status) != 0:
if result_status[0][0] == 'pending':
print("\n-------------------------------------------------------------------------------------------------------------------------------")
print("\nSorry, You have a Pending Laon. \nPlease clear the previous loan to get the benefit of new loan \nSorry for inconvinience")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
else:
print("\nYour loan is going to be in your account in a minute")
query = "Update Bank_Users set Balance = Balance + %s where Pin = %s"
val = (self.loan_amount,pin)
bank_cur.execute(query,val)
query = "Update Bank_Users set Balance = Balance - %s where User_id = 1"
val = (self.loan_amount,)
bank_cur.execute(query,val)
date = str(dt.datetime.now()).split()[0]
query = "Insert into Loan_Users(User_id,Loan_approved,EMI,Total_repay_amount,Loan_issue_date,Loan_Period,Remaining_Period,Amount_Repayed,Loan_Status) Values (%s,%s,%s,%s,%s,%s,%s,%s,%s)"
val = (result_id,self.loan_amount,EMI,repay_amount,date,self.loan_duration,self.loan_duration,0,"pending")
bank_cur.execute(query,val)
bank_db.commit()
user.TransactionHistoryFeeder(result_id,self.loan_amount,'la',date)
print("\nCongratulations! Loan Amount Successfully added to your account")
print("\nThank you! for choosing us, Please pay your loan on time to avoid additional penalty charges")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
else:
print("\nYour loan is going to be in your account in a minute")
query = "Update Bank_Users set Balance = Balance + %s where Pin = %s"
val = (self.loan_amount,pin)
bank_cur.execute(query,val)
query = "Update Bank_Users set Balance = Balance - %s where User_id = 1"
val = (self.loan_amount,)
bank_cur.execute(query,val)
date = str(dt.datetime.now()).split()[0]
query = "Insert into Loan_Users(User_id,Loan_approved,EMI,Total_repay_amount,Loan_issue_date,Loan_Period,Remaining_Period,Amount_Repayed,Loan_Status) Values (%s,%s,%s,%s,%s,%s,%s,%s,%s)"
val = (result_id,self.loan_amount,EMI,repay_amount,date,self.loan_duration,self.loan_duration,0,"pending")
bank_cur.execute(query,val)
bank_db.commit()
user.TransactionHistoryFeeder(result_id,self.loan_amount,'la',date)
print("\nCongratulations! Loan Amount Successfully added to your account")
print("\nThank you! for choosing us, Please pay your loan on time to avoid additional penalty charges")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
elif con == 'n':
print("\n-------------------------------------------------------------------------------------------------------------------------------")
acc_res = input("\nDo you want to open account in our bank(y/n): ")
if acc_res == 'y':
user.CreateUser()
pin = input("\nPlease enter your pin: ")
user.CheckPin(pin)
print("\nYour loan is going to be in your account in a minute")
query = "Update Bank_Users set Balance = Balance + %s where Pin = %s"
val = (self.loan_amount,pin)
bank_cur.execute(query,val)
query = "Update Bank_Users set Balance = Balance - %s where User_id = 1"
val = (self.loan_amount,)
bank_cur.execute(query,val)
query = "Select User_id from Bank_Users where Pin = %s"
val = (pin,)
bank_cur.execute(query,val)
result_id = bank_cur.fetchall()
result_id = result_id[0][0]
date = str(dt.datetime.now()).split()[0]
query = "Insert into Loan_Users(User_id,Loan_approved,EMI,Total_repay_amount,Loan_issue_date,Loan_Period,Remaining_Period,Amount_Repayed,Loan_Status) Values (%s,%s,%s,%s,%s,%s,%s,%s,%s)"
val = (result_id,self.loan_amount,EMI,repay_amount,date,self.loan_duration,self.loan_duration,0,'pending')
bank_cur.execute(query,val)
bank_db.commit()
user.TransactionHistoryFeeder(result_id,self.loan_amount,'la',date)
print("\nCongratulations! Loan Amount Successfully added to your account")
print("\nThank you! for choosing us, Please pay your loan on time to avoid additional penalty charges")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
elif acc_res == 'n':
print("\nYou have to personally visit the bank to get the loan. \nThank you!")
else:
print("\nIncorect Response ----- Please try again -------- Thank you!")
else:
print("\nIncorect Response ----- Please try again -------- Thank you!")
elif res == 'n':
print("\n-------------------------------------------------------------------------------------------------------------------------------")
print("\nThank you for interacting with us.")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
else:
print("\n-------------------------------------------------------------------------------------------------------------------------------")
print("\n Incorect Response ----- Please try again -------- Thank you!")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
else:
print("\n-------------------------------------------------------------------------------------------------------------------------------")
print("\n NO LOANS AVAILABLE")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
def Complaint(self):
print("\n-------------------------------------------------------------------------------------------------------------------------------")
print("\n1.Bad customer service \n2.Loan issues \n3.Bad Service \n4.Other")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
self.res = int(input("\nPlease choose from above choices: "))
print("\n-------------------------------------------------------------------------------------------------------------------------------")
if self.res == 1:
query = "Insert into Complaints (Complaint) values(%s)"
val = ('Bad customer service',)
bank_cur.execute(query,val)
bank_db.commit()
print("\nYour complaint is recorded")
print("\nSorry for the inconvinience, we will work on your complaint")
if self.res == 2:
query = "Insert into Complaints (Complaint) values(%s)"
val = ('Loan issues',)
bank_cur.execute(query,val)
bank_db.commit()
print("\nYour complaint is recorded")
print("\nSorry for the inconvinience, we will work on your complaint")
if self.res == 3:
query = "Insert into Complaints (Complaint) values(%s)"
val = ('Bad Service',)
bank_cur.execute(query,val)
bank_db.commit()
print("\nYour complaint is recorded")
print("\nSorry for the inconvinience, we will work on your complaint")
if self.res == 4:
self.comp = input("\nPlease write your complaint as short as you can: ")
query = "Insert into Complaints (Complaint) values(%s)"
val = (self.comp,)
bank_cur.execute(query,val)
bank_db.commit()
print("\nYour complaint is recorded")
print("\nSorry for the inconvinience, we will work on your complaint")
def CloseAccount(self):
self.close_pin = input("\nPlease enter pin: ")
query = "Select First_Name from Bank_Users where Pin = %s"
val = (self.close_pin,)
bank_cur.execute(query,val)
result = bank_cur.fetchall()
print(f"\nHi! {result[0][0]}\n")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
self.last_res = input("\nAre you sure you want to close your account(y/n): ")
if self.last_res == 'y':
query = "Select User_id,Balance,Acc_Status from Bank_Users where Pin = %s"
val = (self.close_pin,)
bank_cur.execute(query,val)
res_query1 = bank_cur.fetchall()
query = "Select * from Loan_Users where User_id = %s"
val = (res_query1[0][0],)
bank_cur.execute(query,val)
res_query2 = bank_cur.fetchall()
if len(res_query2) == 0:
if res_query1[0][1] > 0:
print("\n-------------------------------------------------------------------------------------------------------------------------------")
print(f"\nYou need to withdraw all the amount you have in your account i.e {res_query1[0][1]} Rs")
last_res1 = input("\nDo you want to continue(y/n): ")
if last_res1 == 'y':
query = "Update Bank_Users set Balance = Balance - %s, Acc_Status = 'c' where pin = %s"
val = (res_query1[0][1],self.close_pin)
bank_cur.execute(query,val)
bank_db.commit()
print("\n-------------------------------------------------------------------------------------------------------------------------------")
print(f"\n{res_query1[0][1]} Rs withdrawn successfully")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
print(f"\nThanks {result[0][0]}, for using our services")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
elif last_res1 == 'n':
print("Looks like You changed your mind! Thats's great news for us!")
else:
print("OK")
else:
print("You have't repaid the loan yet. First you have to pay your loan and then you can access this service.")
elif self.last_res == 'n':
print("Nice")
else:
print("Invalid Response")
def CloseAccountDB(self):
query = "Select * from Bank_Users where Acc_Status = 'c'"
bank_cur.execute(query)
result = bank_cur.fetchall()
if len(result)!= 0:
for i in range (len(result)):
date = str(dt.datetime.now()).split()[0]
query = "Insert into Closed_Bank_Users(User_id,First_Name,Last_Name,Address,Mobile_No,Card_no,Pin,Balance,Opening_Date,Closed_Date,Acc_Status) Values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"
val = (result[i][0],result[i][1],result[i][2],result[i][3],result[i][4],result[i][5],result[i][6],result[i][7],result[i][8],date,result[i][9])
bank_cur.execute(query,val)
query = "Delete from Bank_Users where pin = %s and Acc_Status = %s"
val = (result[i][6],'c')
bank_cur.execute(query,val)
bank_db.commit()
else:
pass
def TransactionHistoryFeeder(self,id,trans,trans_status,date):
query = "Insert into trans_history (User_id ,transaction ,trans_status, Date) Values(%s,%s,%s,%s)"
val = (id ,trans ,trans_status ,date)
bank_cur.execute(query,val)
bank_db.commit()
def TransactionHistoryShower(self,pin):
query = "Select User_id from Bank_Users where Pin = %s"
val = (pin,)
bank_cur.execute(query,val)
result = bank_cur.fetchall()
query2 = "Select Transaction, trans_status, date from trans_history where User_id = %s"
val2 = (result[0][0],)
bank_cur.execute(query2,val2)
res = bank_cur.fetchall()
columns = ['Transaction','Transaction_Status','Date_of_Transaction']
df = pd.DataFrame(res ,columns = columns)
print("\n-------------------------------------------------------------------------------------------------------------------------------\n")
print("\nThe following status meaning are as follows: \nac - Account Creation \nla - Loan Approved \ncr - Credit \nd - Debit \nEMI - Equated Monthly Insatllment")
print(df)
def Pay_Loan(self,pin):
print("\n-------------------------------------------------------------------------------------------------------------------------------")
query = "Select User_id from Bank_Users where Pin = %s"
val = (pin,)
bank_cur.execute(query,val)
result_id = bank_cur.fetchall()
query = "Select EMI,Loan_Status,Remaining_Period from Loan_Users where User_id = %s"
val = (result_id[0][0],)
bank_cur.execute(query,val)
result = bank_cur.fetchall()
result_EMI = result[0][0]
result_status = result[0][1]
resultRemainPeriod = result[0][2]
if result_status == 'pending' and resultRemainPeriod != 0:
print("\n-------------------------------------------------------------------------------------------------------------------------------")
print(f"\nDo you want to pay the EMI i.e. {result_EMI} Rs through your Bank account or by deposting the money")
print("\nType 'ba' for paying through Bank account or 'dm' for depositing money")
response = input("\n(ba/dm): ")
if response == 'ba':
print("\nYou are paying from bank account the amount will be decucted from your account")
date = str(dt.datetime.now()).split()[0]
query = "Update Bank_Users set Balance = Balance - %s where Pin = %s"
val = (result_EMI,pin)
bank_cur.execute(query,val)
query = "Update Loan_Users set Amount_Repayed = %s , Remaining_Period = Remaining_Period - 1 where USer_id = %s"
val = (result_EMI ,result_id[0][0])
bank_cur.execute(query,val)
user.TransactionHistoryFeeder(result_id[0][0],result_EMI,"EMI",date)
bank_db.commit()
print("\nYou have paid your EMI")
elif response == 'dm':
print("\nThis service is not avaialble, Please Deposite money in the account and then oay the EMI")
else:
print("\nWrong Input")
else:
print("\nYou do not have any active loan")
def LoanCloser(self):
query = "Select * from Loan_Users where Remaining_Period = 0 and Loan_Status = 'pending'"
bank_cur.execute(query)
result = bank_cur.fetchall()
if len(result) != 0:
for i in range(len(result)):
query = "Update Loan_Users set Loan_Status = 'paid' where User_id = %s"
val = (result[i][0],)
bank_cur.execute(query,val)
bank_db.commit()
def TranserMoney(self):
print("\nYou can only transfer money to the person which is already using our services")
response_yn = input("\nDo you want to continue(y/n): ")
if response_yn == 'y':
cardNo_to_transfer = input("Please enter card: ")
query = "Select First_name,Last_name from Bank_Users where Card_no = %s"
val = (cardNo_to_transfer,)
bank_cur.execute(query,val)
result_transer = bank_cur.fetchall()
if len(result_transer) != 0:
print("\nReceiver's Details are as follows \n(Please check the details to avoid future problems)")
print(f"\nFirst Name: {result_transer[0][0]} \nLast Name: {result_transer[0][1]}")
response_check = input("\nDo you want to continue(y/n): ")
if response_check == 'y':
print("You can continue")
elif response_check == 'n':
print("\nThank You! for using our services")
#Will do it later
else:
print("\nUser not fouond \n\nPlease check the card no. and try agrain")
elif response_yn == 'n':
print("\nThank You! for using our services")
else:
print("\nIncorrect Response")
user = Bank()
print("\n-------------------------------------------------------------------------------------------------------------------------------")
print("\n------------------------------------------------- WELCOME TO PIE BANK OF INDIA ------------------------------------------------")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
print("""\n Bank created by Piyush Hatewar(Pie) himself. This Bank is one of the best Banks which is fully auomated. \n""")
res = 'y'
while(res == 'y'):
print("\n-------------------------------------------------------------------------------------------------------------------------------")
print("\nServices Provided By Bank :")
print("\n1.Loan Services \n2.Accessing Account \n3.Create Account \n4.Close Account \n5.Complaint ")
print("\n(Note: Use Numbers as Input For Accessing Services)")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
user_res = input("\nService Number: ")
if user_res == '1':
user.Loan()
elif user_res == '2':
print("\nServices: ")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
print("\n1.Check Balance \n2.Deposite \n3.Withdaraw \n4.Pin Change \n5.Transaction History \n6.Pay Loan \n7.Transfer Money")
print("\n-------------------------------------------------------------------------------------------------------------------------------")
user_res1 = input("\nPlease Select Service: ")
if user_res1 == '1':
print("\n-------------------------------------------------------------------------------------------------------------------------------")
pin = input("\nPlease enter pin: ")
user.CheckBalance(pin)
elif user_res1 == '2':
print("\n-------------------------------------------------------------------------------------------------------------------------------")
pin = input("\nPlease enter pin: ")
user.Deposit(pin)
elif user_res1 == '3':
print("\n-------------------------------------------------------------------------------------------------------------------------------")
pin = input("\nPlease enter pin: ")
user.WithDraw(pin)
elif user_res1 == '4':
print("\n-------------------------------------------------------------------------------------------------------------------------------")
pin = input("\nPlease enter pin: ")
user.PinChange(pin)
elif user_res1 == '5':
print("\n-------------------------------------------------------------------------------------------------------------------------------")
pin = input("\nPlease enter pin: ")
user.TransactionHistoryShower(pin)
elif user_res1 == '6':
print("\n-------------------------------------------------------------------------------------------------------------------------------")
pin = input("\nPlease enter pin: ")
user.Pay_Loan(pin)
elif user_res1 == '7':
print("\n-------------------------------------------------------------------------------------------------------------------------------")
user.TranserMoney()
else:
print("\nIncorect Response ----- Please try again -------- Thank you!")
elif user_res == '3':
user.CreateUser()
elif user_res == '4':
print("\n-------------------------------------------------------------------------------------------------------------------------------")
user.CloseAccount()
elif user_res == '5':
print("\n-------------------------------------------------------------------------------------------------------------------------------")
user.Complaint()
print("\n-------------------------------------------------------------------------------------------------------------------------------")
user.CloseAccountDB()
user.LoanCloser()
res = input("\nDo you want to continue(y/n): ")
if res == 'n':
print("\n-------------------------------------------------------------------------------------------------------------------------------")
print(" Thank you for using our services")
print("-------------------------------------------------------------------------------------------------------------------------------")