-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
385 lines (366 loc) · 16.8 KB
/
index.html
File metadata and controls
385 lines (366 loc) · 16.8 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Customer Management</title>
<!-- Bootstrap CSS -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css">
<script src="js/jquery-3.7.0.min.js"></script>
<link rel="stylesheet" href="../css/style.css">
</head>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box; /* Ensures consistent box model */
color: white;
}
body {
background-image: url("image/img_4.png");
background-size: cover; /* Ensures the image covers the entire background */
background-repeat: no-repeat; /* Prevents the image from repeating */
background-position: center; /* Centers the image */
min-height: 100vh; /* Ensures the body takes up at least the full height of the viewport */
}
/* Additional styling */
.form-container {
border: 1px solid #ced4da;
padding: 20px;
border-radius: 5px;
}
.form-section {
display: none; /* Hide all sections by default */
}
b{
color: black;
font-size: 20px;
}
.navbar-nav{
cursor: pointer;
}
.navbar-nav:hover{
cursor: pointer;
color: red;
font-size: 17px;
}
p,h5{
color: black;
}
label{
color: white;
}
a{
color: black;
}
/* Style the Log Out button */
#log {
background-color: green;
color: white;
border: none;
border-radius: 18px;
padding: 8px 15px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.3s ease;
}
/* Hover effect for the button */
#log:hover {
background-color: darkgreen;
transform: scale(1.1);
}
.fw-bold{
color: black;
}
option{
background-color: black;
}
</style>
<body>
<!-- Navigation Bar -->
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#"><b> My Coffe Shoppe</b> </a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="#" onclick="showSection('customer')">Customer</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#" onclick="showSection('item')">Item</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#" onclick="showSection('order')">Order</a>
</li>
</ul>
</div>
<!-- Profile Picture, Date/Time, and Logout Section -->
<div class="collapse navbar-collapse justify-content-end">
<ul class="navbar-nav">
<!-- Profile Picture -->
<li class="nav-item">
<a href="#" class="nav-link">
<img src="image/alina.jpg" alt="Profile" class="rounded-circle" style="width: 40px; height: 40px;">
</a>
</li>
<!-- Date/Time Display -->
<li class="nav-item">
<b><a class="nav-link" id="datetime"></a></b>
</li>
<!-- Log Out -->
<li class="nav-item active">
<a href="../user.html" class="nav-link"><i class="fas fa-door-open"></i><button id="log">Log Out </button></a>
</li>
</ul>
</div>
</nav>
<div class="container mt-4">
<!-- Customer Form Section -->
<div class="form-section" id="customerSection">
<h2>Customer Form</h2>
<div class="row">
<div class="col-md-6">
<div class="form-container">
<form id="customerForm">
<div class="form-group">
<label for="customerId">ID</label>
<input type="text" class="form-control" id="customerId" placeholder="Enter ID" required>
<div class="errorMessageId" style="display: none; color: red;">Invalid Customer ID format CUS-000.</div>
</div>
<div class="form-group">
<label for="customerName">Name</label>
<input type="text" class="form-control" id="customerName" placeholder="Enter Name" onkeyup="checkNameField()" required>
<div class="errorMessageName" style="display: none; color: red;">Name must be between 5 and 18 characters.</div>
</div>
<div class="form-group">
<label for="customerAddress">Address</label>
<input type="text" class="form-control" id="customerAddress" placeholder="Enter Address" onkeyup="checkFieldAddress()" required>
<div class="errorMessageAddress" style="display: none; color: red;">Address must be at least 5 characters long.</div>
</div>
<div class="form-group">
<label for="customerSalary">Salary</label>
<input type="number" class="form-control" id="customerSalary" placeholder="Enter Salary" onkeyup="checkFieldSalary()" required>
<div class="errorMessageSalary" style="display: none; color: red;">Salary must be a valid number.</div>
</div>
<button type="submit" class="btn btn-primary" id="onActionSave" onclick="saveCustomer()">Save</button>
</form>
</div>
</div>
<div class="col-md-6">
<h2>Customer Table</h2>
<table class="table table-bordered">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Address</th>
<th>Salary</th>
<th id="action">Actions</th>
</tr>
</thead>
<tbody id="customerTableBody">
<!-- Dynamic rows will be added here -->
</tbody>
</table>
</div>
</div>
</div>
<!-- Item Form Section -->
<div class="form-section" id="itemSection">
<h2>Item Form</h2>
<div class="row">
<div class="col-md-6">
<div class="form-container">
<form id="itemForm">
<div class="form-group">
<label for="itemCode">Code</label>
<input type="text" class="form-control" id="itemCode" placeholder="Enter Item Code" onkeyup="checkFieldItemId()" required>
<div class="errorMessageItemId" style="display: none; color: red;">item id is required field: Pattern ITM-000 </div>
</div>
<div class="form-group">
<label for="itemName">Name</label>
<input type="text" class="form-control" id="itemName" placeholder="Enter Item Name" onkeyup="checkFieldItemName()" required>
<div class="errorMessageItemName" style="display: none; color: red;">item name is required field: Minimum
8,Max 20, Space Allowed </div>
</div>
<div class="form-group">
<label for="itemQuantity">Quantity</label>
<input type="number" class="form-control" id="itemQuantity" placeholder="Enter Quantity" onkeyup="checkFieldItemQty()" required>
<div class="errorMessageItemQty" style="display: none; color: red;">Quantity is required and must be a positive number.</div>
</div>
<div class="form-group">
<label for="itemPrice">Price</label>
<input type="number" class="form-control" id="itemPrice" placeholder="Enter Price" onkeyup="checkFieldItemPrice()" required>
<div class="errorMessageItemPrice" style="display: none; color: red;">Price is required and must be a positive number.</div>
</div>
<button type="submit" class="btn btn-primary" id="onActionItemSave" onclick="saveItem()">Save</button>
</form>
</div>
</div>
<div class="col-md-6">
<h2>Item Table</h2>
<table class="table table-bordered">
<thead>
<tr>
<th>Code</th>
<th>Name</th>
<th>Quantity</th>
<th>Price</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="itemTableBody">
<!-- Dynamic rows will be added here -->
</tbody>
</table>
</div>
</div>
</div>
<!-- Add this after the Item Form Section -->
<div class="form-section" id="orderSection">
<h2>Order Form</h2>
<div class="row">
<div class="col-md-4">
<div class="card">
<div class="card-body">
<div class="container mt-4">
<h5 class="card-title">Customer Details</h5>
<form>
<div class="row">
<!-- First row: Customer ID and Order ID -->
<div class="col-md-6 mb-3">
<label class="form-label fw-bold">Order ID:</label>
<input type="text" class="form-control" id="orderId" required>
</div>
<div class="col-md-6 mb-3">
<label class="form-label fw-bold">Customer ID:</label>
<select class="form-control" id="custId" name="customer" placeholder="C00-001" id="cusIdOption">
<option>CUS-000</option>
</select>
</div>
</div>
<div class="row">
<!-- Second row: Customer Name and Date -->
<div class="col-md-6 mb-3">
<label class="form-label fw-bold">Customer Name:</label>
<input type="text" class="form-control" id="custName" placeholder="Sachini" disabled>
</div>
<div class="col-md-6 mb-3">
<label class="form-label fw-bold">Date:</label>
<input type="date" class="form-control" id="date" required>
</div>
</div>
<div class="row">
<!-- Third row: Address (full-width input) -->
<div class="col-md-12 mb-3">
<label class="form-label fw-bold">Address:</label>
<input type="text" class="form-control" id="address" required>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-body">
<h5 class="card-title">Item Details</h5>
<div class="row">
<!-- First row: Item code and name -->
<div class="col-md-6 mb-3">
<label class="form-label fw-bold">Item Code:</label>
<select class="form-control" id="itCode" name="customer" placeholder="ITM-001">
<option>ITM-000</option>
</select>
</div>
<div class="col-md-6 mb-3">
<label class="form-label fw-bold">Item Name:</label>
<input type="text" class="form-control" id="itName" placeholder="Apple" disabled>
</div>
</div>
<div class="row">
<!-- Second row: Price qty -->
<div class="col-md-6 mb-3">
<label class="form-label fw-bold">Item Price:</label>
<input type="text" class="form-control" id="itPrice" placeholder="300.00" disabled>
</div>
<div class="col-md-6 mb-3">
<label class="form-label fw-bold">QtyOnHand:</label>
<input type="text" class="form-control" id="QtyOn" disabled>
</div>
</div>
<div class="row">
<!-- Third row: Order qty-->
<div class="col-md-12 mb-3">
<label class="form-label fw-bold">Qty:</label>
<input type="number" class="form-control" id="Qty" required>
</div>
</div>
<button class="btn btn-primary mt-2" onclick="addItemToOrder()">Add Item</button>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-body">
<h5 class="card-title">Order Summary</h5>
<!-- <p>Total Items: <span id="totalItems"></span><label>0</label></p> <!– Updated Total Items –>-->
<!-- <p>Sub Total: <span id="totalCost"></span><label>0.00</label></p> <!– Updated Subtotal –>-->
<div class="row">
<!-- Second row: cash discount -->
<div class="col-md-6 mb-3">
<label class="form-label fw-bold">Cash:</label>
<input type="text" class="form-control" id="cash" placeholder="5000.00" required>
</div>
<div class="col-md-6 mb-3">
<label class="form-label fw-bold">Discount:</label>
<input type="text" class="form-control" id="discount" placeholder="10%" required>
</div>
</div>
<div class="row">
<!-- Third row: total balance-->
<div class="col-md-12 mb-3">
<label class="form-label fw-bold">Balance:</label>
<input type="text" class="form-control" id="balance" required>
</div>
</div>
<button class="btn btn-success" onclick="placeOrder()">Place Order</button>
</div>
</div>
</div>
</div>
<h2 class="mt-4">Order Table</h2>
<table class="table table-bordered">
<thead>
<tr>
<th>Order ID</th>
<th>Date</th>
<th>Item Name</th>
<th>qty</th>
<th>UnitPrice</th>
<th>Total</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="orderTableBody">
<!-- Dynamic rows will be added here -->
</tbody>
</table>
</div>
</div>
<!-- Bootstrap JS and dependencies -->
<script src="../js/validating/scripte.js"></script>
<script src="../js/customer.js"></script>
<script src="../js/main.js"></script>
<script src="../js/item.js"></script>
<script src="../js/order.js"></script>
</body>
</html>