FEATURE_ENTIRE_PAGE_TABLE_PAGENATION : AADHAVAN

This commit is contained in:
aadhavan valli 2024-03-29 17:29:21 +05:30
parent 81f1cd01f2
commit 3d860d23a2
14 changed files with 106 additions and 48 deletions

View File

@ -294,6 +294,7 @@ class ClientController extends AdminController
// print_r($this->request->getFile('client_logo'));die;
$file_name = file_Upload($this->request->getFile('client_logo'), $uploadFilePath);
$id = $this->request->getPost('PrimaryKey');
$data = $this->request->getPost();
$data['updated_by'] = get_session_userid();
$data['client_logo'] = $file_name;
@ -303,8 +304,6 @@ class ClientController extends AdminController
} elseif ($data['is_download_btn']) {
$data['is_download_btn'] = 1;
}
// print_r($data);die;
$update = $this->clientModel->update($id,$data);

View File

@ -680,7 +680,7 @@ class MasterController extends AdminController
$insert = $this->kycDocsModel->insert($data);
if($insert){
$kycDocsData = $this->kycDocsModel->where('kyc_type_id', $data['kyc_type_id'])->findAll();
$kycDocsData = $this->kycDocsModel->where('kyc_type_id', $data['kyc_type_id'])->where('is_active',1)->findAll();
echo json_encode(array("status" => true , 'data' => $kycDocsData));
}else{
echo json_encode(array("status" => false));
@ -715,8 +715,7 @@ class MasterController extends AdminController
$this->myLogger->logme('error','Edit KYC Docs Onboarding function called');
// print_r("id");
// print_r($id);die;
$editData['kyc_docs'] = $this->kycDocsModel->where(['kyc_type_id' => $id, 'is_active' => 1])->findAll();
// Return JSON response
@ -862,7 +861,12 @@ class MasterController extends AdminController
$data['created_by'] = get_session_userid();
$insert = $this->policesModel->insert($data);
if($insert){
$policiesData = $this->policesModel->where('policy_type_id', $this->request->getPost('policy_type_id'))->findAll();
$policiesData = $this->policesModel->select('policies.*, insurers.name as insurer_name')
->join('insurers', 'insurers.id = policies.insurer_id')
->where('policies.policy_type_id', $this->request->getPost('policy_type_id'))
->where('policies.is_active', 1)
->findAll();
// $policiesData = $this->policesModel->where('policy_type_id', $this->request->getPost('policy_type_id'))->findAll();
echo json_encode(array("status" => true , 'data' => $policiesData));
}else{
echo json_encode(array("status" => false));
@ -896,7 +900,12 @@ class MasterController extends AdminController
$headerData['page_name'] = 'Edit Policy Type';
$editData['policytype'] = $this->policyTypeModel->where(['id' => $id, 'is_active' => 1])->first();
$editData['policies'] = $this->policesModel->where(['policy_type_id' => $id, 'is_active' => 1])->findAll();
$editData['policies'] = $this->policesModel->select('policies.*, insurers.name as insurer_name')
->join('insurers', 'insurers.id = policies.insurer_id')
->where('policies.policy_type_id', $id)
->where('policies.is_active', 1)
->findAll();
// $editData['policies'] = $this->policesModel->where(['policy_type_id' => $id, 'is_active' => 1])->findAll();
$editData['insurer'] = $this->insurerModel-> findAll();
echo view('layout/header', $headerData);
echo view('policy_type_onboarding', $editData);
@ -933,6 +942,7 @@ class MasterController extends AdminController
// Retrieve the insurer information
$insurer = $this->insurerModel->find($policy['insurer_id']);
// print_r($insurer);die;
// Add the insurer information to the editData array
if ($insurer) {
$editData['policies'][$policy['id']] = [

View File

@ -56,9 +56,6 @@ class ClientModel extends Model
return $this->db->table('clients')
->select('clients.*')
->select('user_profiles.first_name as user_name')
->join('user_profiles', 'user_profiles.id = clients.created_by')
->where('clients.is_active', 1)
->get()
->getResult();

View File

@ -254,6 +254,7 @@ input:checked + .slider:before {
var OptionsHTML1 = ''
$.ajax({
data:formData,
url: form_action,
type: "POST",
dataType: 'json',

View File

@ -9,6 +9,9 @@
<?php echo $clientName[0]['client_name'];?></h4>
</div>
<div class="col-6" style="text-align: right;">
<a href="<?= base_url("client/list"); ?>"><i class="fas fa-arrow-left" style="font-size: 17px;"></i></a>
</div>
<!-- <div class="col-6" style="text-align: right; position: relative;top: 53px;">
<a href="<?= base_url("client/client_deposit"); ?>" type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" data-toggle="" data-placement="top" title="Add" data-trigger="hover">ADD</a>
</div> -->

View File

@ -55,31 +55,35 @@
</div>
<!-- end row -->
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> -->
<!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> -->
<!-- Include DataTables JS -->
<!-- <script src="https://cdn.datatables.net/1.11.6/js/jquery.dataTables.min.js"></script> -->
<script>
$(document).ready(function(){
$('#tickets-table').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" ,
buttons: [
{
extend: 'csv',
text: 'CSV',
title: 'ClientList',
className: 'my_class',
exportOptions: {
columns: ':not(:last-child)'
},
}
],
language: {
search: "_INPUT_",
searchPlaceholder: "Search..."
$('#tickets-table').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
buttons: [{
extend: 'csv',
text: 'CSV',
title: 'ClientList',
className: 'my_class',
exportOptions: {
columns: ':not(:last-child)'
},
});
}],
language: {
search: "_INPUT_",
searchPlaceholder: "Search..."
},
paging: true ,
// pagingType: 'full_numbers'
});
})

View File

@ -5,9 +5,9 @@
<button type="button" id="BtnAdd" class="btn btn-primary waves-effect waves-light btnAdd btn-sm"><span class="fa fa-plus-square" aria-hidden="true" style="padding: 5px 10px;"></span>Add Policy</button>
</div>
<div class="table-responsive" id="table_list" style="height:200px">
<div class="table-responsive" id="table_list">
<table class="table table-borderless table-nowrap mb-0">
<table class="table table-borderless table-nowrap mb-0" id="table-client-policy">
<thead class="thead-light">
<tr>
<th>Insurer</th>
@ -222,6 +222,12 @@
}
$('#table-client-policy').DataTable({
paging: true ,
searching: false
});
});
/******** for form submit using AJAX *******/

View File

@ -50,7 +50,9 @@
$(document).ready(function(){
$('#tickets-table').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" ,
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>" ,
buttons: [
{
extend: 'csv',
@ -67,7 +69,7 @@
search: "_INPUT_",
searchPlaceholder: "Search..."
},
paging: true ,
});
})

