Admin:-
Username - admin
Password - admin123
Student
Username - user
Password - user
Create users as you want in
#define _CRT_SECURE_NO_WARNINGS // visual studio
#include <
#include <string>
#include<
#include<Windows
#include <
#include <vector> // for the
#include <
//
int changefontsize(void);
void admincase1();
void add_course_details();
void add_offer_details();
void usercase1();
void usercase2();
void usercase3();
//#########################################################################################################################################################
void welcome()
{
HANDLE a = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(a, 10);//to change text colour
cout << " ----------------------------------------------------" << endl;
cout << " ----------------------------------------------------" << endl;
cout << " -- WELCOME TO --" << endl;
cout << " -- MASTER MIND INSTITUTE INFORMATION SYSTEM --" << endl;
cout << " ----------------------------------------------------" << endl;
cout << " ----------------------------------------------------" << endl;
Sleep(2000);
cout << endl << endl << endl;
logging();
}
//#########################################################################################################################################################
void logging()
{
HANDLE a = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(a, 13);//to change text colour
cout << "Enter Your logging Details Below: " << endl << endl;
HANDLE b = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(b, 15);
cout << "Enter Your Username: ";
cin >> username;
cout << "Enter Your Password: ";
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 255);
cin >> password;
HANDLE d = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(d, 15);
mainadmin();
}
//#########################################################################################################################################################
int create()
{
CreateDirectory("C:\\EnoshShanProject", NULL); //create a new folder
return 0;
}
//#########################################################################################################################################################
bool IsLoggedIn()
{
string un, pw;
ifstream read("C:\\EnoshShanProject\\" + username + ".txt");
getline(read, un);
getline(read, pw);
if (un == username && pw == password)
{
return true;
}
else
{
return false;
}
}
//#########################################################################################################################################################
int mainadmin()
{
system("cls");
int choice;
if ((username == "admin") && (password == "admin123"))
{
system("cls");
HANDLE z = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(z,10);
create();
cout << endl << " WELCOME ADMIN" << endl << "________________________________________________________________________" << endl << endl << endl;
HANDLE b = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(b, 13);
cout << "Choose an option from the main menu" << endl << endl;
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 14);
cout << "1: Register a New Student \n2: Add course details \n3: Add a New Offer \n4: Delete Course Details and offers \n5: Delete a Student \n6: Log Out \n7: Exit the System " << endl;
HANDLE d = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(d, 11);
cout << "\nyour Option (ex:- Enter 1 to first option): ";
cin >> choice;
string coursename;
switch (choice)
{
case 1:
{
admincase1();
}
case 2:
add_course_details();
break;
case 3:
add_offer_details();
break;
case 4:
{
//string coursename;
int choice2;
system("cls");
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 13);
cout << endl << "select a Category You want to delete\n\n";
HANDLE f = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(f, 14);
cout << "01. Certificate\n02. Graduate\n03. Offers\n";
HANDLE g = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(g, 11);
cout << "Your Choice:- ";
cin >> choice2;
switch (choice2)
{
case 1:
{
coursename = "Certificate";
show_certificates();
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(h, 13);
cout << "\n\nEnter course name to delete\n";
cin >> coursename;
delete_certificate(coursename);
}
case 2:
{
coursename = "Undergraduate";
show_Graduates();
HANDLE i = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(i, 13);
cout << "\n\nEnter course name to delete\n";
cin >> coursename;
delete_graduate(coursename);
}
case 3:
{
coursename = "Offers";
show_Offers();
HANDLE j = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(j, 13);
cout << "\n\nEnter Offer name to delete\n";
cin >> coursename;
delete_Offer(coursename);
}
default:
{
HANDLE k = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(k, 12);
cout << "Error....... Invalid Choice\n\nPress Enter to Go to main menu\n";
system("pause>null");
cin.clear(); //clear assgned values
cin.ignore(10000, '\n'); //clear assigned values
system("pause>null");
system("cls");
mainadmin();
}
}
system("Pause>nul");
break;
}
case 5:
{
delete_user();
}
case 6:
{
system("cls");
username = "0";
password = "0";
system("cls");
welcome();
break;
}
case 7:
{
system("cls");
HANDLE b = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(b, 10);//to change text colour
cout << "\n\n\n\n 05.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 11);//to change text colour
cout << "\n\n\n\n 04.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE f = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(f, 14);//to change text colour
cout << "\n\n\n\n 03.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE d = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(d, 12);//to change text colour
cout << "\n\n\n\n 02.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 13);//to change text
cout << "\n\n\n\n 01.Thank you for using our system" << endl << endl;
Sleep(1000);
exit(0);
}
default:
{
HANDLE l = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(l, 12);
cout << "Error... Invalid choice. Try again\n\n";
system("pause>null");
cin.clear(); //clear assgned values
cin.ignore(10000, '\n'); //clear assigned values
mainadmin();
}
}
}
else
{
bool status = IsLoggedIn();
if (!status) //status is not true (returned false in IsLoggedIn)
{
cout << "false Login!" << endl;
cout << "Do you want to try again Y/N." << endl;
bool falsemenu = false;
string select1;
while (falsemenu == false)
{
cin >> select1;
if (select1 == "y" | select1 == "Y")
{
falsemenu = true;
system("cls");
welcome();
}
else if (select1 == "n" | select1 == "N")
{
falsemenu = true;
system("cls");
HANDLE b = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(b, 10);//to change text colour
cout << "\n\n\n\n 05.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 11);//to change text colour
cout << "\n\n\n\n 04.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE f = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(f, 14);//to change text colour
cout << "\n\n\n\n 03.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE d = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(d, 12);//to change text colour
cout << "\n\n\n\n 02.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 13);//to change text
cout << "\n\n\n\n 01.Thank you for using our system" << endl << endl;
Sleep(1000);
exit(0);
}
else
{
system("cls");
cout << "Error...... Invalid choice. \nPlease Press 'Y' to try again or Press 'N' to Exit\n";
}
}
}
else
{
HANDLE a = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(a, 10);//to change text
cout << "succesfully loged in!" << endl << endl;
Sleep(2000);
system("cls");
HANDLE b = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(b, 10);//to change text
cout << "Dear " << username << " You are warmly Welcome to the System" << endl;
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 11);//to change text
cout << "Press enter to go to Main menu";
system("Pause>nul");
usermainmenu();
return 1;
}
}
}
//#########################################################################################################################################################
void admincase1()
{
string tempnum1;
HANDLE b = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(b, 12);//to change text colour
cout << endl << endl << "Enter Following Details To Create A New User" << endl;
HANDLE A = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(A, 15);
cout << "select a username: ";
cin >> username1;
cout << "select a Password: ";
cin >> password1;
ofstream file;
file.open("C:\\EnoshShanProject\\" + username1 + ".txt"); //create a new txt file with entered username in directory folder.
file << username1 << endl << password1;
file.close();
system("cls");
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 11);
cout << "Student created succesfully" << endl;
HANDLE d = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(d, 12);
cout << "\nPress Y to go back, Press R to Register a new Student or press ANY KEY to exit" << endl;
cin >> tempnum1;
if (tempnum1 == "y" | tempnum1 == "Y")
{
mainadmin();
}
else if (tempnum1 == "r" | tempnum1 == "R")
{
system("cls");
admincase1();
}
else
{
system("cls");
HANDLE b = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(b, 10);//to change text colour
cout << "\n\n\n\n 05.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 11);//to change text colour
cout << "\n\n\n\n 04.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE f = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(f, 14);//to change text colour
cout << "\n\n\n\n 03.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE d = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(d, 12);//to change text colour
cout << "\n\n\n\n 02.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 13);//to change text
cout << "\n\n\n\n 01.Thank you for using our system" << endl << endl;
Sleep(1000);
exit(0);
}
}
//#########################################################################################################################################################
void add_course_details()
{
struct course_details
{
std::string Filename;
std::string Title;
std::string Location;
std::string Body;
std::string Duration;
std::string Req_qul;
std::string Subjects;
};
course_details certificate;
course_details Graduate;
int select;
system("cls");
HANDLE A = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(A, 13);
cout << "Add Course Details to Certificate and Graduate Courses\nSelect one of follwing categories";
HANDLE b = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(b, 14);
cout << endl << endl << "01. Add a course to Certificate\n02. Add a course to Graduate\n";
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 11);
cout << "Your option: ";
cin >> select;
system("cls");
switch (select)
{//Start of switch
case 1:
{//Start of case1
cout << "Give a search name to the course(DON NOT PUT SPACES BETWEEN WORDS)\nEx:-Software_Engineering" << endl;
std::getline(std::cin, certificate.Filename);
system("cls");
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 13);
cout << "Give a search name to the course(DON NOT PUT SPACES BETWEEN WORDS)\nEx:-Software_Engineering" << endl;
HANDLE f = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(f, 15);
std::getline(std::cin, certificate.Filename);
HANDLE g = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(g, 13);
cout << endl << endl << "Enter a title for the course(Spaces are allowed)\nEx:-Software Engineering" << endl;
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(h, 15);
std::getline(std::cin, certificate.Title);
HANDLE i = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(i, 13);
cout<<"\n\nEnter course Location" << endl;
HANDLE j = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(j, 15);
std::getline(std::cin, certificate.Location);
HANDLE k = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(k, 13);
cout << endl << endl << "Add an overview to the course.\n(DO NOT PRESS ENTER UNTIL YOU FINISHED TYPING.JUST TYPE THE BODY AS ONE LINE)" << endl;
HANDLE l = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(l, 15);
std::getline(std::cin, certificate.Body);
HANDLE m = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(m, 13);
cout << endl << endl << "Add course duration" << endl;
HANDLE n = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(n, 15);
std::getline(std::cin, certificate.Duration);
HANDLE o = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(o, 13);
cout << endl << endl << "Add Required qulifications" << endl;
HANDLE p = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(p, 15);
std::getline(std::cin, certificate.Req_qul);
HANDLE q = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(q, 13);
cout << endl << endl << "Enter course Subjects" << endl;
HANDLE r = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(r, 15);
std::getline(std::cin, certificate.Subjects);
ofstream file;
file.open("C:\\EnoshShanProject\\Defaultinformations\\Certificate\\" + certificate.Filename + ".txt"); //create a new txt file with entered username in directory folder.
file << "COURSE NAME:- " << (certificate.Title);
file << endl << endl << "LOCATION:- " << (certificate.Location);
file << endl << endl << "OVERVIEW\n\n" << (certificate.Body);
file << endl << endl << "DURATION\n\n" << (certificate.Duration);
file << endl << endl << "MINIMUM ENTRY REQUIREMENTS\n\n" << (certificate.Req_qul);
file << endl << endl << "MODULES\n\n" << (certificate.Subjects);
file.close();
HANDLE s = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(s, 10);
cout << "\n\nCourse created Successful! Press ENTER to go to main menu";
system("Pause>nul");
mainadmin();
break;
} //End of case 1
case 2:
{
cout << "Give a search name to the course(DO NOT PUT SPACES BETWEEN WORDS)\nEx:-Software_Engineering" << endl;
std::getline(std::cin, Graduate.Filename);
system("cls");
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 13);
cout << "Give a search name to the course(DO NOT PUT SPACES BETWEEN WORDS)\nEx:-Software_Engineering" << endl;
HANDLE f = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(f, 15);
std::getline(std::cin, Graduate.Filename);
HANDLE g = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(g, 13);
cout << endl << endl << "Enter a title for the course(Spaces are allowed)\nEx:-Software Engineering" << endl;
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(h, 15);
std::getline(std::cin, Graduate.Title);
HANDLE i = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(i, 13);
cout << endl << endl << "Enter course Location" << endl;
HANDLE j = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(j, 15);
std::getline(std::cin, Graduate.Location);
HANDLE k = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(k, 13);
cout << endl << endl << "Add an overview to the course.\n(DO NOT PRESS ENTER UNTIL YOU FINISHED TYPING.JUST TYPE THE BODY AS ONE LINE)" << endl;
HANDLE l = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(l, 15);
std::getline(std::cin, Graduate.Body);
HANDLE m = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(m, 13);
cout << endl << endl << "Add course duration" << endl;
HANDLE n = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(n, 15);
std::getline(std::cin, Graduate.Duration);
HANDLE o = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(o, 13);
cout << endl << endl << "Add Required qulifications" << endl;
HANDLE p = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(p, 15);
std::getline(std::cin, Graduate.Req_qul);
HANDLE q = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(q, 13);
cout << endl << endl << "Enter course Subjects" << endl;
HANDLE r = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(r, 15);
std::getline(std::cin, Graduate.Subjects);
ofstream file;
file.open("C:\\EnoshShanProject\\Defaultinformations\\Graduate\\" + Graduate.Filename + ".txt"); //create a new txt file with entered username in directory folder.
file << "COURSE NAME:- " << (Graduate.Title);
file << endl << endl << "LOCATION:- " << (Graduate.Location);
file << endl << endl << "OVERVIEW\n\n" << (Graduate.Body);
file << endl << endl << "DURATION\n\n" << (Graduate.Duration);
file << endl << endl << "MINIMUM ENTRY REQUIREMENTS\n\n" << (Graduate.Req_qul);
file << endl << endl << "MODULES\n\n" << (Graduate.Subjects);
file.close();
HANDLE s = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(s, 10);
cout << "\n\nCourse created Successful! Press ENTER to go to main menu";
system("Pause>nul");
mainadmin();
break;
}
default:
{
cout << "Error.......Invalid choice!!!!!\n Press Enter to Go to main menu\n";
system("pause>null");
cin.clear(); //clear assgned values
cin.ignore(10000, '\n'); //clear assigned values
system("pause>null");
mainadmin();
break;
}
}
}
//#########################################################################################################################################################
void add_offer_details()
{
struct course_details
{
string Filename;
string Title;
string Body;
string Duration;
};
course_details offer;
system("cls");
cout << "Give a search name to the Offer(DON NOT PUT SPACES BETWEEN WORDS)\nEx:- New_Year" << endl;
std::getline(std::cin, offer.Filename);
system("cls");
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 13);
cout << "Give a search name to the Offer(DON NOT PUT SPACES BETWEEN WORDS)\nEx:- New_Year" << endl;
HANDLE f = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(f, 15);
std::getline(std::cin, offer.Filename);
HANDLE g = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(g, 13);
cout << endl << endl << "Enter a title for the OFfer(Spaces are allowed)\nEx:-New Year" << endl;
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(h, 15);
std::getline(std::cin, offer.Title);
HANDLE i = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(i, 13);
cout << endl << endl << "Add an overview to the Offer.\n(DO NOT PRESS ENTER UNTIL YOU FINISHED TYPING.JUST TYPE THE BODY AS ONE LINE)" << endl;
HANDLE j = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(j, 15);
std::getline(std::cin, offer.Body);
HANDLE k = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(k, 13);
cout << endl << endl << "Add Offer duration" << endl;
HANDLE l = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(l, 15);
std::getline(std::cin, offer.Duration);
ofstream file;
file.open("C:\\EnoshShanProject\\Defaultinformations\\Offers\\" + offer.Filename + ".txt"); //create a new txt file with entered username in directory folder.
file << "COURSE NAME:- " << (offer.Title);
file << endl << endl << "OVERVIEW\n\n" << (offer.Body);
file << endl << endl << "DURATION\n\n" << (offer.Duration);
file.close();
HANDLE s = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(s, 10);
cout << "\n\nOffer created Successful! Press ENTER to go to main menu";
system("Pause>nul");
mainadmin();
}
//#########################################################################################################################################################
void delete_certificate(string delete_name)
{
ifstream in("C:\\EnoshShanProject\\Defaultinformations\\Graduate\\" + delete_name + ".txt");
if (!in.is_open())
{
system("cls");
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 12);
cout << "\nError......invalid course name. Press ENTER to go to main menu\n";
system("pause>null");
system("cls");
mainadmin();
}
else
{
string filedir1 = "C:\\EnoshShanProject\\Defaultinformations\\Graduate\\" + delete_name + ".txt";
remove(filedir1.c_str());
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 10);
cout << "\nCourse Deleted Successfully\npress ENTER to go to main menu";
system("pause>null");
system("cls");
mainadmin();
}
}
void delete_graduate(string delete_name)
{
ifstream in("C:\\EnoshShanProject\\Defaultinformations\\Certificate\\" + delete_name + ".txt");
if (!in.is_open())
{
system("cls");
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 12);
cout << "\nError......invalid course name. Press ENTER to go to main menu\n";
system("pause>null");
system("cls");
mainadmin();
}
else
{
string filedir1 = "C:\\EnoshShanProject\\Defaultinformations\\Certificate\\" + delete_name + ".txt";
remove(filedir1.c_str());
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 10);
cout << "\nCourse Deleted Successfully\npress ENTER to go to main menu";
system("pause>null");
system("cls");
mainadmin();
}
}
void delete_Offer(string delete_name)
{
ifstream in("C:\\EnoshShanProject\\Defaultinformations\\offers\\" + delete_name + ".txt");
if (!in.is_open())
{
system("cls");
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 12);
cout << "\nError......invalid course name. Press ENTER to go to main menu\n";
system("pause>null");
system("cls");
mainadmin();
}
else
{
string filedir1 = "C:\\EnoshShanProject\\Defaultinformations\\offers\\" + delete_name + ".txt";
remove(filedir1.c_str());
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 10);
cout << "\nOffer Deleted Successfully\npress ENTER to go to main menu";
system("pause>null");
system("cls");
mainadmin();
}
}
//#########################################################################################################################################################
void delete_user()
{
string delete_name;
system("cls");
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 15);
cout << "Enter username to delete a user:- ";
cin >> delete_name;
{
ifstream in("C:\\EnoshShanProject\\" + delete_name + ".txt");
if (!in.is_open())
{
system("cls");
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 12);
cout << "\nError......invalid username. Press Enter to go to main menu\n";
system("pause>null");
system("cls");
mainadmin();
}
else
{
string filedir1 = "C:\\EnoshShanProject\\Defaultinformations\\offers\\" + delete_name + ".txt";
remove(filedir1.c_str());
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 10);
cout << "user Deleted Successfully\npress ENTER to go to main menu";
system("pause>null");
system("cls");
mainadmin();
}
}
}
//#########################################################################################################################################################
void usermainmenu()
{
int choice;
HANDLE a = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(a, 13);//to change text
cout << "\n\nChoose an option from the main menu" << endl << endl;
HANDLE b = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(b, 14);//to change text
cout << "1: Available Certificate programs:\n2: Available Undergraduate programs:\n3: List of Offers\n4: Enter program name and search more details\n5: Change your password\n6: Log out\n7: Exit " << endl;
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 11);//to change text
cout << "your Option: ";
cin >> choice;
switch (choice)
{//Start of switch
case 1:
{//Start of case1
usercase1();
break;
} //End of case 1
case 2:
{
usercase2();
break;
}
case 3:
{
usercase3();
break;
}
case 4:
{
searchcourses();
break;
}
case 5:
{
resetuserpassword();
break;
}
case 6:
{
username = "0";
password = "0";
system("cls");
welcome();
break;
}
case 7:
{
system("cls");
HANDLE b = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(b, 10);//to change text colour
cout << "\n\n\n\n 05.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 11);//to change text colour
cout << "\n\n\n\n 04.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE f = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(f, 14);//to change text colour
cout << "\n\n\n\n 03.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE d = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(d, 12);//to change text colour
cout << "\n\n\n\n 02.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 13);//to change text
cout << "\n\n\n\n 01.Thank you for using our system" << endl << endl;
Sleep(1000);
exit(0);
}
default:
{
system("cls");
int choice = NULL;
cout << "\n--------------------------------------------------------------------------------\nError... Invalid choice. Try again\n\n";
system("pause>null");
cin.clear(); //clear assgned values
cin.ignore(10000, '\n'); //clear assigned values
usermainmenu();
}
}
}
//#########################################################################################################################################################
void usercase1()
{
system("cls");
HANDLE a = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(a, 13);//to change text
cout << "Following are the available Certificate courses" << endl << endl;
string coursename;
show_certificates();
HANDLE b = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(b, 11);//to change text
cout << endl << endl << "Enter course name(without '.txt') to get more details.\n(eg-software_engineering)" << endl << "coures name:-";
cin >> coursename;
string line;
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(h, 9);//to change text
cout << endl << "--------------------------------------------------------------------------------\n--------------------------------------------------------------------------------" << endl;
ifstream myfile("C:\\EnoshShanProject\\Defaultinformations\\Certificate\\" + coursename + ".txt"); //opening exatct course name file
if (myfile.is_open())
{
while (getline(myfile, line))
{
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 15);//to change text
cout << line << '\n'; //read and print the lines in the file
}
myfile.close();
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(h, 9);//to change text
cout << "--------------------------------------------------------------------------------\n--------------------------------------------------------------------------------";
}
else cout << "Invalid Course Name";
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 12);//to change text
cout << endl << endl << "Press G to go back, Press M to go to main menu or press any key to exit" << endl;
string tempnum1;
cin >> tempnum1;
if (tempnum1 == "g" | tempnum1 == "G")
{
system("cls");
usercase1();
}
else if (tempnum1 == "m" | tempnum1 == "M")
{
system("cls");
usermainmenu();
}
else
{
system("cls");
HANDLE b = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(b, 10);//to change text colour
cout << "\n\n\n\n 05.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 11);//to change text colour
cout << "\n\n\n\n 04.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE f = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(f, 14);//to change text colour
cout << "\n\n\n\n 03.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE d = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(d, 12);//to change text colour
cout << "\n\n\n\n 02.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 13);//to change text
cout << "\n\n\n\n 01.Thank you for using our system" << endl << endl;
Sleep(1000);
exit(0);
}
system("Pause>nul");
}//########################################################################################################################################################
void usercase2()
{
system("cls");
HANDLE a = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(a, 13);//to change text
cout << "Following are the available Undergraduate courses" << endl << endl;
string coursename;
show_Graduates();
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 11);//to change text
cout << endl << endl << "Enter course name(without '.txt') to get more details.\n(eg-software_engineering)" << endl << "coures name:-";
cin >> coursename;
string line;
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(h, 9);//to change text
cout << endl << "--------------------------------------------------------------------------------\n--------------------------------------------------------------------------------" << endl;
ifstream myfile("C:\\EnoshShanProject\\Defaultinformations\\graduate\\" + coursename + ".txt"); //opening exatct course name file
if (myfile.is_open())
{
while (getline(myfile, line))
{
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 15);//to change text
cout << line << '\n'; //read and print the lines in the file
}
myfile.close();
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(h, 9);//to change text
cout << "--------------------------------------------------------------------------------\n--------------------------------------------------------------------------------";
}
else cout << "Invalid Course Name";
HANDLE z = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(z, 12);//to change text
cout << endl << endl << "Press G to go back, Press M to go to main menu or press any key to exit" << endl;
string tempnum1;
cin >> tempnum1;
if (tempnum1 == "g" | tempnum1 == "G")
{
system("cls");
usercase2();
}
else if (tempnum1 == "m" | tempnum1 == "M")
{
system("cls");
usermainmenu();
}
else
{
system("cls");
HANDLE b = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(b, 10);//to change text colour
cout << "\n\n\n\n 05.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 11);//to change text colour
cout << "\n\n\n\n 04.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE f = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(f, 14);//to change text colour
cout << "\n\n\n\n 03.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE d = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(d, 12);//to change text colour
cout << "\n\n\n\n 02.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 13);//to change text
cout << "\n\n\n\n 01.Thank you for using our system" << endl << endl;
Sleep(1000);
exit(0);
}
system("Pause>nul");
}
//#########################################################################################################################################################
void usercase3()
{
system("cls");
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 13);//to change text
cout << "Following are the available Offers" << endl << endl;
string Offer;
show_Offers();
HANDLE f = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(f, 11);//to change text
cout << endl << endl << "Enter offer name(without '.txt') to get more details.\n(eg-New_year)" << endl;
HANDLE g = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(g, 11);//to change text
cout<<"offer name:-";
cin >> Offer;
string line;
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(h, 9);//to change text
cout << endl << "--------------------------------------------------------------------------------\n--------------------------------------------------------------------------------" << endl;
ifstream myfile("C:\\EnoshShanProject\\Defaultinformations\\Offers\\" + Offer + ".txt"); //opening exatct course name file
HANDLE j = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(j, 12);//to change text
if (myfile.is_open())
{
while (getline(myfile, line))
{
HANDLE k = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(k, 15);//to change text
cout << line << '\n'; //read and print the lines in the file
}
myfile.close();
HANDLE m = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(m, 9);//to change text
cout << "--------------------------------------------------------------------------------\n--------------------------------------------------------------------------------";
}
else cout << "Invalid Course Name";
HANDLE l = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(l, 12);//to change text
cout << endl << endl << "Press G to go back, Press M to go to main menu or press any key to exit" << endl;
string tempnum1;
cin >> tempnum1;
if (tempnum1 == "g" | tempnum1 == "G")
{
system("cls");
usercase3();
}
else if (tempnum1 == "m" | tempnum1 == "M")
{
system("cls");
usermainmenu();
}
else
{
system("cls");
HANDLE b = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(b, 10);//to change text colour
cout << "\n\n\n\n 05.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE c = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(c, 11);//to change text colour
cout << "\n\n\n\n 04.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE f = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(f, 14);//to change text colour
cout << "\n\n\n\n 03.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE d = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(d, 12);//to change text colour
cout << "\n\n\n\n 02.Thank you for using our system" << endl << endl;
Sleep(1000);
system("cls");
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 13);//to change text
cout << "\n\n\n\n 01.Thank you for using our system" << endl << endl;
Sleep(1000);
exit(0);
}
system("Pause>nul");
}
//#########################################################################################################################################################
void show_certificates()
{
int counter = 1;
WIN32_FIND_DATA search_data;
memset(&search_data, 0, sizeof(WIN32_FIND_DATA));
HANDLE handle = FindFirstFile("C:\\EnoshShanProject\\Defaultinformations\\Certificate\\*.txt*", &search_data);
while (handle != INVALID_HANDLE_VALUE)
{
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 14);//to change text
cout << "\n" << counter << ". " << "Certificate in " << search_data.cFileName;
counter++;
if (FindNextFile(handle, &search_data) == FALSE)
break;
}
//Close the handle after use or memory/resource leak
FindClose(handle);
}
//#########################################################################################################################################################
void show_Graduates()
{
int counter = 1;
WIN32_FIND_DATA search_data;
memset(&search_data, 0, sizeof(WIN32_FIND_DATA));
HANDLE handle = FindFirstFile("C:\\EnoshShanProject\\Defaultinformations\\Graduate\\*.txt*", &search_data);
while (handle != INVALID_HANDLE_VALUE)
{
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 14);//to change text
cout << "\n" << counter << ". " << "Degree in " << search_data.cFileName;
counter++;
if (FindNextFile(handle, &search_data) == FALSE)
break;
}
//Close the handle after use or memory/resource leak
FindClose(handle);
}
void show_Offers()
{
int counter = 1;
WIN32_FIND_DATA search_data;
memset(&search_data, 0, sizeof(WIN32_FIND_DATA));
HANDLE handle = FindFirstFile("C:\\EnoshShanProject\\Defaultinformations\\Offers\\*.txt*", &search_data);
while (handle != INVALID_HANDLE_VALUE)
{
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 14);//to change text
cout << "\n" << counter << ". " << search_data.cFileName;
counter++;
if (FindNextFile(handle, &search_data) == FALSE)
break;
}
//Close the handle after use or memory/resource leak
FindClose(handle);
}
//#########################################################################################################################################################
void searchcourses()
{
string coursename, category;
int choice;
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 13);//to change text
cout << endl << "select a Category You want to view\n\n01. Certificate\n02. Graduate\n\n";
HANDLE d = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(d, 11);//to change text
cout << "Your Choice:- ";
cin >> choice;
HANDLE f = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(f, 11);//to change text
cout << "Enter a Course name to get more details:- ";
cin >> coursename;
search_course_details_by_name(choice, coursename, category);
}
void search_course_details_by_name(int categorynumber, string name, string categoryname)
{
if (categorynumber = 1)
{
categoryname = "Certificate";
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 13);//to change text
system("cls");
cout << "Following are the available Details for " << name <<" "<< categoryname << " course";
search_certificates_by_name(categorynumber, name, categoryname);
}
else if (categorynumber = 2)
{
categoryname = "Undergraduate";
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 13);//to change text
cout << "Following are the available Details for " << name <<" "<< categoryname << " course";
search_graduate_by_name(categorynumber, name, categoryname);
}
else
{
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 12);//to change text
cout << "Error....... Invalid Choice\n\nPress Enter to Go to main menu\n";
system("pause>null");
system("cls");
usermainmenu();
}
}
void search_certificates_by_name(int newnumber, string course_name, string name)
{
string line;
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(h, 9);//to change text
cout << endl << "--------------------------------------------------------------------------------\n--------------------------------------------------------------------------------" << endl;
ifstream myfile("C:\\EnoshShanProject\\Defaultinformations\\certificate\\" + course_name + ".txt"); //opening exatct course name file
if (myfile.is_open())
{
while (getline(myfile, line))
{
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 14);//to change text
cout << line << '\n'; //read and print the lines in the file
}
myfile.close();
HANDLE g = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(g, 9);//to change text
cout << "--------------------------------------------------------------------------------\n--------------------------------------------------------------------------------";
HANDLE f = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(f, 12);//to change text
cout << "Press Enter to Go to main menu\n";
system("pause>null");
system("cls");
usermainmenu();
}
}
void search_graduate_by_name(int newnumber, string course_name, string name)
{
string line;
HANDLE f = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(f, 9);//to change text
cout << endl << "--------------------------------------------------------------------------------\n--------------------------------------------------------------------------------" << endl;
ifstream myfile("C:\\EnoshShanProject\\Defaultinformations\\graduate\\" + course_name + ".txt"); //opening exatct course name file
if (myfile.is_open())
{
while (getline(myfile, line))
{
HANDLE e = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(e, 14);//to change text
cout << line << '\n'; //read and print the lines in the file
}
myfile.close();
HANDLE g = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(g, 9);//to change text
cout << "--------------------------------------------------------------------------------\n--------------------------------------------------------------------------------";
HANDLE f = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(f, 12);//to change text
cout << "Press Enter to Go to main menu\n";
system("pause>null");
system("cls");
usermainmenu();
}
}
//#########################################################################################################################################################
string cusername, cpassword;
string newpassword;
int resetuserpassword()
{
HANDLE f = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(f, 10);//to change text
cout << "Enter your current Username: ";
cin >> cusername;
cout << "Enter your current Password: ";
cin >> cpassword;
string line;
// open input file
ifstream in("C:\\EnoshShanProject\\" + cusername + ".txt");
if (!in.is_open())
{
HANDLE y = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(y, 12);//to change text
cout << "\ninvalid username or password. Press enter to go to main menu\n";
system("pause>null");
system("cls");
usermainmenu();
return 1;
}
bool status = checkchangepassword();
if (!status)
{
HANDLE z = GetStdHandle(STD_OUTPUT_HANDLE); //to change text colour
SetConsoleTextAttribute(z, 12);//to change text
cout << "\ninvalid username or password. Press enter to go to main menu\n";
system("pause>null");
system("cls");
usermainmenu();
}
else
{
// now open temp output file
ofstream file;
file.open("C:\\EnoshShanProject\\" + cusername + "1" + ".txt"); //create a new txt file with entered username in directory folder.
ofstream out("C:\\EnoshShanProject\\" + cusername + "1" + ".txt"); //created text file is called as new out file. entering details will go here.
while (getline(in, line))
{
if (line != cpassword)
out << line << "\n";
}
in.close();
out.close();
cout << "select a new Password: ";
cin >> newpassword;
file << cusername << endl << newpassword;
file.close();
system("cls");
cout << "Password Changed Successfully\n\nPress enter to go back" << endl;
// delete the original file
string filedir1 = "C:\\EnoshShanProject\\" + cusername + ".txt";
string filedir2 = "C:\\EnoshShanProject\\" + cusername + "1" + ".txt";
remove(filedir1.c_str()); // Remove old file
rename(filedir2.c_str(), filedir1.c_str()); // rename new file to Old file name
system("pause>null");
system("cls");
usermainmenu();
return 0;
}
}
bool checkchangepassword()
{
string un, pw;
ifstream read("C:\\EnoshShanProject\\" + cusername + ".txt");
getline(read, un);
getline(read, pw);
if (un == cusername && pw == cpassword)
{
return true;
}
else
{
return false;
}
}
//#########################################################################################################################################################
void create_directries_fordefault_details()
{
create();
CreateDirectory("C:\\EnoshShanProject\\Defaultinformations", NULL); //create a new folder
CreateDirectory("C:\\EnoshShanProject\\Defaultinformations\\Certificate", NULL); //create a new folder for certificate information
CreateDirectory("C:\\EnoshShanProject\\Defaultinformations\\Graduate", NULL);//create a new folder graduate Details
CreateDirectory("C:\\EnoshShanProject\\Defaultinformations\\Offers", NULL);//create a new folder offer Details
ofstream file;
file.open("C:\\EnoshShanProject\\user.txt"); //create a new txt file for default user in directory folder.
file << "user" << endl << "user";
file.close();
default_details_certificate();
default_details_Graduate();
default_details_offers();
}
//#########################################################################################################################################################
void default_details_certificate()
{
struct course_details
{
string Title;
string Location;
string Body;
string Duration;
string Req_qul;
string Subjects;
};
course_details thecourse;
course_details thecourse2;
course_details thecourse3;
course_details thecourse4;
ofstream file;
file.open("C:\\EnoshShanProject\\Defaultinformations\\Certificate\\software_engineering.txt"); //create a new txt file with entered username in directory folder.
file << (thecourse.Title = "Course Name:- software engineering") << endl << endl << (thecourse.Location = "Location:- Colombo campus") << endl << endl;
file << (thecourse.Body = "Overview\n\nThis has been accredited by Edexcel International to conduct the internationally recognized Edexcel HND Programmes. The Course Curriculum of HND in Computing and Software Development is specially designed to enhance the skills and knowledge of students who wish to obtain a Job Oriented qualification to match the requirements of the dynamic IT industry. our institute has designed the curriculum such as it provides variety of subjects to match the industrial expectations. HND in Computing and Software Development also provides a pathway to obtain an academic qualification by completing only the final year of B.Sc/BEng Honours Degree.");
file << endl << endl << (thecourse.Duration = "Duration\n\nFull Time:- Monday to Friday 9:00 am to 3:00 pm for 24 Months\nPart Time:- Saturday and / or Sunday 9.30 am to 4.30 pm for 28 Months");
file << endl << endl << (thecourse.Req_qul = "Minimum Entry Requirements\n\n* GCE (A/L) 2 passes or Pending A/L Results - any Stream with\nEnglish and Mathematics at O/L OR\n* Certificate in HRM from HRMI OR equivalent OR\n* GCE (O/L) with English and Mathematics and 2 years work experience");
file << endl << endl << (thecourse.Subjects = "Modules\n\n01. Computer Systems\n02. System Analysis and Design\n03. Procedural Programming\n04.Networking Technologies\n05. Information Systems in Organization\n06. Data Analysis and Design\n07. Object Oriented Programming\n08. Business Skills for e - Commerce\n09. Management of Projects\n10. Employability and Professional Development\n11. Web Application Development\n12. Programming in Java\n13. Data Structures and Algorithms\n14. Programming in.NET\n15. IT Security Management\n16. Project Design, Implementation and Evaluation\n17. Software Development Project");
file.close();
//----------------------------------------------------------------------
ofstream file2;
file.open("C:\\EnoshShanProject\\Defaultinformations\\Certificate\\Computer_Applications.txt"); //create a new txt file with entered username in directory folder.
file << (thecourse2.Title = "Course Name:- Computer Applications") << endl << endl << (thecourse2.Location = "Location:- Colombo campus") << endl << endl;
file << (thecourse2.Body = "Overview\n\nThe course will guide the participants to use computers as a tool for Creativity, Communication and organizing information. Also this will help to fabricate your skills in researching information, Publishing your creative work and using computers effectively for your routine day today work.");
file << endl << endl << (thecourse2.Duration = "Duration\n\nFull Time:- Monday to Friday 9:00 am to 3:00 pm for 3 Months\nPart Time:- Saturday and / or Sunday 9.30 am to 4.30 pm for 5 Months");
file << endl << endl << (thecourse2.Req_qul = "Minimum Entry Requirements\n\n* GCE (A/L) 2 passes or Pending A/L Results - any Stream with\nEnglish and Mathematics at O/L OR\n* Certificate in HRM from HRMI OR equivalent OR\n* GCE (O/L) with English and Mathematics and 2 years work experience");
file << endl << endl << (thecourse2.Subjects = "Modules\n\n01. Introduction\n02. Word Processing (MS Word 2010)\n03. Spread Sheets (MS Excel 2010)\n04.Presentations (MS Power Point 2010)\n05. Photo editing (Adobe Photoshop)\n06. Desktop Publishing (Adobe In Design)\n07. Video Editing (Adobe Premier)\n08. Web Page designing (Adobe Dreamweaver )\n09. Internet");
file.close();
//----------------------------------------------------------------------
ofstream file3;
file.open("C:\\EnoshShanProject\\Defaultinformations\\Certificate\\Software_Development_in_Java.txt"); //create a new txt file with entered username in directory folder.
file << (thecourse3.Title = "Course Name:- Software Development in Java") << endl << endl << (thecourse.Location = "Location:- Colombo campus") << endl << endl;
file << (thecourse3.Body = "Overview\n\nIn this course you will be given hands on experience to object-oriented software development that are widely applicable in the creation of software that meets the needs of its users: from small, simple systems to large ones. After completing this course participants should be able to develop software applications that meets client requirement.");
file << endl << endl << (thecourse3.Duration = "Duration\n\nFull Time:- Monday to Friday 9:00 am to 3:00 pm for 6 Months\nPart Time:- Saturday and / or Sunday 9.30 am to 4.30 pm for 10 Months");
file << endl << endl << (thecourse3.Req_qul = "Minimum Entry Requirements\n\n* GCE (A/L) 2 passes or Pending A/L Results - any Stream with\nEnglish and Mathematics at O/L OR\n* Certificate in HRM from HRMI OR equivalent OR\n* GCE (O/L) with English and Mathematics and 2 years work experience");
file << endl << endl << (thecourse3.Subjects = "Modules\n\n01. Introduction to Software Engineering principles.\n02. Unified Modeling Language (UML).\n03. Introduction to computer programming.\n04. Data structures & Control statements.\n05. Object oriented programming concepts.\n06. Graphical User Interface designing and Event handling.\n07. Exception Handling in Java.\n08. Multithreading.\n09. Files and Streams.\n10. The Collections Framework.\n11. Structured Query Language.\n12. Java Database Connectivity.\n13. Web Application Development using JSP and Servlets.\n14. Application development using NetBeans.");
file.close();
//----------------------------------------------------------------------
ofstream file4;
file.open("C:\\EnoshShanProject\\Defaultinformations\\Certificate\\Computer_Networking_&_Administration.txt"); //create a new txt file with entered username in directory folder.
file << (thecourse4.Title = "Course Name:- Computer Networking & Administration") << endl << endl << (thecourse.Location = "Location:- Colombo campus") << endl << endl;
file << (thecourse4.Body = "Overview\n\nAfter successful completion of the program, participants should be able to :\n01. Acquire theoretical and practical knowledge on computer networking\n02. Setup, configure and maintain Local Area Networks and common Networking Services");
file << endl << endl << (thecourse4.Duration = "Duration\n\nFull Time:- Monday to Friday 9:00 am to 3:00 pm for 6 Months\nPart Time:- Saturday and / or Sunday 9.30 am to 4.30 pm for 10 Months");
file << endl << endl << (thecourse4.Req_qul = "Minimum Entry Requirements\n\n* GCE (A/L) 2 passes or Pending A/L Results - any Stream with\nEnglish and Mathematics at O/L OR\n* Certificate in HRM from HRMI OR equivalent OR\n* GCE (O/L) with English and Mathematics and 2 years work experience");
file << endl << endl << (thecourse4.Subjects = "Modules\n\n01. Introduction.\n02. Windows 2008/2012 Server Setup and Administration.\n03. Web Server Setup and Administration.\n04. Setup, Configuration and Administration of Mail Server.\n05. Network Security.\n06. Introduction to Networking with Linux.\n07. WAN.");
file.close();
}
//#########################################################################################################################################################
void default_details_Graduate()
{
struct course_details
{
string Title;
string Location;
string Body;
string Duration;
string Req_qul;
string Subjects;
};
course_details thecourse;
course_details thecourse2;
course_details thecourse3;
course_details thecourse4;
ofstream file;
file.open("C:\\EnoshShanProject\\Defaultinformations\\Graduate\\Computer_System_Design.txt"); //create a new txt file with entered username in directory folder.
file << (thecourse.Title = "Course Name:- Computer System Design") << endl << endl << (thecourse.Location = "Location:- Colombo campus") << endl << endl;
file << (thecourse.Body = "Overview\n\nThe course provides the knowledge in Computer Programming and Systems Analysis & Design to Work in Business and Industrial Environments.");
file << endl << endl << (thecourse.Duration = "Duration\n\nFull Time:- Monday to Friday 9:00 am to 3:00 pm for 24 Months\nPart Time:- Saturday and / or Sunday 9.30 am to 4.30 pm for 28 Months");
file << endl << endl << (thecourse.Req_qul = "Minimum Entry Requirements\n\n* 2 Passes at GCE A/L or/n*. Credits at GCE O/L including Maths and English or/n*. Successfully completed the Certificate Course in Software Engineering at Mister Mind Institute.");
file << endl << endl << (thecourse.Subjects = "Modules\n\n01. Introduction to Computer Science.\n02. Quantitative Techniques for Computing.\n03. Data Structures and C Language.\n04. Computer Technology.\n05. OOP with C++\n06. Database Management Systems.\n07. Computer Architecture.\n08. Internet Technology.\n09. System Software.\n10. Programming in Visual Basic.NET.\n11. Programming in JAVA.\n12. Business Information Systems.\n13. Systems Analysis and Design.\n14. Systems Design Project.");
file.close();
//----------------------------------------------------------------------
ofstream file2;
file.open("C:\\EnoshShanProject\\Defaultinformations\\Graduate\\Software_Engineering.txt"); //create a new txt file with entered username in directory folder.
file << (thecourse2.Title = "Course Name:- Software Engineering") << endl << endl << (thecourse2.Location = "Location:- Colombo campus") << endl << endl;
file << (thecourse2.Body = "Overview\n\nAfter completing this course: You will gain the ability to meet the needs of the latest trends in the software industry and a broad range of skills for effective participation in a software development team and hence be able to compete effectively for positions in the software industry");
file << endl << endl << (thecourse2.Duration = "Duration\n\nFull Time:- Monday to Friday 9:00 am to 3:00 pm for 3 Months\nPart Time:- Saturday and / or Sunday 9.30 am to 4.30 pm for 5 Months");
file << endl << endl << (thecourse2.Req_qul = "Minimum Entry Requirements\n\n* 2 passes at GCE A/L or 5 Credits at GCE O/L including Maths and English \nworking experience or successfully completed the Certificate Course in Computer Science (CCS).");
file << endl << endl << (thecourse2.Subjects = "Modules\n\n01. Introduction to Computer Science\n02. Quantitative Techniques for Computing\n03. Data Structures & C Language\n04.Computer Technology\n05. OOP with C++\n06. Database Management Systems.\n07. Computer Architecture.\n08. Internet Technology.\n09. System Software.\n10. Business Information Systems\n11. JAVA\n12. Software Engineering\n13. Enterprise Application Development with JAVA\n14. Software Development Project");
file.close();
//----------------------------------------------------------------------
ofstream file3;
file.open("C:\\EnoshShanProject\\Defaultinformations\\Graduate\\Information_Systems .txt"); //create a new txt file with entered username in directory folder.
file << (thecourse3.Title = "Course Name:- Software Development in Java") << endl << endl << (thecourse.Location = "Location:- Colombo campus") << endl << endl;
file << (thecourse3.Body = "Overview\n\nAfter successful completion of the program, participants should be able to apply the knowledge in Management of Information Systems");
file << endl << endl << (thecourse3.Duration = "Duration\n\nFull Time:- Monday to Friday 9:00 am to 3:00 pm for 6 Months\nPart Time:- Saturday and / or Sunday 9.30 am to 4.30 pm for 10 Months");
file << endl << endl << (thecourse3.Req_qul = "Minimum Entry Requirements\n\n* GCE (A/L) 2 passes or Pending A/L Results - any Stream with\nSuccessfully Followed the Diploma in Computer System Design");
file << endl << endl << (thecourse3.Subjects = "Modules\n\n01. Management Practices.\n02. Software Engineering. (UML).\n03. Data Structures and Algorithms.\n04. Advanced Database Management Systems.\n05. Advanced Database Management Systems.\n06. Computer Architecture.\n07. Object Oriented Programming and Design I.\n08. Agile Software Development Practices.\n09. Software Quality Assurance.\n10. Data Warehousing and Data Mining.\n11. Object Oriented Programming and Design II.\n12. Business Statistics for Information Technology.\n13. WDistributed Processing.\n14. Operational Research\n15. Software Development Project");
file.close();
//----------------------------------------------------------------------
ofstream file4;
file.open("C:\\EnoshShanProject\\Defaultinformations\\Graduate\\Computer_Networking_&_Administration.txt"); //create a new txt file with entered username in directory folder.
file << (thecourse4.Title = "Course Name:- Computer Networking & Administration") << endl << endl << (thecourse.Location = "Location:- Colombo campus") << endl << endl;
file << (thecourse4.Body = "Overview\n\nAfter successful completion of the program, participants should be able to :\n01. advance their education and careers in different aspects of Information Technology.\n02. perform all activities related to the networking and network administration function of an organization.");
file << endl << endl << (thecourse4.Duration = "Duration\n\nFull Time:- Monday to Friday 9:00 am to 3:00 pm for 6 Months\nPart Time:- Saturday and / or Sunday 9.30 am to 4.30 pm for 10 Months");
file << endl << endl << (thecourse4.Req_qul = "Minimum Entry Requirements\n\n* GCE (A/L) 2 passes or Pending A/L Results - any Stream with\nEnglish and Mathematics at O/L OR\n* Certificate in HRM from HRMI OR equivalent OR\n* GCE (O/L) with English and Mathematics and 2 years work experience");
file << endl << endl << (thecourse4.Subjects = "Modules\n\n01. Introduction to Computer Science\n02. Quantitative Techniques for Computing\n03. Data Structures & C Language\n04.Computer Technology\n05. OOP with C++\n06. Database Management Systems.\n07. Computer Architecture.\n08. Internet Technology.\n09. System Software.\n10. Business Information Systems\n11. Data communication and Networking\n12. Networking and system Administration\n13. Information Security\n14. Software Development Project\n15. Computer Networking Project");
file.close();
}
//#########################################################################################################################################################
void default_details_offers()
{
struct offer_details
{
string Title;
string Body;
string Duration;
};
offer_details theoffer;
offer_details theoffer2;
ofstream file;
file.open("C:\\EnoshShanProject\\Defaultinformations\\Offers\\New_Year.txt"); //create a new txt file with entered username in directory folder.
file << (theoffer.Title = "Offer Name:- Computer System Design") << endl << endl;
file << (theoffer.Body = "Overview\n\nRegister to any cousrse in our institute during below time period and get a special offer. You will get 30% of discount for your course. Hurry up!! this is the the very time to get your chance.");
file << endl << endl << (theoffer.Duration = "Valid Duration\n\n from 1st of January 2016 to 31st of January 2016");
file.close();
//----------------------------------------------------------------------
ofstream file2;
file.open("C:\\EnoshShanProject\\Defaultinformations\\Offers\\10th_year_aniversary.txt"); //create a new txt file with entered username in directory folder.
file << (theoffer.Title = "Offer Name:- Computer System Design") << endl << endl;
file << (theoffer.Body = "Overview\n\nRegister to psychology course in our institute during below time period and get a special offer. You will get 40% of discount for your course. Hurry up!! this is the the very time to get your chance.");
file << endl << endl << (theoffer.Duration = "Valid Duration\n\n from 1st of December 2015 to 31st of December 2015");
file.close();
}
//#########################################################################################################################################################
// I got this change front size sorce cord here - http://cboard.cprogramming.com/c-programming/157954-changing-font-size-colour.html
int GetFontSize(HANDLE windowHandle, COORD *size)
{
CONSOLE_FONT_INFOEX font = { sizeof(CONSOLE_FONT_INFOEX) };
if (!GetCurrentConsoleFontEx(windowHandle, 0, &font))
{
return 0;
}
*size = font.dwFontSize;
return 1;
}
int SetFontSize(HANDLE windowHandle, COORD size)
{
CONSOLE_FONT_INFOEX font = { sizeof(CONSOLE_FONT_INFOEX) };
if (!GetCurrentConsoleFontEx(windowHandle, 0, &font))
{
return 0;
}
font.dwFontSize = size;
if (!SetCurrentConsoleFontEx(windowHandle, 0, &font))
{
return 0;
}
return 1;
}
int changefontsize(void)
{
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
COORD size;
if (GetFontSize(h, &size))
{
/* Grow by 50% */
size.X += (SHORT)(size.X * .15);
size.Y += (SHORT)(size.Y * .15);
SetFontSize(h, size);
}
return EXIT_SUCCESS;
}
//#########################################################################################################################################################
void main()
{
create_directries_fordefault_details();
changefontsize();
welcome();
system("Pause>nul");
}
No comments:
Post a Comment
lakshanenosh@gmail.com