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

194 lines
8.0 KiB
PHP
Executable File

<script src="<?php echo base_url()?>public/assets/tabletoexport/jquery.tableexport.v2.js"></script>
<style>
.ui-datepicker-trigger{
border:none;
background:none;
}
</style>
<script src="<?php echo base_url()?>public/assets/lightswitch/lightswitch/lib/jquery.tabletojson.js"></script>
<script src="<?php echo base_url()?>public/assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js"></script>
<style type="text/css">
.num {
text-align:right;
}
</style>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center><strong>" <?php echo $MonthwiseReport[0]->EmpID ?> - <?php echo $MonthwiseReport[0]->FirstName ." ". $MonthwiseReport[0]->LastName ?> "</strong> - Monthwise Incentive and Bonus Reports</center>
</h1>
</section>
<section class="content" id="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-body">
<table id="monthlylistings" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead style="background-color: #ddd;">
<tr>
<th>S.No</th>
<th>Employee Id</th>
<th>Employee Name</th>
<th>Month Year</th>
<th>Incentives in </th>
<th>Festival Bonus in </th>
</tr>
</thead>
<tbody>
<?php
$index=0;
$total=0;
$totalbonus=0;
if(!empty($MonthwiseReport))
{
foreach($MonthwiseReport as $record)
{
$index++;
?>
<tr>
<td style="text-align:right;"><?php echo $index; ?></td>
<td style="text-align:right;"><?php echo $record->EmpID ?></td>
<td><?php echo $record->FirstName ." ". $record->LastName ?></td>
<td><?php
$split_val = explode('-',$record->Month_Year);
$month_val = $split_val[0];
$year_val = $split_val[1];
$monthName = date("M", mktime(0, 0, 0, $month_val, 10));
echo $monthName . " , ".$year_val
?></td>
<td style="text-align:right;"><?php if(!empty($record->Incentives)){$total+=$record->Incentives; echo $record->Incentives;}else{echo "0.00";}?></td>
<td style="text-align:right;"><?php if(!empty($record->Bonus)){$totalbonus+=$record->Bonus ;echo $record->Bonus;}else{echo "0.00";} ?></td>
</tr>
<?php
}
}
?>
</tbody>
<tfoot>
</tr>
<td></td>
<td></td>
<td></td>
<td><?php echo "Total" ?></td>
<!-- <td style="text-align:right;" colspan="3"><?php echo "Total"; ?></td> -->
<td style="text-align:right;"><?php echo number_format($total,2,'.',''); ?></td>
<td style="text-align:right;"><?php echo number_format($totalbonus,2,'.','');?></td>
</tr>
</tfoot>
</table>
</div>
</div><!-- /.box-body -->
</div><!-- /.box -->
</div><!-- /.inital row -->
</div><!-- /.12 md div closed -->
</section><!-- /.content section closed -->
</div><!-- /.content wrapper -->
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
<script type="text/javascript">
/*-----------------on ready function ------------------------------- */
$(function () {
/*-----------------for data table ------------------------------ */
var t = $('#monthlylistings').DataTable( {
"columnDefs": [ {
"searchable": false,
"orderable": false,
"targets": 0
} ],
"searching": true,
"lengthChange": true,
"info": true,
"paging": true,
"autoWidth": true,
"order": [[ 0, 'asc' ]]
} );
/**---------------for table index value using datatable -------- */
t.on( 'order.dt search.dt', function () {
t.column(0, {search:'applied', order:'applied'}).nodes().each( function (cell, i) {
cell.innerHTML = i+1;
} );
} ).draw();
/**-----------------for date picker ---------------------------- */
$("#finyear").datepicker(
{
minViewMode: 1,
//format: 'M-yyyy',
});
/**----------------for change function using datepicker -------- */
$("#finyear").change(function(){
$("#finyearttext").val('');
var date = $('#finyear').datepicker('getDate');
$("#finyear").val("Year");
var month = date.getMonth();
var year = date.getFullYear();
month++;
if (month >= 4)
{
$("#finyear").val("Year");
$("#finyearttext").val(year + '-' + (year+1));
}
else
{
$("#finyear").val("Year");
$("#finyearttext").val((year-1) + '-' + year);
}
});
/*------after reload display the value text box (fin_year text box)------- */
//if(!empty($dropdownvalue)){
// var s = "<?php // echo $dropdownvalue; ?>";
// $('#finyearttext').val(s);
///}
});
/*-----------------on ready function ends here---------------------------- */
/*--------------------------for view report button------------------------ */
$("#report").click(function(){
$("#formid").attr("method", "post");
$("#formid").attr("action", "<?php echo base_url() ?>payslip/Bonusreport");
$('#formid').submit();
});
/*-----------------for export execl button------------------------------- */
var employee = "<?php echo $MonthwiseReport[0]->EmpID ?> - <?php echo $MonthwiseReport[0]->FirstName ." ". $MonthwiseReport[0]->LastName ?>";
var fin_year = "<?php echo $finyear ?>";
var name = "<?php echo 'Incentive and Bonus month Report for '.$MonthwiseReport[0]->EmpID.''.$MonthwiseReport[0]->FirstName ." ". $MonthwiseReport[0]->LastName.' ( '.$finyear.' )' ?>";
$("#monthlylistings").tableExport({
bootstrap: true,
separator: ",",
headings: true,
buttonContent: "Export",
addClass: "",
defaultClass: "btn",
defaultTheme: "btn-default",
type: "csv",
fileName: name,
position: "bottom",
stripQuotes: true
});
</script>