sba/main.c
2022-08-27 11:39:59 +08:00

54 lines
1.1 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>
#endif
#ifndef CUSTOM_H
#define CUSTOM_H
#include "database.h"
#endif // !CUSTOM_H
#ifndef MENU_H
#define MENU_H
#include "menu.h"
#endif //MENU_H
#include "normal_user.h"
#include "admin_user.h"
int main(){
bool check;
do
{
//print welcome message
//prompt weather user is admin or normal user
//then redirect them to the corisponding menu
welcome_message();//refer to menu.h, keep things easier for repeat use on future
int choice = user_choices();//same as above
switch (choice)
{
case 1://admin
check = admin_menu();//refers to admin_user.h
break;
case 2://normal user
check = normal_menu();//refers to normal_user.h
break;
case 3://exit
check = false;
break;
default://invalid input
printf("Invalid choice\n");
check = false;
break;
}
} while (check);
return 0;
}