travel code

Upload: 9990737578

Post on 29-May-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 Travel Code

    1/181

    #include#include#include#include#include#include#include

    #include"d:\kumar\screen.cpp"#include"d:\kumar\clear3.cpp"#include"d:\kumar\box.cpp"#include"d:\kumar\box1.cpp"#include"d:\kumar\box2.cpp"#include"d:\kumar\box3.cpp"#include"d:\kumar\dbox.cpp"#include"d:\kumar\clear.cpp"#include"d:\kumar\clear1.cpp"#include"d:\kumar\clear2.cpp"#include"d:\kumar\help.cpp"#include"d:\tc\password.cpp"

    #include"d:\kumar\status.cpp"#include"d:\kumar\market.cpp"#include"d:\kumar\employ.cpp"#include"d:\kumar\road.cpp"class mook:public road,password,status,market,employ{public:

    void menu();};void mook::menu(){clrscr();login();

    char check;do{clrscr();xyz:clrscr();textcolor(WHITE);screen();gotoxy(37,16);cout

  • 8/9/2019 Travel Code

    2/181

    _setcursortype(_SOLIDCURSOR);cprintf("ENTER YOUR CHOICE:");textcolor(WHITE);gotoxy(44,39);check=getch();switch(check){

    case '1':clrscr();admin::look();goto xyz;

    case '2':clrscr();market::make();goto xyz;

    case '3':clrscr();employ::move();goto xyz;

    case '4': clrscr();road::march();goto xyz;

    case '5':clrscr();password::menu();goto xyz;

    case '6':clrscr();screen2();textcolor(RED);gotoxy(35,6);

    cprintf("\nHELP MENU");gotoxy(39,8);cprintf("\nOF");gotoxy(21,10);cprintf("\nTHE TRAVEL AND TRANSPORT MANAGEMENT SYSTEM");textcolor(WHITE);help();textcolor(RED);gotoxy(18,15);cprintf("IF CHOICE:1# ");textcolor(11);gotoxy(26,16);cprintf("The User can work with the ");gotoxy(26,18);cprintf("Administrative Department Menu.");textcolor(RED);gotoxy(18,20);cprintf("IF CHOICE:2# ");textcolor(11);gotoxy(26,21);cprintf("The User can Work with the");gotoxy(26,23);cprintf("Marketing Department Menu.");textcolor(RED);gotoxy(18,25);

    cprintf("IF CHOICE:3# ");textcolor(11);gotoxy(26,26);

  • 8/9/2019 Travel Code

    3/181

    cprintf("The user can work with");gotoxy(26,28);cprintf("Employee Department Menu.");gotoxy(18,30);textcolor(RED);cprintf("IF CHOICE:4# ");textcolor(11);

    gotoxy(26,31);cprintf("The user can work with");gotoxy(26,33);cprintf("Roadways Department Menu.");textcolor(RED);gotoxy(18,35);cprintf("IF CHOICE:5# ");textcolor(11);gotoxy(26,36);cprintf("The user can work with Password Menu");gotoxy(26,39);textcolor(5);

    cprintf("Press Any Key To Continue........");textcolor(WHITE);getch();goto xyz;

    case '7':clrscr();gotoxy(22,22);cout

  • 8/9/2019 Travel Code

    4/181

    ----*//*--------------------Starting of admin class for Administrative Department Menugeneration-----------------------*/class admin:public employee,recruitment,income,budget//declaration of class withthe inheritence of salary,budget,employee and recruitment class{public:

    void look();//declaration of function for Administraive Module menu creation};//End of class declaration/*--------------------------Starting of function definition ---------------------------*/void admin::look(){abc:char first;clrscr();screen();gotoxy(28,16);

    cout

  • 8/9/2019 Travel Code

    5/181

    gotoxy(23,28);cprintf("[3] Account Status");//checking of account statusgotoxy(23,31);cprintf("[4] Help");//for help generationgotoxy(23,34);cprintf("[5] Return to Administrative Menu");textcolor(YELLOW+BLINK);

    gotoxy(32,37);cprintf("Enter Your choice:");textcolor(WHITE);ch6=getch();switch(ch6){case '1': //calling of employee_details from employee class

    clrscr();employee estu;estu.employee_details();getch();goto dep;

    case '2'://calling of recruitment_display from recruitment classclrscr();recruitment rlu;rlu.recruitment_display();gotoxy(25,42);cout

  • 8/9/2019 Travel Code

    6/181

    {case '1'://calling of income_show function fro

    m income classclrscr();income inc;inc.income_show();getch();

    goto dep1;case '2'://calling of salary_show function fr

    om salary classclrscr();salary salu;salu.salary_show();getch();goto dep1;

    case '3'://calling of budget_display functionfrom budget class

    clrscr();budget buk;

    buk.budget_display();getch();goto dep1;

    case '4':goto dep;

    default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retr

    y!!");textcolor(WHITE);getch();goto dep1;

    }case '4'://calling for help generation

    clrscr();screen2();textcolor(RED);gotoxy(35,6);cprintf("\nHELP MENUE");gotoxy(39,8);cprintf("\nFOR");gotoxy(32,10);cprintf("\nDEPARTMENT STATUS");textcolor(WHITE);help();textcolor(RED);gotoxy(18,18);cprintf("IF CHOICE:1# ");textcolor(GREEN);gotoxy(26,21);cprintf("The user can take Information about");gotoxy(26,23);cprintf("Employee Status.");textcolor(RED);gotoxy(18,25);cprintf("IF CHOICE:2# ");textcolor(GREEN);

    gotoxy(26,27);cprintf("The user can take Information about");gotoxy(26,29);

  • 8/9/2019 Travel Code

    7/181

    cprintf("Employee Recruitment Status.");textcolor(RED);gotoxy(18,31);cprintf("IF CHOICE:3# ");textcolor(GREEN);gotoxy(26,33);cprintf("The user can take and generate Report");

    gotoxy(26,35);cprintf("about account Status.");gotoxy(18,42);textcolor(5);cprintf("Press Any Key To Continue........");textcolor(WHITE);getch();goto dep;

    case '5':goto abc;

    default:gotoxy(21,46);

    textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto dep;

    }case '2'://calling of rcruitment menu

    clrscr();recruitment req1;req1.recruitment_menu();goto abc;

    case '3'://calling of account divisionagain:

    char chor;clrscr();screen3();gotoxy(28,15);cout

  • 8/9/2019 Travel Code

    8/181

    income inco;inco.income_menu();goto again;

    case '2'://calling of salary menuclrscr();salary salo;salo.salary_menu();

    goto again;case '3'://calling of budget menu

    clrscr();budget buga;buga.budget_menu();goto again;

    case '4'://for help generationclrscr();screen2();textcolor(RED);gotoxy(35,6);cprintf("\nHELP MENU");

    gotoxy(39,8);cprintf("\nFOR");gotoxy(32,10);cprintf("\nACCOUNT DIVISION");textcolor(WHITE);help();textcolor(RED);gotoxy(18,18);cprintf("IF CHOICE:1# ");textcolor(11);gotoxy(26,20);cprintf("The user can make Entry, Modification,");gotoxy(26,22);

    cprintf("Deletion and Details of Income Details.");textcolor(RED);gotoxy(18,24);cprintf("IF CHOICE:2# ");textcolor(11);gotoxy(26,26);cprintf("The user can make Entry, Modification,");gotoxy(26,28);cprintf("Deletion and Details of Salary Details.");textcolor(RED);gotoxy(18,30);cprintf("IF CHOICE:3# ");textcolor(11);gotoxy(26,32);cprintf("The user can make Entry, Modification,");gotoxy(26,34);cprintf("Deletion and Details of Budget Details.");textcolor(RED);gotoxy(18,36);cprintf("IF CHOICE:4# ");textcolor(11);gotoxy(26,38);cprintf("The user can take Help For");gotoxy(26,40);cprintf("Account Division.");

    gotoxy(18,42);textcolor(5);cprintf("Press Any Key To Continue........");

  • 8/9/2019 Travel Code

    9/181

    textcolor(WHITE);getch();goto again;

    case '5':goto abc;

    default:gotoxy(21,46);

    textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto again;

    }case '4': //for report menu generation

    adm:clrscr();char ch8;screen2();textcolor(RED);

    cprintf("\nREPORT MENU");gotoxy(39,8);cprintf("\nFOR");gotoxy(29,10);cprintf("\nADMINISTRATIVE DEPARTMENT");textcolor(WHITE);screen1();gotoxy(23,21);textcolor(5);cprintf("1.Employee Report");//generation for employee reportgotoxy(23,24);cprintf("2.Employee Recruitment Report");//generation of employee

    recruitment report

    gotoxy(23,27);cprintf("3.Income Report");//generation of income reportgotoxy(23,30);cprintf("4.Salary Report For Administrative Purpose");//generatio

    n of salary reportgotoxy(23,33);cprintf("5.Budget Report");//generation of budget reportgotoxy(23,36);cprintf("6.Return To Administrative Menu");textcolor(WHITE);textcolor(YELLOW+BLINK);gotoxy(25,38);cprintf("Enter Your Choice");textcolor(WHITE);ch8=getch();switch(ch8){case '1'://calling of employee_details function from employe

    e classclrscr();employee eps;eps.employee_details();getch();goto adm;

    case '2'://calling of recruitment_display function from recr

    uitment classclrscr();recruitment reco1;

  • 8/9/2019 Travel Code

    10/181

    reco1.recruitment_display();getch();goto adm;

    case '3'://calling of income_show function from income classclrscr();income incom;incom.income_show();

    getch();goto adm;

    case '4'://calling of salary_show from salary classclrscr();salary salo2;salo2.salary_show();getch();goto adm;

    case '5'://calling of budget_display class from budget classclrscr();budget bug3;bug3.budget_display();

    getch();goto adm;case '6':

    goto abc;default:

    gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto adm;

    }case '5'://help menu generation for Administrative menu

    clrscr();screen2();textcolor(RED);gotoxy(35,6);cprintf("\nHELP MENU");gotoxy(39,8);cprintf("\nFOR");gotoxy(29,10);cprintf("\nADMINISTRATIVE DEPARTMENT");textcolor(WHITE);help();textcolor(RED);gotoxy(18,16);cprintf("IF CHOICE:1# ");textcolor(11);gotoxy(26,18);cprintf("The user can check the Department Status.");textcolor(RED);gotoxy(18,20);cprintf("IF CHOICE:2# ");textcolor(11);gotoxy(26,22);cprintf("The user can make Entry, Modification,");gotoxy(26,24);cprintf("Deletion and Details of Employee Recruitment");

    gotoxy(26,26);cprintf("Division.");textcolor(RED);

  • 8/9/2019 Travel Code

    11/181

    gotoxy(18,28);cprintf("IF CHOICE:3# ");textcolor(11);gotoxy(26,30);cprintf("The user can work with the Account Division.");textcolor(RED);gotoxy(18,32);

    cprintf("IF CHOICE:4# ");textcolor(11);gotoxy(26,34);cprintf("The user can Generate Report For");gotoxy(26,36);cprintf("all above choices");gotoxy(18,40);textcolor(5);cprintf("Press Any Key To Continue........");textcolor(WHITE);getch();goto abc;

    case '6':break;default:

    gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto abc;

    }}/*----------------------------End of admin class-------------------------------*/

    *-------------------------Starting of budget class--------------------*/class budget//Declaration of budget class with inheritence of shape class{protected:

    /*Declaration of variable for access control*/int valid;int ch1;char ch;/*End of declaration*/fstream fin,fin1; //Declaration of fstream variable/*Structure declaration for data,with data dypes*/struct budget1{int snum;int plan;char period[12];char department[15];char purpose[25];float amt;}bug;/*End of declaration*/

    public:budget()//constructor declaration

    {fin.open("budget.dat",ios::inios::outios::binaryios::ate);if(!fin)

  • 8/9/2019 Travel Code

    12/181

    {gotoxy(22,22);cout

  • 8/9/2019 Travel Code

    13/181

    case '1'://calling of budget_create functionclrscr();budget_create();repea3:gotoxy(21,42);textcolor(RED+BLINK);cprintf("HOT KEY: TO MORE ENTRY (PRESS KEY:1)");

    gotoxy(21,44);cprintf("HOT KEY:TO EXIT (PRESS KEY:2)");textcolor(WHITE);getch();char more3;cin>>more3;switch(more3){case '1':

    budget_create();//calling of more entrygoto repea3;

    case '2':

    goto again3;default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto repea3;

    }case '2'://calling of budget_display function

    budget bol1;bol1.budget_display();getch();

    goto again3;case '3': //calling of budget_del function

    budget bol2;bol2.budget_del();getch();goto again3;

    case '4'://calling of budget_modify functionbudget bol3;bol3.budget_modify();getch();goto again3;

    case '5'://calling of budget_query functionbudget bol4;bol4.budget_query();getch();goto again3;

    case '6':break;

    default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto again3;

    }}

    //end of menu function

  • 8/9/2019 Travel Code

    14/181

    /*strating of budget_save function*/void budget::budget_save(){textcolor(RED+BLINK);gotoxy(25,42);cprintf("Are You Sure To Save It(y/n):");ch=getche();

    textcolor(WHITE);if (ch == 'y'){fin.seekp(0,ios::end);fin.write((char*)&bug,sizeof(bug));gotoxy(23,38);cout

  • 8/9/2019 Travel Code

    15/181

  • 8/9/2019 Travel Code

    16/181

    coutbug.amt;float ch= bug.amt;if (ch== 0){valid=0;gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    17/181

    fin.seekg(0,ios::beg);while(fin.read((char*)&bug,sizeof(bug))!=0){gotoxy(4,m);cout

  • 8/9/2019 Travel Code

    18/181

    gotoxy(5,25);cprintf("Year of Plan :");cout

  • 8/9/2019 Travel Code

    19/181

    valid=0;gotoxy(40,38);cout

  • 8/9/2019 Travel Code

    20/181

    ch=strlen(bug.purpose);if (ch== 0 ch>=25){valid=0;gotoxy(40,38);coutbug.amt;float ch= bug.amt;if (ch== 0){valid=0;gotoxy(40,38);cout

  • 8/9/2019 Travel Code

    21/181

    clrscr();screen2();textcolor(RED);cprintf("\nDELETION FORM\n");gotoxy(39,8);cprintf("\nOF");gotoxy(34,10);

    cprintf("\nBUDGET DETAILS");textcolor(WHITE);screen4();int code1;fin1.open("temp3.dat",ios::out);gotoxy(23,24);cprintf("Enter The Serial No.To be Deleted:");cin>>code1;fin.seekg(0,ios::beg);int found1=0;while(fin.read((char*)&bug,sizeof(bug))){

    if(bug.snum!=code1)fin1.write((char*)&bug,sizeof(bug));elsefound1=1;

    }if(found1==0)

    {gotoxy(25,31);cout

  • 8/9/2019 Travel Code

    22/181

    gotoxy(20,22);cprintf("Enter The Serial Number To be Make Query:");cin>>vac;clear1();int co=0;fin.seekg(0,ios::beg);while(fin.read((char*)&bug,sizeof(bug))!=0)

    {if(bug.snum!=vac)co++;

    else{clrscr();int s=1;screen2();screen1();gotoxy(30,6);textcolor(RED);cprintf("\nQUERY RESULT FORM\n");

    gotoxy(38,8);cprintf("\nOF");gotoxy(31,10);cprintf("\nBUDGET DETAILS");textcolor(WHITE);gotoxy(27,16);cout

  • 8/9/2019 Travel Code

    23/181

    }}if(co==0)gotoxy(10,30);gotoxy(24,42);cout

  • 8/9/2019 Travel Code

    24/181

    again2:clrscr();char ch3;screen3();gotoxy(18,15);textcolor(CYAN);cprintf("Account Division of Administrative Department");

    gotoxy(31,17);cprintf("Salary Division");screen1();textcolor(GREEN);gotoxy(25,21);cprintf("[1] Salary Entry");//for entering of datagotoxy(25,24);cprintf("[2] Salary Details");//for details/report generationgotoxy(25,27);cprintf("[3] Salary Deletion");//for record deletiongotoxy(25,30);cprintf("[4] Salary Modification");//for record modification

    gotoxy(25,33);cprintf("[5] Query for Salary Details");//for querygotoxy(25,36);cprintf("[6] Return To Account Division Menu");textcolor(YELLOW+BLINK);gotoxy(25,38);cprintf("Enter Your Choice:");textcolor(WHITE);ch3=getch();switch(ch3){case '1'://calling of salary_entry function

    clrscr();

    salary_entry();repea2:gotoxy(21,42);textcolor(RED+BLINK);cprintf("HOT KEY: TO MORE ENTRY (PRESS KEY:1)");gotoxy(21,44);cprintf("HOT KEY:TO EXIT (PRESS KEY:2)");textcolor(WHITE);char more2;cin>>more2;switch(more2){case '1'://for more entry

    clrscr();salary_entry();goto repea2;

    case '2':goto again2;

    default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto repea2;

    }case '2'://calling of salary_show function

    salary som;

  • 8/9/2019 Travel Code

    25/181

    som.salary_show();fin.clear();getch();goto again2;

    case '3'://calling of salary_del functionsalary som1;som1.salary_del();

    fin.clear();getch();goto again2;

    case '4'://calling of salary_modify functionsalary som2;som2.salary_modify();fin.clear();getch();goto again2;

    case '5'://calling of salary_query functionsalary som3;som3.salary_query();

    fin.clear();getch();goto again2;

    case '6':break;

    default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto again2;

    }

    }

    //end of function definition/*starting of salary_save function body definition*/void salary::salary_save(){char in;textcolor(RED+BLINK);gotoxy(25,42);cprintf("Are You Sure To Save It(y/n):");in=getche();textcolor(WHITE);if (in == 'y'){fin.seekp(0,ios::end);fin.write((char*)&sal,sizeof(sal));gotoxy(23,38);cout

  • 8/9/2019 Travel Code

    26/181

    void salary::exit2(){fin.close();}

    //end of function definition

    /*starting of salary_entry function definition*/void salary::salary_entry(){int valid;clrscr();screen2();screen1();gotoxy(34,6);textcolor(RED);cprintf("\nENTRY FORM\n");gotoxy(38,8);cprintf("\nOF");

    gotoxy(32,10);cprintf("\nSALARY DETAILS");textcolor(CYAN);gotoxy(20,23);cprintf("Enter The Job_Code :");gotoxy(20,26);cprintf("Enter The Department Name :");gotoxy(20,29);cprintf("Enter The Mode of Payment :");gotoxy(20,32);cprintf("Enter The Salary :");gotoxy(20,35);cprintf("Enter The date Of payment :");

    textcolor(WHITE);fin.seekp(0,ios::end);do{valid=1;employee::employee1 elo1;fin2.open("elook.dat",ios::in);gotoxy(51,23);cin>>sal.emp_jcode;int ch=sal.emp_jcode;fin2.seekg(0,ios::beg);while(fin2.read((char*)&elo1,sizeof(elo1))!=0){if(ch==elo1.jcode){gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    27/181

    }}while(!valid);do{valid=1;gotoxy(51,26);gets(sal.emp_dep);

    char ch=strlen(sal.emp_dep);if (ch== 0 ch>=16){valid=0;gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    28/181

    {valid=0;gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    29/181

    coutcode;fin.seekg(0,ios::beg);int found=0;while(fin.read((char*)&sal,sizeof(sal))){

    if(sal.emp_jcode!=code)fin1.write((char*)&sal,sizeof(sal));

    elsefound=1;

    }if(found==0)

    {gotoxy(25,31);cout

  • 8/9/2019 Travel Code

    30/181

    //end of function definition

    /*starting of salary_modify function definition*/

    void salary::salary_modify(){int valid;

    clrscr();int jcode;screen2();gotoxy(31,6);textcolor(RED);cprintf("\nMODIFICATION fORM\n");gotoxy(38,8);cprintf("\nOF");gotoxy(32,10);cprintf("\nSALARY DETAILS");textcolor(WHITE);screen4();

    gotoxy(20,21);cprintf("Enter The Emp_jcode To be Modified:");//modifying through emp_jcodecin>>jcode;clear(20,21);clear1();int pos=0,count=0;fin.seekg(0,ios::beg);while(fin.read((char*)&sal,sizeof(sal))){if(sal.emp_jcode!=jcode)count++;

    else{

    scoot();textcolor(GREEN);gotoxy(12,21);cprintf("Old Value");gotoxy(12,22);cout

  • 8/9/2019 Travel Code

    31/181

    textcolor(GREEN);gotoxy(47,21);cprintf("Enter New Value");gotoxy(47,22);coutsal.emp_jcode;int ch=sal.emp_jcode;if (ch== 0){

    valid=0;gotoxy(40,38);cout

  • 8/9/2019 Travel Code

    32/181

    {valid=0;gotoxy(40,38);coutsal.emp_sal;

    int ch=sal.emp_sal;if (ch== 0 ){valid=0;gotoxy(40,38);cout

  • 8/9/2019 Travel Code

    33/181

    {fin.seekp(pos,ios::beg);fin.write((char*)&sal,sizeof(sal));gotoxy(45,38);cout

  • 8/9/2019 Travel Code

    34/181

    cout

  • 8/9/2019 Travel Code

    35/181

    {gotoxy(22,22);cout

  • 8/9/2019 Travel Code

    36/181

    {case '1'://calling of employee_entry function

    clrscr();employee_entry();eko:gotoxy(21,42);textcolor(RED+BLINK);

    cprintf("HOT KEY: TO MORE ENTRY (PRESS KEY:1)");gotoxy(21,44);cprintf("HOT KEY:TO EXIT (PRESS KEY:2)");textcolor(WHITE);char ek1;cin>>ek1;switch(ek1){case '1'://for more entry

    employee_entry();goto eko;

    case '2':

    goto emplo;default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto eko;

    }case '2'://calling of employee_details function

    employee er1;clrscr();er1.employee_details();

    fin.clear();getch();goto emplo;

    case'3'://calling of employee_modify functionemployee er2;clrscr();er2.employee_modify();getch();goto emplo;

    case'4'://calling of employee_del functionemployee er3;clrscr();er3.employee_del();getch();goto emplo;

    case'5'://calling of employee_query functionemployee er4;clrscr();er4.employee_query();getch();goto emplo;

    case'6':break;

    default:gotoxy(21,46);

    textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);

  • 8/9/2019 Travel Code

    37/181

    getch();goto emplo;

    }}//end of menu function/*starting of employee_save function body*/void employee::employee_save(){

    char in;textcolor(RED+BLINK);gotoxy(25,42);cprintf("Are You Sure To Save It(y/n):");in=getche();textcolor(WHITE);if (in == 'y'){fin.seekp(0,ios::end);fin.write((char*)&elo,sizeof(elo));gotoxy(23,37);cout

  • 8/9/2019 Travel Code

    38/181

    gotoxy(18,34);cprintf("Enter The Sex(M/F) :");textcolor(WHITE);fin.seekp(0,ios::end);gotoxy(48,22);cout

  • 8/9/2019 Travel Code

    39/181

    gotoxy(48,30);gets(elo.add);char ch=strlen(elo.add);if (ch== 0 ch>=15){valid=0;gotoxy(18,38);

    cout

  • 8/9/2019 Travel Code

    40/181

    gotoxy(28,4);cprintf("Employee Details");textcolor(WHITE);gotoxy(2,6);cprintf("---------------------------------------------------------------------

    ----------");textcolor(BLUE);

    gotoxy(2,7);cprintf("E_jcode");gotoxy(10,7);cprintf("J_date");gotoxy(21,7);cprintf("Name");gotoxy(37,7);cprintf("F_name");gotoxy(53,7);cprintf("Adderess");gotoxy(66,7);cprintf("Designation");

    gotoxy(78,7);cprintf("Sex");textcolor(WHITE);gotoxy(2,8);cout

  • 8/9/2019 Travel Code

    41/181

    gotoxy(38,8);cprintf("\nOF");gotoxy(31,10);cprintf("\nEMPLOYEE DETAILS");textcolor(WHITE);screen4();gotoxy(20,21);

    cprintf("Enter The Emp_jcode To be Modified:");cin>>number1;clear(20,21);clear1();int pos=0,count=0;fin.seekg(0,ios::beg);while(fin.read((char*)&elo,sizeof(elo))){if(elo.jcode!=number1)count++;

    else{

    int ck;/*Displaying of old value of reference*/scoot();textcolor(GREEN);gotoxy(12,21);cprintf("Old Value");gotoxy(12,22);cout

  • 8/9/2019 Travel Code

    42/181

    cprintf("Enter New Value");gotoxy(47,22);coutelo.jcode;ck=elo.jcode;if(ck!=number1){valid=0;gotoxy(40,38);cout

  • 8/9/2019 Travel Code

    43/181

    gotoxy(40,38);cout

  • 8/9/2019 Travel Code

    44/181

    if (ch== 0 ch>=10){valid=0;gotoxy(40,38);cout

  • 8/9/2019 Travel Code

    45/181

    /*starting of employee_del function body*/

    void employee::employee_del(){clrscr();screen2();textcolor(RED);

    cprintf("\nDELETION FORM\n");gotoxy(39,8);cprintf("\nOF");gotoxy(33,10);cprintf("\nEMPLOYEE DETAILS");textcolor(WHITE);screen4();int code1;fin1.open("temk.dat",ios::out);gotoxy(23,24);cprintf("Enter The Emp_jcode To be Deleted:");cin>>code1;

    fin.seekg(0,ios::beg);int found1=0;while(fin.read((char*)&elo,sizeof(elo))){if(elo.jcode!=code1)fin1.write((char*)&elo,sizeof(elo));

    elsefound1=1;

    }if(found1==0)

    {gotoxy(25,31);cout

  • 8/9/2019 Travel Code

    46/181

    textcolor(RED);cprintf("\nQUERY FORM\n");gotoxy(36,8);cprintf("\nOF");gotoxy(30,10);cprintf("\nEMPLOYEE DETAILS");textcolor(WHITE);

    screen4();gotoxy(20,22);cprintf("Enter The Employee Jcode To Make Query:");cin>>vac;clear1();int co=0;fin.seekg(0,ios::beg);while(fin.read((char*)&elo,sizeof(elo))!=0){if(elo.jcode!=vac)co++;

    else

    { clrscr();int s=1;screen2();screen1();gotoxy(30,6);textcolor(RED);cprintf("\nQUERY RESULT FORM\n");gotoxy(38,8);cprintf("\nOF");gotoxy(30,10);cprintf("\nEMPLOYEE DETAILS");textcolor(WHITE);

    gotoxy(27,16);cout

  • 8/9/2019 Travel Code

    47/181

    cout

  • 8/9/2019 Travel Code

    48/181

    /*starting of function declaration*/void income_entry();void income_show();void income_menu();void income_query();void income_save();void exit1();

    /*end of function declaration*/};

    //end of class declaration

    /*starting of menu function body*/

    void income::income_menu(){again1:char ch2;clrscr();

    screen3();gotoxy(18,15);textcolor(CYAN);cprintf("Account Division of Administrative Department");gotoxy(31,17);cprintf("Income Division");screen4();textcolor(GREEN);gotoxy(25,20);cprintf("[1] Income Entry");//for income entrygotoxy(25,23);cprintf("[2] Income Details");//for details/report generationgotoxy(25,26);

    cprintf("[3] Query For Income details");//query for detailsgotoxy(25,29);cprintf("[4] Return To Account Division Menu");textcolor(YELLOW+BLINK);gotoxy(25,31);cprintf("Enter Your Choice:");textcolor(WHITE);ch2=getch();switch(ch2){case '1'://calling of income_entry function

    clrscr();income_entry();repea1:gotoxy(21,42);textcolor(RED+BLINK);cprintf("HOT KEY: TO MORE ENTRY (PRESS KEY:1)");gotoxy(21,44);cprintf("HOT KEY:TO EXIT (PRESS KEY:2)");textcolor(WHITE);char more1;cin>>more1;switch(more1){case '1'://for more entry

    income_entry();goto repea1;

    case '2':

  • 8/9/2019 Travel Code

    49/181

    goto again1;default:

    gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();

    goto repea1;}

    case '2'://calling of income_show functionincome i;i.income_show();getch();goto again1;

    case '3'://calling of income_query functionincome i1;i1.income_query();getch();goto again1;

    case '4':break;default:

    gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto again1;

    }}

    //end of menu function body

    /*starting of income_save function body defination*/

    void income::income_save(){char in;textcolor(RED+BLINK);gotoxy(25,42);cprintf("Are You Sure To Save It(y/n):");in=getche();textcolor(WHITE);if (in == 'y'){fin.seekp(0,ios::end);fin.write((char*)&ins,sizeof(ins));gotoxy(23,38);cout

  • 8/9/2019 Travel Code

    50/181

    }/*starting of income_entry function*/

    void income::income_entry(){int valid;clrscr();

    screen2();screen1();gotoxy(34,6);textcolor(RED);cprintf("\nENTRY FORM");gotoxy(38,8);cprintf("\nOF");gotoxy(33,10);cprintf("\nINCOME DATILS");textcolor(WHITE);gotoxy(20,22);textcolor(CYAN);

    cprintf("Enter The Date :");gotoxy(20,24);cprintf("Enter The Department Name :");gotoxy(20,26);cprintf("Enter The Head Job_code :");gotoxy(20,28);cprintf("Enter The Income Mode :");gotoxy(20,30);cprintf("Enter The Year :");gotoxy(20,32);cprintf("Enter The Total Income :");gotoxy(20,34);cprintf("Payment :");

    textcolor(WHITE);fin.seekp(0,ios::end);do{valid=1;gotoxy(51,22);gets(ins.edate);char ch=strlen(ins.edate);if (ch== 0 ch>=15){valid=0;gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    51/181

    gotoxy(18,38);coutins.jcode;int ch=ins.jcode;if (ch== 0 ){valid=0;gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    52/181

    {valid=1;gotoxy(51,32);cin>>ins.amount;int ch=ins.amount;if (ch== 0){

    valid=0;gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    53/181

    gotoxy(35,8);cprintf("Jcode");gotoxy(45,8);cprintf("Mode");gotoxy(54,8);cprintf("Year");gotoxy(62,8);

    cprintf("Income");gotoxy(72,8);cprintf("Payment");textcolor(WHITE);gotoxy(2,9);cout

  • 8/9/2019 Travel Code

    54/181

    cprintf("Enter Eployee Jcode To Make Query:");cin>>vac_no;clear1();int co=0;fin.seekg(0,ios::beg);while(fin.read((char*)&ins,sizeof(ins))!=0){

    if(ins.jcode!=vac_no)co++;

    else{clrscr();int s=1;screen2();screen1();gotoxy(30,6);textcolor(RED);cprintf("\nQUERY RESULT FORM\n");gotoxy(38,8);

    cprintf("\nOF");gotoxy(31,10);cprintf("\nEMPLOYEE DETAILS");textcolor(WHITE);gotoxy(27,16);cout

  • 8/9/2019 Travel Code

    55/181

    }textcolor(WHITE);flush(fin);

    }}if(co==0)gotoxy(10,30);

    gotoxy(24,42);cout

  • 8/9/2019 Travel Code

    56/181

    /*end of function declaration*/};//end of class declaration

    /*starting of menu function body*/void recruitment::recruitment_menu()

    {all:char ch;clrscr();screen3();gotoxy(28,15);textcolor(CYAN);cprintf("ADMINISTRATIVE DEPARTMENT");gotoxy(27,17);cprintf("EMPLOYEE RECRUITMENT DIVISION");screen1();textcolor(GREEN);

    gotoxy(23,21);cprintf("[1] Entry of Details");//for entry of detailsgotoxy(23,24);cprintf("[2] Recruitment Details");//for showing and report generationgotoxy(23,27);cprintf("[3] Deletion of Details");//for deletion of detailsgotoxy(23,30);cprintf("[4] Modification of Details");//for modifying of deatailsgotoxy(23,33);cprintf("[5] Query for Details");//for query related to datagotoxy(23,36);cprintf("[6] Return to Administrative Menu");textcolor(YELLOW+BLINK);

    gotoxy(32,38);cprintf("Enter Your choice:");textcolor(WHITE);ch=getch();switch(ch){case '1'://calling of recruitment_entry function

    clrscr();recruitment_entry();repea:gotoxy(21,41);textcolor(RED+BLINK);cprintf("HOT KEY: TO MORE ENTRY (PRESS KEY:1)");gotoxy(21,42);cprintf("HOT KEY:TO EXIT (PRESS KEY:2) :");textcolor(WHITE);char more;cin>>more;switch(more){case '1'://for more entry

    recruitment_entry();flush(fin);goto repea;

    case '2':

    goto all;default:

    gotoxy(21,46);

  • 8/9/2019 Travel Code

    57/181

    textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto repea;

    }case '2'://calling of recruitment_dispaly function

    recruitment rom;clrscr();rom.recruitment_display();fin.clear();getch();goto all;

    case '3'://calling of recruitment_del functionrecruitment rom1;clrscr();rom1.recruitment_del();fin.clear();fin1.clear();

    getch();goto all;case '4'://calling of rcruitment_modify function

    recruitment rom2;rom2.recruitment_modify();flush(fin);getch();goto all;

    case '5'://calling of recruitment_query functionrecruitment rom3;rom3.recruitment_query();getch();goto all;

    case '6':break;

    default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto all;

    }}//end of menu function definiion

    /*starting of recruitment_save function definition body*/

    void recruitment::recruitment_save(){char in;textcolor(RED+BLINK);gotoxy(25,42);cprintf("Are You Sure To Save It(y/n):");in=getche();textcolor(WHITE);if (in == 'y'){

    fin.seekp(0,ios::end);fin.write((char*)&hum,sizeof(hum));gotoxy(23,38);

  • 8/9/2019 Travel Code

    58/181

    cout

  • 8/9/2019 Travel Code

    59/181

    gotoxy(54,24);clear(54,24);}

    }while(!valid);do{valid=1;

    gotoxy(54,26);cin>>hum.seat;if (hum.seat==0){valid=0;gotoxy(18,36);cprintf("Seat Entry Should Not be Zero ");getch();clear(18,36);}}while(!valid);do

    {valid=1;gotoxy(54,28);gets(hum.post);char ch=strlen(hum.post);if (ch== 0 ch>=10){valid=0;gotoxy(18,38);couthum.amount;float ch=hum.amount;if (ch== 0){valid=0;gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    60/181

    valid=0;gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    61/181

    cout

  • 8/9/2019 Travel Code

    62/181

    coutvaccency_no;clear(20,22);clear1();int pos=0,count=0;fin.seekg(0,ios::beg);while(fin.read((char*)&hum,sizeof(hum))){

    if(hum.snum!=vaccency_no)count++;

    else{scoot();textcolor(GREEN);gotoxy(10,21);cprintf("Old Value");gotoxy(10,22);cout

  • 8/9/2019 Travel Code

    63/181

    gotoxy(5,32);cprintf("Pay Scale :");cout

  • 8/9/2019 Travel Code

    64/181

    do{valid=1;gotoxy(57,28);cin>>hum.seat;if (hum.seat==0){

    valid=0;gotoxy(40,36);cprintf("Seat Entry Should Not be Zero ");getch();clear3(40,36);

    }}while(!valid);gotoxy(40,30);textcolor(CYAN);cprintf("The Name_of_Post:");textcolor(WHITE);do

    {valid=1;gotoxy(57,30);gets(hum.post);char ch=strlen(hum.post);if (ch== 0 ch>=10){valid=0;gotoxy(40,38);couthum.amount;float ch=hum.amount;if (ch== 0){valid=0;gotoxy(40,38);cout

  • 8/9/2019 Travel Code

    65/181

    do{valid=1;gotoxy(57,34);gets(hum.ldate);char ch=strlen(hum.ldate);if (ch== 0 ch>=15)

    {valid=0;gotoxy(40,38);cout

  • 8/9/2019 Travel Code

    66/181

    clear1();int co=0;fin.seekg(0,ios::beg);while(fin.read((char*)&hum,sizeof(hum))!=0){if(hum.snum!=vac_no)co++;

    else{clrscr();int s=1;screen2();screen1();gotoxy(30,6);textcolor(RED);cprintf("\nQUERY RESULT FORM\n");gotoxy(38,8);cprintf("\nOF");gotoxy(30,10);

    cprintf("\nRECRUITMENT DETAILS");textcolor(WHITE);gotoxy(24,16);cout

  • 8/9/2019 Travel Code

    67/181

    fin.clear();}

    }if(co==0)//if record is not foundgotoxy(10,30);gotoxy(24,42);cout

  • 8/9/2019 Travel Code

    68/181

    switch(first1){case '1'://calling of purchase menu function from purchase class

    clrscr();//purchase pum;purchase::purchase_menu();goto abc1;

    case '2'://calling of lease menu function from lease classclrscr();lease lov;lov.lease_menu();goto abc1;

    case '3'://calling of expense menu function from expense classclrscr();//expense expo;expense::expense_menu();goto abc1;

    case '4'://calling for report generationmarketo1:

    clrscr();char muk6;screen2();textcolor(RED);cprintf("\nREPORT MENU");gotoxy(39,8);cprintf("\nFOR");gotoxy(30,10);cprintf("\nMARKETING DEPARTMENT");textcolor(WHITE);screen4();gotoxy(23,22);textcolor(11);

    cprintf("1.Purchase Order Report");gotoxy(23,24);cprintf("2.Lease Report");gotoxy(23,26);cprintf("3.Expenses Report");gotoxy(23,28);cprintf("4.Return To Marketing Menu");textcolor(YELLOW+BLINK);gotoxy(25,31);cprintf("Enter Your Choice:");textcolor(WHITE);muk6=getch();switch(muk6){case '1'://report generation for purchase division

    clrscr();purchase pr;pr.purchase_details();getch();goto marketo1;

    case '2'://report generation for lease divisionclrscr();lease les;les.lease_details();getch();

    goto marketo1;case '3'://report generation for expense division

    clrscr();

  • 8/9/2019 Travel Code

    69/181

    expense expu;expu.expense_details();getch();goto marketo1;

    case '4':goto abc1;

    default:

    gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto marketo1;

    }case '5'://calling for help generation

    clrscr();screen2();textcolor(RED);gotoxy(35,6);

    cprintf("\nHELP MENU");gotoxy(39,8);cprintf("\nFOR");gotoxy(31,10);cprintf("\nMARKETING DEPARTMENT");textcolor(WHITE);help();textcolor(RED);gotoxy(15,16);cprintf("IF CHOICE:1# ");gotoxy(21,17);textcolor(11);cprintf("The User can work with the Purchase Divisin.");

    gotoxy(16,19);textcolor(5);cprintf("IF SUB CHOICE:#");gotoxy(21,20);textcolor(11);cprintf("The User can make Entry,Modify,Delete and take");gotoxy(21,21);cprintf("Details of Purchase Order.");textcolor(RED);gotoxy(15,23);cprintf("IF CHOICE:2# ");textcolor(11);gotoxy(21,24);cprintf("The User can Work with the Lease Division.");gotoxy(16,26);textcolor(5);cprintf("IF SUB CHOICE:#");gotoxy(21,27);textcolor(11);cprintf("The User can make Entry,Modify,Delete and take");gotoxy(21,28);cprintf("Details of Lease Details.");textcolor(RED);gotoxy(15,30);cprintf("IF CHOICE:3# ");

    textcolor(11);gotoxy(21,31);cprintf("The User Can Work with the Expenses Division.");

  • 8/9/2019 Travel Code

    70/181

    gotoxy(16,33);textcolor(5);cprintf("IF SUB CHOICE#");gotoxy(21,34);textcolor(11);cprintf("The User Can make Entry and Display the Details.");gotoxy(15,36);

    textcolor(RED);cprintf("IF CHOICE:4# ");gotoxy(21,37);textcolor(11);cprintf("User can Generate Report For all above choices.");gotoxy(18,39);textcolor(5);cprintf("Press Any Key To Continue........");textcolor(WHITE);getch();goto abc1;

    case '6':

    break;default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto abc1;

    }}/*----------------------------End of market class-----------------------------*/

    /*------------------------------Starting of purchase class-------------------*/class purchase//class declaration{protected:

    fstream fin,fin1;//declaration of fstream variable/*starting of structure declaration of data with their data types*/struct purchase1{int order;char vehicle[10];float cost;int emp_jcode;char data[15];}pur;//end of structure declaration

    public:purchase()//declaration of constructor{fin.open("purcase.dat",ios::inios::outios::binaryios::ate);if(!fin){gotoxy(22,22);cout

  • 8/9/2019 Travel Code

    71/181

    ~purchase()//declaration of destructor{fin.close();delete pur.vehicle,pur.data;//deletion of structure varable expli

    citly}/* starting of declaration of function*/

    void purchase_entry();void purchase_details();void purchase_menu();void purchase_query();void purchase_save();void exit5();/*end of functin declaration*/

    };//end of class declaration/*starting of menu class defination*/void purchase::purchase_menu(){market1:

    clrscr();char m1;screen3();gotoxy(18,15);textcolor(CYAN);cprintf("Purchase Division of Marketing Department");gotoxy(27,17);cprintf("purchase Order Submenue");screen4();textcolor(GREEN);gotoxy(25,21);cprintf("[1] Purchase Order Entry");//for entry of purchase ordergotoxy(25,24);

    cprintf("[2] Order Details");//for order detailsgotoxy(25,27);cprintf("[3] Query For Purchase Order");//for query of detailsgotoxy(25,30);cprintf("[4] Return To Purchase Division Menu");textcolor(YELLOW+BLINK);gotoxy(25,32);cprintf("Enter Your Choice:");textcolor(WHITE);m1=getch();switch(m1){case '1'://calling of purchase_entry function

    clrscr();purchase_entry();rep:gotoxy(21,42);textcolor(RED+BLINK);cprintf("HOT KEY: TO MORE ENTRY (PRESS KEY:1)");gotoxy(21,44);cprintf("HOT KEY:TO EXIT (PRESS KEY:2)");textcolor(WHITE);char m2;cin>>m2;switch(m2)

    {case '1'://for more enrry

    purchase_entry();

  • 8/9/2019 Travel Code

    72/181

    goto rep;case '2':

    goto market1;default:

    gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");

    textcolor(WHITE);getch();gotoxy(21,42);goto rep;

    }case '2'://calling of purchase_details function

    clrscr();purchase po;po.purchase_details();fin.clear();getch();goto market1;

    case'3'://calling of purchase_query functionpurchase po1;po1.purchase_query();fin.clear();getch();goto market1;

    case '4':break;

    default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);

    getch();goto market1;

    }}

    //end of menu function

    /*starting of purchase_save function definition*/

    void purchase::purchase_save(){char in;textcolor(RED+BLINK);gotoxy(25,42);cprintf("Are You Sure To Save It(y/n):");in=getche();textcolor(WHITE);if (in == 'y'){fin.seekp(0,ios::end);fin.write((char*)&pur,sizeof(pur));gotoxy(23,38);cout

  • 8/9/2019 Travel Code

    73/181

    gotoxy(56,42);return;

    }

    //end of function definition

    void purchase::exit5()

    {fin.close();}/*starting of purchase_entry function definition*/void purchase::purchase_entry(){int valid;clrscr();screen2();textcolor(RED);cprintf("\nENTRY FORM");gotoxy(38,8);

    cprintf("\nOF");gotoxy(32,10);cprintf("\nPURCHASE ORDER");textcolor(WHITE);screen1();textcolor(CYAN);gotoxy(18,21);cprintf("Number of Purchase Order :");gotoxy(18,24);cprintf("Enter The Name of Purchasable Thing :");gotoxy(18,27);cprintf("Enter The Date :");gotoxy(18,30);

    cprintf("Enter The Spended Cost :");gotoxy(18,33);cprintf("The Job_code of Responsible Employee :");textcolor(WHITE);fin.seekp(0,ios::end);gotoxy(57,21);cout

  • 8/9/2019 Travel Code

    74/181

    gotoxy(57,27);gets(pur.data);char ch=strlen(pur.data);if (ch== 0 ch>=15){valid=0;gotoxy(18,38);

    coutpur.cost;

    int ch=pur.cost;if (ch== 0){valid=0;gotoxy(18,38);coutpur.emp_jcode;int ch=pur.emp_jcode;if (ch== 0){valid=0;gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    75/181

    cprintf("THE TRAVEL AND TRANSPORT AGENCY");gotoxy(29,4);cprintf("Purchase Oredr");textcolor(WHITE);gotoxy(2,6);cout

  • 8/9/2019 Travel Code

    76/181

    while(fin.read((char*)&pur,sizeof(pur))!=0){if(pur.order!=vac)co++;

    else{clrscr();

    int s=1;screen2();screen4();gotoxy(30,6);textcolor(RED);cprintf("\nQUERY RESULT FORM\n");gotoxy(38,8);cprintf("\nOF");gotoxy(29,10);cprintf("\nPURCHASE DETAILS");textcolor(WHITE);gotoxy(27,16);

    cout

  • 8/9/2019 Travel Code

    77/181

    /*--------------------End of purchase class-----------------*/

    /*-----------------------starting of lease class--------------------*/class lease//declaratin of class{

    protected:int valid;

    char ch;int ch1;fstream fin ,fin1;//declaration of fstream variable/*starting of struct declaration for dat with their data types*/struct lease1{long int lea_num; char name[10];char data[15];char n_owner[15];char add[15];char mode[10];float pay;

    char num[12];}lea;//end of struct declarationpublic:

    lease()//constuctor declaration{fin.open("lease6.dat",ios::inios::outios::binaryios::ate);if (!fin){gotoxy(22,22);cout

  • 8/9/2019 Travel Code

    78/181

    char m3;screen3();gotoxy(18,15);textcolor(CYAN);cprintf("Lease Division of Marketing Department");gotoxy(27,17);cprintf("Lease Division Submenu");

    screen1();textcolor(GREEN);gotoxy(25,21);cprintf("[1] Lease Details Entry");//for entry of detailsgotoxy(25,24);cprintf("[2] Lease Details");//for displaying/report generationgotoxy(25,27);cprintf("[3] Lease Deatails Modificatin");//for modify of detailsgotoxy(25,30);cprintf("[4] Lease details Deletion");//for deletion of detailsgotoxy(25,33);cprintf("[5] Query For Lease Details");//query for details

    gotoxy(25,36);cprintf("[6] Return To Purchase Division Menu");textcolor(YELLOW+BLINK);gotoxy(25,38);cprintf("Enter Your Choice:");textcolor(WHITE);m3=getch();switch(m3){case '1'://calling of lease_entry function

    clrscr();lease_entry();rep3:

    gotoxy(21,42);textcolor(RED+BLINK);cprintf("HOT KEY: TO MORE ENTRY (PRESS KEY:1)");gotoxy(21,44);cprintf("HOT KEY:TO EXIT (PRESS KEY:2)");textcolor(WHITE);char m5;cin>>m5;switch(m5){case '1'://for more entry

    lease_entry();goto rep3;

    case '2':goto market2;

    default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto rep3;

    }case '2'://calling of lease_details function

    clrscr();

    lease lo;lo.lease_details();fin.clear();

  • 8/9/2019 Travel Code

    79/181

    getch();goto market2;

    case'3'://calling of lease_modify functionclrscr();lease lo1;lo1.lease_modify();fin.clear();

    getch();goto market2;

    case'4'://calling of lease_del functionclrscr();lease lo2;lo2.lease_del();fin.clear();getch();goto market2;

    case'5'://calling of lease_query functionclrscr();lease lo3;

    lo3.lease_query();fin.clear();getch();goto market2;

    case '6':break;

    default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto market2;

    }}

    //end of function definetion

    /*starting of lease_save function definetion*/

    void lease::lease_save(){textcolor(RED+BLINK);gotoxy(25,42);cprintf("Are You Sure To Save It(y/n):");ch=getche();textcolor(WHITE);if (ch == 'y'){fin.seekp(0,ios::end);fin.write((char*)&lea,sizeof(lea));gotoxy(23,38);cout

  • 8/9/2019 Travel Code

    80/181

    void lease::exit8(){fin.close();}/*starting of lease_entry function definition*/void lease::lease_entry(){

    clrscr();screen2();gotoxy(34,6);textcolor(RED);cprintf("\nENTRY FORM");gotoxy(38,8);cprintf("\nOF");gotoxy(33,10);cprintf("\nLEASE DETAILS");screen1();textcolor(CYAN);gotoxy(18,21);

    cprintf("Enter Lease Number :");gotoxy(18,23);cprintf("Enter The Category of Vehicle :");gotoxy(18,25);cprintf("Enter The Date :");gotoxy(18,27);cprintf("Enter The Name of Owner :");gotoxy(18,29);cprintf("Enter The Address :");gotoxy(18,31);cprintf("Enter The Payment Mode :");gotoxy(18,33);cprintf("Enter The Amount of Payment :");

    gotoxy(18,35);cprintf("Enter The Number :");textcolor(WHITE);fin.seekp(0,ios::end);gotoxy(52,21);cout

  • 8/9/2019 Travel Code

    81/181

    gets(lea.data);ch=strlen(lea.data);if (ch== 0 ch>=15){valid=0;gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    82/181

    gotoxy(52,31);clear(52,31);}

    }while(!valid);do{valid=1;

    gotoxy(52,33);cin>>lea.pay;ch1=lea.pay;if (ch1== 0 ){valid=0;gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    83/181

    cout

  • 8/9/2019 Travel Code

    84/181

    textcolor(WHITE);screen4();gotoxy(20,21);cprintf("Enter The Lease Number To be Modified:");//modify by lease numbercin>>sno;clear(20,21);clear1();

    int pos=0,count=0;fin.seekg(0,ios::beg);while(fin.read((char*)&lea,sizeof(lea))){if(lea.lea_num!=sno)count++;

    else{scoot();textcolor(GREEN);gotoxy(10,21);cprintf("Old Value");

    gotoxy(10,22);cout

  • 8/9/2019 Travel Code

    85/181

    textcolor(WHITE);textcolor(CYAN);gotoxy(40,23);cprintf("Lease Number :");textcolor(WHITE);/*checking of duplicate entry*/do

    {valid=1;gotoxy(57,23);cin>>lea.lea_num;int ck=lea.lea_num;if(ck!=sno){valid=0;gotoxy(40,38);textcolor(CYAN);cout

  • 8/9/2019 Travel Code

    86/181

    valid=0;gotoxy(40,38);cout

  • 8/9/2019 Travel Code

    87/181

    ch=strlen(lea.mode);if (ch== 0 ch>=10){valid=0;gotoxy(40,38);coutlea.pay;ch1=lea.pay;if (ch1== 0 ){valid=0;gotoxy(40,38);cout

  • 8/9/2019 Travel Code

    88/181

    textcolor(WHITE);if (ch == 'y'){fin.seekp(pos,ios::beg);fin.write((char*)&lea,sizeof(lea));gotoxy(45,38);cout

  • 8/9/2019 Travel Code

    89/181

    gotoxy(25,29);cout

  • 8/9/2019 Travel Code

    90/181

    gotoxy(20,32);cprintf("Payment Mode :");gotoxy(20,34);cprintf("Amount of payment :");gotoxy(20,36);cprintf("Number of Vehicle :");textcolor(WHITE);

    fin.seekg(0,ios::beg);/*displaying of particular query*/gotoxy(45,22);cout

  • 8/9/2019 Travel Code

    91/181

    {fin.open("expense7.dat",ios::inios::outios::binaryios::ate);ho.snum=1;//initialization of serial number

    }~expense()//destructor declaration{fin.close();//closing of file

    delete ho.date,ho.matter;//deletion of structure data explicitly}/*starting of function declaration*/void expense_entry();void expense_details();void expense_menu();void expense_query();void expense_save();/*end of function declaration*/

    };//end of class declaration/*starting of menu function body*/void expense::expense_menu()

    {market6:clrscr();char muk4;screen3();gotoxy(18,15);textcolor(CYAN);cprintf("Workshops Division of Marketing Department");gotoxy(27,17);cprintf("Expenses Details Submenu");screen4();textcolor(GREEN);gotoxy(25,21);

    cprintf("[1] Expenses Entry");//for details entrygotoxy(25,24);cprintf("[2] Expenses Details");//for details and report generationgotoxy(25,27);cprintf("[3] Query for Expenses details");//for querygotoxy(25,30);cprintf("[4] Return To Workshops Division Menu");textcolor(YELLOW+BLINK);gotoxy(25,32);cprintf("Enter Your Choice:");textcolor(WHITE);muk4=getch();switch(muk4){case '1'://calling of expense_entry function

    clrscr();expense_entry();rep5:gotoxy(21,42);textcolor(RED+BLINK);cprintf("HOT KEY: TO MORE ENTRY (PRESS KEY:1)");gotoxy(21,44);cprintf("HOT KEY:TO EXIT (PRESS KEY:2)");textcolor(WHITE);char muk5;

    muk5=getch();switch(muk5){

  • 8/9/2019 Travel Code

    92/181

    case '1'://for more entryexpense_entry();goto rep5;

    case '2':goto market6;

    default:gotoxy(21,46);

    textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto rep5;

    }case '2'://calling of expense_details function

    expense ex;clrscr();ex.expense_details();fin.clear();getch();

    goto market6;case '3'://calling of expense_query functionexpense ex1;ex1.expense_query();fin.clear();getch();goto market6;

    case '4':break;

    default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");

    textcolor(WHITE);getch();goto market6;

    }}

    //end of function body

    /*starting of expense_save function body*/

    void expense::expense_save(){char in;textcolor(RED+BLINK);gotoxy(23,32);cprintf("Are You Sure To Save It(y/n):");in=getche();textcolor(WHITE);if (in == 'y'){fin.seekp(0,ios::end);fin.write((char*)&ho,sizeof(ho));gotoxy(23,32);cout

  • 8/9/2019 Travel Code

    93/181

    elsegotoxy(56,42);return;

    }//end of function body/*starting of expense_enry function*/void expense::expense_entry(){

    int valid;clrscr();screen2();gotoxy(34,6);textcolor(RED);cprintf("\nENTRY FORM");gotoxy(38,8);cprintf("\nOF");gotoxy(31,10);cprintf("\nEXPENSES DETAILS");screen4();textcolor(BLUE);

    gotoxy(21,21);cprintf("Serial Number :");gotoxy(21,24);cprintf("Enter The Date of Entry :");gotoxy(21,27);cprintf("Enter The Matter :");gotoxy(21,30);cprintf("Enter The Expenses Amount :");textcolor(WHITE);fin.seekp(0,ios::end);gotoxy(48,21);cout

  • 8/9/2019 Travel Code

    94/181

    clear(18,38);gotoxy(48,27);clear(48,27);}

    }while(!valid);do{

    valid=1;gotoxy(48,30);cin>>ho.amount;int ch=ho.amount;if (ch== 0 ){valid=0;gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    95/181

    {gotoxy(14,m);cout

  • 8/9/2019 Travel Code

    96/181

    gotoxy(20,27);cprintf("Matter :");gotoxy(20,30);cprintf("Expenses Amount :");textcolor(WHITE);fin.seekg(0,ios::beg);gotoxy(44,21);

    cout

  • 8/9/2019 Travel Code

    97/181

    gotoxy(24,21);cprintf(" 1. EMPLOYEE DIVISION");//calling of Employee Divisiongotoxy(24,24);cprintf(" 2. EMPLOYEE SALARY DIVISION");//calling of Salary Divisiongotoxy(24,27);cprintf(" 3. TIME TABLE DETAILS");//calling of Time-Table Division for employe

    e department

    gotoxy(24,30);cprintf(" 4. REPORT");//calling of report generation menugotoxy(24,33);cprintf(" 5. HELP");//calling of help generation menugotoxy(24,36);cprintf(" 6. RETURN TO MAIN");//return to main menutextcolor(YELLOW+BLINK);gotoxy(25,38);cprintf("Enter Your Choice:");textcolor(WHITE);gotoxy(43,38);e=getch();

    switch(e){case '1'://calling of employee menu function from employee class

    clrscr();employee est;est.employee_menu();goto abc2;

    case '2'://calling of salary menu function from salary classclrscr();salary sook;sook.salary_menu();goto abc2;

    case '3'://calling of tlook menu function from tlook class

    clrscr();tlook cup;cup.tlook_menu();goto abc2;

    case '4'://calling for report generationemplo3:clrscr();char took;screen2();textcolor(RED);cprintf("\nREPORT MENU");gotoxy(39,8);cprintf("\nFOR");gotoxy(30,10);cprintf("\nEMPLOYEE DEPARTMENT");textcolor(WHITE);screen4();gotoxy(23,21);textcolor(11);cprintf("1.Employee Report");//generation fo employee reportgotoxy(23,24);cprintf("2.Salary Report");//calling of salary reportgotoxy(23,27);cprintf("3.Time_Table Report");//generation of time_table reportgotoxy(23,30);

    cprintf("4.Return To Administrative Menu");textcolor(WHITE);textcolor(YELLOW+BLINK);

  • 8/9/2019 Travel Code

    98/181

    gotoxy(25,33);cprintf("Enter Your Choice");textcolor(WHITE);took=getch();switch(took){case '1'://calling of employee details from employee class

    clrscr();employee ewq;ewq.employee_details();getch();goto emplo3;

    case '2'://calling of salary show function from salary classclrscr();salary sak;sak.salary_show();getch();goto emplo3;

    case '3'://calling of tlook details function from tlook clas

    s clrscr();tlook_details();getch();goto emplo3;

    case '4':goto abc2;

    default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();

    goto emplo3;}

    case '5'://calling of help generation menuclrscr();screen2();textcolor(RED);gotoxy(35,6);cprintf("\nHELP MENU");gotoxy(39,8);cprintf("\nFOR");gotoxy(30,10);cprintf("\nEMPLOYEE DEPARTMENT");textcolor(WHITE);help();textcolor(RED);gotoxy(15,16);cprintf("IF CHOICE:1# ");textcolor(GREEN);gotoxy(21,18);cprintf("The User can work with the Employee Divisin.");gotoxy(16,20);textcolor(5);cprintf("IF SUB CHOICE:#");gotoxy(21,21);textcolor(GREEN);

    cprintf("The User can make Entry,Modify,Delete and take");gotoxy(21,22);cprintf("Details of Employee Details.");

  • 8/9/2019 Travel Code

    99/181

    textcolor(RED);gotoxy(15,24);cprintf("IF CHOICE:2# ");textcolor(GREEN);gotoxy(21,26);cprintf("The User can Work with the Salary Divisin.");gotoxy(16,28);

    textcolor(5);cprintf("IF SUB CHOICE:#");gotoxy(21,29);textcolor(GREEN);cprintf("The User can make Entry,Modify,Delete and take");gotoxy(21,30);cprintf("Details of Salary Details and");gotoxy(21,31);cprintf("Expenses Details.");textcolor(RED);gotoxy(15,33);cprintf("IF CHOICE:3# ");

    textcolor(GREEN);gotoxy(21,35);cprintf("User can Generate Report For all above choices.");gotoxy(18,39);textcolor(5);cprintf("Press Any Key To Continue........");textcolor(WHITE);getch();goto abc2;

    case '6':break;

    default:gotoxy(21,46);

    textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto abc2;

    }}//end of function body/*--------------------------End of Employ class-----------------------------*/

    /*-----------------------Starting of tlook class---------------------------*/class tlook//declaration of class{private:

    int valid;char ch;int ch1;fstream fin,fin1;//variable declaration of fstream variable/*declaration of structure data with their data types*/struct tlook2{int jcode;char attend[7];char leave[7];int day;int year;

    }tom;//end of structure declarationpublic:

    tlook()//constructor declaration

  • 8/9/2019 Travel Code

    100/181

    {fin.open("tlook.dat",ios::inios::outios::binaryios::ate);if(!fin){gotoxy(22,22);cout

  • 8/9/2019 Travel Code

    101/181

    case '1'://calling of tlook_entry functionclrscr();tlook_entry();ti:gotoxy(21,42);textcolor(RED+BLINK);cprintf("HOT KEY: TO MORE ENTRY (PRESS KEY:1)");

    gotoxy(21,44);cprintf("HOT KEY:TO EXIT (PRESS KEY:2)");textcolor(WHITE);char ti1;cin>>ti1;switch(ti1){case '1'://for more entry

    tlook_entry();goto ti;

    case '2':goto emplo2;

    default: gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto ti;

    }case '2'://calling of tlook_details functon

    clrscr();tlook tu;tu.tlook_details();fin.clear();

    getch();goto emplo2;

    case'3'://calling of tlook_modify functionclrscr();tlook tu1;tu1.tlook_modify();fin.clear();getch();goto emplo2;

    case'4'://calling of tlook_del functionclrscr();tlook tu2;tu2.tlook_del();fin.clear();getch();goto emplo2;

    case'5'://calling of tlook_query functionclrscr();tlook tu3;tu3.tlook_query();fin.clear();getch();goto emplo2;

    case'6':break;

    default:gotoxy(21,46);textcolor(BLUE+BLINK);

  • 8/9/2019 Travel Code

    102/181

    cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto emplo2;

    }}//end of menu function definition/*starting of tlook_save function definition*/

    void tlook::tlook_save(){textcolor(RED+BLINK);gotoxy(25,42);cprintf("Are You Sure To Save It(y/n):");ch=getche();textcolor(WHITE);if (ch == 'y'){fin.seekp(0,ios::end);fin.write((char*)&tom,sizeof(tom));gotoxy(23,38);

    cout

  • 8/9/2019 Travel Code

    103/181

    valid=1;gotoxy(53,23);cin>>tom.jcode;ch1=tom.jcode;if (ch1 == 0){valid=0;

    gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    104/181

    getch();clear(18,38);gotoxy(53,32);clear(53,32);}

    }while(!valid);do

    {valid=1;gotoxy(53,35);cin>>tom.year;ch1=tom.year;if (ch1 == 0){valid=0;gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    105/181

    textcolor(WHITE);fin.seekg(0,ios::beg);while(fin.read((char*)&tom,sizeof(tom))!=0){gotoxy(12,m);cout

  • 8/9/2019 Travel Code

    106/181

    textcolor(WHITE);textcolor(CYAN);gotoxy(5,29);cprintf("Leave Time :");cout

  • 8/9/2019 Travel Code

    107/181

    }}while(!valid);gotoxy(40,29);textcolor(CYAN);cprintf("The Leave Time :");textcolor(WHITE);

    do

    {valid=1;gotoxy(56,29);gets(tom.leave);ch=strlen(tom.leave);if (ch== 0 ch>=7){valid=0;gotoxy(40,38);couttom.day;

    ch1=tom.day;if (ch1 == 0){valid=0;gotoxy(40,38);couttom.year;ch1=tom.year;if (ch1 == 0){valid=0;

    gotoxy(40,38);cout

  • 8/9/2019 Travel Code

    108/181

    clear3(40,38);gotoxy(56,35);clear3(56,35);}

    }while(!valid);pos=count*sizeof(tom);textcolor(RED+BLINK);

    gotoxy(25,42);cprintf("Are You Sure To Save It(y/n):");ch=getche();textcolor(WHITE);if (ch == 'y'){fin.seekp(pos,ios::beg);fin.write((char*)&tom,sizeof(tom));gotoxy(42,38);cout

  • 8/9/2019 Travel Code

    109/181

    cout

  • 8/9/2019 Travel Code

    110/181

    gotoxy(20,21);textcolor(CYAN);cprintf("Job Code :");gotoxy(20,24);cprintf("Attend Time :");gotoxy(20,27);cprintf("Leave Time :");

    gotoxy(20,30);cprintf("Working Days :");gotoxy(20,33);cprintf("Working Years :");textcolor(WHITE);fin.seekg(0,ios::beg);gotoxy(40,21);cout

  • 8/9/2019 Travel Code

    111/181

    -----------*/void road::march(){abc3:char ro;clrscr();screen();

    gotoxy(30,16);cout

  • 8/9/2019 Travel Code

    112/181

    cprintf("\nROADWAYS DEPARTMENT");textcolor(WHITE);screen1();gotoxy(23,22);textcolor(5);cprintf("1.Vechile Report");gotoxy(23,25);

    cprintf("2.Time-Table Report");gotoxy(23,28);cprintf("3.Counter Report");gotoxy(23,31);cprintf("4.Passenger Report");gotoxy(23,34);cprintf("5.Income Report");gotoxy(23,37);cprintf("6.Return To Roadways Department Menu");textcolor(WHITE);textcolor(YELLOW+BLINK);gotoxy(25,39);

    cprintf("Enter Your Choice:");textcolor(WHITE);cool=getch();switch(cool){case '1'://calling from vehicle class

    clrscr();vehicle hick;hick.display();getch();goto repo;

    case '2'://calling from table classclrscr();

    table::table_display();getch();goto repo;

    case '3'://calling from counter classclrscr();counter com;com.counter_display();getch();goto repo;

    case '4'://calling from passenger classmunsi mon;mon.passenger_display();getch();goto repo;

    case '5'://calling from munsi classmunsi ipc;ipc.income_display();getch();goto repo;

    case '6':goto abc3;

    default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");

    textcolor(WHITE);getch();goto repo;

  • 8/9/2019 Travel Code

    113/181

    }case '6'://callling for help generation menu

    clrscr();screen2();textcolor(RED);gotoxy(35,6);cprintf("\nHELP MENU");

    gotoxy(39,8);cprintf("\nFOR");gotoxy(30,10);cprintf("\nROADWAYS DEPARTMENT");textcolor(WHITE);help();textcolor(RED);gotoxy(15,15);cprintf("IF CHOICE:1# ");textcolor(11);gotoxy(21,16);cprintf("The User can work with the Bus&Truck Divisin.");

    gotoxy(16,17);textcolor(5);cprintf("IF SUB CHOICE:#");gotoxy(21,18);textcolor(11);cprintf("The User can make Entry,Modify,Delete and take");gotoxy(21,19);cprintf("Details of Vechicles Details.");textcolor(RED);gotoxy(15,21);cprintf("IF CHOICE:2# ");textcolor(11);gotoxy(21,22);

    cprintf("The User can Work with the Time-Table Divisin.");gotoxy(16,23);textcolor(5);cprintf("IF SUB CHOICE:#");gotoxy(21,24);textcolor(11);cprintf("The User can make Entry,Modify,Delete and take");gotoxy(21,25);cprintf("Details of Time-Table Details for Roadways.");gotoxy(15,27);textcolor(RED);cprintf("IF CHOICE:3# ");gotoxy(21,28);textcolor(11);cprintf("The User can Work with The Counter Division.");gotoxy(16,29);textcolor(5);cprintf("IF SUB CHOICE:#");gotoxy(21,30);textcolor(11);cprintf("The User can make Entry,Modify,Delete and take");gotoxy(21,31);cprintf("Details of Details for Truck Counter.");gotoxy(15,33);textcolor(RED);

    cprintf("IF CHOICE:4# ");gotoxy(21,34);textcolor(11);

  • 8/9/2019 Travel Code

    114/181

    cprintf("The User can Work with The Munsi Control Section.");gotoxy(16,35);textcolor(5);cprintf("IF SUB CHOICE:#");gotoxy(21,36);textcolor(11);cprintf("The User can make Entry,Modify,Delete and take");

    gotoxy(21,37);cprintf("Details of Passenger & Time-Table.");gotoxy(15,39);textcolor(RED);cprintf("IF CHOICE:5# ");gotoxy(21,40);textcolor(11);cprintf("User can Generate Report For all above choices.");gotoxy(18,41);textcolor(5);cprintf("Press Any Key To Continue........");textcolor(WHITE);

    getch();goto abc3;case '7':

    break;default:

    gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto abc3;

    }}

    /*------------------End of road class definition-----------------------*/

    /*-------------------Starting of counter class----------------------*/class counter//class declaration{protected:

    /*declaration of variable for error checking*/char ch;int valid;int ch1;/*end of variable declaration*//*definition of structure for data*/struct counter1{int snum;char number[12];char source[17];char desti[17];char date[15];float amount;int jcode;}hero;//structure variable with end of dclarationfstream fin,fin1;//declaration of fstream variable

    public:

    //vehicle vol;counter()//constructor declaration{

  • 8/9/2019 Travel Code

    115/181

    fin.open("counter.dat",ios::inios::outios::binaryios::ate);if(!fin){gotoxy(22,22);cout

  • 8/9/2019 Travel Code

    116/181

    {case '1'://callingf of counter_entry function

    clrscr();counter_entry();co:gotoxy(21,42);textcolor(RED+BLINK);

    cprintf("HOT KEY: TO MORE ENTRY (PRESS KEY:1)");gotoxy(21,44);cprintf("HOT KEY:TO EXIT (PRESS KEY:2)");textcolor(WHITE);char co1;cin>>co1;switch(co1){case '1'://for more entry

    counter_entry();flush(fin);goto co;

    case '2': goto coun;default:

    gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto co;

    }case '2'://calling of counter_display function

    counter com;com.counter_display();

    fin.clear();getch();goto coun;

    case '3'://calling of counter_modify functioncounter com1;com1.counter_modify();fin.clear();getch();goto coun;

    case '4'://calling of counter_del funtioncounter com2;com2.counter_del();fin.clear();getch();goto coun;

    case '5'://calling of counter_query functioncounter com3;com3.counter_query();fin.clear();getch();goto coun;

    case '6':break;

    default:gotoxy(21,46);

    textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);

  • 8/9/2019 Travel Code

    117/181

    getch();goto coun;

    }}//end of menu function

    /*starting of counter_save function defination*/void counter::counter_save(){

    textcolor(RED+BLINK);gotoxy(25,42);cprintf("Are You Sure To Save It(y/n):");ch=getche();textcolor(WHITE);if (ch == 'y'){fin.seekp(0,ios::end);fin.write((char*)&hero,sizeof(hero));gotoxy(23,37);cprintf("Counter Details Entered.....");hero.snum++;//encrementation of serial number

    clear(25,42);gotoxy(52,37);}else

    gotoxy(56,42);return;

    }//end of counter_save functionvoid counter::exit9()//function for error handling{fin.close();fin.clear();}/*starting of counter_entry function defination*/

    void counter::counter_entry(){clrscr();screen2();gotoxy(34,6);textcolor(RED);cprintf("\nENTRY FORM");gotoxy(38,8);cprintf("\nOF");gotoxy(33,10);cprintf("\nCOUNTER DETAILS");textcolor(WHITE);screen1();textcolor(CYAN);gotoxy(18,22);cprintf("Serial Number :");gotoxy(18,24);cprintf("Enter The Truck Number :");gotoxy(18,26);cprintf("Enter The Source From Go :");gotoxy(18,28);cprintf("Enter The Date To Go :");gotoxy(18,30);cprintf("Enter The Destination :");gotoxy(18,32);

    cprintf("Enter The Charge :");gotoxy(18,34);cprintf("Enter The Head_Jcode :");

  • 8/9/2019 Travel Code

    118/181

    textcolor(WHITE);fin.seekp(0,ios::end);gotoxy(49,22);cout=17){valid=0;gotoxy(18,38);cprintf("You Can Not Skip(or Make More) This Entry");

    getch();clear(18,38);gotoxy(49,26);clear(49,26);}

    }while(!valid);do{valid=1;gotoxy(49,28);gets(hero.date);ch=strlen(hero.date);if (ch== 0 ch>=15){valid=0;gotoxy(18,38);cprintf("You Can Not Skip(or Make More) This Entry");getch();clear(18,38);gotoxy(49,28);clear(48,28);}

    }while(!valid);do{

    valid=1;gotoxy(49,30);gets(hero.desti);

  • 8/9/2019 Travel Code

    119/181

    ch=strlen(hero.desti);if (ch== 0 ch>=17){valid=0;gotoxy(18,38);cprintf("You Can Not Skip(or Make More) This Entry");getch();

    clear(18,38);gotoxy(49,30);clear(49,30);}

    }while(!valid);do{valid=1;gotoxy(49,32);cin>>hero.amount;float ch=hero.amount;if (ch== 0 )

    {valid=0;gotoxy(18,38);cprintf("You Can Not Skip This Entry");getch();clear(18,38);gotoxy(49,32);clear(49,32);}

    }while(!valid);do{valid=1;

    gotoxy(49,34);cin>>hero.jcode;ch1= hero.jcode;if (ch1== 0){valid=0;gotoxy(18,38);cprintf("You Can Not Skip This Entry");getch();clear(18,38);gotoxy(49,34);clear(49,34);}

    }while(!valid);counter_save();fin.clear();getch();}//end of function defination/*starting of counter_display function*/void counter::counter_display(){clrscr();textcolor(RED);int m=9;gotoxy(22,2);

    cprintf("THE TRAVEL AND TRANSPORT AGENCY");cout

  • 8/9/2019 Travel Code

    120/181

    cprintf("Counter Details");textcolor(WHITE);gotoxy(2,6);cprintf("---------------------------------------------------------------------

    ----------\n\n");gotoxy(2,7);textcolor(BLUE);

    cprintf("Sno");gotoxy(7,7);cprintf("Truck_No.");gotoxy(20,7);cprintf("Source");gotoxy(35,7);cprintf("Desination");gotoxy(50,7);cprintf("Date");gotoxy(63,7);cprintf("Charge");gotoxy(73,7);

    cprintf("H_Jcode");textcolor(WHITE);gotoxy(2,8);cprintf("---------------------------------------------------------------------

    ----------\n\n");textcolor(WHITE);fin.seekg(0,ios::beg);while(fin.read((char*)&hero,sizeof(hero))!=0){gotoxy(2,m);cout

  • 8/9/2019 Travel Code

    121/181

    screen4();gotoxy(20,21);textcolor(CYAN);cprintf("Enter Serial No. of Details To be Modified:");//modifying through ser

    ial numbertextcolor(WHITE);cin>>number1;

    clear(20,21);clear1();int pos=0,count=0;fin.seekg(0,ios::beg);while(fin.read((char*)&hero,sizeof(hero))){if(hero.snum!=number1)count++;

    else{int ck;/*displaying of old value for reference*/

    scoot();textcolor(GREEN);gotoxy(12,21);cprintf("Old Value");gotoxy(12,22);cout

  • 8/9/2019 Travel Code

    122/181

    couthero.snum;ck=hero.snum;if(ck!=number1){valid=0;gotoxy(40,38);cprintf("Not Make Duplicate entry");getch();clear3(40,38);

    gotoxy(56,23);clear3(56,23);}

    }while(!valid);gotoxy(40,25);textcolor(CYAN);cprintf("Truck Number :");textcolor(WHITE);do{valid=1;gotoxy(56,25);gets(hero.number);

    ch=strlen(hero.number);if (ch== 0 ch>=12){valid=0;gotoxy(40,38);cprintf("Not Skip(or Make More)Entry");getch();clear3(40,38);gotoxy(56,25);clear3(56,25);

    }}while(!valid);gotoxy(40,27);textcolor(CYAN);cprintf("Source To Go :");textcolor(WHITE);do{valid=1;gotoxy(56,27);gets(hero.source);ch=strlen(hero.source);if (ch== 0 ch>=17)

    {valid=0;

    gotoxy(40,38);cprintf("Not Skip(or Make More)Entry");getch();

  • 8/9/2019 Travel Code

    123/181

    clear3(40,38);gotoxy(56,27);clear3(56,27);

    }}while(!valid);

    gotoxy(40,29);textcolor(CYAN);

    cprintf("The Destination:");textcolor(WHITE);do{valid=1;gotoxy(56,29);gets(hero.desti);ch=strlen(hero.desti);if (ch== 0 ch>=17){valid=0;gotoxy(40,38);

    cprintf("Not Skip(or Make More)Entry");getch();clear3(40,38);gotoxy(56,29);clear3(56,29);}

    }while(!valid);gotoxy(40,31);textcolor(CYAN);cprintf("The Date To Go :");textcolor(WHITE);do{

    valid=1;gotoxy(56,31);gets(hero.date);ch=strlen(hero.date);if (ch== 0 ch>=15){valid=0;gotoxy(40,38);cprintf("Not Skip(or Make More)Entry");getch();clear3(40,38);gotoxy(56,31);clear3(56,31);

    }}while(!valid);

    gotoxy(40,33);textcolor(CYAN);cprintf("Enter Charge :");textcolor(WHITE);do{valid=1;gotoxy(56,33);cin>>hero.amount;float ch=hero.amount;

    if (ch== 0 ){valid=0;

  • 8/9/2019 Travel Code

    124/181

    gotoxy(40,38);cprintf("Not Skip This Entry");getch();clear3(56,38);gotoxy(56,33);clear3(56,33);

    }

    }while(!valid);gotoxy(40,35);textcolor(CYAN);cprintf("The Head Jcode :");textcolor(WHITE);do{valid=1;gotoxy(56,35);cin>>hero.jcode;ch1= hero.jcode;if (ch1== 0)

    { valid=0;gotoxy(40,38);cprintf("Not Skip This Entry");getch();clear3(40,38);gotoxy(56,35);clear3(56,35);

    }}while(!valid);

    pos=count*sizeof(hero);textcolor(RED+BLINK);gotoxy(25,42);

    cprintf("Are You Sure To Save It(y/n):");ch=getche();textcolor(WHITE);if (ch == 'y'){fin.seekp(pos,ios::beg);fin.write((char*)&hero,sizeof(hero));gotoxy(45,38);cout

  • 8/9/2019 Travel Code

    125/181

    textcolor(RED);cprintf("\nDELETION FORM\n");gotoxy(39,8);cprintf("\nOF");gotoxy(34,10);cprintf("\nCOUNTER DETAILS");textcolor(WHITE);

    screen4();int code1;fin1.open("coo.dat",ios::out);gotoxy(23,24);cprintf("Enter The Serial No.To be Deleted:");cin>>code1;fin.seekg(0,ios::beg);int found1=0;while(fin.read((char*)&hero,sizeof(hero))){if(hero.snum!=code1)fin1.write((char*)&hero,sizeof(hero));

    elsefound1=1;}if(found1==0)

    {gotoxy(25,31);cprintf("Record is Not Found! Try Again...");fin.clear();

    }else if(found1==1){fin.close();fin1.close();

    remove("counter4.dat");rename("coo.dat","counter4.dat");fin.open("counter4.dat",ios::inios::outios::binary);gotoxy(25,29);cprintf("Record Has been Successfully Deleted...");textcolor(RED+BLINK);gotoxy(32,38);cprintf("Press Any To Exit:");textcolor(WHITE);}

    fin.clear();fin1.clear();

    }//end of functio defination/*starting of counter_query function defination*/void counter::counter_query(){clrscr();int vac;screen2();gotoxy(32,6);textcolor(RED);cprintf("\nQUERY FORM\n");gotoxy(36,8);cprintf("\nOF");gotoxy(27,10);

    cprintf("\nTRUCK COUNTER DETAILS");textcolor(WHITE);screen4();

  • 8/9/2019 Travel Code

    126/181

    gotoxy(20,22);cprintf("Enter Serial Number To Make Query:");cin>>vac;clear1();int co=0;fin.seekg(0,ios::beg);while(fin.read((char*)&hero,sizeof(hero))!=0)

    {if(hero.snum!=vac)co++;

    else{clrscr();int s=1;screen2();screen1();gotoxy(30,6);textcolor(RED);cprintf("\nQUERY RESULT FORM\n");

    gotoxy(38,8);cprintf("\nOF");gotoxy(28,10);cprintf("\nTRUCK COUNTER DETAILS");textcolor(WHITE);gotoxy(27,16);textcolor(CYAN);cout

  • 8/9/2019 Travel Code

    127/181

    return;}

    textcolor(WHITE);flush(fin);

    }}if(co==0)

    gotoxy(10,30);gotoxy(24,42);cprintf("Record Not Found! Try Again..... ");fin.clear();return;

    }//end of function defination/*----------------------End of Counter Class-------------------------*/

    /*-------------------Starting of vehicle class-------------------*/class vehicle//class declaration

    {protected:/*structure declaration for data with their data types*/struct vehicle1{char number[12];int sn;char status[10];char pdate[15];char wstatus[5];char category[7];}vol;//end of structure declaration with structue variablefstream fin,fin1;//fstream variable

    public:vehicle()//constructor declaration{fin.open("vehicle.dat",ios::inios::outios::binaryios::ate);if(!fin){gotoxy(22,22);cout

  • 8/9/2019 Travel Code

    128/181

    /*end of function declaration*/};//end of class declaration

    /*starting of menu function defination*/void vehicle::vehicle_menu(){vecho:clrscr();

    char ve;screen3();gotoxy(30,15);textcolor(CYAN);cprintf("ROADWAYS DEPARTMENT");gotoxy(31,17);cprintf("Vehicle Division");screen1();textcolor(GREEN);gotoxy(25,21);cprintf("[1] Vehicle Entry");//for vehicle details entrygotoxy(25,24);

    cprintf("[2] Vehicle Details");//for detailsgotoxy(25,27);cprintf("[3] Vehicle Modifiction");//for modification of detailsgotoxy(25,30);cprintf("[4] Vehicle Deletion");//for deletion of recordsgotoxy(25,33);cprintf("[5] Query for Vehicle details");//for querygotoxy(25,36);cprintf("[6] Return To RoadWays Department Menu");textcolor(YELLOW+BLINK);gotoxy(25,38);cprintf("Enter Your Choice:");textcolor(WHITE);

    ve=getch();switch(ve){case '1'://calling of entry function

    clrscr();entry();vcl:gotoxy(21,42);textcolor(RED+BLINK);cprintf("HOT KEY: TO MORE ENTRY (PRESS KEY:1)");gotoxy(21,44);cprintf("HOT KEY:TO EXIT (PRESS KEY:2)");textcolor(WHITE);char ve1;cin>>ve1;switch(ve1){case '1'://for more entry

    entry();goto vcl;

    case '2':goto vecho;

    default:gotoxy(21,46);textcolor(BLUE+BLINK);

    cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();

  • 8/9/2019 Travel Code

    129/181

  • 8/9/2019 Travel Code

    130/181

    /*starting of entry function declaration*/void vehicle::entry(){int valid;clrscr();screen2();gotoxy(34,6);

    textcolor(RED);cprintf("\nENTRY FORM");gotoxy(38,8);cprintf("\nOF");gotoxy(33,10);cprintf("\nVEHICLE DETAILS");textcolor(WHITE);screen1();textcolor(CYAN);gotoxy(18,21);cprintf("Enter The serial Number :");gotoxy(18,24);

    cprintf("Enter The Vechile's Number :");gotoxy(18,27);cprintf("Enter The Category :");gotoxy(18,30);cprintf("Enter The Status :");gotoxy(18,33);cprintf("Enter The Purchasing date :");gotoxy(18,36);cprintf("Enter The Working Status :");textcolor(WHITE);fin.seekp(0,ios::end);gotoxy(55,21);cout

  • 8/9/2019 Travel Code

    131/181

    getch();clear(18,38);gotoxy(55,27);clear(55,27);}

    }while(!valid);do

    {valid=1;gotoxy(55,30);gets(vol.status);char ch=strlen(vol.status);if (ch== 0 ch>=10){valid=0;gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    132/181

    }//end of function defination/*tarting of display function body*/void vehicle::display(){clrscr();textcolor(RED);int m=9;

    gotoxy(22,2);cprintf("THE TRAVEL AND TRANSPORT AGENCY");gotoxy(29,4);cprintf("Vehicle Details");textcolor(WHITE);gotoxy(2,6);cout

  • 8/9/2019 Travel Code

    133/181

    cprintf("\nMODIFICATION fORM\n");gotoxy(38,8);cprintf("\nOF");gotoxy(32,10);cprintf("\nVEHICLE DETAILS");textcolor(WHITE);screen4();

    gotoxy(20,21);cprintf("Enter Serial No. of Vehicle To be Modified:");cin>>number1;clear(20,21);clear1();int pos=0,count=0;fin.seekg(0,ios::beg);while(fin.read((char*)&vol,sizeof(vol))){if(vol.sn!=number1)count++;

    else

    {int ck;scoot();textcolor(GREEN);gotoxy(10,21);cprintf("Old Value");gotoxy(10,22);cout

  • 8/9/2019 Travel Code

    134/181

    gotoxy(40,23);cprintf("Serial Number :");textcolor(WHITE);do{valid=1;gotoxy(57,23);

    cin>>vol.sn;int ck=vol.sn;if(ck!=number1){valid=0;gotoxy(40,38);cout

  • 8/9/2019 Travel Code

    135/181

    }}while(!valid);gotoxy(40,29);textcolor(CYAN);cprintf("Enter The Status:");textcolor(WHITE);

    do

    {valid=1;gotoxy(57,29);gets(vol.status);char ch=strlen(vol.status);if (ch== 0 ch>=10){valid=0;gotoxy(40,38);cout

  • 8/9/2019 Travel Code

    136/181

    clear(40,38);gotoxy(57,33);clear(57,33);}

    }while(!valid);pos=count*sizeof(vol);textcolor(RED+BLINK);

    gotoxy(25,42);cprintf("Are You Sure To Save It(y/n):");char ch;ch=getche();textcolor(WHITE);if (ch == 'y'){fin.seekp(pos,ios::beg);fin.write((char*)&vol,sizeof(vol));gotoxy(42,38);cout

  • 8/9/2019 Travel Code

    137/181

    cout

  • 8/9/2019 Travel Code

    138/181

    gotoxy(20,22);cout

  • 8/9/2019 Travel Code

    139/181

    char category[8];float income;}muns;//end of struct declaration

    public:munsi()//declaration of contructor{fin2.open("munsi.dat",ios::inios::outios::binaryios::ate);

    if(!fin2)//error/exception handling{gotoxy(22,22);cout

  • 8/9/2019 Travel Code

    140/181

    char mo;screen3();gotoxy(29,15);textcolor(CYAN);cprintf("ROADWAYS DEPARTMENT");gotoxy(30,17);cprintf("Passenger Section");

    screen1();textcolor(GREEN);gotoxy(23,21);cprintf("[1] Entry of Passenger Details");//entry of passenger d

    etailsgotoxy(23,24);cprintf("[2] Passenger Details");//for details/report generationgotoxy(23,27);cprintf("[3] Modification Of Passenger Details");//for modificat

    ion of detailsgotoxy(23,30);cprintf("[4] Deletion Of Details");//for deltion of details

    gotoxy(23,33);cprintf("[5] Query for Passenger details");//for query of details

    gotoxy(23,36);cprintf("[6] Return To Munsi Control Section");textcolor(YELLOW+BLINK);gotoxy(32,38);cprintf("Enter Your choice:");textcolor(WHITE);mo=getch();switch(mo){case'1'://calling of passenger_entry function

    clrscr();passenger_entry();pass:gotoxy(21,42);textcolor(RED+BLINK);cprintf("HOT KEY: TO MORE ENTRY (PRESS KEY:1)");gotoxy(21,44);cprintf("HOT KEY:TO EXIT (PRESS KEY:2)");textcolor(WHITE);char co1;cin>>co1;switch(co1){case '1'://for more entry

    passenger_entry();goto pass;

    case '2':goto munpo1;

    default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!

    ");textcolor(WHITE);getch();

    goto pass;}

    case '2'://calling of passenger_display function

  • 8/9/2019 Travel Code

    141/181

    passenger pa;pa.passenger_display();getch();clrscr();goto munpo1;

    case '3'://calling of passneger_modify functionpassenger pa1;

    pa1.passenger_modify();getch();goto munpo1;

    case '4'://calling of passenger_del functionpassenger pa2;pa2.passenger_del();getch();goto munpo1;

    case '5'://calling of passenger_query functionpassenger pa3;pa3.passenger_query();getch();

    goto munpo1;case '6':goto munpo;

    default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto munpo1;

    }case '2'://calling of income function

    munpon:

    clrscr();char moo;screen3();gotoxy(29,15);textcolor(CYAN);cprintf("ROADWAYS DEPARTMENT");gotoxy(28,17);cprintf("Income Section For Munsi");screen4();textcolor(GREEN);gotoxy(23,22);cprintf("[1] Entry of Income Details");//for munsi income entrygotoxy(23,25);cprintf("[2] Income Details");//for dispalying of detailsgotoxy(23,28);cprintf("[3] Return To Munsi Control Section");textcolor(YELLOW+BLINK);gotoxy(32,31);cprintf("Enter Your choice:");textcolor(WHITE);moo=getch();switch(moo){case'1'://calling of income_entry function

    clrscr();

    income_entry();pok:gotoxy(21,42);

  • 8/9/2019 Travel Code

    142/181

    textcolor(RED+BLINK);cprintf("HOT KEY: TO MORE ENTRY (PRESS KEY:1)");gotoxy(21,44);cprintf("HOT KEY:TO EXIT (PRESS KEY:2)");textcolor(WHITE);char po;cin>>po;

    switch(po){case '1'://for more entry

    income_entry();goto pok;

    case '2':goto munpon;

    default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!

    ");

    textcolor(WHITE);getch();goto pok;

    }case '2'://calling of income_display function

    munsi ip;ip.income_display();getch();goto munpon;

    case '3':goto munpo;

    default:gotoxy(21,46);

    textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto munpon;

    }case '3':

    break;default:

    gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto munpo;

    }}//end of menu function definition

    /*starting of income_save function definition*/void munsi::income_save(){textcolor(RED+BLINK);gotoxy(25,42);cprintf("Are You Sure To Save It(y/n):");ch=getche();textcolor(WHITE);

    if (ch == 'y'){fin2.seekp(0,ios::end);

  • 8/9/2019 Travel Code

    143/181

    fin2.write((char*)&muns,sizeof(muns));gotoxy(23,31);cout

  • 8/9/2019 Travel Code

    144/181

  • 8/9/2019 Travel Code

    145/181

    gotoxy(22,2);textcolor(RED);cprintf("THE TRAVEL AND TRANSPORT AGENCY");gotoxy(25,4);cprintf("Munsi Income Details");textcolor(WHITE);gotoxy(3,6);

    cout

  • 8/9/2019 Travel Code

    146/181

    char source[17];}mun;//end of structure declaration

    public:passenger()//constructor declaration{fin.open("passenger.dat",ios::inios::outios::binaryios::ate);if (!fin)

    {gotoxy(22,22);cout

  • 8/9/2019 Travel Code

    147/181

    clrscr();screen2();gotoxy(34,6);textcolor(RED);cprintf("\nENTRY FORM");gotoxy(38,8);cprintf("\nOF");

    gotoxy(31,10);cprintf("\nPASSENGER DETAILS");textcolor(WHITE);screen1();textcolor(CYAN);gotoxy(18,22);cprintf("Serial Number :");gotoxy(18,24);cprintf("Enter The Date of Travelling :");gotoxy(18,26);cprintf("Enter The Bus Number :");gotoxy(18,28);

    cprintf("Enter The name of Passenger :");gotoxy(18,30);cprintf("Enter The Adderess :");gotoxy(18,32);cprintf("Enter The Source :");gotoxy(18,34);cprintf("Enter The Destination :");textcolor(WHITE);fin.seekp(0,ios::end);gotoxy(49,22);cout

  • 8/9/2019 Travel Code

    148/181

    clear(18,38);gotoxy(49,26);clear(49,26);}

    }while(!valid);do{

    valid=1;gotoxy(49,28);gets(mun.name);ch=strlen(mun.name);if (ch== 0 ch>=15){valid=0;gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    149/181

    gets(mun.desti);ch=strlen(mun.desti);if (ch== 0 ch>=17){valid=0;gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    150/181

    gotoxy(29,m);cout

  • 8/9/2019 Travel Code

    151/181

    gotoxy(5,29);cprintf("Name :");cout

  • 8/9/2019 Travel Code

    152/181

    gotoxy(56,25);clear3(56,25);}

    }while(!valid);gotoxy(40,27);textcolor(CYAN);cprintf("The Bus Number :");

    textcolor(WHITE);do{valid=1;gotoxy(56,27);gets(mun.number);ch=strlen(mun.number);if (ch== 0 ch>=12){valid=0;gotoxy(40,38);cout

  • 8/9/2019 Travel Code

    153/181

    cout

  • 8/9/2019 Travel Code

    154/181

    cout

  • 8/9/2019 Travel Code

    155/181

    coutvac;clear1();int co=0;fin.seekg(0,ios::beg);while(fin.read((char*)&mun,sizeof(mun))!=0){if(mun.snum!=vac)co++;

    else{clrscr();

    int s=1;screen2();screen1();gotoxy(30,6);textcolor(RED);cprintf("\nQUERY RESULT FORM\n");gotoxy(38,8);cprintf("\nOF");gotoxy(30,10);cprintf("\nPASSENGER DETAILS");textcolor(WHITE);gotoxy(25,16);cout

  • 8/9/2019 Travel Code

    156/181

    textcolor(WHITE);fin.seekg(0,ios::beg);gotoxy(45,22);cout

  • 8/9/2019 Travel Code

    157/181

    cout

  • 8/9/2019 Travel Code

    158/181

    gotoxy(21,42);textcolor(RED+BLINK);cprintf("HOT KEY: TO MORE ENTRY (PRESS KEY:1)");gotoxy(21,44);cprintf("HOT KEY:TO EXIT (PRESS KEY:2)");textcolor(WHITE);char tb1;

    cin>>tb1;switch(tb1){case '1'://for more entry

    table_entry();goto tme;

    case '2':goto tebco;

    default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");

    textcolor(WHITE);getch();goto tme;

    }case '2'://calling of table_display function

    table to;to.table_display();getch();goto tebco;

    case '3'://calling of table_modify functiontable to1;to1.table_modify();getch();

    goto tebco;case '4'://calling of table_del function

    table to2;to2.table_del();getch();goto tebco;

    case '5'://calling of table_query functiontable to3;to3.table_query();getch();goto tebco;

    case '6':break;

    default:gotoxy(21,46);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto tebco;

    }}//end of table_menu function definition

    /*starting of table_save function definition body*/void table::table_save(){

    textcolor(RED+BLINK);gotoxy(25,42);cprintf("Are You Sure To Save It(y/n):");

  • 8/9/2019 Travel Code

    159/181

    ch=getche();textcolor(WHITE);if (ch == 'y'){fin.seekp(0,ios::end);fin.write((char*)&teb,sizeof(teb));gotoxy(23,38);

    cout

  • 8/9/2019 Travel Code

    160/181

    if (ch== 0 ch>=12){valid=0;gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    161/181

    }}while(!valid);do{valid=1;gotoxy(52,32);gets(teb.dtn);

    ch=strlen(teb.dtn);if (ch== 0 ch>=10){valid=0;gotoxy(18,38);coutteb.charge;ch1=teb.charge;if (ch1== 0 ){valid=0;gotoxy(18,38);cout

  • 8/9/2019 Travel Code

    162/181

    cprintf("dep_time_sc");gotoxy(31,7);cprintf("source");gotoxy(45,7);cprintf("Destination");gotoxy(61,7);cprintf("dep_time_des");

    gotoxy(74,7);cprintf("Charge");textcolor(WHITE);gotoxy(1,8);cout

  • 8/9/2019 Travel Code

    163/181

    {scoot();textcolor(GREEN);gotoxy(10,21);cprintf("Old Value");gotoxy(10,22);cout

  • 8/9/2019 Travel Code

    164/181

    gotoxy(57,23);clear3(57,23);}

    }while(!valid);gotoxy(40,25);textcolor(CYAN);cprintf("Enter Bus Number:");

    textcolor(WHITE);do{valid=1;gotoxy(57,25);gets(teb.number);ch=strlen(teb.number);if (ch== 0 ch>=12){valid=0;gotoxy(40,38);cout

  • 8/9/2019 Travel Code

    165/181

    cout

  • 8/9/2019 Travel Code

    166/181

    {valid=0;gotoxy(40,38);cout

  • 8/9/2019 Travel Code

    167/181

    }if(found1==0)

    {gotoxy(25,31);cout

  • 8/9/2019 Travel Code

    168/181

    textcolor(WHITE);gotoxy(29,16);cout

  • 8/9/2019 Travel Code

    169/181

    cprintf("%c",205);c++;

    }r=13;c=11;for(i=1;i

  • 8/9/2019 Travel Code

    170/181

    gotoxy(c,r);cprintf("%c",205);c++;

    }gotoxy(13,19);cprintf("%c",201);gotoxy(70,19);

    cprintf("%c",187);gotoxy(13,40);cprintf("%c",200);gotoxy(70,40);cprintf("%c",188);r=20;c=13;for(i=1;i

  • 8/9/2019 Travel Code

    171/181

    for(i=1;i

  • 8/9/2019 Travel Code

    172/181

    r=6;c=72;for(i=1;i

  • 8/9/2019 Travel Code

    173/181

    }gotoxy(17,19);cprintf("%c",201);gotoxy(66,19);cprintf("%c",187);gotoxy(17,34);cprintf("%c",200);

    gotoxy(66,34);cprintf("%c",188);r=20,c=17;for(i=1;i

  • 8/9/2019 Travel Code

    174/181

    cprintf(" ");r=20,c=17;for(i=1;i

  • 8/9/2019 Travel Code

    175/181

    r=15;c=13;for(i=1;i

  • 8/9/2019 Travel Code

    176/181

    textcolor(RED);cprintf("\nPASSWORD FORM");gotoxy(38,8);cprintf("\nOF");gotoxy(21,10);cprintf("\nTHE TRAVEL AND TRANSPORT MANAGEMENT SYSTEM");textcolor(WHITE);

    screen4();textcolor(5);gotoxy(24,23);cprintf("1.Change of Password");//for change of passwordgotoxy(24,26);cprintf("2.Change User Name");//for change of user namegotoxy(24,29);cprintf("3.Return to Main Menu");textcolor(YELLOW+BLINK);gotoxy(25,31);cprintf("Enter Your Choice:");textcolor(WHITE);

    char ch=getch();;switch(ch){case '1':

    clrscr();password poo;poo.change_password();getch();goto repa3;

    case '2':clrscr();password poo1;poo1.change_user();

    getch();goto repa3;

    case '3':break;

    default :gotoxy(21,42);textcolor(BLUE+BLINK);cprintf("Invalid Choice,Please retry!!");textcolor(WHITE);getch();goto repa3;

    }}//end of menu function body/*starting of change_user function*/void password::change_user(){msgbox();int pos1=0,count1=0;char usr[14],p,r;gotoxy(34,9);textcolor(BLUE);cprintf("Change User Name");textcolor(CYAN);gotoxy(26,12);cprintf("Enter the old User Name:");

    gotoxy(51,12);cprintf(" ");gotoxy(51,12);

  • 8/9/2019 Travel Code

    177/181

    cin>>usr;textcolor(WHITE);file.seekg(0,ios::beg);while(file.read((char*)&pass,sizeof(pass))!=0){if (strcmp(pass.name,usr)==0){

    textcolor(CYAN);gotoxy(26,15);cprintf("Enter New User Name :");gotoxy(51,15);cprintf(" ");textcolor(WHITE);gotoxy(51,15);cin>>pass.name;pos1=count1*sizeof(pass);file.seekp(pos1,ios::beg);file.write((char*)&pass,sizeof(pass));gotoxy(29,18);

    cout

  • 8/9/2019 Travel Code

    178/181

    textcolor(WHITE);file.seekg(0,ios::beg);while(file.read((char*)&pass,sizeof(pass))!=0){if (strcmp(pass.password,pop)==0){textcolor(CYAN);

    gotoxy(26,15);cprintf("Enter New Password :");gotoxy(50,15);cprintf(" ");textcolor(WHITE);gotoxy(50,15);for(int k=0;k

  • 8/9/2019 Travel Code

    179/181

    file.seekp(0L,ios::end);file.write((char*)&pass,sizeof(pass));}//end of function definition/*starting of login function*/int password::login(){char t,name1[15];

    char passwd[15];int i,l,flag,j,flag1;j=0;for(i=0;i>name1;gotoxy(41,15);for(l=0;l

  • 8/9/2019 Travel Code

    180/181

    {gotoxy(29,18);cout

  • 8/9/2019 Travel Code

    181/181

    textbackground(BLACK);textcolor(WHITE);}//end of function