added admin

This commit is contained in:
MassiveAtoms
2019-07-09 09:17:33 -03:00
parent 5e2b91fda6
commit 3c7d7121e2
11 changed files with 123 additions and 19 deletions

21
headers/Admin.h Normal file
View File

@@ -0,0 +1,21 @@
#ifndef ADMIN_H
#define ADMIN_H
#pragma once
#include "data.h"
class Admin {
public:
int id;
string name;
string password;
Admin(string name_, string password_);
Admin(int id_, string name_, string password);
// private:
void update_db();
void save_db();
int auto_increment_db();
};
#endif // CUSTOMER_H

View File

@@ -3,7 +3,6 @@
#pragma once
#include "Park_time.h"
#include "data.h"
#include <vector>

View File

@@ -10,4 +10,5 @@ void interface_member(vector<Park_spot>& spots);
void interface_admin(vector<Park_spot>& spots);
void park(Customer& c, vector<Park_spot>& spots);
void new_customer();
void new_parkspot(vector<Park_spot>& spots);
void new_parkspot(vector<Park_spot>& spots);
void new_admin();

View File

@@ -3,6 +3,7 @@
#pragma once
#include "Park_spot.h"
#include "Admin.h"
/*these are the functions that search the database and create objects from it.
@@ -25,7 +26,7 @@ customers who have the same name.
2. I have no clue how many of you have done error handling in c++
(try/catch/finally).
Ya boi is nice and doesn't want to bombard you with more new concepts than needed.
I dont want to bombard you with more new concepts than needed.
so now you'd do
vector<Customer> test = query_customer_with_name("Testman");
@@ -46,9 +47,6 @@ finally{
do more stuff
}
3. Ya boi needs to brush up on how to create custom exceptions class, and it will complicate code
furhter.
*/
vector<Park_time> query_parktimes_for_customer(int cid);
@@ -56,12 +54,11 @@ vector<Park_time> query_parktimes_for_customer(int cid);
vector<Customer> query_customer_with_name(string name);
Customer query_customer_with_id(int id);
Admin query_admin_with_id(int id);
vector<Park_spot> populate_spots();
Park_spot query_parkspot_with_id(int id, vector<Park_spot>& parkspots);
void reports_from_parkspot(int spotid, bool weekly = false);
void reports_from_allparkspots(bool weekly = false);
void current_status_parkspots(vector<Park_spot>& spots);
#endif // CUSTOMER_H