-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
405 lines (400 loc) · 15.8 KB
/
index.html
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"
/>
<title>Loyalty</title>
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/tailwind.min.css"
rel="stylesheet"
/>
<link
href="https://cdnjs.cloudflare.com/ajax/libs/flowbite/1.8.1/flowbite.min.css"
rel="stylesheet"
/>
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dexie/3.2.4/dexie.min.js"></script>
<link
href="https://cdnjs.cloudflare.com/ajax/libs/jsoneditor/9.5.6/jsoneditor.min.css"
rel="stylesheet"
type="text/css"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jsoneditor/9.5.6/jsoneditor.min.js"></script>
<!-- <script src="main.js?123"></script> -->
<script src="main.js?2333"></script>
</head>
<body class="bg-gray-100">
<nav class="bg-white p-4">
<div class="container mx-auto">
<div class="flex justify-between items-center nav">
<div id="siteName" class="text-2xl font-semibold">LOYA</div>
<div class="hidden md:flex md:space-x-2">
<button id="showHome" class="btn btn-outline btn-primary">
Customers
</button>
<button id="showVisits" class="btn btn-outline btn-primary ml-2">
Visits
</button>
<button
id="showAddCustomer"
class="btn btn-outline btn-primary ml-2"
>
Add Customer
</button>
<button
id="showAddTransaction"
class="btn btn-outline btn-primary ml-2"
>
Add Transaction
</button>
<button id="showSettings" class="btn btn-outline btn-primary ml-2">
Settings
</button>
</div>
<button
id="burgerMenu"
class="md:hidden btn btn-outline btn-primary ml-2"
>
Menu
</button>
<!-- Drawer Menu -->
<div
id="drawerMenu"
class="fixed top-0 left-0 h-full sm:w-full bg-white p-4 overflow-y-auto transform translate-x-full transition-transform duration-300 ease-in-out md:hidden hidden z-50"
>
<button
id="drawerShowHome"
class="btn btn-outline btn-primary w-full mb-2 border-b"
>
Customers
</button>
<button
id="drawerShowVisits"
class="btn btn-outline btn-primary w-full mb-2 border-b"
>
Visits
</button>
<button
id="drawerShowAddCustomer"
class="btn btn-outline btn-primary w-full mb-2 border-b"
>
Add Customer
</button>
<button
id="drawerShowAddTransaction"
class="btn btn-outline btn-primary w-full mb-2 border-b"
>
Add Transaction
</button>
<button
id="drawerShowSettings"
class="btn btn-outline btn-primary w-full mb-2 border-b"
>
Settings
</button>
<button
id="menuClose"
class="btn btn-outline btn-primary w-full mb-2 text-lg"
>
X
</button>
</div>
</div>
</div>
</nav>
<!-- Customers -->
<div id="home" class="container mx-auto p-4 overflow-x-auto">
<form id="searchCustomerForm" class="mb-4">
<div class="form-control">
<label
for="default-search"
class="mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"
>Search</label
>
<div class="relative">
<div
class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"
>
<svg
class="w-4 h-4 text-gray-500 dark:text-gray-400"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 20 20"
>
<path
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"
/>
</svg>
</div>
<input
type="text"
id="searchCustomer"
class="block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder="Search by Name or Phone."
/>
<button
type="submit"
class="btn btn-primary text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
>
Search
</button>
</div>
</div>
</form>
<table
class="table w-full shadow-md w-full text-sm text-left text-gray-500 dark:text-gray-400"
>
<thead
class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400"
>
<tr>
<th class="table-header px-6 py-4">ID</th>
<th class="table-header px-6 py-4">Name</th>
<th class="table-header px-6 py-4">Gender</th>
<th class="table-header px-6 py-4">Phone</th>
<th class="table-header px-2 py-2">Actions</th>
</tr>
</thead>
<tbody id="customerList">
<!-- Customer List Here -->
</tbody>
</table>
</div>
<!-- Visits -->
<div id="visits" class="container mx-auto p-4 hidden overflow-x-auto">
<!-- Visits Filter -->
<form id="filterTransactionForm" class="mb-4">
<div class="grid grid-cols-7 gap-4">
<input
type="date"
id="fromDate"
class="col-span-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
required
/>
<input
type="date"
id="toDate"
class="col-span-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
required
/>
<button
type="submit"
class="col-span-1 btn btn-primary text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2.5 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
>
Filter
</button>
</div>
</form>
<table
class="table w-full table-compac w-full text-sm text-left text-gray-500 dark:text-gray-400 shadow-md"
>
<thead
class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400"
>
<tr>
<th class="table-header px-6 py-4">ID</th>
<th class="table-header px-6 py-4">Date</th>
<th class="table-header px-6 py-4">Amount</th>
<th class="table-header px-6 py-4">Services</th>
<th class="table-header px-6 py-4">Customer ID</th>
<th class="table-header px-6 py-4">Category</th>
</tr>
</thead>
<tbody id="transactionList">
<!-- Transaction List Here -->
</tbody>
</table>
</div>
<!-- Add Customer Form -->
<form
id="addCustomer"
class="container mx-auto p-4 hidden shadow-md bg-white border-b dark:bg-gray-800 dark:border-gray-700 mt-4"
>
<div class="grid gap-6 mb-6 md:grid-cols-2">
<div>
<label
for="customerName"
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>Name</label
>
<input
type="text"
name="name"
id="customerName"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
required
/>
</div>
<div>
<label
for="customerPhone"
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>Phone</label
>
<input
type="tel"
name="phone"
id="customerPhone"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
required
/>
</div>
<div>
<label
for="customerEmail"
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>Email</label
>
<input
type="email"
name="email"
id="customerEmail"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
required
/>
</div>
<div>
<label
for="customerAddress"
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>Address</label
>
<input
type="text"
name="location"
id="customerAddress"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
required
/>
</div>
<div>
<label
for="customerGender"
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>Gender</label
>
<select
id="customerGender"
name="gender"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
>
<option value="Male">Male</option>
<option value="Female">Female</option>
<option value="Other">Other</option>
</select>
</div>
</div>
<button
type="submit"
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
>
Add Customer
</button>
</form>
<!-- Add Transaction Form -->
<form
id="addTransaction"
class="container mx-auto p-4 hidden shadow-md bg-white border-b dark:bg-gray-800 dark:border-gray-700 mt-4"
>
<div class="grid gap-6 mb-6 md:grid-cols-2">
<div>
<label
for="date"
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>Date</label
>
<input
type="date"
name="date"
id="date"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
required
/>
</div>
<div>
<label
for="amount"
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>Amount</label
>
<input
type="number"
name="amount"
id="amount"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
required
/>
</div>
<div>
<label
for="services"
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>Services</label
>
<select
id="services"
name="services"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
>
<!-- Options will be populated from DB -->
</select>
</div>
<div>
<label
for="customerId"
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>Customer ID</label
>
<input
type="text"
name="customerId"
id="customerId"
placeholder="Customer ID"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
required
readonly
/>
</div>
<div>
<label
for="category"
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>Category</label
>
<select
id="category"
name="category"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
>
<!-- Options will be populated from DB -->
</select>
</div>
</div>
<button
type="submit"
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
>
Add Transaction
</button>
</form>
<!-- Settings -->
<div id="settings" class="container mx-auto p-4 hidden">
<h2 class="text-2xl mb-4">Settings</h2>
<textarea
id="settingsEditor"
class="w-full h-60 border rounded"
></textarea>
<button id="saveSettings" class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">
Save
</button>
</div>
</body>
</html>