You are on page 1of 8

#include <iostream>

#include <windows.h>
#include <string>
using namespace std;
void
void
void
void
void
void
void
void
void
void

menu();
login();
display();
aboutus();
speoffrs();
onscrnhlp();
cinform();
disply(string num);
inputdata(void);
Quit();

// Record structure
struct course
{
string cid;
string cnam;
string cstart;
int fee;
string cduration;
}carry[3];
// Main Program of the Student Information System
void main()
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 11);
cout << "
*
*
"
<< endl;
cout << "
**
** "
<< endl;
cout << " *** Welcome to the Woodman Furniture customer order system **
**" << endl;
cout << "
**
** "
<< endl;
cout << "
*
* " <
< endl;
cout << "\n";
cout << "-------------------------------------------------------------------------" << endl;
login();
system("pause");
}
/* Login program of the system.
In this login program users and the adminstrator can login to their programs sep
arately. */
void login()
{
string username, password;
int counter = 3;
do

{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14);
cout << "<<<>>> Customer order login system <<<>>>" << endl;
cout << "\n";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
cout << "Enter your username:";
cin >> username;
cout << "\n";
cout << "Enter password:";
cin >> password;
cout << "\n";
if ((username == "gajenthran") && (password == "gajen"))
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
10);
cout << " login Succeed" << endl;
cout << "\n";
break;
cout << "\n";
}
else if ((username == "administrator") && (password == "admin"))
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
10);
cout << "Administrator login Succeed" << endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
15);
cout << "\n";
inputdata();
cout << "\n";
char opt;
cout << "Do you want to log out y/n:" << endl;
cin >> opt;
cout << "-------------------------------------------------------------------------" << endl;
if (opt == 'y')
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_
HANDLE), 9);
login();
}
else
{
inputdata();
}
cout << "\n";
break;
cout << "\n";
}
else
{

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
12);
cout << "Accesss Denied....Invalid user name & password"
<< endl;
cout << "\n";
}
counter--;
} while (counter>0);
if (counter == 0)
{
cout << "\n";
cout << "\n";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);
cout << "You are unauthorized person" << endl;
cout << "\n";
}
else
{
menu();
}
}
/* Main Menu program of the system.
Users can select options in this main menu according their purposes. */
void menu()
{
cout << "-------------------------------------------------------------------------" << endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14);
cout << "<<<>>> WOOD FURNITURE OPTIONS <<<>>> " << endl;
cout << "\n";
bool quit = false;
char option;
display();
while (quit == false)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
cout << "Select 1,2,3,4,5 or 6 to quit" << endl;
cin >> option;
cout << "\n";
cout << "-------------------------------------------------------------------------" << endl;
switch (option)
{
case '1':SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE)
, 11);
cout << "(()) About Us (())" << endl;
cout << "\n";
aboutus();
cout << "\n";
cout << "-------------------------------------------------------------------------" << endl;
break;

case '2': SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE


), 11);
cout << "(()) list Special Offers (())" << endl;
speoffrs();
cout << "\n";
cout << "-------------------------------------------------------------------------" << endl;
break;
case '4': SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE
), 11);
cout << "(()) Search Specific Items or Category Informat
ion(())" << endl;
cout << "\n";
cout << "-------------------------------------------------------------------------" << endl;
break;
case '5': SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE
), 11);
cout << "(()) Onscreen Help (())" << endl;
onscrnhlp();
cout << "\n";
cout << "-------------------------------------------------------------------------" << endl;
break;
case '6': SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE
), 11);
cout << "(()) EXIT (())" << endl;
Quit();
cout << "\n";
break;
default: SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDL
E), 12);
cout << "Invalid number" << endl;
menu();
cout << "Please use only 1,2,3,4,5 or 6" << endl;
cout << "\n";
cout << "-------------------------------------------------------------------------" << endl;
}
char opt;
cout << "Do you want to continue y/n:" << endl;
cin >> opt;
cout << "-------------------------------------------------------------------------" << endl;
if (opt == 'y')
{
menu();
}
else
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
11);

cout << "(()) Quitting Menu (())" << endl;


Quit();
}
}
}
//About Us option in Main Menu
void aboutus()
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
cout << "\n";
cout << "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * " << endl;
cout << "***************************************************************
*****************" << endl;
cout << "*Woodman Furniture is a newly built shop in city of Blackheth s
outh east *" << endl;
cout << "* london which has become famous within a short time period. *"
<< endl;
cout << "*\n";
cout << "*The main Reason for this is introducing modern furiture for sm
all spaces *" << endl;
cout << "*to help people with organization of their space*" << endl;
cout << "*\n";
cout << "****************************Contact Info=**********************
" << endl;
cout << "*\n";
cout << "*Phone Number= 077-1415922
*" << endl;
cout << "*Email Address= Gajenthran1995@gmail.com
*" << endl;
cout << "***************************************************************
*****************" << endl;
cout << "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * " << endl;
}
//Special Offers option in Main Menu
void speoffrs()
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
cout << "\n";
cout << "***************************************************************
**************" << endl;
cout << "***************************************************************
**************" << endl;
cout << "*
Free Delivery for Moticate customers
*" << endl;
cout << "*Most of time special offers and discounts are given for motiva
te customers *" << endl;
cout << "***************************************************************
**************" << endl;
cout << "***************************************************************
**************" << endl;
}
// Onscreen Help option in Main Menu
void onscrnhlp()
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);

cout << "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


* * * * " << endl;
cout << "***************************************************************
*********" << endl;
}
/* The ID number that is entered in cinform function pass to this disply functio
n to show
course information according to the given ID number. So this is value parameter
passing */
void disply(string ID)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
bool found = false;
for (int i = 0; i<3; i++)
{
if (ID == carry[i].cid)
{
found = true;
cout << "" << '
cout << "" << '
cout << "" << '
cout << "" << '

'
'
'
'

<<
<<
<<
<<

carry[i].cnam << endl;


carry[i].fee << endl;
carry[i].cduration << endl;
carry[i].cstart << endl;

cout << "\n";


break;
}
}//end for
if (found == false)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);
cout << "Invalid course ID number" << endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
}
}
// This is the function to enter course details to the system by the administrat
or
void inputdata(void)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 11);
cout << "......................................." << endl;
cout << "<>Please enter course details to edit<>" << endl;
cout << "......................................." << endl;
}
cout << "\n";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10);
cout << "You have successfully edited the course information." << endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
}
// Display function of Main Menu
void display()
{

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
cout << "********************************************" << endl;
cout << "* * * * * * * * * * * * * * * " << endl;
cout << "*
Customer Order System
*" << endl;
cout << "--------------------------------------------" << endl;
cout << "*(1. About Us
)*"
cout << "\n";
cout << "*(2. List Special Offers
)*"
cout << "\n";
cout << "*(3. List Available Courses
)*"
cout << "\n";
cout << "*(4. Search Specific Items or Category information )*"
cout << "\n";
cout << "*(5. On Screen Help
)*" << endl;
cout << "\n";
cout << "*(6. Exit
)*" << endl;
cout << "*
*" << endl;
cout << "* * * * * * * * * * * * * * * " << endl;
cout << "********************************************" << endl;
cout << "\n";
}
//Quit function
void Quit()
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
char opt;
cout << "Do you want to Exit from the system y/n:" << endl;
cin >> opt;
if (opt == 'y')
{
exit(1);
}
else
{
menu();
}
}

<< endl;
<< endl;
<< endl;
<< endl;

You might also like