#include<stdio.h>
#include<conio.h>
void buy();
void show();
void ret();
void shop();
void realme();
void redmi();
void vivo();
void oppo();
void sumsung();
void main_p();
void login();
void main()
{
//how to apply that without skip not come out of login page
char un[20];
int p=1234,pass,c;
clrscr();
//textbackground(11);
//window(1,1,80,60);
clrscr();
textbackground(8);
window(20,8,60,8);
clrscr();
textcolor(7);
cprintf(" RT LAVKUSH - %c x",223);
textbackground(YELLOW+3);
window(20,9,60,19);
clrscr();
l:
textcolor(WHITE);
gotoxy(11,3);
cprintf("User Name:");
scanf("%s",&un);
gotoxy(11,5);
cprintf("Password:");
//fflush(stdin); i want to match like 1234=1234 then direct open the menu
//pass=getch();
scanf("%d",&pass);
if(pass==p)
{
main_p();
}
else
{
gotoxy(12,9);
textcolor(RED+BLINK);
cprintf("Wrong Password!!");
goto l;
}
do
{
gotoxy(11,8);
cprintf("1.RESET");
gotoxy(25,8);
cprintf("2.SUBMIT");
textcolor(YELLOW);
gotoxy(13,10);
cprintf("Enter The Option? ");
scanf("%d",&c);
switch(c)
{
case 1:
//login();
break;
case 2:
main_p();
case 27:
exit(0);
}
}while(c!=27);
main_p();
getch();
}
//**************************************************************************
void main_p()
{
char ch;
textbackground(LIGHTMAGENTA);
window(10,5,75,22);
clrscr();
gotoxy(8,3);
printf("********* WELCOME TO HARI MOBILE SERVICE **********\n");
// gotoxy(14,5); //for change color both are
// textcolor(BLACK);
// cprintf(" HOW CAN I HELP YOU");
gotoxy(8,5);
textcolor(YELLOW+BLINK+12);
cprintf(" HOW CAN I HELP YOU \n");
do
{
gotoxy(21,7);
printf("F1. Buy Phone\n");
gotoxy(21,9);
printf("F2. Show Phones\n");
gotoxy(21,11);
printf("F3. Return Phone\n");
gotoxy(21,13);
printf("F4. Shop Work\n");
gotoxy(21,15);
printf("ESC. Exit\n");
gotoxy(25,17);
textcolor(BLACK+BLINK);
cprintf("Enter your choice? ");
// fflush(stdin);
// ch=getche();
scanf("%s",&ch);
switch(ch)
{
case 43:
buy();
break;
case 42: /*i want to use function key of place of choice*/
show();
break;
case 45:
ret();
break;
case 47:
shop();
break;
case 27:
exit(1);
default:
gotoxy(19,19);
textcolor(RED+BLINK);
cprintf("Wrong Choice Try Again!!");
}
}while(ch!=27);
}
//***********************************************************************
//void login()
//*************************************************************************
void buy()
{
int in;
printf("\n1. Realme\n2. Redmi\n3. Oppo\n4. Vivo\n5. Another Phone\n");
printf("Select Phone Brand: ");
scanf("%d",&in);
switch(in)
{
case 1:
realme();
break;
case 2:
redmi();
break;
case 3:
oppo();
break;
case 4:
vivo();
break;
case 5:
sumsung();
case 6:
exit(0);
break;
}
}
//*************************************************************************
void show()
{
printf("\n\t******************* Welcome To Hari Shop ********************\n");
printf("\t********************* Available Phones **********************\n");
printf("\n\t\t\tRealme Brand\n\n\t\t\tRedmi Brand\n\n\t\t\tOppo Brand\n\n\t\t\tVivo Brand\n\n\t\t\tSumsung\n");
}
//*************************************************************************
void ret()
{
char ph;
printf("\nEnter Brand Name: ");
scanf("%s",&ph);
printf("\n\nWhat is the Problem With this Phone: ");
scanf("%s",&ph);
printf("\n\nReturn Successfull!!");
printf("\nNext time it will be improved");
/*here i want to cmp phone if user enter moto then sorry something wrong*/
}
//*************************************************************************
void shop()
{
int a=9;
a=a-a;
printf("%d",a);
}
//**********************************************
void realme()
{
printf("real me");
}
//**********************************************
void redmi()
{
printf("hari");
}
//************************************************
void oppo()
{
printf("hari om");
}
//************************************************
void vivo()
{
printf("siv");
}
//***********************************************
void sumsung()
{
printf("ravi");
}
/*in the buy phone level there are available there types phones
like when we will go in realme level then show
realme(4,64)
realme(3,32)
etc.............
this will be in the realme function
*/