41 lines
1.0 KiB
C++
41 lines
1.0 KiB
C++
#include "headers/Interface.h"
|
|
|
|
void interface_member() {
|
|
int id;
|
|
string password;
|
|
cout << "\nPlease input id:";
|
|
cin >> id;
|
|
Customer c = query_customer_with_id(id);
|
|
cout << "\nPlease input password:";
|
|
cin >> password;
|
|
while (!(verify_password(c.password, password))){
|
|
cout << "ERROR: wrong password. Please retype your password \n";
|
|
cin >> password;
|
|
}
|
|
cout << "Logged in succesfully\n";
|
|
|
|
// if (verify_password(c.password, password)) {
|
|
// cout << "\nLogged in successfully.";
|
|
// } else {
|
|
// cout
|
|
// << "Error, id and password combination not found, please try again.";
|
|
// }
|
|
}
|
|
|
|
void interface_admin() {}
|
|
|
|
void interface() {
|
|
int selector;
|
|
cout << "\nHello and welcome to the parking spot! Please select a suitable "
|
|
"option:";
|
|
cout << "\n[1]Log in as member";
|
|
cout << "\n[2]Log in as administrator";
|
|
cin >> selector;
|
|
switch (selector) {
|
|
case 1:
|
|
interface_member();
|
|
case 2:
|
|
interface_admin();
|
|
}
|
|
}
|