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

222 lines
6.1 KiB
PHP

<div id="headerbar">
<h1 class="headerbar-title"><?php _trans('Year Wise Sales Report'); ?></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 id="report_options" class="panel panel-default">
<a href="#" style="float:right; font-size:30px; margin-right:17px;" class="show_hide">-</a>
<div class="panel-heading">
<i class="fa fa-print"></i>
<?php _trans('Select Year'); ?>
</div>
<div class="slidingDiv">
<div class="panel-body">
<form method="post" id="fo" action=" ">
<input type="hidden" name="_ip_csrf" value="<?= $this->security->get_csrf_hash() ?>">
<select class="form-control" id="financialyear" name="financialyear">
<option value="">Select</option>
<?php
foreach($result as $item):
{?>
<option value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
<?php } endforeach; ?>
</select>
<p>&nbsp;</p>
<input type="submit" class="btn btn-success" name="btn_submit"
value="View Report" onclick="JavaScript:window.location.hash = '#tabl'" >
</form>
</div>
</div>
</div>
</div>
</div>
<div id="tabl">
<?php
if(!empty($results))
{
?>
<center><h3 class="report_title">
<?php echo trans('Year-Wise'); ?>(<?php echo $ab=$this->input->post('financialyear');
?>)
</h3></center>
<div class="table-responsive">
<div id="panel-recent-invoices" class="panel panel-default">
<body>
<h3 class="report_title">
<?php
//$ab=$this->input->post('financialyear');
//echo $ab;
?><br/>
<small><?php //echo $from_date . ' - ' . $to_date ?></small>
</h3>
<table class="table table-striped table-condensed no-margin" id="tab">
<thead>
<tr>
<th style="text-align:center"><?php echo trans('Months'); ?></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;
$ab=$this->input->post('financialyear');
foreach ($results as $result) { ?>
<tr>
<td style="text-align:center"><?php
$date = strtotime($result->months);
$new_date = date('M-y', $date);
//echo anchor('reports/month_wise/' . $result->months,($new_date) );
?><a href="<?= site_url() ?>/reports/month_wise?ab=<?php echo $ab;?>&date=<?php echo $result->months;?>">
<?php echo $new_date;?></a></td>
<td class="amount"><?php
$tr3= $tr3 + $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 width="100%">
<tr>
<td style="text-align:center;"><strong><?php
$ab=$this->input->post('financialyear');
$Total="Total";
echo anchor('reports/year_wise_total/' . $ab,$Total); ?></strong>
</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 }
if(empty($results))
{
echo "<center><h3>No Records Found</h3></center>";
}
?>
</body>
</div>
</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,
"order": [],
"aoColumnDefs": [
{ 'bSortable': false, 'aTargets': [ 0 ] }
],
dom: 'Bfrtip',
buttons: [
{
extend: 'excelHtml5',
footer: 'true',
//messageTop: $('h3').text(),
title: $('center').text(),
exportOptions: {
columns: ':visible'
}
},
'colvis'
]
} );
} );
$(document).ready(function () {
$(".slidingDiv").show();
$('.show_hide').click(function (e) {
$(".slidingDiv").slideToggle("fast");
var val = $(this).text() == "-" ? "+" : "-";
$(this).hide().text(val).fadeIn("fast");
e.preventDefault();
});
});
</script>