-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.h
147 lines (127 loc) · 3.79 KB
/
header.h
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <time.h>
#include <windows.h>
#define STATIC_FILE "statis.bin"
#define NOTA_FILE "nota.bin"
#define JUMLAH_MEJA 20
#define FILENAME "nomor.txt"
#define MENU_PESANAN { \
{1, "Grilled Sandwich", 40900}, \
{2, "Granola", 36800}, \
{3, "Croissant", 30100}, \
{4, "Caesar Salad", 25900}, \
{5, "Carbonara", 35800}, \
{6, "Chicken Wings", 40800}, \
{7, "Signature Fried Rice", 45900}, \
{8, "Mineral Water", 10500}, \
{9, "Signature Tea", 30900}, \
{10, "Oolong Rain Tea", 25900}, \
{11, "Me-Espresso", 37800}, \
{12, "Mochalatte", 36900}, \
{13, "Lattearth", 37900}, \
{14, "Koomboocha", 32900} \
}
typedef char string[200];
extern int MEJA[20];
typedef struct{
float omset;
int ID[14];
} Statis;
extern Statis Stat;
typedef struct{
int id;
string nama;
float harga;
} Menu;
typedef struct Child* AddressChild;
typedef struct Parent* AddressParent;
// DATA STRUKTUR UNTUK ITEM PESANAN (CHILD)
typedef struct DataChild {
string namaItem;
int jumlah;
float harga;
float subtotal;
} DataChild;
// DATA STRUKTUR UNTUK NOTA (PARENT)
typedef struct DataParent {
int nomorNota;
string tanggal;
int nomorMeja;
float totalPembelian;
bool status;
} DataParent;
// STRUKTUR NODE CHILD (ITEM PESANAN)
typedef struct Child {
DataChild dataChild;
AddressChild next;
} NodeChild;
// STRUKTUR NODE PARENT (NOTA)
typedef struct Parent {
DataParent dataParent;
AddressParent next;
AddressChild firstChild;
AddressParent merged;
} NodeParent;
// STRUKTUR MULTILIST
typedef struct {
AddressParent firstParent;
} Multilist;
// SOURCE.C
void createEmpty(Multilist *L);
bool isEmpty(Multilist L);
DataParent makeDataParent(int nomor, string tanggal, int meja);
AddressParent alokasiParent(DataParent data);
AddressParent findParent(Multilist L, int nomorNota);
void insertFirstParent(Multilist *L, DataParent data);
void insertLastParent(Multilist *L, DataParent data);
void deleteParent(Multilist *L, int nomorNota);
DataChild makeDataChild(string nama, int jumlah, float harga);
AddressChild alokasiChild(DataChild data);
void insertFirstChild(Multilist L, int nomorNota, DataChild data);
void insertLastChild(Multilist L, int nomorNota, DataChild data);
void deleteChild(Multilist *L, int nomorNota, string namaItem);
// NOTA.C
void mergeNota(Multilist *L, Multilist *L2);
void splitNota(Multilist *L, Multilist *L2);
void prosesPayment(Multilist *Kasir, Multilist *Dapur);
void updateTotalPembelian(AddressParent nota);
AddressChild findChild(AddressParent nota, string namaItem);
void moveAllItems(AddressParent source, AddressParent destination);
void updateNota(Multilist *Kasir, Multilist *Dapur);
// FUNGSI LAPORAN
void cariItemTerlaris(Multilist L);
// GENERAL.C
void printNota(AddressParent nota);
void printAllNota(Multilist L);
void printNotaAktif(Multilist Nota);
void printPilih(Multilist Nota);
void logoASCII();
void getLocalTime(int *day, int *month, int *year);
void showMenu(char *picker, string user);
void showTools(char *picker, string user);
void color(string cname);
void printMEJA();
bool isMEJAFull(int MEJA[]);
bool isMEJAEmpty(int MEJA);
int getNomorNota();
void saveCounter(int counter);
int readCounter();
void tampilkanMenu();
void inputPesanan(Multilist *Kasir, Multilist *Dapur, string tanggal);
void preBoot();
void drawProgressBar(int current, int total, int width);
void ShutdownMessage();
void gotoxy(int x, int y);
HWND WINAPI GetConsoleWindowNT();
bool integrityCheck();
void printCenterText(char *message);
// FILEHANDLER.C
void saveToFile(Multilist L);
void loadFromFile(Multilist *L);
void saveStatis(Statis *data);
void loadStatis(Statis *data);
void resetNota();
void resetStatis();