-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCOURTSYS.CPP
612 lines (578 loc) · 14.1 KB
/
COURTSYS.CPP
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
/**********************************************
Header file
***********************************************/
#include<iostream>
#include<direct.h>
#include<conio.h>
#include<process.h>
#include<stdio.h>
#include<fstream>
#include<string.h>
#include<windows.h>
using namespace std;
/**********************************************
Classes used
***********************************************/
class Case
{
int cno;
char nature[20];
char cname[20];
char cdetail[100];
char dohearing[20];
char party1[20];
char party2[20];
char judge[30];
char status[20];
public:
Case(); //constructor
void input();
void output();
int getcno();
void assign_judge();
void assign_nature();
void assign_status();
};
class login
{
char uname[30];
char pass[30];
public:
login(); //constructor
void Enter_un_pass();
};
class judgeasset
{ int choice;
char ch;
public:
void judgelist();
};
/**********************************************
Function definations
***********************************************/
//constructors
Case::Case()
{
cno=0;
strcpy(cname,"Not assigned");
strcpy(cdetail,"Not assigned");
strcpy(nature,"Not assigned");
strcpy(dohearing,"Not assigned");
strcpy(party1,"Not assigned");
strcpy(party2,"Not assigned");
strcpy(judge,"Not assigned");
strcpy(status,"Not assigned");
}
login::login()
{
strcpy(uname,"no");
strcpy(pass,"no");
}
//functions
void Case::input()
{
cout<<"ENTER CASE NO.: ";
cin>>cno;
cout<<"ENTER CASE NAME: ";
gets(cname);
cout<<"ENTER DATE OF HEARING: ";
gets(dohearing);
cout<<"ENTER NATURE OF CASE: "<<endl;
assign_nature();
cout<<"ENTER THE NAME OF PETITIONER: ";
gets(party1);
cout<<"ENTER NAME OF RESPONDENT: ";
gets(party2);
cout<<"ENTER JUDGE NAME: "<<endl;
assign_judge();
cout<<"ENTER CASE DETAILS: ";
gets(cdetail);
cout<<"ENTER CASE STATUS: ";
assign_status();
}
void Case::output()
{
cout<<"===========================================================";
cout<<"\n\t\t\tCase Details\n";
cout<<"==========================================================="<<endl;
cout<<"Case no:"<<cno;
cout<<"\t\tDate of hearing: "<<dohearing<<endl;
cout<<"Case name: "<<cname<<endl;
cout<<"Judge assigned: "<<judge<<endl;
cout<<"Case nature: "<<nature<<endl;
cout<<"Status: "<<status<<endl;
cout<<"Petitioner: "<<party1<<endl;
cout<<"Respondent: "<<party2<<endl;
cout<<"case details: "<<cdetail<<endl;
}
int Case::getcno()
{return cno;
}
void Case::assign_judge()
{int ch;
target:
cout<<"\nCHOOSE FROM THE FOLLOWING JUDGES "<<endl;
cout<<"1.Justice Sanjay Kishan Kaul\n";
cout<<"2.Justice Badar Durrez Ahmed\n";
cout<<"3.Justice Pradeep Nandrajog\n";
cin>>ch;
switch(ch)
{case 1:strcpy(judge,"Justice Sanjay Kishan Kaul");
break;
case 2:strcpy(judge,"Justice Badar Durrez Ahmed");
break;
case 3:strcpy(judge,"Justice Pradeep Nandrajog");
break;
default: cout<<"invalid entry!!";
goto target;
}
}
void Case::assign_nature()
{
int ch;
lable:
cout<<"\nCHOOSE FROM THE FOLLOWING OPTINS "<<endl;
cout<<"1.Criminal"<<endl;
cout<<"2.Banking"<<endl;
cout<<"3.Matrimonial"<<endl;
cout<<"4.Service"<<endl;
cin>>ch;
switch(ch)
{case 1:strcpy(nature,"Criminal");
break;
case 2:strcpy(nature,"Banking");
break;
case 3:strcpy(nature,"Matrimonial");
break;
case 4:strcpy(nature,"Service");
break;
default: cout<<"invalid entry!!"<<endl;
goto lable;
}
}
void Case::assign_status()
{
int ch;
lable:
cout<<"\nCHOOSE FROM THE FOLLOWING"<<endl;
cout<<"1.Pending"<<endl;
cout<<"2.Decided"<<endl;
cin>>ch;
switch(ch)
{
case 1:strcpy(nature,"Pending");
break;
case 2:strcpy(nature,"Decided");
break;
default: cout<<"Invalid entry!!"<<endl;
goto lable;
}
}
void login::Enter_un_pass()
{
lable:
system("cls");
cout<<"Username: ";
gets(uname);
cout<<"password: ";
gets(pass);
if(strcmpi(uname,"admin")==0 &&strcmpi(pass,"12345")==0)
{
cout<<"\nlogin successful ";
Sleep(1000);
system("cls");
}
else if(strcmp(uname,"0"))
{
goto lable;
}
else
{
cout<<"\n!!Wrong username or password"<<endl<<endl;
Sleep(1000);
system("cls");
goto lable;
}
}
void judgeasset::judgelist()
{
do
{
lable:
system("cls");
cout<<"\n YOU CAN CHOOSE FROM THE FOLLOWING JUDGES TO VIEW THEIR ASSETS\n";
cout<<endl;
cout<<"1. Justice Sanjay Kishan Kaul\n";
cout<<"2. Justice Badar Durrez Ahmed\n";
cout<<"3. Justice Pradeep Nandrajog\n";
cout<<"4. Justice Gita Mittal\n";
cout<<"5. Justice S.Rvindra Bhatt\n";
cout<<"0. EXIT";
cout<<"\n ENTER THE NUMBER FOR THE JUDGE WHOSE ASSETS YOU WANT TO SEE\n";
cin>>choice;
switch(choice)
{
case 1 :system("cls");
cout<<"==============================================================================\n";
cout<<" JUDGES ASSETS\n";
cout<<"==============================================================================\n";
cout <<"1. Undivided Share in the Residential Property at lal Mandi, Sringar\n";
cout <<"2. Undivided share in approximately 70 of nambal\n";
cout <<"3. Balance in bank Accounts = Rs. 1,22,115 /-";
cout <<"4. PPF Account with SBI = Rs. 9,30,845/-";
getch();
break;
case 2 :system("cls");
cout<<"==============================================================================\n";
cout<<" JUDGES ASSETS\n";
cout<<"==============================================================================\n";
cout<<endl;
cout<<endl;
cout<<"\n Undivided share in commercial property at 5.5. Road, Lakhtokia";
cout<<"Guwahati, Assam comprised of 2 storeyed building.\n";
cout<<"\nUndivided share in property at village Ulubari, Mauza Beltola, Guwahati";
cout<<"Assam. Total area (approx) = 1 bigha \n";
cout<<"\nUndivided share in property at village F1!tasil, Mauza Beltola";
cout<<" Assam. Total area (approx) =2 bighas 4 kathas - 7 lechas.\n";
cout<<"\nUndivided share in agricultural lands at Kalmani, Rangiya, Assam. ";
cout<<"Total area (approx) =202 bighas 1 katha 5 lechas. \n";
break;
case 3 :system("cls");
cout<<"==============================================================================\n";
cout<<" JUDGES ASSETS\n";
cout<<"==============================================================================\n";
cout<<endl;
cout<<endl;
cout<<"\nHALF OWNER OF FLAT AT RIDGEWOOD ESTATE, DLF PHASE -IV, GURGAON, HARYANA AD-MEASURING 1720 SO.FT. (SUPER AREA)\n";
cout<<"\nFIRST FLOOR (AD-MEASURING ABOUT 1000 SO. FT.) WITH ROOF RIGHTS OF CODAGE AT RADHA BHAWAN ESTATE LIBRARY, MUSSOURIE, UDARAKHAND . ALF OWNER OF FLAT AT RIDGEWOOD ESTATE, ' DLF\n";
cout<<"PHASE-IV, GURGAON, ARYANA A~MEASURINGI H2O . SO.FT. (SUPER AREA) \n";
cout<<"\nFIXED DEPOSITS IN BANK \n";
break;
case 4 :system("cls");
cout<<"==============================================================================\n";
cout<<" JUDGES ASSETS\n";
cout<<"==============================================================================\n";
cout<<endl;
cout<<endl;
cout<<"\nUndivided share in house property in Friends Colony (West), New Delhi [2}'2 storeyed + garages +servant Qtrs]. \n";
cout<<"\nJoint commercial property (four office spaces) in building in Barakhamba Road, New Delhi.\n";
cout<<"\nClaim to undivided share in properties in District Rampur, UP left by paternal grandfather\n";
cout<<"\nReal Estate (immoveable property) of the Judge's dependent (son) \n";
break;
case 5 :system("cls");
cout<<"==============================================================================\n";
cout<<" JUDGES ASSETS\n";
cout<<"==============================================================================\n";
cout<<endl;
cout<<endl;
cout<<"\nUndivided share in property in Gali Qasim Jaan & Gali Murghewali, Ballimaran, Delhi\n";
cout<<"\nUndivided share in agricultural lands at Khubnikuchi,";
cout<<"Rangiya, Assam. Total area (approx) =214 bighas 7kathas 6lechas.\n";
cout<<"\nTempleton India Corporate Bond Opportunities Fund Dividend Payout.\n";
break;
case 0 :exit(0);
break;
default: cout<<"Invalid entry!!";
Sleep(1000);
system("cls");
goto lable;
}
cout<<"\nWant to know more? ";
cin>>ch;
} while(ch=='Y'||ch=='y');
}
/**********************************************
Function prototyping for D.F.H.
***********************************************/
void add_record();
void display_record();
void search_record();
void delete_record();
void update_record();
/**********************************************
Global declaration for variables and stream objects
***********************************************/
int cno,ch,view,flag;
char stat[20],ans;
fstream f1,f2;
Case c;
judgeasset j;
login l;
/**********************************************
The main function of the program
***********************************************/
int main()
{
system("cls");
cout<<"\n\n\n\n\t\t\t Court Management System"<<endl;
Sleep(1000);
cout<<"\n\n\n\n\t\t\t\tCoded by:\n\t\t\t Atrij Sharma and Rithin Jose";
cout<<"\n\n\n\n\n\n\n\n\n\n\n\nPress any key to continue...";
getch();
lable:
system("cls");
cout<<"\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<"\t\t\tWELCOME TO DELHI HIGH COURT"<<endl;
cout<<"\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<"\t\tYOU CAN DO THE FOLLOWING OPERATIONS:"<<endl;
cout<<"\t\t1. USE AS A VIEWER"<<endl;
cout<<"\t\t2. USE AS AN ADMIN"<<endl;
cout<<"\n\n\n\n\t\t\t0. EXIT"<<endl;
cout<<"ENTER YOUR CHOICE: ";
cin>>view;
switch(view)
{
case 1:int v_ch;
lable1:
system("cls");
cout<<"\n\n\n\n\n\tDELHI HIGH COURT";
cout<<"\n\t\tYOU CAN DO THE FOLLOWING OPERATIONS: "<<endl;
cout<<"\t\t1.View case"<<endl;
cout<<"\t\t2.Search case"<<endl;
cout<<"\t\t3.View judges asset"<<endl;
cout<<"\t\t4.Return to main menu"<<endl;
cout<<"ENTER YOUR CHOICE: ";
cin>>v_ch;
if(v_ch==1)
{
system("cls");
display_record();
getch();
goto lable1;
}
else if(v_ch==2)
{
system("cls");
search_record();
goto lable1;
}
else if(v_ch==3)
{
j.judgelist();
goto lable1;
}
else if(v_ch==4)
goto lable;
else
{
cout<<"Invalid entry!!";
getch();
goto lable1;
}
case 2:l.Enter_un_pass();
int a_ch;
lable2:
system("cls");
cout<<"\n\n Welcome ADMIN";
cout<<"\n\n\t\tYOU CAN DO THE FOLLOWING OPERATIONS:"<<endl;
cout<<"\t\t1.Add case"<<endl;
cout<<"\t\t2.Delete case"<<endl;
cout<<"\t\t3.Update case"<<endl;
cout<<"\t\t4.Display case"<<endl;
cout<<"\t\t5.Search case"<<endl;
cout<<"\t\t6.Log out and Return to main menu";
cout<<"\n\n\n\t\tENTER YOUR CHOICE: ";
cin>>a_ch;
if(a_ch==1)
{
system("cls");
add_record();
goto lable2;
}
else if(a_ch==2)
{
system("cls");
delete_record();
goto lable2;
}
else if(a_ch==3)
{
system("cls");
update_record();
goto lable2;
}
else if(a_ch==4)
{
system("cls");
display_record();
getch();
goto lable2;
}
else if(a_ch==5)
{
system("cls");
search_record();
goto lable2;
}
else if(a_ch==6)
goto lable;
else
{
cout<<"Invalid entry!!";
getch();
goto lable2;
}
case 0:exit(0);
break;
default: cout<<"Invalid entry!!";
getch();
goto lable;
}
getch();
return 0;
}
/**********************************************
D.F.H function defination
***********************************************/
void add_record()
{
do
{
system("cls");
f1.open("court.dat",ios::out|ios::app);
cout<<"Enter new case details: "<<endl;
c.input();
f1.write((char*)&c,sizeof(c));
cout<<"\n\n\t\tCASE ADDED";
cout<<"\n\nDo you wish to add another case? ";
cin>>ans;
}while(ans=='y'||ans=='Y');
f1.close();
}
void display_record()
{
f1.open("court.dat",ios::in);
if(!f1)
cout<<"\nNo case available.\n"<<"Try entering case by viewing as admin"<<endl;
else
{
f1.read((char*)&c,sizeof(c));
while(!f1.eof())
{
c.output();
f1.read((char*)&c,sizeof(c));
}
}
f1.close();
}
void search_record()
{
flag=0;
char arr[20];
do
{
system("cls");
cout<<"\nEnter case no. to be searched for: ";
cin>>cno;
f1.open("court.dat",ios::in);
if(!f1)
cout<<"File does not exist."<<endl;
else
{
f1.read((char*)&c,sizeof(c));
while(!f1.eof())
{
if(c.getcno()==cno)
{
flag=1;
cout<<"Case exists"<<endl;
c.output();
break;
}
f1.read((char*)&c,sizeof(c));
}
if(flag==0)
cout<<"\nCase does not exist.\n";
f1.close();
}
cout<<"Do you wish to search another case? ";
cin>>ans;
}while(ans=='Y'||ans=='y');
}
void delete_record()
{
flag=0;
do
{
system("cls");
cout<<"Enter the case no.to be deleted: ";
cin>>cno;
f1.open("court.dat",ios::in);
f2.open("temp.dat",ios::out|ios::app);
if(!f1)
cout<<"File does not exist."<<endl;
else
{
f1.read((char*)&c,sizeof(c));
while(!f1.eof())
{
if(c.getcno()==cno)
{
cout<<"\nCase found.";
flag=1;
}
else
{
f2.write((char*)&c,sizeof(c));
}
f1.read((char*)&c,sizeof(c));
}
if(flag==1)
{
cout<<"\nCase no. "<<cno<<" is deleted."<<endl;
}
else
cout<<"\nCase does not exist."<<endl;
f1.close();
f2.close();
remove("court.dat");
rename("temp.dat","court.dat");
}
cout<<"Do you want to delete more cases? ";
cin>>ans;
}while(ans=='Y'||ans=='y');
}
void update_record()
{
flag=0;
char ans;
do
{
system("cls");
f1.open("court.dat",ios::in|ios::out);
if(!f1)
cout<<"File does not exist"<<endl;
else
{
cout<<"Enter case no to be updated: ";
cin>>cno;
f1.read((char*)&c,sizeof(c));
while(!f1.eof())
{
if(cno==c.getcno())
{
cout<<"Case exist.Old information is: "<<endl;
c.output();
flag=1;
break;
}
f1.read((char*)&c,sizeof(c));
}
if(flag==1)
{
int getpos = f1.tellg(); //error removal temp variable to remove ambiguity
int pos= getpos - sizeof(c);
f1.seekp(pos,ios::beg);
cout<<"\nENTER NEW INFORMATION: "<<endl;
c.input();
f1.write((char*)&c,sizeof(c));
cout<<"Case updated"<<endl;
}
else
cout<<"Case does not exist"<<endl;
}
f1.close();
cout<<"Do you wish to update more cases? ";
cin>>ans;
}while(ans=='Y'||ans=='y');
}