ria/app/Views/Report_month_wise_inward.php
2025-04-24 03:57:39 +00:00

190 lines
5.6 KiB
PHP
Executable File

<!-- Report_month_wise_inward.php -->
<style>
table {
width: auto;
}
</style>
<div class="content-page">
<div class="content">
<!-- Start Content-->
<div class="container-fluid">
<!-- start page title -->
<div>
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);">Report</a></li>
<li class="breadcrumb-item"><a href="javascript: void(0);">Inward</a></li>
<li class="breadcrumb-item active">
<h4 class="page-title"><b> Month-wise ( <?php echo $mont; ?> )
</b></h4>
</li>
</ol>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="card">
<!-- <form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;"> -->
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered table-hover" id="cc" style="font-size:14px;">
<thead>
<tr>
<th style="text-align:center">Supplier Name</th>
<th style="text-align:center">Material Name</th>
<th style="text-align:center">Quantity</th>
<th style="text-align:center">Total Value &nbsp;(&#8377;)</th>
</tr>
</thead>
<tbody>
<?php if (!empty($month)) {
$tr3 = 0;
$tr4 = 0;
$ab = isset($_GET['ab']) ? $_GET['ab'] : '';
$last = isset($_GET['dat']) ? $_GET['dat'] : '';
$new = date("F", strtotime($last)) . "\n";
foreach ($month as $rel) {
?>
<tr>
<td><span>
<a href="<?= base_url() ?>report/ilink_purchase?sid=<?php echo $rel->sid; ?>&mid=<?php echo $rel->mid; ?>&ab=<?php echo $ab; ?>&m=<?php echo $new; ?>"><?php echo $rel->supplier_name; ?></a>
</span></td>
<td><span><?php echo $rel->material_name; ?></span></td>
<td style="text-align:right"><span><?php
$tr3 = $tr3 + round($rel->quantity);
echo round($rel->quantity); ?></span></td>
<td style="text-align:right"><span><?php
$tr4 = $tr4 + number_format($rel->total, 2, '.', '');
echo number_format($rel->total, 2, '.', ''); ?></span></td>
</tr>
<?php
}
?>
</tbody>
<tfoot width="100%">
<tr>
<td style="text-align:center;">
<strong><?php echo 'Total'; ?></strong>
</td>
<td style="text-align:center;">
<?php echo ''; ?>
</td>
<td style="text-align:right">
<strong>
<?php {
echo round($tr3);
}
?>
</strong>
</td>
<td style="text-align:right">
<strong>
<?php {
echo number_format($tr4, 2, '.', '');
}
?>
</strong>
</td>
</tr>
</tfoot>
<?php
}
?>
</table>
</div>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
</div>
</div> <!-- container -->
</div> <!-- content -->
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
<script>
$(document).ready(function() {
$.fn.dataTable.moment('DD-MM-YYYY');
// Initialize the DataTable
var table = $('#cc').DataTable({
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
buttons: [
'excel' // Export buttons
],
pageLength: 10, // Default rows per page
lengthMenu: [
[10, 20, 30, 50, -1],
[10, 20, 30, 50, "All"]
], // Rows per page options
responsive: true, // Responsive table
ordering: false,
language: {
paginate: {
next: '<i class="fas fa-angle-right"></i>', // Next button icon
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
},
emptyTable: '<div style="text-align:center;">Data Not Found!</div>'
}
});
});
$(function() {
//var dateFormat = "mm/dd/yy",
from = $("#min-date")
.datepicker({
dateFormat: "dd-mm-yy",
defaultDate: "+0d",
changeMonth: true,
//numberOfMonths: 1
})
.on("change", function() {
to.datepicker("option", "minDate", getDate(this));
}),
to = $("#max-date").datepicker({
dateFormat: "dd-mm-yy",
defaultDate: "+0d",
changeMonth: true,
//numberOfMonths: 1
})
.on("change", function() {
from.datepicker("option", "maxDate", getDate(this));
});
function getDate(element) {
var date;
try {
date = $.datepicker.parseDate(dateFormat, element.value);
} catch (error) {
date = null;
}
return date;
}
});
</script>