more OOP and restructure utils
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
<div class="card ">
|
||||
<div class="card-body p-0">
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap ">
|
||||
<div class=" p-6 flex-grow-1 d-flex justify-content-between">
|
||||
<div class=" p-6 flex-grow-1 d-flex justify-content-between" id="total_warehouse">
|
||||
<div class="d-flex flex-column">
|
||||
<span class="fs-2 fw-bold mb-3 d-block">5</span>
|
||||
<span class="fs-5">Total Warehouses</span>
|
||||
@@ -50,7 +50,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class=" p-6 flex-grow-1 d-flex justify-content-between">
|
||||
<div class=" p-6 flex-grow-1 d-flex justify-content-between" id="total_capacity">
|
||||
<div class="d-flex flex-column">
|
||||
<span class="fs-2 fw-bold mb-3 d-block">41,000</span>
|
||||
<span class="fs-5">Total Capacity</span>
|
||||
@@ -78,7 +78,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class=" p-6 flex-grow-1 d-flex justify-content-between">
|
||||
<div class=" p-6 flex-grow-1 d-flex justify-content-between" id="total_space_used">
|
||||
<div class="d-flex flex-column">
|
||||
<span class="fs-2 fw-bold mb-3 d-block">25,500</span>
|
||||
<span class="fs-5">Space Used</span>
|
||||
@@ -101,7 +101,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="-0 p-6 flex-grow-1 d-flex justify-content-between">
|
||||
<div class="-0 p-6 flex-grow-1 d-flex justify-content-between" id="total_product">
|
||||
<div class="d-flex flex-column">
|
||||
<span class="fs-2 fw-bold mb-3 d-block">730</span>
|
||||
<span class="fs-5">Total Products</span>
|
||||
@@ -251,6 +251,30 @@
|
||||
<?php require "../include_ending.php";?>
|
||||
|
||||
<script>
|
||||
function retrieve_stats() {
|
||||
|
||||
return ajax_request({
|
||||
url: "<?php echo $server_url?>inventory/api/engine/warehouse_stats.php",
|
||||
autoPrepare: true,
|
||||
checkRequired: 0,
|
||||
action: 'read',
|
||||
onSuccess: function(res) {
|
||||
|
||||
$("#total_warehouse span.fs-2").text(res.total_warehouse);
|
||||
$("#total_warehouse small.text-info").text(`Across ${res.total_location} locations`);
|
||||
|
||||
$("#total_capacity span.fs-2").text(format_number(res.total_capacity,2));
|
||||
|
||||
$("#total_product span.fs-2").text(res.total_product);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function retrieve_warehouse() {
|
||||
|
||||
return ajax_request({
|
||||
@@ -294,11 +318,11 @@
|
||||
body += `<tr>
|
||||
<td class="py-3">${item['warehouse_name']}</td>
|
||||
<td class="py-3">${item['location']}</td>
|
||||
<td class="py-3">${item['manager']}</td>
|
||||
<td class="py-3">${item['manager_name']} ${item['manager_surname']}</td>
|
||||
<td class="py-3" style='text-align: right;'>${format_number(item['capacity'],2)}</td>
|
||||
<td class="py-3">${item['product']}</td>
|
||||
<td class="py-3">${item['unique_product']}</td>
|
||||
<td class="py-3">
|
||||
<span class="badge bg-${item['bg_class']}">${item.status}</span>
|
||||
${(item['status']==1)?'<span class="badge bg-success">Active</span>':'<span class="badge bg-secondary">Inactive</span>'}
|
||||
</td>
|
||||
<td class="py-3">
|
||||
<a href="<?php echo $server_url?>inventory/manage_warehouse.php?id=${item['id']}" class=""><i class="ti ti-eye fs-5"></i></a>
|
||||
@@ -371,6 +395,7 @@
|
||||
|
||||
$(async function() {
|
||||
try {
|
||||
await retrieve_stats();
|
||||
await retrieve_warehouse();
|
||||
await retrieve_storage();
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user