Skip to content

Commit 1f53843

Browse files
Refactor queue and sales views
1 parent f9dae84 commit 1f53843

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

functions/views/queue-dashboard.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@
2828
?>
2929
<tr>
3030
<td><?php echo $row['queue_number']; ?></td>
31+
<td>#<?php echo $row['id']; ?></td>
3132
<td><img class="rounded-circle me-2" width="30" height="30" src="assets/img/profile.png"><?php echo $row['fullname']; ?></td>
32-
<td><?php echo $row['id']; ?></td>
3333
<td><?php echo $row['kilo']; ?></td>
34-
<td>₱<?php echo number_format($row['total'] , 2); ?></td>
3534
<td><?php echo $status ?></td>
3635
<td><?php echo $row['created_at']; ?></td>
3736
</tr>

functions/views/queue.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?php
22
include_once 'functions/connection.php';
3-
$sql = 'SELECT l.status, l.id AS laundry_id, l.kilo, t.id, t.customer_id, t.total, l.created_at, c.fullname, ROW_NUMBER() OVER (ORDER BY status DESC, kilo ASC) AS queue_number
3+
$sql = 'SELECT l.status, l.id AS laundry_id, l.kilo, p.price, p.name, t.id, t.customer_id, t.total, l.created_at, c.fullname, ROW_NUMBER() OVER (ORDER BY status DESC, kilo ASC) AS queue_number
44
FROM laundry AS l
5+
JOIN prices AS p ON l.type = p.id
56
JOIN transactions AS t ON l.transaction_id = t.id
67
JOIN customers AS c ON t.customer_id = c.id
78
WHERE l.status > 0 AND l.status < 4';
@@ -28,10 +29,11 @@
2829
?>
2930
<tr>
3031
<td><?php echo $row['queue_number']; ?></td>
32+
<td>#<?php echo $row['id']; ?></td>
3133
<td><img class="rounded-circle me-2" width="30" height="30" src="assets/img/profile.png"><?php echo $row['fullname']; ?></td>
32-
<td><?php echo $row['id']; ?></td>
3334
<td><?php echo $row['kilo']; ?></td>
34-
<td>₱<?php echo number_format($row['total'], 2); ?></td>
35+
<td><?php echo $row['name']; ?> - ₱<?php echo number_format($row['price'], 2)?></td>
36+
<td>₱<?php echo number_format($row['price'] * $row['kilo'], 2); ?></td>
3537
<td><?php echo $status ?></td>
3638
<td><?php echo $row['created_at']; ?></td>
3739
<td class="text-center">

functions/views/sales.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
}
2929

3030
echo '<tr>';
31-
echo '<td>' . $row['id'] . '</td>';
31+
echo '<td>#' . $row['id'] . '</td>';
3232
echo '<td><img class="rounded-circle me-2" width="30" height="30" src="assets/img/profile.png">' . $row['fullname'] . '</td>';
3333
echo '<td><img class="rounded-circle me-2" width="30" height="30" src="assets/img/profile.png">' . $row['username'] . '</td>';
3434
echo '<td>' . $row['kilo'] . '</td>';

index.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,9 @@
220220
<thead>
221221
<tr>
222222
<th>Queue </th>
223+
<th>Invoice</th>
223224
<th>Customer</th>
224-
<th>Transaction ID</th>
225225
<th>Kg/Kilo</th>
226-
<th>Total</th>
227226
<th>Status</th>
228227
<th>Date</th>
229228
</tr>

queue.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@
6060
<thead>
6161
<tr>
6262
<th>Queue </th>
63+
<th>Invoice</th>
6364
<th>Customer</th>
64-
<th>Transaction ID</th>
6565
<th>Kg/Kilo</th>
66+
<th>Type & Price</th>
6667
<th>Total</th>
6768
<th>Status</th>
6869
<th>Date</th>
@@ -189,21 +190,21 @@
189190
extend: 'excel',
190191
className: 'btn btn-primary',
191192
exportOptions: {
192-
columns: [0, 1, 2, 3, 4, 5, 6]
193+
columns: [0, 1, 2, 3, 4, 5, 7]
193194
}
194195
},
195196
{
196197
extend: 'pdf',
197198
className: 'btn btn-primary',
198199
exportOptions: {
199-
columns: [0, 1, 2, 3, 4, 5, 6]
200+
columns: [0, 1, 2, 3, 4, 5, 7]
200201
}
201202
},
202203
{
203204
extend: 'print',
204205
className: 'btn btn-primary',
205206
exportOptions: {
206-
columns: [0, 1, 2, 3, 4, 5, 6]
207+
columns: [0, 1, 2, 3, 4, 5, 7]
207208
}
208209
}
209210
]

sales.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<table class="table table-striped my-0" id="dataTable">
6161
<thead>
6262
<tr>
63-
<th>Transaction ID</th>
63+
<th>Invoice</th>
6464
<th>Customer</th>
6565
<th>User</th>
6666
<th>KG/Kilo</th>

0 commit comments

Comments
 (0)