-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.h
More file actions
88 lines (76 loc) · 2.21 KB
/
header.h
File metadata and controls
88 lines (76 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#pragma once
#include<iostream> //print to screen
#include<limits.h> //INT_MAX
#include<cstring> //strcat, strcpy
#include<iomanip> //format output
#include<fstream> //file operation
#include<sstream> //print table in view course and show score easily
#include<time.h> //get real time in check-in function
#include<direct.h> //create directory
using namespace std;
const int wholeRange = 80, numRange = 6;
const int usernameLimit = 10, fullnameLimit = 30, emailLimit = 27,
mobileLimit = 12, passwordLimit = 10, ClassLimit = 10;
const int courseCodeLimit = 10, yearLimit = 5, semesterLimit = 2, courseNameLimit = 50,
dayLimit = 11, timeLimit = 6;
const int checktimeLimit = 30;
const char pathMain[]{ "data" };
const char pathCourse[]{ "course" }, pathClass[]{ "class" },
pathScore[]{ "score" }, pathPresence[]{ "presence" };
const char fileUser[]{ "users" }, fileCourse[]{ "courses" }, fileClass[]{ "classes" };
struct user {
char username[usernameLimit]{};
char fullname[fullnameLimit]{};
char email[emailLimit]{};
char mobile[mobileLimit]{};
enum category { student, academicStaff, lecturer }type;
char password[passwordLimit]{};
char Class[ClassLimit]{};
user*next = NULL;
};
struct course {
char courseCode[courseCodeLimit]{};
char year[yearLimit]{};
char semester[semesterLimit]{};
char courseName[courseNameLimit]{};
char lecturerUsername[usernameLimit]{};
char startAt[dayLimit]{};
char endAt[dayLimit]{};
struct {
char from[timeLimit]{};
char to[timeLimit]{};
}day[6]{};
struct student {
char ID[usernameLimit]{};
float mid = 0;
float lab = 0;
float final = 0;
int timecheck = 0;
time_t checktime[checktimeLimit]{};
student*next = NULL;
}*stuhead = NULL;
course*next = NULL;
};
struct classes {
char Class[ClassLimit]{};
struct student {
char ID[usernameLimit]{};
student*next = NULL;
}*stuhead = NULL;
classes*next = NULL;
};
extern user*User;
extern course*Course;
extern classes*Classes;
void optionForm(char*title, char &var, int titleRange);
void menuForm(int num, char*title);
void notifyForm(char*title);
void start();
bool SignIn();
bool SignUp();
void initAndShowUser();
void initAndShowCourse();
void initAndShowClass();
void delAndSaveUser();
void delAndSaveCourse();
void delAndSaveClass();