riainvoice/application/modules/reports/views/year_wise_total.php
2021-10-01 23:34:16 +05:30

153 lines
4.1 KiB
PHP

<div id="headerbar">
<h1 class="headerbar-title"><?php _trans('Year-Wise'); ?></h1>
</div>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<div id="content">
<div class="row">
<div class="col-xs-12 col-md-6 col-md-offset-3">
<?php $this->layout->load_view('layout/alerts'); ?>
</div>
</div>
<?php
if(!empty($results))
{
?>
<center><h3 class="report_title">
<?php echo trans('Year-Wise'); ?>(
<?php
$last = $this->uri->total_segments();
$month=$this->uri->segment($last);
echo $month;
?>)
<br/>
</h3></center>
<div class="table-responsive">
<div id="panel-recent-invoices" class="panel panel-default">
<body>
<table class="table table-striped table-condensed no-margin" id="tab">
<thead>
<tr>
<th><?php echo trans('Customer Name'); ?></th>
<th><?php echo trans('Products'); ?></th>
<th class="amount"><?php echo trans('Quantity'); ?></th>
<th class="amount"><?php echo trans('Value'); ?></th>
</tr>
</thead>
<tbody>
<?php
$tr3=0;
$tr4=0;
$last = $this->uri->total_segments();
$month=$this->uri->segment($last);
foreach ($results as $result) { ?>
<tr>
<td>
<a href="<?= site_url() ?>/reports/link_sales?client_name=<?php echo $result->client_name;?>&ab=<?php echo $month;?>"><?php echo $result->client_name;?></a>
</td>
<td><?php
echo $result->product_name; ?></td>
<td class="amount"><?php
$tr3= $tr3 + round($result->quantity);
echo round($result->quantity); ?></td>
<td class="amount"><?php
$tr4= $tr4 + $result->value;
echo format_currency(round($result->value)); ?></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr>
<td style="text-align:center;"><strong>Total</strong></td>
<td>&nbsp;</td>
<td class="amount">
<strong>
<?php
{
echo round($tr3);
}
?>
</strong>
</td>
<td class="amount">
<strong>
<?php
{
echo format_currency(round($tr4));
}
?>
</strong>
</td>
</tr>
</tfoot>
</table>
<?php } ?>
</body>
</div>
</div>
</div>
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<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>
$(document).ready(function() {
$('#tab').DataTable( {
"pageLength": 30,
dom: 'Bfrtip',
buttons: [
{
extend: 'excelHtml5',
footer: 'true',
//messageTop: $('h3').text(),
title: $('center').text(),
exportOptions: {
columns: ':visible'
}
},
// {
// extend: 'pdfHtml5',
// exportOptions: {
// columns: [ 0, 1, 2 ],
// }
// },
'colvis'
]
} );
} );
</script>