siddharth_application/application/views/cashbook_cumulative_month_report.php
2018-05-22 17:37:37 +05:30

293 lines
14 KiB
PHP
Executable File

<?php
$tiapr=0.00;$timay=0.00;$tijun=0.00;$tijul=0.00;$tiaug=0.00;$tisep=0.00;$tioct=0.00;$tinov=0.00;$tidec=0.00;
$teapr=0.00;$temay=0.00;$tejun=0.00;$tejul=0.00;$teaug=0.00;$tesep=0.00;$teoct=0.00;$tenov=0.00;$tedec=0.00;
$tinjan=0.00;$tinfeb=0.00;$tinmar=0.00;
$texjan=0.00;$texfeb=0.00;$texmar=0.00;
$rowwise = 0.00;
if (date('m') >= 4) {
$yearl = date('Y').'-'.(date('Y')+1);
} else {
$yearl = (date('Y')-1).'-'.date('Y');
}
$ab=$yearl;
$fa=substr($ab,0,-5);
$aa=substr($ab,5,5);
?>
<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;">
<div class="col-md-12">
<div class="box box-info">
<div class="box-header with-border">
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Cashbook - Cumulative Monthwise Report
<!-- ( <?php echo $fa.'-'.$aa; ?> ) -->
<?php
if($this->input->post('client_name')){
$cl=$this->input->post('client_name');
echo '('.$cl.')';
}
if($this->input->post('financialyear')){
$ab=$this->input->post('financialyear');
echo '('.$ab.')';
}
?></b></p></h3></center>
</div>
<div class="panel-body">
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
<div class="form-group has-feedback">
<div class="col-md-4">
<label for="client_name">
<?php echo 'Account Name'; ?>
</label>
<div class="input-group">
<select class="form-control" id="client_name" name="client_name">
<option value="">Select Account Name</option>
<?php
foreach($accountname as $item):
{?>
<option value="<?php echo $item->name;?>"><?php echo $item->name ; ?></option>
<?php } endforeach; ?>
</select>
</div>
</div>
<div class="col-md-2">
<label for="to_date">
<?php echo 'year'; ?>
</label>
<div class="input-group">
<select class="form-control" id="financialyear" name="financialyear">
<option value="">Select Year</option>
<?php
foreach($finyear as $item):
{?>
<option value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
<?php } endforeach; ?>
</select>
</div>
</div>
<div class="col-md-2"></div>
<!-- <div class="col-md-2">
<br>
<label><input type="radio" name="colorRadio" id="value" onclick="toggleTables('2')" value="tab" checked> Recepit</label>
<label><input type="radio" name="colorRadio" id="qty" onclick="toggleTables('1')" value="ta" > Payment</label>
</div> -->
<div class="col-md-2 "><br>
<input type="submit" class="btn btn-success" name="btn_submit"
value="View Report">
</div>
</div>
</form>
</div>
<div class="box-body">
<div class = "table-responsive">
<table class="table table-bordered table-hover table-responsive" id="ccmonthwise" style="font-size:14px;">
<thead>
<tr>
<th style="text-align:center" rowspan="2">Account Name</th>
<th style="text-align:center" colspan="2">April</th>
<th style="text-align:center" colspan="2">May</th>
<th style="text-align:center" colspan="2">June</th>
<th style="text-align:center" colspan="2">July</th>
<th style="text-align:center" colspan="2">August</th>
<th style="text-align:center" colspan="2">September</th>
<th style="text-align:center" colspan="2">October</th>
<th style="text-align:center" colspan="2">November</th>
<th style="text-align:center" colspan="2">December</th>
<th style="text-align:center" colspan="2">January</th>
<th style="text-align:center" colspan="2">February</th>
<th style="text-align:center" colspan="2">March</th>
<th style="text-align:center" rowspan="2">Total</th>
</tr>
<tr>
<th style="text-align:center">Receipt &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Payment &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Receipt &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Payment &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Recepit &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Payment &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Receipt &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Payment &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Receipt &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Payment &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Recepit &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Payment &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Receipt &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Payment &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Receipt &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Payment &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Recepit &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Payment &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Receipt &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Payment &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Receipt &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Payment &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Recepit &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Payment &nbsp;(<i class="fa fa-rupee "></i>)</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($datas)){
foreach($datas as $d)
{
?>
<tr>
<td><?php echo $d->name; ?></td>
<td><?php $tiapr= $tiapr + number_format($d->AprilIncome,2,'.',''); echo number_format($d->AprilIncome,2,'.',''); ?></td>
<td><?php $teapr= $teapr + number_format($d->AprilExpense,2,'.',''); echo number_format($d->AprilExpense,2,'.',''); ?></td>
<td><?php $timay= $timay + number_format($d->MayIncome,2,'.',''); echo number_format($d->MayIncome,2,'.',''); ?></td>
<td><?php $temay= $temay + number_format($d->MayExpense,2,'.',''); echo number_format($d->MayExpense,2,'.',''); ?></td>
<td><?php $tijun= $tijun + number_format($d->JuneIncome,2,'.',''); echo number_format($d->JuneIncome,2,'.',''); ?></td>
<td><?php $tejun= $tejun + number_format($d->JuneExpense,2,'.',''); echo number_format($d->JuneExpense,2,'.',''); ?></td>
<td><?php $tijul= $tijul + number_format($d->JulyIncome,2,'.',''); echo number_format($d->JulyIncome,2,'.',''); ?></td>
<td><?php $tejul= $tejul + number_format($d->JulyExpense,2,'.',''); echo number_format($d->JulyExpense,2,'.',''); ?></td>
<td><?php $tiaug= $tiaug + number_format($d->AugustIncome,2,'.',''); echo number_format($d->AugustIncome,2,'.',''); ?></td>
<td><?php $teaug= $teaug + number_format($d->AugustExpense,2,'.',''); echo number_format($d->AugustExpense,2,'.',''); ?></td>
<td><?php $tisep= $tisep + number_format($d->SepIncome,2,'.',''); echo number_format($d->SepIncome,2,'.',''); ?></td>
<td><?php $tesep= $tesep + number_format($d->SepExpense,2,'.',''); echo number_format($d->SepExpense,2,'.',''); ?></td>
<td><?php $tioct= $tioct + number_format($d->OctIncome,2,'.',''); echo number_format($d->OctIncome,2,'.',''); ?></td>
<td><?php $teoct= $teoct + number_format($d->OctExpense,2,'.',''); echo number_format($d->OctExpense,2,'.',''); ?></td>
<td><?php $tinov= $tinov + number_format($d->NovIncome,2,'.',''); echo number_format($d->NovIncome,2,'.',''); ?></td>
<td><?php $tenov= $tenov + number_format($d->NovExpense,2,'.',''); echo number_format($d->NovExpense,2,'.',''); ?></td>
<td><?php $tidec= $tidec + number_format($d->DecIncome,2,'.',''); echo number_format($d->DecIncome,2,'.',''); ?></td>
<td><?php $tedec= $tedec + number_format($d->DecExpense,2,'.',''); echo number_format($d->DecExpense,2,'.',''); ?></td>
<td><?php $tinjan= $tinjan + number_format($d->JanIncome,2,'.',''); echo number_format($d->JanIncome,2,'.',''); ?></td>
<td><?php $texjan= $texjan + number_format($d->JanExpense,2,'.',''); echo number_format($d->JanExpense,2,'.',''); ?></td>
<td><?php $tinfeb= $tinfeb + number_format($d->FebIncome,2,'.',''); echo number_format($d->FebIncome,2,'.',''); ?></td>
<td><?php $texfeb= $texfeb + number_format($d->FebExpense,2,'.',''); echo number_format($d->FebExpense,2,'.',''); ?></td>
<td><?php $tinmar= $tinmar + number_format($d->MarIncome,2,'.',''); echo number_format($d->MarIncome,2,'.',''); ?></td>
<td><?php $texmar= $texmar + number_format($d->MarExpense,2,'.',''); echo number_format($d->MarExpense,2,'.',''); ?></td>
<td><?php $rowwise = $rowwise + number_format($d->overalltotal,2,'.',''); echo number_format($d->overalltotal,2,'.',''); ?></td>
</tr>
<?php } ?>
</tbody>
<tfoot width="100%">
<tr>
<td><b><?php echo "TOTAL" ?></b></td>
<td><b><?php echo number_format($tiapr,2,'.',''); ?></b></td>
<td><b><?php echo number_format($teapr,2,'.',''); ?></b></td>
<td><b><?php echo number_format($timay,2,'.',''); ?></b></td>
<td><b><?php echo number_format($temay,2,'.',''); ?></b></td>
<td><b><?php echo number_format($tijun,2,'.',''); ?></b></td>
<td><b><?php echo number_format($tejun,2,'.',''); ?></b></td>
<td><b><?php echo number_format($tijul,2,'.',''); ?></b></td>
<td><b><?php echo number_format($tejul,2,'.',''); ?></b></td>
<td><b><?php echo number_format($tiaug,2,'.',''); ?></b></td>
<td><b><?php echo number_format($teaug,2,'.',''); ?></b></td>
<td><b><?php echo number_format($tisep,2,'.',''); ?></b></td>
<td><b><?php echo number_format($tesep,2,'.',''); ?></b></td>
<td><b><?php echo number_format($tioct,2,'.',''); ?></b></td>
<td><b><?php echo number_format($teoct,2,'.',''); ?></b></td>
<td><b><?php echo number_format($tinov,2,'.',''); ?></b></td>
<td><b><?php echo number_format($tenov,2,'.',''); ?></b></td>
<td><b><?php echo number_format($tidec,2,'.',''); ?></b></td>
<td><b><?php echo number_format($tedec,2,'.',''); ?></b></td>
<td><b><?php echo number_format($tinjan,2,'.',''); ?></b></td>
<td><b><?php echo number_format($texjan,2,'.',''); ?></b></td>
<td><b><?php echo number_format($tinfeb,2,'.',''); ?></b></td>
<td><b><?php echo number_format($texfeb,2,'.',''); ?></b></td>
<td><b><?php echo number_format($tinmar,2,'.',''); ?></b></td>
<td><b><?php echo number_format($texmar,2,'.',''); ?></b></td>
<td><b><?php echo number_format($rowwise,2,'.',''); ?></b></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 = $('#ccmonthwise').DataTable( {
"dom": "<'row'<'col-md-3'l><'col-md-9'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'
]
} );
} );
</script>