siddharth_application/application/views/Report_cumulative.php
2018-04-30 16:38:20 +05:30

281 lines
7.7 KiB
PHP
Executable File

<?php
if(!empty($mms))
{
}
?>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
.dataTables_filter input {padding: 4px;}
.dataTables_filter {
width: 50%;
float: right;
text-align: right;
}
.dataTables_paginate {
width: 50%;
float: right;
text-align: right;
}
div.dt-buttons {
position: relative;
float: right;
}
.btn-success {
background-color: #3c8dbc;
border-color: #3c8dbc;
}
</style>
<div class="content-wrapper">
<section class="content">
<div class="row" style="min-height: 600px;">
<!-- 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>Report - Cumulative</b>
(<i>
<?php
if (date('m') >= 4) {
$yearl = date('Y').'-'.(date('Y')+1);
} else {
$yearl = (date('Y')-1).'-'.date('Y');
}
echo $yearl;
?>
</i>)</p></h3></center>
</div>
<!-- /.box-header -->
<div class="box-body">
<div>
<table class="table table-bordered table-hover" id="cc" style="font-size:14px;">
<thead>
<tr>
<?php
if (date('m') >= 4) {
$yearl = date('Y').'-'.(date('Y')+1);
} else {
$yearl = (date('Y')-1).'-'.date('Y');
}
$ab=$yearl;
?>
<th style="text-align:center" rowspan="2">Supplier Name</th>
<th style="text-align:center" rowspan="2">Material Name</th>
<th style="text-align:center" colspan="2"><?php echo date('d-m-Y'); ?></th>
<th style="text-align:center" colspan="2"><?php echo date('M-Y'); ?></th>
<th style="text-align:center" colspan="2"><?php echo $ab; ?></th>
</tr>
<tr>
<th style="text-align:center">Quantity</th>
<th style="text-align:center">Value &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Quantity</th>
<th style="text-align:center">Value &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Quantity</th>
<th style="text-align:center">Value &nbsp;(<i class="fa fa-rupee "></i>)</th>
</tr>
</thead>
<tbody>
<?php if(!empty($cum)){
$yqt=0.00;
$yvt=0.00;
$mqt=0.00;
$mvt=0.00;
$tqt=0.00;
$tvt=0.00;
if (date('m') >= 4) {
$yearl = date('Y').'-'.(date('Y')+1);
} else {
$yearl = (date('Y')-1).'-'.date('Y');
}
$ab=$yearl;
foreach($cum as $rel)
{
?>
<tr>
<td><span>
<a href="<?= base_url() ?>report/link_purchase?sid=<?php echo $rel->sid;?>&ab=<?php echo $ab;?>&mid=<?php echo $rel->mid;?>"><?php echo $rel->supplier_name;?></a>
</span></td>
<td><span><?php echo $rel->material_name;?></span></td>
<td style="text-align:right"><span><?php
$tqt= $tqt + round($rel->tquantity);
echo anchor('report/cum_day/'.$rel->sid . '/' . $rel->mid,round($rel->tquantity));?></span></td>
<td style="text-align:right"><span><?php
$tvt= $tvt + number_format($rel->ttotal,2,'.','');
echo anchor('report/cum_day/'.$rel->sid . '/' . $rel->mid,number_format($rel->ttotal,2,'.',''));?></span></td>
<td style="text-align:right"><span><?php
$mqt= $mqt + round($rel->mquantity);
echo anchor('report/cum_month/'.$rel->sid . '/' . $rel->mid,round($rel->mquantity));?></span></td>
<td style="text-align:right"><span><?php
$mvt= $mvt + number_format($rel->mtotal,2,'.','');
echo anchor('report/cum_month/'.$rel->sid . '/' . $rel->mid,number_format($rel->mtotal,2,'.',''));?></span></td>
<td style="text-align:right"><span><?php
$yqt= $yqt + round($rel->quantity);
echo anchor('report/cum_year/'.$rel->sid . '/' . $rel->mid,round($rel->quantity));?></span></td>
<td style="text-align:right"><span><?php
$yvt= $yvt + number_format($rel->total,2,'.','');
echo anchor('report/cum_year/'.$rel->sid . '/' . $rel->mid,number_format($rel->total,2,'.',''));?></span></td>
</tr>
<?php
}
?>
</tbody>
<tfoot width="100%">
<tr>
<td style="text-align:center;"><strong>Total</strong></td>
<td style="text-align:right"><strong>
<?php
{
echo '';
}
?>
</strong>
</td>
<td style="text-align:right">
<strong>
<?php
{
echo $tqt;
}
?>
</strong>
</td>
<td style="text-align:right">
<strong>
<?php
{
echo number_format($tvt,2,'.','');
}
?>
</strong>
</td>
<td style="text-align:right">
<strong>
<?php
{
echo $mqt;
}
?>
</strong>
</td>
<td style="text-align:right">
<strong>
<?php
{
echo number_format($mvt,2,'.','');
}
?>
</strong>
</td>
<td style="text-align:right">
<strong>
<?php
{
echo $yqt;
}
?>
</strong>
</td>
<td style="text-align:right">
<strong>
<?php
{
echo number_format($yvt,2,'.','');
}
?>
</strong>
</td>
</tr>
</tfoot>
<?php
}
?>
</table>
</div>
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
</section>
</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>
// Bootstrap datepicker
// Set up your table
$(document).ready(function() {
table = $('#cc').DataTable( {
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
"<'row'<'col-md-6'><'col-md-6'>>" +
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
buttons: [
{
extend: 'excelHtml5',
footer: 'true',
//messageTop: $('h3').text(),
title: $('h3').text(),
exportOptions: {
columns: ':visible'
}
},
'colvis'
]
} );
} );
$('#mySelect').on('change',function(){
table
.column(4)
.search(this.value)
.draw();
});
</script>