ria/app/Views/leavereportsmonthwise.php
2024-06-12 03:14:50 +00:00

134 lines
6.0 KiB
PHP

<script src="<?php echo base_url()?>public/assets/tabletoexport/jquery.tableexport.v2.js"></script>
<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>
<style>
.dataTables_empty {
text-align: center !important;
}
</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]->FullName ?> "</strong> - Monthwise Leave Reports <?= ' ( '.$finyear.' )' ?></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="leavelistings" 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>Total Work in Days</th> -->
<th>Leave Taken</th>
<th>Paid Leave Taken</th>
</tr>
</thead>
<tbody>
<?php
$index=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->FullName ?></td>
<td><?php
$split_val = explode('-',$record->Month_Year);
$year_val = $split_val[0];
$month_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->NoofWorkedDays)) { echo number_format((int)$record->NoofWorkedDays, 0, '.', ''); } else { echo "0"; } ?></td> -->
<td style="text-align:right;"><?php if (!empty($record->NoofAbsentDays)) { echo number_format((int)$record->NoofAbsentDays, 0, '.', ''); } else { echo "0"; } ?></td>
<td style="text-align:right;"><?php if (!empty($record->NoofPaidLeaveDays)) { echo number_format((int)$record->NoofPaidLeaveDays, 0, '.', ''); } else { echo "0"; } ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div><!-- /.box-body -->
</div><!-- /.box -->
</div><!-- /. col-xs-12 -->
</div><!-- /.inital row -->
</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 = $('#leavelistings').DataTable( {
"columnDefs": [ {
"searchable": false,
"orderable": false,
"targets": 0
} ],
"searching": true,
"lengthChange": true,
"info": true,
"paging": true,
"autoWidth": true,
"language": {
"emptyTable": "No data found"
},
"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();
});
$("#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]->FullName ?>";
var fin_year = "<?php echo $finyear ?>";
var name = "<?php echo 'Leave Month Report for '.$MonthwiseReport[0]->EmpID.''.$MonthwiseReport[0]->FullName .' ( '.$finyear.' )' ?>";
$("#leavelistings").tableExport({
bootstrap: true,
separator: ",",
headings: true,
buttonContent: "Export",
addClass: "",
defaultClass: "btn",
defaultTheme: "btn-default",
type: "csv",
fileName: name,
position: "bottom",
stripQuotes: true
});
</script>