61 lines
1.3 KiB
C
61 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
|
|
//admin_menu();//refers to admin_user.h
|
|
check = true;
|
|
break;
|
|
case 2://normal user
|
|
normal_menu();//refers to normal_user.h
|
|
check = true;
|
|
break;
|
|
case 3://exit
|
|
check = false;
|
|
break;
|
|
default://invalid input
|
|
printf("Invalid choice...press any key to retry....\n");
|
|
fflush(stdin);
|
|
getchar();
|
|
check = true;
|
|
|
|
break;
|
|
}
|
|
|
|
fflush(stdin);
|
|
} while (check);
|
|
|
|
return 0;
|
|
} |