latest commit 23-05-2025
This commit is contained in:
parent
eeb8c342d7
commit
6efba5bf7b
@ -112,12 +112,12 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xl-12 col-md-12">
|
<div class="col-xl-6 col-md-6">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body" style="min-height: 460px;">
|
||||||
<h4 class="header-title">This Month Stock Closing</h4>
|
<h4 class="header-title">This Month Stock Closing</h4>
|
||||||
|
|
||||||
<div class="d-flex justify-content-between align-items-center w-50">
|
<div class="d-flex justify-content-between align-items-center ">
|
||||||
<div>
|
<div>
|
||||||
<a class="btn btn-primary btn-sm px-2" href="<?php echo base_url(); ?>sales_dashboard?stock=resin">Resin</a>
|
<a class="btn btn-primary btn-sm px-2" href="<?php echo base_url(); ?>sales_dashboard?stock=resin">Resin</a>
|
||||||
<a class="btn btn-secondary btn-sm px-2" href="<?php echo base_url(); ?>sales_dashboard?stock=bag">Bag</a>
|
<a class="btn btn-secondary btn-sm px-2" href="<?php echo base_url(); ?>sales_dashboard?stock=bag">Bag</a>
|
||||||
@ -152,7 +152,7 @@
|
|||||||
}
|
}
|
||||||
}?>
|
}?>
|
||||||
|
|
||||||
<table align="left" id="stockClosing" class="table dt-responsive nowrap w-50">
|
<table align="left" id="stockClosing" class="table dt-responsive nowrap ">
|
||||||
<thead>
|
<thead>
|
||||||
|
|
||||||
<?php if (is_array($stock[0]['header'])) { ?>
|
<?php if (is_array($stock[0]['header'])) { ?>
|
||||||
@ -224,7 +224,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
|
<div class="col-xl-6 col-md-6">
|
||||||
|
<div class="card" style="min-height: 460px;">
|
||||||
|
<div class="card-body">
|
||||||
|
<h4 class="header-title">This Month Stock Chart</h4>
|
||||||
|
<canvas id="stockChart" height="170"></canvas>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -414,6 +426,72 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const stockLabels = <?php echo json_encode(is_array($stock[0]['header']) ? $stock[0]['header'] : [$stock[0]['header']]); ?>;
|
||||||
|
const stockData = <?php echo json_encode(is_array($stock[0]['header']) ? $stock[2]['body'] : [$stock[1]['body']]); ?>;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const stockCtx = document.getElementById('stockChart').getContext('2d');
|
||||||
|
|
||||||
|
const stockChart = new Chart(stockCtx, {
|
||||||
|
type: 'bar', // or 'line', 'doughnut', etc.
|
||||||
|
|
||||||
|
data: {
|
||||||
|
labels: stockLabels,
|
||||||
|
datasets: [{
|
||||||
|
label: 'Closing Stock',
|
||||||
|
data: stockData,
|
||||||
|
backgroundColor: 'rgba(54, 162, 235, 0.5)',
|
||||||
|
borderColor: 'rgba(54, 162, 235, 1)',
|
||||||
|
borderWidth: 1
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
responsive: true,
|
||||||
|
plugins: {
|
||||||
|
legend: {
|
||||||
|
position: 'top',
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
callbacks: {
|
||||||
|
label: function(context) {
|
||||||
|
return ` ${context.parsed.y} units`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scales: {
|
||||||
|
y: {
|
||||||
|
beginAtZero: true,
|
||||||
|
title: {
|
||||||
|
display: true,
|
||||||
|
text: 'Stock Quantity'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
x: {
|
||||||
|
title: {
|
||||||
|
display: true,
|
||||||
|
text: 'Material'
|
||||||
|
},
|
||||||
|
ticks: {
|
||||||
|
callback: function(value, index, ticks) {
|
||||||
|
const label = this.getLabelForValue(value);
|
||||||
|
return label.length > 12 ? label.substr(0, 12) + '...' : label;
|
||||||
|
},
|
||||||
|
font: {
|
||||||
|
size: 10
|
||||||
|
},
|
||||||
|
maxRotation: 45,
|
||||||
|
minRotation: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user