32 lines
780 B
C++
32 lines
780 B
C++
#ifndef DB_H
|
|
#define DB_H
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include "user.h"
|
|
|
|
struct Student {
|
|
int id;
|
|
std::string nom;
|
|
int notes[3];
|
|
};
|
|
|
|
// --- Connexion et fermeture ---
|
|
bool openDB(const std::string& filename);
|
|
void closeDB();
|
|
|
|
// --- Authentification ---
|
|
int loginUser(const std::string& login, const std::string& password);
|
|
|
|
// --- Étudiants ---
|
|
std::vector<Student> getAllStudents(); // ADMIN/PROF
|
|
Student getStudentByLogin(const std::string& login); // STUDENT
|
|
|
|
// --- Notes ---
|
|
bool updateNote(int studentId, int noteIndex, int newNote);
|
|
|
|
// --- Export / Import ---
|
|
bool exportData(const std::string& filename, const std::string& role, const std::string& login);
|
|
bool importData(const std::string& filename, const std::string& role);
|
|
|
|
#endif |