#ifndef MYSQL_QUERY_H #define MYSQL_QUERY_H #include #define MYSQL_HOST "127.0.0.1" #define MYSQL_USER "root" #define MYSQL_PASS "moumouh" #define MYSQL_DB "inpres-hopital" class mysqlQuery { public: static std::string roomGetAll() { return string("SELECT * FROM room"); }; static std::string roomGet(int id) { return string(""); }; static std::string bookGetAll() { return string("SELECT * FROM reservations"); }; static std::string bookGetByRoom(std::string r) { return string("SELECT * FROM reservations WHERE idroom='") + r + string("'"); }; static std::string bookGetByName(std::string r) { return string("SELECT * FROM reservations WHERE nom='") + r + string("'"); }; static std::string getUsers() { return string("SELECT * FROM users"); }; static std::string getUser(std::string l) { return string("SELECT * FROM users WHERE login='") + l + string("'"); }; static std::string getUser(std::string l, std::string p) { return string("SELECT * FROM users WHERE login='") + l + string("' AND pass='") + p + string("'"); }; static std::string insertBook(std::string num, std::string nom, std::string nbr, std::string date) { return string("INSERT INTO reservations(numroom,nom,nbr_nuit,date_arrive) VALUES('") + num + string("', '") + nom + string("', '") + nbr + string("', '") + date + string("')"); }; static std::string deleteBook(std::string num, std::string nom, std::string nbr, std::string date) { return string("DELETE FROM reservations WHERE numroom='") + num + string("' AND nom='") + nom + string("' AND date_arrive='") + date + string("'"); }; }; #endif