31 lines
683 B
C++
31 lines
683 B
C++
#include <iostream>
|
|
#include "database/Database.h"
|
|
#include "services/AuthService.h"
|
|
#include "services/ExportService.h"
|
|
|
|
int main() {
|
|
Database db;
|
|
db.connect("localhost", "root", "password", "studentdb");
|
|
|
|
std::string username;
|
|
std::string password;
|
|
|
|
std::cout << "Username: ";
|
|
std::cin >> username;
|
|
std::cout << "Password: ";
|
|
std::cin >> password;
|
|
|
|
User* user = AuthService::login(db, username, password);
|
|
|
|
if (user) {
|
|
std::cout << "\nConnexion réussie.\n";
|
|
user->displayMenu();
|
|
|
|
ExportService::exportData(user);
|
|
} else {
|
|
std::cout << "Connexion échouée.\n";
|
|
}
|
|
|
|
db.disconnect();
|
|
return 0;
|
|
} |