Skip to content

Commit e941bd0

Browse files
Fix SQL query and update table layout
1 parent 822249c commit e941bd0

File tree

7 files changed

+22
-11
lines changed

7 files changed

+22
-11
lines changed

functions/proceed-transaction.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
exit();
3232
}
3333

34-
$sql = 'SELECT l.id, p.price AS price
34+
$sql = 'SELECT l.id, l.kilo, p.price AS price
3535
FROM laundry AS l
3636
JOIN transactions AS t ON l.transaction_id = t.id
3737
JOIN prices AS p ON l.type = p.id
@@ -43,7 +43,7 @@
4343

4444
$total_price = 0;
4545
foreach ($results as $row) {
46-
$total_price += $row['price'];
46+
$total_price += $row['price'] * $row['kilo'];
4747
}
4848

4949
echo $total_price;

functions/views/customers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
$lastname = $fullname[1];
1515
?>
1616
<tr>
17-
<td>#<?php echo $row['id']; ?></td>
17+
<td><?php echo $row['id']; ?></td>
1818
<td><img class="rounded-circle me-2" width="30" height="30" src="assets/img/profile.png"><?php echo $row['fullname']; ?></td>
1919
<td><?php echo $row['address']; ?></td>
2020
<td><?php echo $row['contact']; ?></td>

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>';

functions/views/staff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
?>
1515
<tr>
16-
<td>#<?php echo $row['id']; ?></td>
16+
<td><?php echo $row['id']; ?></td>
1717
<td><img class="rounded-circle me-2" width="30" height="30" src="assets/img/profile.png"><?php echo $row['username']; ?></td>
1818
<td><?php echo $row['created_at']; ?></td>
1919
<td class="text-center">

functions/views/supply.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
?>
1313
<tr>
14-
<td>#<?php echo $row['id']; ?></td>
14+
<td><?php echo $row['id']; ?></td>
1515
<td><?php echo $row['name']; ?></td>
1616
<td><?php echo $row['unit']; ?></td>
1717
<td><?php echo $row['stock']; ?></td>

sales.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
<script src="assets/js/vfs_fonts.js"></script>
108108
<script src="assets/js/buttons.html5.min.js"></script>
109109
<script src="assets/js/buttons.print.min.js"></script>
110-
<script src="assets/js/listTable.js"></script>
111110
<script src="assets/js/theme.js"></script>
112111
<script src="assets/js/sweetalert.min.js"></script>
113112
<script>
@@ -119,7 +118,19 @@
119118
} else if (type == 'error') {
120119
swal("Error!", message, "error");
121120
}
122-
121+
$(document).ready(function() {
122+
$('#dataTable').DataTable( {
123+
dom: 'Blfrtip',
124+
aaSorting: [[0, 'desc']],
125+
buttons: [
126+
{ extend: 'excel', className: 'btn btn-primary' },
127+
{ extend: 'pdf', className: 'btn btn-primary' },
128+
{ extend: 'print', className: 'btn btn-primary' }
129+
]
130+
} );
131+
132+
133+
} );
123134
</script>
124135
</body>
125136

tracking.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@
7474
?>
7575
<div class="d-flex justify-content-between align-items-center mb-5">
7676
<div>
77-
<h2 class="mb-0">Queue <span class="text-primary font-weight-bold">#<?php echo $queue_number; ?></span></h2>
78-
<h4 class="mb-0">Type - <span class="text-primary font-weight-bold"><?php echo $row['name']; ?></span></h4>
79-
<h4 class="mb-0">Load - <span class="text-primary font-weight-bold"><?php echo $row['kilo']; ?>kg</span></h4>
77+
<h2 class="mb-2">Queue <span class="text-primary font-weight-bold">#<?php echo $queue_number; ?></span></h2>
78+
<h5 class="mb-0 ms-5 font-monospace">Type - <span class="text-primary font-weight-bold"><?php echo $row['name']; ?></span></h5>
79+
<h5 class="mb-0 ms-5 font-monospace">Load - <span class="text-primary font-weight-bold"><?php echo $row['kilo']; ?>kg</span></h5>
8080
</div>
8181
</div>
8282
<div class="progress d-flex justify-content-between d-flex justify-content-between mx-0 mt-0 mb-5">

0 commit comments

Comments
 (0)