View File

@ -6,7 +6,7 @@
<div class="table-responsive" id="branch_table" >
<table class="table table-borderless table-nowrap mb-0">
<table class="table table-borderless table-nowrap mb-0" id="table-kyc-docs">
<thead class="thead-light">
<tr>
<th>File Name</th>
@ -249,10 +249,12 @@ $(document).ready(function () {
$('body').on('click', '#btnSubmit', function() {
$('#kyc_docs_list').html(" ");
$('#kyc_docs_list').html("");
console.log($('#kyc_docs_list')[0]);
setTimeout(function() {
loadKYCDocsList();
}, 100) });
console.log("hjknjkhiulhjulihj----------------------");
// loadKYCDocsList();
}, 1000) });
function loadKYCDocsList() {
var base_url = '<?= base_url("master/kyc/kycdocs/list/"); ?>';
@ -292,6 +294,7 @@ $(document).ready(function () {
</tr>
`;
});
console.log($('#kyc_docs_list')[0]);
$('#kyc_docs_list').append(insurerBranchTableInsert);
},
error: function (xhr, status, error) {
@ -307,6 +310,14 @@ $(document).ready(function () {
});
}
}
setTimeout(() => {
$('#table-kyc-docs').DataTable({
paging: true ,
searching: false
});
}, 2000);
});

View File

@ -48,7 +48,9 @@
$(document).ready(function(){
$('#tickets-table').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" ,
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>" ,
buttons: [
{
extend: 'csv',
@ -65,7 +67,7 @@
search: "_INPUT_",
searchPlaceholder: "Search..."
},
paging: true ,
});
})

View File

@ -6,7 +6,7 @@
<div class="table-responsive" id="branch_table" >
<table class="table table-borderless table-nowrap mb-0">
<table class="table table-borderless table-nowrap mb-0" id="table-policies">
<thead class="thead-light">
<tr>
<th>Insurer</th>
@ -81,7 +81,12 @@ $(document).ready(function () {
loadPoliciesList();
setTimeout(() => {
$('#table-policies').DataTable({
paging: true ,
searching: false
});
}, 2000);
// var insurer_branch_action = '<?= base_url("master/insurer/list/"); ?>';
// if ($('#policy_type_id').val() != '') {
@ -183,9 +188,10 @@ $(document).ready(function () {
var branchTable = '';
var data = <?= isset($policies) ? json_encode($policies) : '[]' ?>;
$.each(data, function(index, item) {
branchTable += `
<tr>
<td>${item.insurer_id}</td>
<td>${item.insurer_name}</td>
<td>${item.name}</td>
<td>
<a class="btnBranchEdit" data-id="${item.id}" href="#"><i data-id="${item.id}" class="mdi mdi-lead-pencil btnBranchEdit" style="font-size:18px;"></i></a>
@ -229,7 +235,7 @@ $(document).ready(function () {
$.each(res.data, function(index, item) {
tpaBranchTableInsert += `
<tr>
<td>${item.insurer_id}</td>
<td>${item.insurer_name}</td>
<td>${item.name}</td>
<td>
<a class="btnBranchEdit" data-id="${item.id}" href="#"><i data-id="${item.id}" class="mdi mdi-lead-pencil btnBranchEdit" style="font-size:18px;"></i></a>
@ -241,6 +247,8 @@ $(document).ready(function () {
$('#policies_list').append(tpaBranchTableInsert);
// $('#policies_list').html("");
// loadPoliciesList();
$('#add_branch').hide();
$('#branch_table').show();
$('.btnBack').hide();

View File

@ -54,7 +54,9 @@
$(document).ready(function(){
$('#tickets-table').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" ,
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>" ,
buttons: [
{
extend: 'csv',
@ -71,7 +73,7 @@
search: "_INPUT_",
searchPlaceholder: "Search..."
},
paging: true ,
});
})

View File

@ -48,7 +48,9 @@
$(document).ready(function(){
$('#tickets-table').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" ,
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>" ,
buttons: [
{
extend: 'csv',
@ -65,7 +67,7 @@
search: "_INPUT_",
searchPlaceholder: "Search..."
},
paging: true ,
});
})

View File

@ -2,7 +2,9 @@
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="text-center">
<div class="row">
<div class="col-md-6 col-xl-5">
@ -19,6 +21,8 @@
</div>
</div>
</div>
<div class="row mt-3 text-center">
@ -72,10 +76,17 @@
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-12" style="text-align: right;">
<a href="<?= base_url("client/deposit/$clientData->id"); ?>"><i class="fas fa-arrow-left" style="font-size: 17px;"></i></a>
</div>
</div>
<div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">Transaction Details</h4>
</div>
<div class="col-6" style="text-align: right; position: relative;top: 53px;">
<button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light"
data-toggle="modal" data-target="#addTransactionModal">New</button>