sba/main.c
2023-11-07 01:07:45 +08:00

59 lines
1.2 KiB
C

//include std lib if they havent been included
#ifndef STD_LIB_H
#define STD_LIB_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <time.h>
#include <ctype.h>
#include <stddef.h>
#endif
#ifndef CUSTOM_H
#define CUSTOM_H
#include "database.h"
#endif // !CUSTOM_H
#include "admin_user.h"
#include "normal_user.h"
#ifndef Utils
#define Utils
#include "sorting.h"
#include "utils.h"
#endif // !Utils
int main(){
bool check;
do{
Cls();
//print welcome message
//prompt weather user is admin or normal user
//then redirect them to the corisponding menu
int choice = choices_selecter((char*[]){
"Admin",
"Normal User"
},2,welcome_message(NULL));
switch (choice)
{
case 1://admin
admin_menu();//refers to admin_user.h
check = true;
break;
case 2://normal user
normal_menu();//refers to normal_user.h
check = true;
break;
default://Exit
check = false;
break;
}
fflush_stdin();
} while (check);
return 0;
}