forked from rajarshikhare/College-research-grant-system
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadminui.cpp
More file actions
44 lines (41 loc) · 1.47 KB
/
adminui.cpp
File metadata and controls
44 lines (41 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "adminoperationui.cpp"
void adminui(){
std::cin.ignore();
system("cls");
credentials c;
std::cout << "\n\t\t*********************** WELCOME TO Administrator PORTAL **************************"<<std::endl<<std::endl<<std::endl<<std::endl<<std::endl;
std::string collegename,password;
std::cout << " ----------------------" << std::endl;
std::cout << " Enter the admin name : "<<std::endl;;
std::cout << " ----------------------"<<std::endl;
std::cout << "\n Password : ";
std::cout << "\n ----------------------"<<std::endl;
gotoxy(58,7);
c.getusername();
//std::cout << "\n\n Password : ";
gotoxy(58,10);
c.getpassword();
adminkey(c);
}
int adminkey(credentials c){
std::fstream fp;
std::string fileusername,filepassword;
fp.open("csv files/admincredentials.csv",std::ios::in);
while(1)
{
getline(fp,fileusername,',');
getline(fp,filepassword,'\n');
if( fileusername == c.username && filepassword == c.password ){
fp.close();
adminoperation();
return 1;
}
if( fp.eof() ){
fp.close();
std::cout <<"\n\n\t\t\t\tPassword and Username combination not found\n"<< std::endl;
break;
}
}
system("pause");
return 0;
}