sba/main.c

59 lines
1.3 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>
#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
{
system("cls");
//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...press anykey to retry....\n");
fflush(stdin);
getchar();
check = true;
break;
}
fflush(stdin);
} while (check);
return 0;
}