-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBanking_Management.c
More file actions
783 lines (726 loc) · 22 KB
/
Banking_Management.c
File metadata and controls
783 lines (726 loc) · 22 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
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
779
780
781
782
783
#include <stdio.h>
#include <string.h>
#include <conio.h>
#include <stdlib.h>
//added
struct customer_info
{
char ID_NUMBER[15];
char NAME[20];
char IFSC[15];
char ADDRESS[70];
char MOBILE_NUMBER[15];
char DATE_OF_BIRTH[15];
char AADHAR_NUMBER[15];
} d1, e1;
{
int year;
int month;
int date;
float money;
char from;
char to;
long mobile;
} t1;
void transection_details()
{
int id;
printf("Enter Customer's ID-NUMBER : ");
scanf("%d", &id);
}
void holiday_details()
{
int date;
printf("Enter '1' for checking holiday's in upcoming month\n");
printf("Enter '2' for checking holiday's in upcoming 3 months\n");
printf("Enter '3' for checking holiday's in upcoming 6 months\n");
printf("Enter '4' for checking holiday's in upcoming 9 months\n");
printf("Enter '5' for checking holiday's in upcoming 12 months\n");
scanf("%d", &date);
switch (date)
{
case 1:
printf("1 Jnauary 2021 : New Year's Day\n");
printf("14 January 2021 : Makar Sankranti/Pongal\n");
printf("26 January 2021 : Repubic Day\n");
break;
case 2:
printf("1 Jnauary 2021 : New Year's Day\n");
printf("14 January 2021 : Makar Sankranti/Pongal\n");
printf("26 January 2021 : Repubic Day\n");
printf("11 March 2021 : Maha Shivratri\n");
printf("29 March 2021 : Holi\n");
break;
case 3:
printf("1 Jnauary 2021 : New Year's Day\n");
printf("14 January 2021 : Makar Sankranti/Pongal\n");
printf("26 January 2021 : Repubic Day\n");
printf("11 March 2021 : Maha Shivratri\n");
printf("29 March 2021 : Holi\n");
printf("2 April 2021 : Good Friday\n");
printf("6 April 2021 : Mahavir Javanti\n");
printf("1 May 2021 : May Day\n");
printf("13 May 2021 : Idul Fitr\n");
break;
case 4:
printf("1 Jnauary 2021 : New Year's Day\n");
printf("14 January 2021 : Makar Sankranti/Pongal\n");
printf("26 January 2021 : Repubic Day\n");
printf("11 March 2021 : Maha Shivratri\n");
printf("29 March 2021 : Holi\n");
printf("2 April 2021 : Good Friday\n");
printf("6 April 2021 : Mahavir Javanti\n");
printf("1 May 2021 : May Day\n");
printf("13 May 2021 : Idul Fitr\n");
printf("20 July 2021 : EID al Adha\n");
printf("21 July 2021 : Bakrid\n");
printf("24 July 2021 : Guru Purnima\n");
printf("15 August 2021 : Independence Day\n");
printf("19 August 2021 : Muharram\n");
printf("22 August 2021 : Raksha Bandhan\n");
printf("30 August 2021 : Janamashtami\n");
printf("11 September 2021 : Ganesh Chaturthi\n");
break;
case 5:
printf("1 Jnauary 2021 : New Year's Day\n");
printf("14 January 2021 : Makar Sankranti/Pongal\n");
printf("26 January 2021 : Repubic Day\n");
printf("11 March 2021 : Maha Shivratri\n");
printf("29 March 2021 : Holi\n");
printf("2 April 2021 : Good Friday\n");
printf("6 April 2021 : Mahavir Javanti\n");
printf("1 May 2021 : May Day\n");
printf("13 May 2021 : Idul Fitr\n");
printf("20 July 2021 : EID al Adha\n");
printf("21 July 2021 : Bakrid\n");
printf("24 July 2021 : Guru Purnima\n");
printf("15 August 2021 : Independence Day\n");
printf("19 August 2021 : Muharram\n");
printf("22 August 2021 : Raksha Bandhan\n");
printf("30 August 2021 : Janamashtami\n");
printf("11 September 2021 : Ganesh Chaturthi\n");
printf("2 October 2021 : Mahatma Gandhi Jayanti\n");
printf("6 October : Mahalaya\n");
printf("12 October : Maha Saptami\n");
printf("13 October : Maha Ashtami\n");
printf("14 October 2021 : Maha Navami\n");
printf("15 October 2021: Vijaya Dashami/Dussehra\n");
printf("19 October 2021: Id-e-Milad\n");
printf("20 October 2021 : Lakshmi Puja\n");
printf("04 November 2021 : Diwali\n");
printf("06 November 2021 : Chhath Puja\n");
printf("25 December 2021 : Christmas Day\n");
break;
default:
printf("INVALID INPUT\n");
break;
}
}
void branch_details()
{
int state;
printf("Press '1' for Checking Branches is Andhra Pradesh\n");
printf("Press '2' for Checking Branches is Arunachal Pradesh\n");
printf("Press '3' for Checking Branches is Assam\n");
printf("Press '4' for Checking Branches is Bihar\n");
printf("Press '5' for Checking Branches is Chhattisgarh\n");
printf("Press '6' for Checking Branches is Goa\n");
printf("Press '7' for Checking Branches is Gujrat\n");
printf("Press '8' for Checking Branches is Haryana\n");
printf("Press '9' for Checking Branches is Himachal Pradesh\n");
printf("Press '10' for Checking Branches is Jharkhand\n");
printf("Press '11' for Checking Branches is Karnataka\n");
printf("Press '12' for Checking Branches is Kerala\n");
printf("Press '13' for Checking Branches is Madhya Pradesh\n");
printf("Press '14' for Checking Branches is Maharashtra\n");
printf("Press '15' for Checking Branches is Manipur\n");
printf("Press '16' for Checking Branches is Meghalaya\n");
printf("Press '17' for Checking Branches is Mizoram\n");
printf("Press '18' for Checking Branches is Nagaland\n");
printf("Press '19' for Checking Branches is Odisha\n");
printf("Press '20' for Checking Branches is Punjab\n");
printf("Press '21' for Checking Branches is Rajasthan\n");
printf("Press '22' for Checking Branches is Sikkim\n");
printf("Press '23' for Checking Branches is Tamil Nadu\n");
printf("Press '24' for Checking Branches is Telangana\n");
printf("Press '25' for Checking Branches is Tripura\n");
printf("Press '26' for Checking Branches is Uttar Pradesh\n");
printf("Press '27' for Checking Branches is Uttarakhand\n");
printf("Press '28' for Checking Branches is West Bengal\n");
printf("Press '29' for Checking Branches is Delhi\n");
printf("Press '30' for Checking Branches is J&K\n");
scanf("%d", &state);
switch (state)
{
case 1:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 2:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 3:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 4:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 5:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 6:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 7:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 8:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 9:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 10:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 11:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 12:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 13:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 14:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 15:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 16:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 17:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 18:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 19:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 20:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 21:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 22:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 23:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 24:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 25:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 26:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 27:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 28:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 29:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
case 30:
printf("INFORMATION WILL UPLOADED SOON!\n");
break;
default:
printf("INVALI INPUT\n");
break;
}
}
void seven(){
char ch;
FILE *fp;
fp = fopen("seven.txt", "r");
if (fp == NULL)
{
printf("Can't open\n");
}
while (1)
{
ch = fgetc(fp);
if (ch == EOF)
{
break;
}
printf("%c", ch);
}
fclose(fp);
}
void thirty(){
char ch;
FILE *fp;
fp = fopen("thirty.txt", "r");
if (fp == NULL)
{
printf("Can't open\n");
}
while (1)
{
ch = fgetc(fp);
if (ch == EOF)
{
break;
}
printf("%c", ch);
}
fclose(fp);
}
void quatar(){
char ch;
FILE *fp;
fp = fopen("quatar.txt", "r");
if (fp == NULL)
{
printf("Can't open\n");
}
while (1)
{
ch = fgetc(fp);
if (ch == EOF)
{
break;
}
printf("%c", ch);
}
fclose(fp);
}
void yearly(){
char ch;
FILE *fp;
fp = fopen("yearly.txt", "r");
if (fp == NULL)
{
printf("Can't open\n");
}
while (1)
{
ch = fgetc(fp);
if (ch == EOF)
{
break;
}
printf("%c", ch);
}
fclose(fp);
}
void verification_customer(char *login_info, char *pass_info)
{
char result[20] = "rajnishpuri";
char pass_result[20] = "password";
int value;
raj:
fflush(stdin);
printf("Enter Your Username : ");
gets(login_info);
fflush(stdin);
value = strcmp(login_info, result);
if (value == 0)
{
goto raj2;
}
else
{
printf("INVALID INPUT\n");
goto raj;
}
raj2:
printf("Enter Your Password : ");
for (int i = 0; i < 8; i++)
{
pass_info[i] = getch();
printf("*");
}
pass_info[8] = '\0';
fflush(stdin);
value = strcmp(pass_info, pass_result);
if (value == 0)
{
return;
}
else
{
printf("\n");
printf("INVALID PASSWORD\n");
goto raj2;
}
}
void verification_employe(char *login_info, char *pass_info)
{
int value;
char result[20] = "RAJNISHPURI";
char pass_result[20] = "PASSWORD";
emp_part1:
fflush(stdin);
printf("Enter Your Username : ");
gets(login_info);
fflush(stdin);
value = strcmp(login_info, result);
if (value == 0)
{
goto emp_part2;
}
else
{
printf("INVALID INPUT\n");
goto emp_part1;
}
emp_part2:
fflush(stdin);
printf("Enter Your Password : ");
for (int i = 0; i < 8; i++)
{
pass_info[i] = getch();
printf("*");
}
pass_info[8] = '\0';
fflush(stdin);
value = strcmp(pass_info, pass_result);
if (value == 0)
{
return;
}
else
{
printf("\n");
printf("INVALID PASSWORD\n");
goto emp_part2;
}
}
void customer_writting()
{
FILE *fp;
fp = fopen("Customer_Info.txt", "w");
if (fp == NULL)
{
printf("FILE IS NOT AVAILABLE\n");
}
fflush(stdin);
printf("Enter Customer's Name : ");
gets(e1.NAME);
fflush(stdin);
printf("Enter Customer's D-O-B : ");
gets(e1.DATE_OF_BIRTH);
fflush(stdin);
printf("Enter Customer's Address : ");
gets(e1.ADDRESS);
fflush(stdin);
printf("Enter Customer's Mobile Number : ");
gets(e1.MOBILE_NUMBER);
fflush(stdin);
printf("Enter Customer's IFSC Number : ");
gets(e1.IFSC);
fflush(stdin);
printf("Enter Customer's Aadhar number : ");
gets(e1.AADHAR_NUMBER);
strcpy(e1.ID_NUMBER, "7846457684");
fprintf(fp, "Name : ");
fputs(e1.NAME, fp);
fputs("\n", fp);
fprintf(fp, "ID-NUMBER - %s\n", e1.ID_NUMBER);
fprintf(fp, "IFSC CODE : ");
fputs(e1.IFSC, fp);
fprintf(fp, "\n");
fprintf(fp, "D-O-B : ");
fputs(e1.DATE_OF_BIRTH, fp);
fprintf(fp, "\n");
fprintf(fp, "Address : ");
fputs(e1.ADDRESS, fp);
fprintf(fp, "\n");
fprintf(fp, "Mobile Number : %s\n", e1.MOBILE_NUMBER);
fprintf(fp, "Aadhar Number : %s\n", e1.AADHAR_NUMBER);
fclose(fp);
};
int main()
{
int hard;
char login_info[20];
char pass_info[9];
part1:
printf(" WELCOME TO RP BANK\n");
printf("Please Give your Login Credentials \n");
printf("Enter '1' for login as customer\n");
printf("Enter '2' for login as Employe\n");
int what;
scanf("%d", &what);
switch (what)
{
case 1:
raj3:
printf("\e[1;1H\e[2J");
printf(" Hello, Welcome to RP Bank\n");
printf(" HOME\n");
int a;
verification_customer(login_info, pass_info);
raj10:
printf("\e[1;1H\e[2J");
printf(" Welcome Rajnish Puri to RP BANK\n");
printf("\nPress '1' for Customer Information\n");
printf("Press '2' for Transection Information\n");
printf("Press '3' for Holidays\n");
printf("Press '4' for Branches\n");
printf("Press '5' for Logout\n");
scanf("%d", &a);
switch (a)
{
case 1:
printf("\e[1;H\e[2J");
strcpy(d1.ID_NUMBER, "7384676767");
// fflush(stdin);
strcpy(d1.NAME, "Rajnish Puri");
strcpy(d1.IFSC, "GDHFE23245");
strcpy(d1.ADDRESS, "Gobarsahi, Prashan nagar colony, Muzaffarpur, bihar, 843146");
strcpy(d1.MOBILE_NUMBER, "7683543564");
strcpy(d1.AADHAR_NUMBER, "564564434465");
strcpy(d1.DATE_OF_BIRTH, "15-11-2002");
printf(" Customer Information\n");
printf("ID-NUMBER : %s\n", d1.ID_NUMBER);
printf("NAME : ");
puts(d1.NAME);
printf("IFSC Code : ");
puts(d1.IFSC);
printf("ADDRESS : ");
puts(d1.ADDRESS);
printf("MOBILE NUMBER : %s\n", d1.MOBILE_NUMBER);
printf("D-O-B : ");
puts(d1.DATE_OF_BIRTH);
printf("AADAHAR NUMBER : %s\n", d1.AADHAR_NUMBER);
int check, otp;
printf("press '1' for change Mobile Number : \n");
scanf("%d", &check);
if (check == 1)
{
printf("Enter Your new mobile number : ");
fflush(stdin);
gets(d1.MOBILE_NUMBER);
printf("Enter the OTP : ");
scanf("%d", &otp);
if (otp == 123456)
{
printf("Your Mobile Information is successfully changed\n");
}
else
{
printf("INVALID OTP\n");
goto raj10;
}
}
else
{
goto raj3;
}
case 2:
printf(" Transection Information\n");
printf("\n");
printf("Enter '0' for checking transection info of last seven days\n");
printf("Enter '1' for checking transection info of last month\n");
printf("Enter '2' for checking transection info of last quater\n");
printf("Enter '3' for checking transection info of last year\n");
int time;
scanf("%d", &time);
switch (time)
{
case 0:
printf("\e[1;1H\e[2j");
printf("Transection History For Last 7 Days : \n");
seven();
printf("Enter '1' for go back : ");
scanf("%d", &hard);
if (hard == 1)
{
goto raj10;
}
else
{
goto part1;
}
case 1:
printf("\e[1;1H\e[2j");
printf("Transection History For Last 30 Days : \n");
thirty();
printf("Enter '1' for go back : ");
scanf("%d", &hard);
if (hard == 1)
{
goto raj10;
}
else
{
goto part1;
}
case 2:
printf("\e[1;1H\e[2j");
printf("Transection History For Last 180 Days : \n");
quatar();
printf("Enter '1' for go back : ");
scanf("%d", &hard);
if (hard == 1)
{
goto raj10;
}
else
{
goto part1;
}
case 3:
printf("\e[1;1H\e[2j");
printf("Transection History For Last 365 Days : \n");
yearly();
printf("Enter '1' for go back : ");
scanf("%d", &hard);
if (hard == 1)
{
goto raj10;
}
else
{
goto part1;
}
default:
break;
}
case 3:
holiday_details();
printf("Enter '1' for go back : ");
scanf("%d", &hard);
if (hard == 1)
{
goto raj10;
}
else
{
break;
}
case 4:
branch_details();
printf("Enter '1' for go back : ");
scanf("%d", &hard);
if (hard == 1)
{
goto raj10;
}
else
{
break;
}
case 5:
printf("\e[1;1H\e[2J");
int press;
printf("Press '1' for Logout\n");
printf("press any key to back\n");
scanf("%d", &press);
if (press == 1)
{
printf("\e[1;1H\e[2J");
goto part1;
}
else
{
printf("\e[1;1H\e[2J");
goto raj10;
}
default:
break;
}
break;
case 2:
verification_employe(login_info, pass_info);
emp_part3:
printf("\e[1;1H\e[2J");
printf(" RP Bank\n");
printf(" Department of Information\n");
printf(" HOME\n");
int new1;
printf("Press '1' for New Customer Information\n");
printf("Press '2' for checking Transection Information\n");
printf("Press '3' for checking Holidays\n");
printf("Press '4' for checking Branches\n");
printf("Press '5' for Logout\n");
scanf("%d", &new1);
printf("\e[1;1H\e[2J");
switch (new1)
{
case 1:
customer_writting();
printf("Enter '1' for go back : ");
scanf("%d", &hard);
if (hard == 1)
{
goto emp_part3;
}
else
{
break;
}
case 2:
case 3:
holiday_details();
printf("Enter '1' for go back : ");
scanf("%d", &hard);
if (hard == 1)
{
goto emp_part3;
}
else
{
break;
}
case 4:
branch_details();
printf("Enter '1' for go back : ");
scanf("%d", &hard);
if (hard == 1)
{
goto raj10;
}
else
{
break;
}
case 5:
printf("\e[1;1H\e[2J");
int press;
printf("Press '1' for Logout\n");
printf("press any key to back\n");
scanf("%d", &press);
if (press == 1)
{
printf("\e[1;1H\e[2J");
goto part1;
}
else
{
printf("\e[1;1H\e[2J");
goto emp_part3;
}
default:
printf("INVALID INPUT\n");
break;
}
break;
default:
printf("INVALID INPUT\n");
goto part1;
break;
}
return 0;
}