Pharmacy Management System

#include<iostream.h>
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<fstream.h>
#include<graphics.h>
FILE *P;
struct abc
{
int i,x,z,age;
char ch[10],ch9[10],ch1,ch2[10],ch3[10],cn[50];
char m,sname[50],fname[50];
}j;

class project
{
int i;
public:
void abc();
void info();
void text();
void front()

{
clrscr();
textcolor(BLACK);
textbackground(YELLOW);
cout<<"\t\t\t\tDATE: "<<__DATE__;
gotoxy(1,10);

cout<<"                           WELCOME TO MEDICAL STORE MANAGEMENT"; cout<<endl;
gotoxy(15,10);
cout<<"\n\n\n\n\n\n\n\n\npress any key to continue......";
getch();
          }
};
void project::abc()
          {

                   textcolor(WHITE);
                   textbackground(BLUE);
                   char ch[10]="user123";
                   char ch9[10]="user",ch1,ch2[10],ch3[10];
                   i=0;
                   cout<<"\t\t\t\tDATE: "<<__DATE__;
                   gotoxy(20,10);
                   cout<<"\n                            PLEASE ENTER YOUR PASSWORD"<<endl;


                   while(ch1!=13)
                   {
                             ch1=getch();
                             ch2[i]=ch1;
                             putchar('*');
                             ++i;
                   }
                   --i;
                   ch2[i]=NULL;
                   gotoxy(30,15);

                   cout<<"\n\n                         PLEASE ENTER YOUR USER ID"<<endl;
                   cin>>ch3;
                   if((strcmp(ch,ch2)==0)&&(strcmp(ch9,ch3)==0))
                             {cout<<"\n\n                                password/id matched\n\n                            press any key to continue........";
                             getch();
                             clrscr();
                             info();
                             }
                             else
                             cout<<"\n\n                                  wrong id or password";
                             getch();
          }
void project::text()
{
clrscr();
textcolor(BLACK);
textbackground(MAGENTA);
cout<<"\t\t\t\tDATE: "<<__DATE__;
int x,z,age;
char fname[50],sname[50],cn[50];
char pr[20];
cout<<"\n\n\n\n\n\t\t############# AVAILABLE FORMS #############";
cout<<"\n\n********************************************************************************";
cout<<"\n\n\t\t1.For shop owner                            *";
cout<<"\n\n\t\t2.For customer                           *";
cout<<"\n\n\t\t3.For Salesmen                            *";
cout<<"\n\n\t\t4.For medicines                           *";
cout<<"\n\n\t\t5.Exit                                   *";
cout<<"\n\n********************************************************************************";
cout<<"\n\n\t\tPlease Enter Your Choice.......";
cin>>x;
switch(x)
{
case 1:
{
clrscr();
cout<<"\t\t\t\tDATE: "<<__DATE__;
cout<<"\n\n\t\t1.Your selection is shop owner";
cout<<"\n\n\t\tFILLUP THIS FORM";
cout<<"\n\n\n\n\t\tFIRST NAME:-";
cin>>j.fname;
fwrite(&j.fname,sizeof(j.fname),1,P);
cout<<"\n\t\tSECOND NAME:-";
cin>>j.sname;
fwrite(&j.sname,sizeof(j.sname),1,P);

cout<<"\n\t\tCONTACT NO:-";
cin>>j.cn;
fwrite(&j.cn,sizeof(j.cn),1,P);
cout<<"\n\n\n\t\tThanks.........for registering";
break;
}
case 2:
{
clrscr();
cout<<"\t\t\t\tDATE: "<<__DATE__;
cout<<"\n\n\t\t1.Your selection is customer";
cout<<"\n\n\t\tFILLUP THIS FORM";
cout<<"\n\n\n\n\t\tFIRST NAME:-";
cin>>j.fname;
fwrite(&j.fname,sizeof(j.fname),1,P);
cout<<"\n\t\tSECOND NAME:-";
cin>>j.sname;
fwrite(&j.sname,sizeof(j.sname),1,P);

cout<<"\n\t\tCONTACT NO:-";
cin>>j.cn;
fwrite(&j.cn,sizeof(j.cn),1,P);
cout<<"\n\n\n\t\tThanks.........for registering";
break;
}
case 3:
{
clrscr();
cout<<"\t\t\t\tDATE: "<<__DATE__;
cout<<"\n\n\t\t1.Your selection is salesmen";
cout<<"\n\n\t\tFILLUP THIS FORM";
cout<<"\n\n\n\n\t\tFIRST NAME:-";
cin>>j.fname;
fwrite(&j.fname,sizeof(j.fname),1,P);
cout<<"\n\t\tSECOND NAME:-";
cin>>j.sname;
fwrite(&j.sname,sizeof(j.sname),1,P);
cout<<"\n\t\tCONTACT NO:-";
cin>>j.cn;
fwrite(&j.cn,sizeof(j.cn),1,P);
cout<<"\n\n\n\t\tThanks";
break;
}
case 4:
{
clrscr();
cout<<"\t\t\t\tDATE: "<<__DATE__;
cout<<"\n\n\t\t1.Your selection is medicines";
cout<<"\n\n\t\tFILLUP THIS FORM";
cout<<"\n\n\n\n\t\tMEDICINE'S NAME:-";
cin>>j.fname;
fwrite(&j.fname,sizeof(j.fname),1,P);
cout<<"\n\t\tPRICE:-";
cin>>j.cn;
fwrite(&j.PR,sizeof(j.PR),1,P);
break;
}

case 5:
clrscr();
cout<<"\n\t\t6.Exit";
}
}

