-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorders-create.php
More file actions
208 lines (196 loc) · 10.7 KB
/
Copy pathorders-create.php
File metadata and controls
208 lines (196 loc) · 10.7 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
<?php include('user/includes1/header.php'); ?>
<style>
.form-control, .datatable-input {
display: block;
width: 100%;
padding: 0.375rem 0.75rem;
font-size: 12px;
font-weight: 400;
line-height: 1.5;
color: #212529;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ced4da;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
border-radius: 0.375rem;
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
</style>
<div class="modal fade" id="addCustomerModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title" id="exampleModalLabel">Add Customer</h6>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<!-- Message container for success/error messages -->
<div id="customerMessage" class="alert d-none"></div>
<div class="mb-2">
<label for="c_name" class="form-label form-label-sm">Enter Customer Name</label>
<input type="text" class="form-control form-control-sm" id="c_name" />
</div>
<div class="mb-2">
<label for="c_email" class="form-label form-label-sm">Enter Email</label>
<input type="text" class="form-control form-control-sm" id="c_email" />
</div>
<div class="mb-2">
<label for="c_phone" class="form-label form-label-sm">Enter Phone Number</label>
<input type="text" class="form-control form-control-sm" id="c_phone" />
</div>
<div class="mb-2">
<label for="c_address" class="form-label form-label-sm">Enter Address</label>
<input type="text" class="form-control form-control-sm" id="c_address" />
</div>
<div class="mb-2">
<label for="c_city" class="form-label form-label-sm">Enter City</label>
<input type="text" class="form-control form-control-sm" id="c_city" />
</div>
<div class="mb-2">
<label for="c_state" class="form-label form-label-sm">Enter State</label>
<input type="text" class="form-control form-control-sm" id="c_state" />
</div>
<div class="mb-2">
<label for="c_zipcode" class="form-label form-label-sm">Enter Zip Code</label>
<input type="text" class="form-control form-control-sm" id="c_zipcode" />
</div>
<div class="mb-2">
<label for="c_country" class="form-label form-label-sm">Enter Country</label>
<input type="text" class="form-control form-control-sm" id="c_country" />
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary btn-sm saveCustomer">Save</button>
</div>
</div>
</div>
</div>
<div class="container-fluid px-4">
<div class="card mt-4 shadow-sm">
<div style="background-color:#4153B7; color:white; " class="card-header d-flex justify-content-between align-items-center">
<h6 class="mb-0 fw-bold">Create Order</h6>
<a href="orders.php" class="btn btn-danger btn-sm">Back</a>
</div>
<div class="card-body">
<?php alertMessage(); ?>
<form action="orders-code.php" method="POST">
<div class="row align-items-end">
<div class="col-md-4 mb-2">
<label style="display:block; margin-bottom: 7px;">Scan Barcode</label>
<input type="text" name="barcode" id="barcodeInput" class="form-control" placeholder="Scan barcode here..." autofocus>
</div>
<div class="col-md-2 mb-2">
<label class="form-label form-label-sm">Quantity</label>
<input type="number" name="quantity" value="1" class="form-control form-control-sm" />
</div>
<div class="col-md-2 mb-2 d-flex">
<button type="submit" name="addItem" class="btn btn-primary btn-sm">Add Item</button>
</div>
</div>
</form>
</div>
</div>
<div class="card mt-3">
<div class="card-header">
<h6 class="mb-0 fw-bold">Products</h6>
</div>
<div class="card-body" id="productArea">
<?php
if (isset($_SESSION['productItems'])) {
$sessionProducts = $_SESSION['productItems'];
if (empty($sessionProducts)) {
unset($_SESSION['productItemIds']);
unset($_SESSION['productItems']);
}
?>
<div class="table-responsive mb-3" id="productContent">
<table class="table table-bordered table-striped" style="font-size: 0.9rem;">
<thead>
<tr>
<th class="align-middle">Id</th>
<th class="align-middle">Product Name</th>
<th class="align-middle">Barcode</th>
<th class="align-middle">Price</th>
<th class="align-middle">Quantity</th>
<th class="text-end align-middle">Total Price</th>
<th class="text-center align-middle">Remove</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
foreach ($sessionProducts as $key => $item) :
?>
<tr>
<td class="align-middle"><?= $i++; ?></td>
<td class="fw-normal align-middle"><?= $item['name']; ?></td>
<td class="fw-normal align-middle"><?= $item['barcode']; ?></td>
<td class="fw-normal align-middle"><?= $item['price']; ?></td>
<td class="align-middle">
<!-- <div class="d-flex align-items-center">
<div class="input-group qtyBox input-group-sm">
<input type="hidden" value="<?= $item['product_id'] ?>" class="prodId" />
<button class="input-group-text decrement">-</button>
<input type="text" value="<?= $item['quantity']; ?>" class="qty quantityInput form-control form-control-sm text-center" />
<button class="input-group-text increment">+</button>
</div>
</div> -->
<?= $item['quantity']; ?>
</td>
<td class="fw-normal text-end align-middle"><?= number_format($item['price'] * $item['quantity'], 0); ?></td>
<td class="text-center align-middle">
<a href="orders-item-delete.php?index=<?= $key; ?>" class="btn btn-danger btn-sm">Remove</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div class="mt-2">
<hr>
<div class="row align-items-center">
<div class="col-md-4 mb-2">
<label class="form-label fs-6">Select Payment Mode</label>
<select id="payment_mode" class="form-select">
<option value="">-- Select Payment --</option>
<option value="Cash Payment">Cash Payment</option>
<option value="Card Payment - Credit Card">Card Payment-Credit Card</option>
<option value="Card Payment - Debit Card">Card Payment-Debit Card</option>
<option value="E-Transfer">E-Transfer</option>
<option value="Credit Customer">Credit Customer (Weekly/Monthly)</option>
</select>
<!-- <select id="payment_mode" class="form-select form-select-sm">
<option value="">-- Select Payment --</option>
<option value="Cash Payment">Cash Payment</option>
<option value="Online Payment">Online Payment</option>
</select> -->
</div>
<div class="col-md-4 mb-2">
<label class="form-label fs-6">Enter Customer Phone Number</label>
<input type="text" id="cphone" class="form-control form-control-sm" value="" />
</div>
<div class="col-md-4 mb-2">
<label class="form-label fs-6">Enter Type Of Billing</label>
<select id="billing_type" class="form-control">
<option value="instant">Instant Payment</option>
<option value="weekly">Weekly Billing</option>
<option value="monthly">Monthly Billing</option>
</select>
</div>
<div class="col-12 mt-4 text-end">
<button type="button" class="btn btn-warning btn-sm w-100 proceedToPlace">Proceed to place order</button>
</div>
</div>
</div>
<?php
} else {
echo '<h6 class="text-center">No Items Added</h6>';
}
?>
</div>
</div>
</div>
<?php include('user/includes1/footer.php'); ?>