-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
79 lines (72 loc) · 1.91 KB
/
main.c
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
#include <stdio.h>
#include <stdlib.h>
#include "./types/structures.c"
#include "./functions/product.c"
#include "./functions/seller.c"
#include "./functions/stock.c"
#include "./functions/warehouse.c"
#include "./functions/report.c"
#include "./functions/supplier.c"
#define ANSI_COLOR_GREEN "\x1b[32m"
#define ANSI_COLOR_RESET "\x1b[0m"
int main() {
printf(ANSI_COLOR_GREEN "Hello Welcome!" ANSI_COLOR_RESET "\n");
printf("+----+------------------------+\n");
printf("| %2d | %-22s |\n", 1, "Manage Products");
printf("| %2d | %-22s |\n", 2, "Management Stocks");
printf("| %2d | %-22s |\n", 3, "Manage Suppliers");
printf("| %2d | %-22s |\n", 4, "Warehouse Management");
printf("| %2d | %-22s |\n", 5, "Seller Management");
printf("| %2d | %-22s |\n", 6, "Reports");
printf("+----+------------------------+\n");
int choice;
printf("Enter your choice: ");
scanf("%d", &choice);
switch (choice) {
case 1:
manage_product();
system("clear");
main();
break;
case 2:
manage_stock();
system("clear");
main();
break;
case 3:
manage_suppliers();
system("clear");
main();
break;
case 4:
manage_warehouse();
system("clear");
main();
break;
case 5:
manage_sellers();
system("clear");
main();
break;
case 6:
manage_reports();
system("clear");
main();
break;
default:
printf("Invalid choice\n");
break;
}
return 0;
}
void print_menu() {
printf("+----+------------------------+\n");
printf("| %2d | %-22s |\n", 1, "Manage Products");
printf("| %2d | %-22s |\n", 2, "Management Stocks");
printf("| %2d | %-22s |\n", 3, "Manage Suppliers");
printf("| %2d | %-22s |\n", 4, "Warehouse Management");
printf("| %2d | %-22s |\n", 5, "Order Management");
printf("| %2d | %-22s |\n", 6, "Seller Management");
printf("| %2d | %-22s |\n", 7, "Reports");
printf("+----+------------------------+\n");
}