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

286 lines
9.1 KiB
PHP
Executable File

<!-- deliver_perform.php -->
<script>
$(document).ready(function() {
$("#financialyear").select2();
$("#month").select2();
});
</script>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<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> Delivery Performance
<?php echo isset($month) ? '(' . $month . ')' : ''; ?>
<?php echo isset($financialyear) ? '(' . $financialyear . ')' : ''; ?>
</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">
<form method="post" action="<?php echo base_url("DeliveryPerformance"); ?>">
<div class="form-group">
<div class="row">
<div class="col-3">
<label for="financialyear">
<?php echo 'Year'; ?>
</label>
<select class="form-control" id="financialyear" name="financialyear">
<option value="">Select Year</option>
<?php
foreach ($fy as $item): { ?>
<option value="<?php echo $item->financial_year; ?>" <?php if (isset($financialyear) && ($financialyear == $item->financial_year)) {
echo 'selected';
} ?>><?php echo $item->financial_year; ?></option>
<?php }
endforeach; ?>
</select>
</div>
<div class="col-3">
<label for="month">
<?php echo 'Month'; ?>
</label>
<select class="form-control" id="month" name="month">
<option value="">Select Month</option>
<option value="January" <?php if (isset($month) && ($month == "January")) {
echo 'selected';
} ?>>January</option>
<option value="February" <?php if (isset($month) && ($month == "February")) {
echo 'selected';
} ?>>February</option>
<option value="March" <?php if (isset($month) && ($month == "March")) {
echo 'selected';
} ?>>March</option>
<option value="April" <?php if (isset($month) && ($month == "April")) {
echo 'selected';
} ?>>April</option>
<option value="May" <?php if (isset($month) && ($month == "May")) {
echo 'selected';
} ?>>May</option>
<option value="June" <?php if (isset($month) && ($month == "June")) {
echo 'selected';
} ?>>June</option>
<option value="July" <?php if (isset($month) && ($month == "July")) {
echo 'selected';
} ?>>July</option>
<option value="August" <?php if (isset($month) && ($month == "August")) {
echo 'selected';
} ?>>August</option>
<option value="September" <?php if (isset($month) && ($month == "September")) {
echo 'selected';
} ?>>September</option>
<option value="October" <?php if (isset($month) && ($month == "October")) {
echo 'selected';
} ?>>October</option>
<option value="November" <?php if (isset($month) && ($month == "November")) {
echo 'selected';
} ?>>November</option>
<option value="December" <?php if (isset($month) && ($month == "December")) {
echo 'selected';
} ?>>December</option>
</select>
</div>
<div class="col-md-6 text-right">
<input type="button" class="btn btn-danger m-2" value="Reset" onclick="window.location.href='<?= base_url('DeliveryPerformance') ?>';">
<input type="submit" class="btn btn-success m-2" name="btn_submit" value="View Report">
</div>
</div>
</div>
<div class="form-group has-feedback">
</div>
</form>
<table id="cc" class="table table-bordered table-hover mb-0 nowrap w-100"
style="background-color:#fff; font-size:12px;">
<thead>
<tr>
<!-- <th>S.No</th> -->
<th>OrderedDate</th>
<th>DispatchDate</th>
<th>CustomerName</th>
<th>InvoiceNumber</th>
<th>OrderedQuantity</th>
<th>DispatchQuantity</th>
<th>Rating</th>
</tr>
</thead>
<tbody>
<?php if (!empty($per)) {
$tr1 = 0;
$tr2 = 0;
// $last = $this->uri->total_segments();
// $ab=$this->uri->segment($last);
$i = 0;
foreach ($per as $rel) {
?>
<tr>
<!-- <td style="text-align:left;"><span><?php echo ++$i; ?></span></td> -->
<td><?php
$itemdate = date("d-m-Y", strtotime($rel->invoice_date_created));
echo $itemdate;
?>
</td>
<td><?php
$invoicedate = date("d-m-Y", strtotime($rel->invoice_date_created));
echo $invoicedate;
?>
</td>
<td style="text-align:left;"><?php echo ($rel->client_name); ?></td>
<td style="text-align:center;"><?php echo ($rel->invoice_number); ?></td>
<td class="amount" style="text-align:right;"><?php
$tr1 = $tr1 + round($rel->qty);
echo number_format(round($rel->qty));
?></td>
<td class="amount" style="text-align:right;"><?php
$tr2 = $tr2 + round($rel->qty);
echo number_format(round($rel->qty));
?></td>
<td style="text-align:right;"><?php
$OrderedQuantity = round($rel->qty);
$DispatchQuantity = round($rel->qty);
$Rating = @($DispatchQuantity / $OrderedQuantity) * 100;
echo number_format($Rating, 2, '.', ' '); ?></td>
</tr>
<?php
}
?>
</tbody>
<tfoot width="100%">
<td><strong>&nbsp</strong></td>
<td><strong>&nbsp</strong></td>
<td><strong>&nbsp</strong></td>
<td><strong>Total</strong></td>
<td><strong>&nbsp</strong></td>
<td class="amount" style="text-align:right"><strong>
<?php {
echo $tr1;
}
?>
</strong>
</td>
<td class="amount" style="text-align:right"><strong>
<?php {
echo $tr2;
}
?>
</strong>
</td>
<td><strong>&nbsp</strong></td>
</tfoot>
<?php
}
?>
</table>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
</div>
</div> <!-- container -->
</div> <!-- content -->
</div>
<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>
// Bootstrap datepicker
// Set up your table
$(document).ready(function() {
// Initialize the DataTable
var table = $('#cc').DataTable({
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
buttons: ['excel'],
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
}
}
});
});
</script>