116 lines
4.9 KiB
PHP
Executable File
116 lines
4.9 KiB
PHP
Executable File
<div class="content-page">
|
|
<div class="content">
|
|
<!-- Start Content-->
|
|
<div class="container-fluid">
|
|
<!-- start page title -->
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="page-title-box page-title-box-alt">
|
|
<div class="page-title-right">
|
|
<ol class="breadcrumb m-0">
|
|
<li class="breadcrumb-item"><a href="javascript: void(0);">HR</a></li>
|
|
<li class="breadcrumb-item"><a href="javascript: void(0);">PaySlip</a></li>
|
|
<li class="breadcrumb-item active">
|
|
<h4 class="page-title">Employee Loan Details</h4>
|
|
</li>
|
|
</ol>
|
|
</div>
|
|
|
|
|
|
<a class="btn btn-success auditor-restricted-btn" href="<?php echo base_url(); ?>emppaydate/addemppaydate">Create New Loan</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<table id="datatable" class="table table-hover dt-responsive nowrap w-100" style="background-color:#fff;">
|
|
<!-- <table id="datatable" class="table dt-responsive nowrap w-100 ria_data_table"> any doubts ask about datable plugin ask VV-->
|
|
<thead>
|
|
<tr>
|
|
<th width="15%">Employee</th>
|
|
<th width="7%"> Total Sal in ₹</th>
|
|
<th width="7%"> Loan Amt in ₹</th>
|
|
<th width="7%"> Loan Issued Date</th>
|
|
<th width="7%"> Monthly Due Amt in ₹</th>
|
|
<th width="7%"> No Of Dues</th>
|
|
<th width="7%"> Paid Dues</th>
|
|
<th width="7%"> Remaining Dues</th>
|
|
<th width="7%"> Paid Amt in ₹</th>
|
|
<th width="7%">Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
if (!empty($userRecords)) {
|
|
foreach ($userRecords as $record) { ?>
|
|
<tr>
|
|
<td style="text-align: left;"><?php echo $record->EmpID ?>-<?php echo $record->FirstName; ?></td>
|
|
<td><?php echo $record->TotalSalary; ?></td>
|
|
<td><?php echo $record->Loan_Amount; ?></td>
|
|
<td><?php echo get_date_time_dynamical_format('Y-m-d','d-m-Y',"$record->Loan_Issued_Date"); ?></td>
|
|
<td><?php echo $record->Monthly_Due; ?></td>
|
|
<td><?php echo $record->No_of_Dues; ?></td>
|
|
<td><?php echo $record->Paid_Due; ?></td>
|
|
<td><?php echo $record->Remaining_Due; ?></td>
|
|
<td><?php echo $record->Paid_Amount; ?></td>
|
|
<td>
|
|
<a href="<?php echo base_url() . 'emppaydate/downloadEmpLoanData/' . $record->Pay_Data_ID; ?>"><i class="fas fa-download"></i></a>
|
|
|
|
<a class="edit-btn" href="<?php echo base_url() . 'emppaydate/editOldemppay/' . $record->Pay_Data_ID; ?>"><i class="fas fa-pencil-alt"></i></a>
|
|
</td>
|
|
</tr>
|
|
<?php }
|
|
} ?>
|
|
</tbody>
|
|
</table>
|
|
</div> <!-- end card body-->
|
|
</div> <!-- end card -->
|
|
</div><!-- end col-->
|
|
</div>
|
|
</div> <!-- container -->
|
|
</div> <!-- content -->
|
|
</div>
|
|
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
|
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('#datatable').DataTable({
|
|
dom: 'Bfrtip', // Enables the Buttons layout
|
|
buttons: [
|
|
'excelHtml5',
|
|
'pdfHtml5'
|
|
]
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<script>
|
|
$(document).ready(function () {
|
|
// Ensure DataTable is initialized
|
|
let table = $('#datatable').DataTable();
|
|
|
|
console.log("DataTable initialized:", table ? "Yes" : "No");
|
|
|
|
// Store page number on edit button click
|
|
$('#datatable').on('click', '.edit-btn', function () {
|
|
const pageInfo = table.page.info();
|
|
|
|
console.log("Edit clicked, current page info:", pageInfo);
|
|
|
|
sessionStorage.setItem("datatablePage", pageInfo.page);
|
|
});
|
|
|
|
// Restore page if saved
|
|
let startPage = sessionStorage.getItem("datatablePage");
|
|
if (startPage !== null) {
|
|
console.log("Restoring to page:", startPage);
|
|
table.page(parseInt(startPage)).draw('page');
|
|
sessionStorage.removeItem("datatablePage");
|
|
} else {
|
|
console.log("No page info found in sessionStorage.");
|
|
}
|
|
});
|
|
</script>
|