void project::info()
{
clrscr();
textcolor(GREEN);
textbackground(BLUE);
int ch;
cout<<"\t\t\t\tDATE: "<<__DATE__;
cout<<"\n\n\n\n\n\t  ############# ENTER YOUR AREA OF MEDICINES #############";
cout<<"\n\n********************************************************************************";
cout<<"\n\n\t\t1.Paracetamol Brands";
cout<<"\n\n\t\t2.Aspirin Brands";
cout<<"\n\n\t\t3.Ibuprofen brands";
cout<<"\n\n\t\t4.Codral Brands";
cout<<"\n\n\t\t5.Lemsip Brands";
cout<<"\n\n********************************************************************************";
cout<<"\n\n\t\tPLEASE ENTER YOUR CHOICE.......";
cin>>ch;

switch(ch)
{
case 1:
{
clrscr();
cout<<"\t\t\t\tDATE: "<<__DATE__;
cout<<"\n     !!!!!!!!!!!!!!!!! INFORMATION ABOUT MEDICINES BRANDS !!!!!!!!!!!!!!!!!!!!!!!!!!!\n";
cout<<"\n\n pARACETAMOL BRANDS";
cout<<"\n\n\n\n Panadol";
cout<<"\n\n\n\n Dymadon";
cout<<"\n\n\n\n Dymadon p*";
cout<<"\n\n\n\n Lemsip";
cout<<"\n\n\n\n Panamax*";
cout<<"\n\n\n\n Tylenol";
cout<<"\n\n\n                  PRESS ENTER TO SEE THE LIST OF FORMS AVAILABLE......";
getch();
text();
break;
}
case 2:
{
clrscr();
cout<<"\n     !!!!!!!!!!!!!!!!! INFORMATION ABOUT MEDICINES BRAND !!!!!!!!!!!!!!!!!!!!!!!!!!!\n";
cout<<"\n\n:ASPIRIN BRANDS";
cout<<"\n\n\n\n Disprin";
cout<<"\n\n\n\n Aspro clear";
cout<<"\n\n\n\n solprin*";
cout<<"\n\n\n                  PRESS ENTER TO SEE THE LIST OF FORMS AVAILABLE......";
getch();
text();
break;
}
case 3:
{
clrscr();
cout<<"\t\t\t\tDATE: "<<__DATE__;
cout<<"\n     !!!!!!!!!!!!!!!!! INFORMATION ABOUT MEDICINES BRANDS !!!!!!!!!!!!!!!!!!!!!!!!!!!\n";
cout<<"\n\n IBUPROFEN BRANDS:";
cout<<"\n\n\n\n Nurofen";
cout<<"\n\n\n\n Advil";
cout<<"\n\n\n\n Brufen*";
cout<<"\n\n\n\n Herron blue profen";
cout<<"\n\n\n\n Rafen*";
cout<<"\n\n\n\n Triprofen";


cout<<"\n\n\n                  PRESS ENTER TO SEE THE LIST OF FORMS AVAILABLE......";
getch();
text();
break;
}
case 4:
{
clrscr();
cout<<"\t\t\t\tDATE: "<<__DATE__;
cout<<"\n     !!!!!!!!!!!!!!!!! INFORMATION ABOUT MEDICINES!!!!!!!!!!!!!!!!!!!!!!!!!!!\n";
cout<<"\n\n CODRAL BRANDS:";
cout<<"\n\n\n\n Codral Cold and Flu tablets";
cout<<"\n\n\n\n Codral Forte tablets";
cout<<"\n\n\n\n Codral Pain Relief tablets";
cout<<"\n\n\n                  PRESS ENTER TO SEE THE LIST OF FORMS AVAILABLE......";
getch();
text();
break;
}
case 5:
{
clrscr();
cout<<"\t\t\t\tDATE: "<<__DATE__;
cout<<"\n     !!!!!!!!!!!!!!!!! INFORMATION ABOUT MEDICINES !!!!!!!!!!!!!!!!!!!!!!!!!!!\n";
cout<<"\n\n LEMSIP BRANDS";
cout<<"\n\n\n\n Lemsip Max Cold & Flu sachets";
cout<<"\n\n\n\n Lemsip Flu 12 hour capsules";
cout<<"\n\n\n                  PRESS ENTER TO SEE THE LIST OF FORMS AVAILABLE......";
getch();
text();
break;
}
default:cout<<"invalid choice";
}

getch();
}

void main()
{
char m;
do
{
clrscr();
textcolor(GREEN);
textbackground(BLACK);
project a;
P=fopen("LP.txt","w+");
a.front();
clrscr();
a.abc();
clrscr();
cout<<"\n\n\n\n\n\n\n\n\n\n\t\t\tCONTINUE WITH THE PROGRAM?(Y/N) :";
cin>>m;
 }while(m=='y'||m=='Y');
clrscr();
cout<<"\t\t\t\tDATE: "<<__DATE__;
cout<<"\n\n\n\n\n\n\n\n\n##############################################################################";
cout<<"\n\n\t\t\tPROGRAMMED BY ADITYA SHARMA\n";
cout<<"\n###############################################################################\n";
fclose(P);
getch();

}

No comments