176 lines
4.4 KiB
PHP
176 lines
4.4 KiB
PHP
|
|
|
|
<?php
|
|
if(!empty($Total))
|
|
{
|
|
|
|
}
|
|
?>
|
|
|
|
|
|
<div class="row">
|
|
<!-- Left col -->
|
|
<div class="col-md-12">
|
|
<!-- TABLE: LATEST ORDERS -->
|
|
<div class="box box-info">
|
|
<div class="box-header with-border">
|
|
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Total Orders</b></p></h3></center>
|
|
</div>
|
|
<!-- /.box-header -->
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="input-group input-daterange input">
|
|
<div class="input-group-addon"><b>Date From:</b></div>
|
|
<input type="text" id="min-date" class="form-control filter1" data-date-format="yyyy-mm-dd" placeholder="From:">
|
|
<div class="input-group-addon"><b>to</b></div>
|
|
<input type="text" id="max-date" class="form-control filter1" data-date-format="yyyy-mm-dd" placeholder="To:">
|
|
<div class="input-group-addon"> <a onclick="Reset()" ><b>Clear</b></a></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="col-xs-12 text-right">
|
|
<div class="form-group">
|
|
<a class="btn btn-primary" href="<?php echo base_url(); ?>report/export_total">Export Total Orders <i class="fa fa-download"aira-hidden="true"></i></a>
|
|
</div>
|
|
</div>
|
|
<div class="box-body">
|
|
<div>
|
|
<table class="table table-bordered table-hover" id="req" >
|
|
<thead>
|
|
<tr>
|
|
<th>podate</th>
|
|
<th>Department</th>
|
|
|
|
<th>PO Created</th>
|
|
<th>Approved</th>
|
|
<th>OnHold</th>
|
|
<th>Released</th>
|
|
<th>IGR Created</th>
|
|
<th>MRIR Approved</th>
|
|
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php if(!empty($Total)){
|
|
foreach($Total as $rel)
|
|
{
|
|
?>
|
|
<tr>
|
|
<td align="right"><span><?php $date = new DateTime($rel->podate);echo $date->format('Y-m-d'); ?></span></td>
|
|
<td><span><?php echo $rel->Dept_Name?></span></td>
|
|
|
|
<td align="right"><span><?php echo $rel->PO_Created?></span></td>
|
|
<td align="right"><span><?php echo $rel->Approved?></span></td>
|
|
<td align="right"><span><?php echo $rel->Onhold?></span></td>
|
|
<td align="right"><span><?php echo $rel->Released?></span></td>
|
|
<td align="right"><span><?php echo $rel->IGR_Created?></span></td>
|
|
<td align="right"><span><?php echo $rel->MRIR_Approved?></span></td>
|
|
|
|
|
|
</tr>
|
|
<?php
|
|
}
|
|
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- /.box -->
|
|
</div>
|
|
<!-- /.col -->
|
|
</div>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
// Bootstrap datepicker
|
|
// Set up your table
|
|
table = $('#req').DataTable
|
|
({
|
|
paging: true,
|
|
info: true
|
|
|
|
});
|
|
$( function() {
|
|
var dateFormat = "mm/dd/yy",
|
|
from = $( "#min-date" )
|
|
.datepicker({
|
|
defaultDate: "+0d",
|
|
changeMonth: true,
|
|
numberOfMonths: 1
|
|
})
|
|
.on( "change", function() {
|
|
to.datepicker( "option", "minDate", getDate( this ) );
|
|
}),
|
|
to = $( "#max-date" ).datepicker({
|
|
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;
|
|
}
|
|
} );
|
|
|
|
|
|
//$('.input-daterange').each(function() {
|
|
// $(this).datepicker('clearDates');
|
|
//});
|
|
|
|
|
|
// Extend dataTables search
|
|
$.fn.dataTable.ext.search.push(
|
|
function(settings, data, dataIndex) {
|
|
var min = $('#min-date').val();
|
|
var max = $('#max-date').val();
|
|
var podate = data[0] || 0; // Our date column in the table
|
|
|
|
if (
|
|
(min == "" || max == "") ||
|
|
(moment(podate).isSameOrAfter(min) && moment(podate).isSameOrBefore(max))
|
|
) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
);
|
|
|
|
// Re-draw the table when the a date range filter changes
|
|
$('.filter1').change(function() {
|
|
table.draw();
|
|
});
|
|
|
|
$('#my-table_filter').hide();
|
|
function Reset()
|
|
{
|
|
|
|
$('#min-date').val('');
|
|
$('#max-date').val('');
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|