ria/app/Views/AmendPOlist.php
2024-05-16 04:57:50 +00:00

142 lines
5.7 KiB
PHP

<!-- In this purchase order listing , datatable is used for sorting , pagination and etc.. , new design is used for table fro the theme-->
<style>
.pagination {
margin: 0px !important;
}
</style>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<center>
<h3 class="box-title">Amendment Purchase Order List </h3>
</center>
</div>
<!-- /.box-header -->
<div class="box-body">
<table id="example1" class="table table-hover editableTable" style="background-color:#fff;font-size:12px;">
<thead style="background-color: #ddd;">
<tr>
<!-- <th>#</th> -->
<th>PONO#</th>
<th>PO Type</th>
<th>PO Date</th>
<th>Supplier Name</th>
<th>Total Order Value</th>
<th>PO Status</th>
<th>Delivery Option</th>
<th>Delivery Date</th>
<th>Delivery Schedule</th>
<th>Action</th>
</tr>
</thead>
<tbody><?php
if (!empty($POData)) {
$index = 0;
foreach ($POData as $record) {
$index = $index + 1;
?>
<tr id="<?php echo $index; ?>">
<!-- <td align="left"><?php echo $index; ?></td> -->
<td><?php echo $record->PONO ?></td>
<td><?php echo $record->ReqType ?></td>
<td align="right"><?php $Pdt = new DateTime($record->PODate);
$PODate = $Pdt->format('d-m-Y');
echo $PODate
?></td>
<td><?php echo $record->SupplierName ?></td>
<td align="right"><?php echo $record->TotalOrderValue ?></td>
<!-- <td><?php echo $record->StatusName ?></td> -->
<td><?php
$statusMappings = [
'PO APPROVED' => 'AWAITING APPROVE',
'AWAITING RELEASE' => 'AWAITING APPROVE',
'RELEASER ONHOLD' => 'APPROVER ONHOLD',
'PO RELEASED' => 'PO APPROVED',
];
if (isset($record->StatusName) && !empty($record->StatusName)) {
if (isset($statusMappings[$record->StatusName])) {
echo $statusMappings[$record->StatusName];
} else {
echo $record->StatusName;
}
} else {
echo "Status not provided";
}
?></td>
<td><?php $option = 'By Deliver Date';
if ($record->DeliveryOption == 1) {
$option = "By Schedule";
} else if ($record->DeliveryOption == 2) {
$option = "By Dispatch Instruction";
}
echo $option ?></td>
<td align="right"><?php
if ($record->DeliveryOption == 0) {
$Ddt = new DateTime($record->DeliveryDate);
$Deliverydt = $Ddt->format('d-m-Y');
echo $Deliverydt;
} else if ($record->DeliveryOption == 1) {
$Deliverydt = '';
echo $Deliverydt;
} ?></td>
<td><?php echo $record->DeliverySchedule ?></td>
<td> <a data-toggle="tooltip" href="<?php echo base_url() . 'EditAmendPO?PONO=' . $record->PONO . '&ReqType=' . $record->ReqType . '&CapitalRange=' . $record->CapitalRange; ?>"><i class="fa fa-pencil" data-toggle="tooltip" title="<?php echo $record->PONO; ?> - Click here to Edit Purchase Order details"></i>&nbsp;&nbsp;&nbsp;</a>
<a data-toggle="tooltip" href="<?php echo base_url() . 'EditAmendPO?PONO=' . $record->PONO . '&ReqType=' . $record->ReqType . '&CapitalRange=' . $record->CapitalRange; ?>"> &nbsp;&nbsp;&nbsp; <a data-toggle="tooltip" href="<?php echo base_url() . 'purchaseorder/CreatePOPrint?PONO=' . $record->PONO . '&ReqType=' . $record->ReqType; ?>"><i class="fa fa-print" data-toggle="tooltip" title="<?php echo $record->PONO; ?> - Click here to Print the Purchase Order details"></i>&nbsp;&nbsp;&nbsp;</a>
</td>
<?php
} ?>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<script>
$(function() {
$.fn.dataTable.moment('DD-MM-YYYY');
$('#example1').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
// "columnDefs" : [{"targets":3, "type":"date-eu"}],
"aaSorting": [
[2, "desc"]
],
"info": true,
"autoWidth": false
});
});
</script>
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>