ria/app/Views/cashbookmonthlyexp.php
2024-09-11 08:54:25 +05:30

231 lines
6.1 KiB
PHP
Executable File

<?php
$department='';
if(!empty($departmentwise))
{
foreach($departmentwise as $dw)
{
$department=$dw->name;
//echo $department;
break;//echo $department;
// echo $department;
}
}
$inrsymbol='';
if(!empty($Indiancurrency))
{
foreach ($Indiancurrency as $inr)
{
$inrsymbol = $inr->FontCode2000;
}}
?>
<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;
}
</style>
<div class="content-wrapper">
<!-- Main content -->
<section class="content">
<div class="col-md-12">
<div id="panel-quick-actions" class="panel panel-default quick-actions">
<div class="panel-heading">
<center><h3 class="box-title"><p style="color: #00d976;"><b><?php $d=$_GET['d'] ;echo $d;?> Report (DEP:<?php echo $department;?>)</b></p></h3></center>
</div>
<div class="btn-group btn-group-justified no-margin">
<div>
<table class="table table-bordered table-hover" id="req" style="font-size:13px;">
<thead>
<tr>
<th>Date</th>
<th>Account Name</th>
<th>Type</th>
<th>Received From</th>
<th style="text-align:right;"> Receipt <?php echo '('.$inrsymbol.')' ?></th>
<th>Description</th>
<th>File</th>
</tr>
</thead>
<tbody>
<?php
$ti=0.00;
if(!empty($departmentwise)){
foreach($departmentwise as $dw)
{
?>
<tr>
<td><span><?php echo $dw->date?></span></td>
<td align="left"><span><?php echo $dw->name?></span></td>
<td align="left"><span><?php echo $dw->type?></span></td>
<td align="left"><span><?php echo $dw->receiptname?></span></td>
<td align="right"><span><?php
$ti= $ti + number_format($dw->income,2,'.','');
echo number_format($dw->income,2,'.','');?></span></td>
<td align="left"><span><?php echo $dw->description?></span></td>
<td>
<?php
if(!empty($dw->document))
{
?>
<a target="_blank" href="<?php echo base_url().$dw->document ?>"><i class="fa fa-download" ></i></a>
<?php
}
else
{
echo "NO FILE";
}
?>
</td>
</tr>
<?php
}
}
?>
</tbody>
<tfoot width="100%">
<tr>
<td style="text-align:left;"><strong>Total</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align:right"><strong>
<?php
{
echo number_format($ti,2,'.','');
}
?>
</strong>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</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 src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
<script>
// Bootstrap datepicker
// Set up your table
$(document).ready(function() {
$.fn.dataTable.moment( 'DD-MM-YYYY' );
table = $('#req').DataTable( {
"language": {
"emptyTable":"<center> Data Not Found ! </center>"
},
"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'
],
"footerCallback": function ( row, data, start, end, display ) {
var api = this.api(), data;
// Remove the formatting to get integer data for summation
var intVal = function ( i ) {
return typeof i === 'string' ?
parseFloat(i.replace(/[^0.00-9.00]+/g,"")*1) :
typeof i === 'number' ?
parseFloat(i) : 0;
};
TotalPmt = api
.column( 4, { search:'applied' } )
.data()
.reduce( function (a, b) {
return intVal(a) + intVal(b);
}, 0 );
$( api.column( 4 ).footer() ).html( TotalPmt.toFixed(2).bold() );
}
} );
} );
</script>