FIX_DELETE_CONFIRM_ROLE_AND_OTHERS : RV
This commit is contained in:
parent
33a07a816e
commit
9d6c23ff4e
@ -213,7 +213,7 @@ $routes->group("/master", ["filter" => "authMVC"], function ($routes) {
|
|||||||
$routes->post("create", "MasterController::createCDMasterData");
|
$routes->post("create", "MasterController::createCDMasterData");
|
||||||
$routes->post("edit", "MasterController::editCDMasterData");
|
$routes->post("edit", "MasterController::editCDMasterData");
|
||||||
$routes->get("list/(:any)", "MasterController::getCDMasterDataByID/$1");
|
$routes->get("list/(:any)", "MasterController::getCDMasterDataByID/$1");
|
||||||
// $routes->get("remove/(:any)", "MasterController::policyTypeRemove/$1");
|
$routes->get("remove/(:any)", "MasterController::removeCDMaster/$1");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -301,9 +301,9 @@ class ClientController extends AdminController
|
|||||||
$editData['client_kyc'] = $this->clientKYCDocsModel->where('client_id', $id)->findAll();
|
$editData['client_kyc'] = $this->clientKYCDocsModel->where('client_id', $id)->findAll();
|
||||||
$editData['client_branch'] = $this->clientBranchModel->where(['client_id' => $id, 'is_active' => 1])->findAll();
|
$editData['client_branch'] = $this->clientBranchModel->where(['client_id' => $id, 'is_active' => 1])->findAll();
|
||||||
$editData['client_relation'] = $this->clientRMModel->where(['client_id' => $id, 'is_active' => 1])->findAll();
|
$editData['client_relation'] = $this->clientRMModel->where(['client_id' => $id, 'is_active' => 1])->findAll();
|
||||||
// dd('Hi');
|
$editData['client_branch']['role'] = get_role_id();
|
||||||
$clientPoliceData = $this->clientPolicyModel->getClientPolicyByClientId($id);
|
$clientPoliceData = $this->clientPolicyModel->getClientPolicyByClientId($id);
|
||||||
// dd($this->clientPolicyModel->getLastQuery());
|
|
||||||
foreach ($clientPoliceData as $key => $value) {
|
foreach ($clientPoliceData as $key => $value) {
|
||||||
|
|
||||||
$clientPoliceData[$key]->policy_start_date = date('d-M-Y', strtotime($value->policy_start_date));
|
$clientPoliceData[$key]->policy_start_date = date('d-M-Y', strtotime($value->policy_start_date));
|
||||||
@ -311,12 +311,10 @@ class ClientController extends AdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$editData['client_policy'] = $clientPoliceData;
|
$editData['client_policy'] = $clientPoliceData;
|
||||||
|
|
||||||
|
|
||||||
$editData['notification'] =$this->notificationModel->select('template_name,enabled')->where('client_id',$id)->findAll();
|
$editData['notification'] =$this->notificationModel->select('template_name,enabled')->where('client_id',$id)->findAll();
|
||||||
$editData['placeHolders'] = ['member_name','nhance_logo','tpa_id','ecard_download_link', 'client_logo', 'policy_no', 'member_summary', 'app_link', 'post_enrollment_app_link', 'client_name'];
|
$editData['placeHolders'] = ['member_name','nhance_logo','tpa_id','ecard_download_link', 'client_logo', 'policy_no', 'member_summary', 'app_link', 'post_enrollment_app_link', 'client_name'];
|
||||||
|
|
||||||
|
// dd($editData);
|
||||||
echo view('layout/header', $headerData);
|
echo view('layout/header', $headerData);
|
||||||
echo view('client_onboarding', $editData);
|
echo view('client_onboarding', $editData);
|
||||||
echo view('layout/footer');
|
echo view('layout/footer');
|
||||||
@ -565,6 +563,7 @@ class ClientController extends AdminController
|
|||||||
|
|
||||||
if($insert){
|
if($insert){
|
||||||
$branchData = $this->clientBranchModel->where('client_id', $this->request->getPost('client_id'))->findAll();
|
$branchData = $this->clientBranchModel->where('client_id', $this->request->getPost('client_id'))->findAll();
|
||||||
|
$branchData['role'] = get_role_id();
|
||||||
return $this->respond(['status' => true,'code' => 200,'data' => $branchData], 200);
|
return $this->respond(['status' => true,'code' => 200,'data' => $branchData], 200);
|
||||||
}else{
|
}else{
|
||||||
return $this->respond(['status' => false,'code' => 404, 'message' => 'no data found'], 200);
|
return $this->respond(['status' => false,'code' => 404, 'message' => 'no data found'], 200);
|
||||||
|
|||||||
@ -1123,13 +1123,7 @@ class MasterController extends AdminController
|
|||||||
public function CDMasterList()
|
public function CDMasterList()
|
||||||
{
|
{
|
||||||
|
|
||||||
$data['CD_Master_Data'] = $this->CDMasterModel
|
$data['CD_Master_Data'] = $this->CDMasterModel->getCDMasterList();
|
||||||
->select('cd_master.*, clients.client_name, clients.short_name, insurers.name as insurer_name, user_profiles.first_name as user_name')
|
|
||||||
->join('clients', 'clients.id = cd_master.client_id')
|
|
||||||
->join('insurers', 'insurers.id = cd_master.insurer_id')
|
|
||||||
->join('user_profiles', 'user_profiles.id = cd_master.created_by')
|
|
||||||
->where('cd_master.is_active', 1)
|
|
||||||
->findAll();
|
|
||||||
$data['insurers'] = $this->insurerModel->findAll();
|
$data['insurers'] = $this->insurerModel->findAll();
|
||||||
$data['clients'] = $this->clientModel->findAll();
|
$data['clients'] = $this->clientModel->findAll();
|
||||||
$this->loadLayout('cd_master_list', $data);
|
$this->loadLayout('cd_master_list', $data);
|
||||||
@ -1217,4 +1211,18 @@ class MasterController extends AdminController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function removeCDMaster($id){
|
||||||
|
|
||||||
|
$this->myLogger->logme('error','CDMaster Remove function called');
|
||||||
|
$data['updated_by'] = get_session_userid();
|
||||||
|
$data['is_active'] = 0;
|
||||||
|
$update = $this->CDMasterModel->where('id', $id)->set($data)->update();
|
||||||
|
if($update){
|
||||||
|
return $this->respond(['status' => true,'code' => 200], 200);
|
||||||
|
}else{
|
||||||
|
return $this->respond(['status' => false,'code' => 404], 200);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -239,3 +239,12 @@ if (!function_exists('get_username')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!function_exists('get_role_id')) {
|
||||||
|
function get_role_id() {
|
||||||
|
|
||||||
|
$role_id = get_session_userdata()->role;
|
||||||
|
return $role_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -61,4 +61,26 @@ class CDMasterModel extends Model
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getCDMasterList(){
|
||||||
|
|
||||||
|
$query = $this->db->table('cd_master')
|
||||||
|
->select('cd_master.*, clients.client_name, clients.short_name, insurers.name AS insurer_name, user_profiles.first_name AS user_name, IFNULL(cd_ac_counts.cd_ac_no_count, 0) AS cd_ac_no_count')
|
||||||
|
->join('clients', 'clients.id = cd_master.client_id')
|
||||||
|
->join('insurers', 'insurers.id = cd_master.insurer_id')
|
||||||
|
->join('user_profiles', 'user_profiles.id = cd_master.created_by')
|
||||||
|
->join(
|
||||||
|
'(SELECT cd_master.cd_ac_no, COUNT(client_policy.cd_ac_no) AS cd_ac_no_count
|
||||||
|
FROM cd_master
|
||||||
|
JOIN client_policy ON client_policy.cd_ac_no = cd_master.cd_ac_no
|
||||||
|
GROUP BY cd_master.cd_ac_no) AS cd_ac_counts',
|
||||||
|
'cd_ac_counts.cd_ac_no = cd_master.cd_ac_no',
|
||||||
|
'left'
|
||||||
|
)
|
||||||
|
->where('cd_master.is_active', 1)
|
||||||
|
->get();
|
||||||
|
|
||||||
|
$result = $query->getResultArray();
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,12 +77,14 @@ class ClientPolicyModel extends Model
|
|||||||
->select('insurer_branch.branch_name as insurer_branch_name, insurer_branch.branch_code as insurer_branch_code')
|
->select('insurer_branch.branch_name as insurer_branch_name, insurer_branch.branch_code as insurer_branch_code')
|
||||||
->select('tpa_branch.branch_name as tpa_branch_name, tpa_branch.branch_code as tpa_branch_code')
|
->select('tpa_branch.branch_name as tpa_branch_name, tpa_branch.branch_code as tpa_branch_code')
|
||||||
->select('policy_type.policy_type as policy_type_name')
|
->select('policy_type.policy_type as policy_type_name')
|
||||||
|
->select('client_branch.branch_name as branch_name')
|
||||||
->join('insurers', 'insurers.id = client_policy.insurer_id')
|
->join('insurers', 'insurers.id = client_policy.insurer_id')
|
||||||
->join('insurer_branch', 'client_policy.insurer_branch_id = insurer_branch.id')
|
->join('insurer_branch', 'client_policy.insurer_branch_id = insurer_branch.id')
|
||||||
->join('tpa', 'tpa.id = client_policy.tpa_id', 'left')
|
->join('tpa', 'tpa.id = client_policy.tpa_id', 'left')
|
||||||
->join('tpa_branch', 'client_policy.tpa_branch_id = tpa_branch.id', 'left')
|
->join('tpa_branch', 'client_policy.tpa_branch_id = tpa_branch.id', 'left')
|
||||||
->join('policies', 'policies.id = client_policy.policy_id')
|
->join('policies', 'policies.id = client_policy.policy_id')
|
||||||
->join('policy_type', 'policy_type.id = policies.policy_type_id')
|
->join('policy_type', 'policy_type.id = policies.policy_type_id')
|
||||||
|
->join('client_branch', 'client_branch.id = client_policy.client_branch_id')
|
||||||
->where('client_policy.client_id', $client_id)
|
->where('client_policy.client_id', $client_id)
|
||||||
->where('client_policy.policy_status', 1)
|
->where('client_policy.policy_status', 1)
|
||||||
->where('client_policy.is_active', 1)
|
->where('client_policy.is_active', 1)
|
||||||
|
|||||||
@ -58,12 +58,12 @@ table.dataTable thead th {
|
|||||||
<?php echo $row['user_name']; ?></td>
|
<?php echo $row['user_name']; ?></td>
|
||||||
<td>
|
<td>
|
||||||
<div class="btn-group dropdown">
|
<div class="btn-group dropdown">
|
||||||
<a href="javascript: void(0);"
|
<a href="javascript: void(0);"class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||||
class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"
|
|
||||||
aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
|
||||||
<div class="dropdown-menu dropdown-menu-right">
|
<div class="dropdown-menu dropdown-menu-right">
|
||||||
<a class="dropdown-item btnEdit" data-id="<?= $row['id'];?>" data-toggle="modal" data-target="#con-close-modal"> <i
|
<a class="dropdown-item btnEdit" data-id="<?= $row['id'];?>" data-toggle="modal" data-target="#con-close-modal"> <i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||||
class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
<?php if($row['cd_ac_no_count'] == 0) { ?>
|
||||||
|
<a class="dropdown-item" data-id="<?= $row['id'];?>" onclick="removeCDMaster(this)"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@ -290,4 +290,50 @@ table.dataTable thead th {
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
function removeCDMaster(element) {
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
title: "Are you sure?",
|
||||||
|
text: "You need to remove this CD.",
|
||||||
|
icon: "info",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: "#3085d6",
|
||||||
|
confirmButtonText: "Yes",
|
||||||
|
}).then((result) => {
|
||||||
|
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
var id = element.getAttribute('data-id');
|
||||||
|
var form_action = '<?= base_url("master/cash_deposite/remove/") ?>' + id;
|
||||||
|
$.ajax({
|
||||||
|
url: form_action,
|
||||||
|
type: "GET",
|
||||||
|
dataType: 'json',
|
||||||
|
processData: false,
|
||||||
|
contentType: false,
|
||||||
|
success: function(res) {
|
||||||
|
// console.log(res.status == true);
|
||||||
|
if(res){
|
||||||
|
if (res.status == true) {
|
||||||
|
toastr.success('CD removed successfully.', 'success');
|
||||||
|
location.reload();
|
||||||
|
} else {
|
||||||
|
toastr.warning('Failed to remove CD.', 'warning');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (xhr, status, error) {
|
||||||
|
console.error(xhr.responseText);
|
||||||
|
console.error(status, error);
|
||||||
|
$('.loader').fadeOut();
|
||||||
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
|
console.log('Something Wrong!', 'warning');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -1,7 +1,8 @@
|
|||||||
<div class="tab-pane fade" id="branch-tab">
|
<div class="tab-pane fade" id="branch-tab">
|
||||||
<input type="hidden" id="client_id_for_client_branch" value="<?= isset($client['id']) ? $client['id'] : '' ?>" />
|
<input type="hidden" id="client_id_for_client_branch" value="<?= isset($client['id']) ? $client['id'] : '' ?>" />
|
||||||
<div class="row float-right" style="padding-bottom: 10px;position: relative;right: 13px;">
|
<div class="row float-right" style="padding-bottom: 10px;position: relative;right: 13px;">
|
||||||
<button type="button" id="btnBranchAdd" class="btn btn-primary waves-effect waves-light btn-sm"><span class="fa fa-plus-square" aria-hidden="true" style="padding: 5px 10px;"></span>Add Branch</button>
|
<button type="button" id="btnBranchAdd" class="btn btn-primary waves-effect waves-light btn-sm"><span
|
||||||
|
class="fa fa-plus-square" aria-hidden="true" style="padding: 5px 10px;"></span>Add Branch</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="table-responsive" id="branch_table">
|
<div class="table-responsive" id="branch_table">
|
||||||
@ -23,34 +24,35 @@
|
|||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="row float-right" style="position: relative; bottom: 20px; right: 13px;">
|
<div class="row float-right" style="position: relative; bottom: 20px; right: 13px;">
|
||||||
<button type="button" id="btnBranchBack" class="btn btn-primary waves-effect waves-light btn-sm btnBack"><span class="fa fa-list" aria-hidden="true" style="padding: 5px 10px;"></span>Back To List</button>
|
<button type="button" id="btnBranchBack"
|
||||||
|
class="btn btn-primary waves-effect waves-light btn-sm btnBack"><span class="fa fa-list"
|
||||||
|
aria-hidden="true" style="padding: 5px 10px;"></span>Back To List</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<form role="form" class="parsley-examples" method="post" id="branch_form"
|
<form role="form" class="parsley-examples" method="post" id="branch_form" enctype="multipart/form-data">
|
||||||
enctype="multipart/form-data">
|
|
||||||
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||||
<input type="hidden" name="client_id" id="client_id_branch" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
|
<input type="hidden" name="client_id" id="client_id_branch"
|
||||||
|
value="<?= isset($client['id']) ? $client['id'] : '' ?>" />
|
||||||
<input type="hidden" name="branch_id_primarykey" id="branch_id_primarykey" />
|
<input type="hidden" name="branch_id_primarykey" id="branch_id_primarykey" />
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="branch_name">Branch Name<span class="text-danger">*</span></label>
|
<label for="branch_name">Branch Name<span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="branch_name" placeholder="Enter Branch Name" name="branch_name" required>
|
<input type="text" class="form-control" id="branch_name" placeholder="Enter Branch Name"
|
||||||
|
name="branch_name" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="branch_code">Branch Code<span
|
<label for="branch_code">Branch Code<span class="text-danger">*</span></label>
|
||||||
class="text-danger">*</span></label>
|
<input type="text" class="form-control" id="branch_code" placeholder="Enter Branch Code"
|
||||||
<input type="text" class="form-control" id="branch_code"
|
name="branch_code" required>
|
||||||
placeholder="Enter Branch Code" name="branch_code" required>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="state">State<span
|
<label for="state">State<span class="text-danger">*</span></label>
|
||||||
class="text-danger">*</span></label>
|
|
||||||
<select class="form-control" id="state" name="state" required>
|
<select class="form-control" id="state" name="state" required>
|
||||||
<option value="">Select State</option>
|
<option value="">Select State</option>
|
||||||
<?php foreach($state as $value) { ?>
|
<?php foreach($state as $value) { ?>
|
||||||
@ -59,16 +61,14 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="district">District<span
|
<label for="district">District<span class="text-danger">*</span></label>
|
||||||
class="text-danger">*</span></label>
|
<input type="text" class="form-control" id="district" placeholder="Enter District"
|
||||||
<input type="text" class="form-control" id="district"
|
name="district" required>
|
||||||
placeholder="Enter District" name="district" required>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="city">City<span
|
<label for="city">City<span class="text-danger">*</span></label>
|
||||||
class="text-danger">*</span></label>
|
<input type="text" class="form-control" id="branch_city" placeholder="Enter City"
|
||||||
<input type="text" class="form-control" id="branch_city"
|
name="city" required>
|
||||||
placeholder="Enter City" name="city" required>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -79,26 +79,37 @@
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="first_name">Name<span class="text-danger">*</span></label>
|
<label for="first_name">Name<span class="text-danger">*</span></label>
|
||||||
<input value="" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="name" required>
|
<input value="" type="text" class="form-control" placeholder="Enter Contact Name"
|
||||||
|
name="name[]" id="name" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="last_name">Email<span class="text-danger">*</span></label>
|
<label for="last_name">Email<span class="text-danger">*</span></label>
|
||||||
<input value="" type="text" class="form-control" placeholder="Enter Contact Email" name="email[]" id="email" data-parsley-trigger="change" data-parsley-type="email" required>
|
<input value="" type="text" class="form-control" placeholder="Enter Contact Email"
|
||||||
|
name="email[]" id="email" data-parsley-trigger="change" data-parsley-type="email"
|
||||||
|
required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="mobile">Mobile<span class="text-danger">*</span></label>
|
<label for="mobile">Mobile<span class="text-danger">*</span></label>
|
||||||
<input value="" type="text" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="mobile" onchange="checkMobileNumber(this)" onkeypress = "return onlyNumbers(event)" maxlength="10" minlength="10" data-parsley-type-message="Please enter a valid 10-digit mobile number." data-parsley-required-message="Please enter a valid 10-digit mobile number." required>
|
<input value="" type="text" class="form-control" placeholder="Enter Contact Mobile"
|
||||||
|
name="mobile[]" id="mobile" onchange="checkMobileNumber(this)"
|
||||||
|
onkeypress="return onlyNumbers(event)" maxlength="10" minlength="10"
|
||||||
|
data-parsley-type-message="Please enter a valid 10-digit mobile number."
|
||||||
|
data-parsley-required-message="Please enter a valid 10-digit mobile number."
|
||||||
|
required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="designation">Designation<span class="text-danger">*</span></label>
|
<label for="designation">Designation<span class="text-danger">*</span></label>
|
||||||
<input value="" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation" required>
|
<input value="" type="text" class="form-control" placeholder="Enter Designation Name"
|
||||||
|
name="designation[]" id="designation" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group" style="display: flex;">
|
<div class="form-group" style="display: flex;">
|
||||||
<button style="margin-right: 10px;" type="button" class="btn btn-primary btn-sm ac" onclick="appendContactHtml()" id="add">Add Contact</button>
|
<button style="margin-right: 10px;" type="button" class="btn btn-primary btn-sm ac"
|
||||||
<button type="button" class="btn btn-danger btn-sm" onclick="removeContact(this)" id="remove_btn">Remove</button>
|
onclick="appendContactHtml()" id="add">Add Contact</button>
|
||||||
|
<button type="button" class="btn btn-danger btn-sm" onclick="removeContact(this)"
|
||||||
|
id="remove_btn">Remove</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="container"></div>
|
<div id="container"></div>
|
||||||
@ -119,7 +130,6 @@
|
|||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
var branch_form_action = '';
|
var branch_form_action = '';
|
||||||
var contactCount = 1;
|
var contactCount = 1;
|
||||||
var branch_PrimaryKey = $('#client_id_for_client_branch').val();
|
var branch_PrimaryKey = $('#client_id_for_client_branch').val();
|
||||||
@ -135,7 +145,13 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
var branchTable = '';
|
var branchTable = '';
|
||||||
var data = <?= isset($client_branch) ? json_encode($client_branch) : '[]' ?>;
|
var data = <?= isset($client_branch) ? json_encode($client_branch) : '[]' ?>;
|
||||||
|
var role = data.role
|
||||||
|
delete data.role;
|
||||||
|
console.log(role)
|
||||||
$.each(data, function(index, item) {
|
$.each(data, function(index, item) {
|
||||||
|
|
||||||
|
if(role != 3 && role != 4){
|
||||||
|
|
||||||
branchTable += `
|
branchTable += `
|
||||||
<tr>
|
<tr>
|
||||||
<td>${item.branch_name}</td>
|
<td>${item.branch_name}</td>
|
||||||
@ -143,10 +159,22 @@ $(document).ready(function () {
|
|||||||
<td>
|
<td>
|
||||||
<a class="mdi mdi-lead-pencil btnBranchEdit" href="#" data-id="${item.id}" style="font-size:18px;"></a>
|
<a class="mdi mdi-lead-pencil btnBranchEdit" href="#" data-id="${item.id}" style="font-size:18px;"></a>
|
||||||
<a style="color:#02a8b5" data-id="${item.id}" onclick="removeClientBranch(this)"><i data-id="${item.id}" class="mdi mdi-delete" style="font-size:18px;"></i></a>
|
<a style="color:#02a8b5" data-id="${item.id}" onclick="removeClientBranch(this)"><i data-id="${item.id}" class="mdi mdi-delete" style="font-size:18px;"></i></a>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
`;
|
`;
|
||||||
|
}else{
|
||||||
|
|
||||||
|
branchTable += `
|
||||||
|
<tr>
|
||||||
|
<td>${item.branch_name}</td>
|
||||||
|
<td>${item.branch_code}</td>
|
||||||
|
<td>
|
||||||
|
<a class="mdi mdi-lead-pencil btnBranchEdit" href="#" data-id="${item.id}" style="font-size:18px;"></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
$('#branch_list').append(branchTable);
|
$('#branch_list').append(branchTable);
|
||||||
}
|
}
|
||||||
@ -273,14 +301,25 @@ $(document).ready(function () {
|
|||||||
$('#branch_table').show();
|
$('#branch_table').show();
|
||||||
$('.btnBack').hide();
|
$('.btnBack').hide();
|
||||||
$('#btnBranchAdd').show();
|
$('#btnBranchAdd').show();
|
||||||
var message = (branch_PrimaryKey === '') ? 'Client Branch Created successfully' : 'Client Branch Updated successfully';
|
var message = (branch_PrimaryKey === '') ?
|
||||||
|
'Client Branch Created successfully' :
|
||||||
|
'Client Branch Updated successfully';
|
||||||
toastr.success(message, 'Success');
|
toastr.success(message, 'Success');
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#branch_list tr').remove();
|
$('#branch_list tr').remove();
|
||||||
var branchTableInsert = ''
|
var branchTableInsert = ''
|
||||||
|
|
||||||
|
var role = res.data.role
|
||||||
|
delete res.data.role;
|
||||||
|
console.log(role)
|
||||||
$.each(res.data, function(index, item) {
|
$.each(res.data, function(index, item) {
|
||||||
|
|
||||||
|
console.log('client_branch_data', item)
|
||||||
|
|
||||||
|
if(role != 3 && role != 4){
|
||||||
|
|
||||||
branchTableInsert += `
|
branchTableInsert += `
|
||||||
<tr>
|
<tr>
|
||||||
<td>${item.branch_name}</td>
|
<td>${item.branch_name}</td>
|
||||||
@ -291,6 +330,21 @@ $(document).ready(function () {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
}else{
|
||||||
|
|
||||||
|
branchTableInsert += `
|
||||||
|
<tr>
|
||||||
|
<td>${item.branch_name}</td>
|
||||||
|
<td>${item.branch_code}</td>
|
||||||
|
<td>
|
||||||
|
<a class="mdi mdi-lead-pencil btnBranchEdit" href="#" data-id="${item.id}" style="font-size:18px;"></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
`;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
$('#branch_list').append(branchTableInsert);
|
$('#branch_list').append(branchTableInsert);
|
||||||
},
|
},
|
||||||
@ -528,6 +582,17 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function removeClientBranch(element) {
|
function removeClientBranch(element) {
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
title: "Are you sure?",
|
||||||
|
text: "You need to remove this client branch.",
|
||||||
|
icon: "info",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: "#3085d6",
|
||||||
|
confirmButtonText: "Yes",
|
||||||
|
}).then((result) => {
|
||||||
|
|
||||||
|
if (result.isConfirmed) {
|
||||||
var id = element.getAttribute('data-id');
|
var id = element.getAttribute('data-id');
|
||||||
var form_action = '<?= base_url("client/branch/remove/") ?>' + id;
|
var form_action = '<?= base_url("client/branch/remove/") ?>' + id;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -540,12 +605,10 @@ $(document).ready(function () {
|
|||||||
// console.log(res.status == true);
|
// console.log(res.status == true);
|
||||||
if (res) {
|
if (res) {
|
||||||
if (res.status == true) {
|
if (res.status == true) {
|
||||||
toastr.success('Remove Done!', 'success');
|
toastr.success('Client branch removed successfully', 'success');
|
||||||
|
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
toastr.warning('Remove Not Done!', 'warning');
|
toastr.warning('Failed to remove client branch', 'warning');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -555,12 +618,16 @@ $(document).ready(function () {
|
|||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
$('.loader').fadeOut();
|
$('.loader').fadeOut();
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
toastr.warning('Something Wrong!', 'warning');
|
console.log('Something Wrong!', 'warning');
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function checkMobileNumber(input) {
|
function checkMobileNumber(input) {
|
||||||
@ -589,7 +656,4 @@ $(document).ready(function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -59,7 +59,9 @@ table.dataTable thead th {
|
|||||||
<div class="dropdown-menu dropdown-menu-right">
|
<div class="dropdown-menu dropdown-menu-right">
|
||||||
<a class="dropdown-item" href="<?= base_url("client/list/"); ?><?= $row->id;?>"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
<a class="dropdown-item" href="<?= base_url("client/list/"); ?><?= $row->id;?>"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||||
<a class="dropdown-item" href="<?= base_url("client/deposit/{$row->id}"); ?>"><i class="mdi mdi-cash mr-2 text-muted font-18 vertical-middle"></i>Deposit</a>
|
<a class="dropdown-item" href="<?= base_url("client/deposit/{$row->id}"); ?>"><i class="mdi mdi-cash mr-2 text-muted font-18 vertical-middle"></i>Deposit</a>
|
||||||
|
<?php if(get_role_id() != 3 && get_role_id() != 4) { ?>
|
||||||
<a class="dropdown-item" data-id="<?= $row->id;?>" onclick="removeClient(this)"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
<a class="dropdown-item" data-id="<?= $row->id;?>" onclick="removeClient(this)"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@ -111,6 +113,17 @@ table.dataTable thead th {
|
|||||||
|
|
||||||
|
|
||||||
function removeClient(element) {
|
function removeClient(element) {
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
title: "Are you sure?",
|
||||||
|
text: "You need to remove this client.",
|
||||||
|
icon: "info",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: "#3085d6",
|
||||||
|
confirmButtonText: "Yes",
|
||||||
|
}).then((result) => {
|
||||||
|
|
||||||
|
if (result.isConfirmed) {
|
||||||
var id = element.getAttribute('data-id');
|
var id = element.getAttribute('data-id');
|
||||||
var form_action = '<?= base_url("client/remove/") ?>' + id;
|
var form_action = '<?= base_url("client/remove/") ?>' + id;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -123,26 +136,24 @@ table.dataTable thead th {
|
|||||||
// console.log(res.status == true);
|
// console.log(res.status == true);
|
||||||
if(res){
|
if(res){
|
||||||
if (res.status == true) {
|
if (res.status == true) {
|
||||||
toastr.success('Remove Done!', 'success');
|
toastr.success('Client removed successfully.', 'success');
|
||||||
|
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
toastr.warning('Remove Not Done!', 'warning');
|
toastr.warning('Failed to remove client.', 'warning');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
console.error(xhr.responseText);
|
console.error(xhr.responseText);
|
||||||
console.error(status, error);
|
console.error(status, error);
|
||||||
setTimeout(function() {
|
|
||||||
$('.loader').fadeOut();
|
$('.loader').fadeOut();
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
toastr.warning('Something Wrong!', 'warning');
|
console.log('Something Wrong!', 'warning');
|
||||||
}, 1000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,14 +7,15 @@
|
|||||||
|
|
||||||
<div class="table-responsive" id="table_list">
|
<div class="table-responsive" id="table_list">
|
||||||
|
|
||||||
<table class="table table-borderless table-nowrap mb-0" id="table-client-policy">
|
<table class="table table-borderless table mb-0" id="table-client-policy">
|
||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Insurer</th>
|
<th>Insurer</th>
|
||||||
<th>Policy</th>
|
<th>Policy</th>
|
||||||
|
<th>Client Branch</th>
|
||||||
<th>TPA</th>
|
<th>TPA</th>
|
||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
<th>Enrollment <br> Status</th>
|
<th>Enrollment Status</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -263,8 +264,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
|
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
|
||||||
<td>${item.policy_name} (${item.policy_type_name})</td>
|
<td>${item.policy_name} (${item.policy_type_name})</td>
|
||||||
|
<td>${item.branch_name}</td>
|
||||||
<td>${tpaValue}</td>
|
<td>${tpaValue}</td>
|
||||||
<td>${(item.policy_start_date)} / <br> ${(item.policy_end_date)}</td>
|
<td>${(item.policy_start_date)} / ${(item.policy_end_date)}</td>
|
||||||
<td style="text-align: center;">${(enrollmentStatus)}</td>
|
<td style="text-align: center;">${(enrollmentStatus)}</td>
|
||||||
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
||||||
<td>
|
<td>
|
||||||
@ -481,8 +483,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
|
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
|
||||||
<td>${item.policy_name} (${item.policy_type_name})</td>
|
<td>${item.policy_name} (${item.policy_type_name})</td>
|
||||||
|
<td>${item.branch_name}</td>
|
||||||
<td>${tpaValue}</td>
|
<td>${tpaValue}</td>
|
||||||
<td>${rearrangeDateFormat(item.policy_start_date)} / <br> ${rearrangeDateFormat(item.policy_end_date)}</td>
|
<td>${rearrangeDateFormat(item.policy_start_date)} / ${rearrangeDateFormat(item.policy_end_date)}</td>
|
||||||
<td style="text-align: center;">${(enrollmentStatus)}</td>
|
<td style="text-align: center;">${(enrollmentStatus)}</td>
|
||||||
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="emp_code">Account Manager</label>
|
<label for="emp_code">Account Manager ( L2 )</label>
|
||||||
<select class="form-control" id="account_manager" name="account_manager[]" multiple>
|
<select class="form-control" id="account_manager" name="account_manager[]" multiple>
|
||||||
<?php foreach($RM as $value) { ?>
|
<?php foreach($RM as $value) { ?>
|
||||||
<?php if($value['role'] === '3') { ?>
|
<?php if($value['role'] === '3') { ?>
|
||||||
@ -26,7 +26,7 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="profile">Manager</label>
|
<label for="profile">Manager ( L1 )</label>
|
||||||
<select class="form-control" id="manager" name="manager">user_id
|
<select class="form-control" id="manager" name="manager">user_id
|
||||||
<option value="">Select Manager</option>
|
<option value="">Select Manager</option>
|
||||||
<?php foreach($RM as $value) { ?>
|
<?php foreach($RM as $value) { ?>
|
||||||
|
|||||||
@ -473,6 +473,17 @@
|
|||||||
|
|
||||||
|
|
||||||
function removeInsurerBranch(element) {
|
function removeInsurerBranch(element) {
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
title: "Are you sure?",
|
||||||
|
text: "You need to remove this insurer branch.",
|
||||||
|
icon: "info",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: "#3085d6",
|
||||||
|
confirmButtonText: "Yes",
|
||||||
|
}).then((result) => {
|
||||||
|
|
||||||
|
if (result.isConfirmed) {
|
||||||
var id = element.getAttribute('data-id');
|
var id = element.getAttribute('data-id');
|
||||||
var form_action = '<?= base_url("master/insurer/branch/remove/") ?>' + id;
|
var form_action = '<?= base_url("master/insurer/branch/remove/") ?>' + id;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -485,26 +496,25 @@
|
|||||||
// console.log(res.status == true);
|
// console.log(res.status == true);
|
||||||
if(res){
|
if(res){
|
||||||
if (res.status == true) {
|
if (res.status == true) {
|
||||||
toastr.success('Remove Done!', 'success');
|
toastr.success('Insurer branch removed successfully', 'success');
|
||||||
|
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
toastr.warning('Remove Not Done!', 'warning');
|
toastr.warning('Failed to remove insurer branch', 'warning');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
console.error(xhr.responseText);
|
console.error(xhr.responseText);
|
||||||
console.error(status, error);
|
console.error(status, error);
|
||||||
setTimeout(function() {
|
|
||||||
$('.loader').fadeOut();
|
$('.loader').fadeOut();
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
toastr.warning('Something Wrong!', 'warning');
|
toastr.warning('Failed to remove insurer branch', 'warning');
|
||||||
}, 1000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -134,6 +134,17 @@ class csvExport {
|
|||||||
|
|
||||||
|
|
||||||
function removeInsurer(element) {
|
function removeInsurer(element) {
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
title: "Are you sure?",
|
||||||
|
text: "You need to remove this insurer.",
|
||||||
|
icon: "info",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: "#3085d6",
|
||||||
|
confirmButtonText: "Yes",
|
||||||
|
}).then((result) => {
|
||||||
|
|
||||||
|
if (result.isConfirmed) {
|
||||||
var id = element.getAttribute('data-id');
|
var id = element.getAttribute('data-id');
|
||||||
var form_action = '<?= base_url("master/insurer/remove/") ?>' + id;
|
var form_action = '<?= base_url("master/insurer/remove/") ?>' + id;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -146,26 +157,24 @@ class csvExport {
|
|||||||
// console.log(res.status == true);
|
// console.log(res.status == true);
|
||||||
if(res){
|
if(res){
|
||||||
if (res.status == true) {
|
if (res.status == true) {
|
||||||
toastr.success('Remove Done!', 'success');
|
toastr.success('Insurer removed successfully', 'success');
|
||||||
|
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
toastr.warning('Remove Not Done!', 'warning');
|
toastr.warning('Failed to remove insurer', 'warning');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
console.error(xhr.responseText);
|
console.error(xhr.responseText);
|
||||||
console.error(status, error);
|
console.error(status, error);
|
||||||
setTimeout(function() {
|
|
||||||
$('.loader').fadeOut();
|
$('.loader').fadeOut();
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
toastr.warning('Something Wrong!', 'warning');
|
toastr.warning('Failed to remove insurer', 'warning');
|
||||||
}, 1000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -323,6 +323,17 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
|
|
||||||
function removeKYCDocs(element) {
|
function removeKYCDocs(element) {
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
title: "Are you sure?",
|
||||||
|
text: "You need to remove this!.",
|
||||||
|
icon: "info",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: "#3085d6",
|
||||||
|
confirmButtonText: "Yes",
|
||||||
|
}).then((result) => {
|
||||||
|
|
||||||
|
if (result.isConfirmed) {
|
||||||
var kyc_docs_id_for_reload = $('#kyc_type_id').val();
|
var kyc_docs_id_for_reload = $('#kyc_type_id').val();
|
||||||
var id = element.getAttribute('data-id');
|
var id = element.getAttribute('data-id');
|
||||||
var form_action = '<?= base_url("master/kyc/kycdocs/remove/") ?>' + id;
|
var form_action = '<?= base_url("master/kyc/kycdocs/remove/") ?>' + id;
|
||||||
@ -336,26 +347,26 @@ $(document).ready(function () {
|
|||||||
// console.log(res.status == true);
|
// console.log(res.status == true);
|
||||||
if(res){
|
if(res){
|
||||||
if (res.status == true) {
|
if (res.status == true) {
|
||||||
toastr.success('Remove Done!', 'success');
|
toastr.success('KYC docs removed successfully');
|
||||||
|
|
||||||
// location.reload();
|
// location.reload();
|
||||||
window.location.href = '<?= base_url("master/kyc/list/") ?>' + kyc_docs_id_for_reload;
|
window.location.href = '<?= base_url("master/kyc/list/") ?>' + kyc_docs_id_for_reload;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
toastr.warning('Remove Not Done!', 'warning');
|
toastr.warning('Failed to remove KYC docs', 'warning');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
console.error(xhr.responseText);
|
console.error(xhr.responseText);
|
||||||
console.error(status, error);
|
console.error(status, error);
|
||||||
setTimeout(function() {
|
|
||||||
$('.loader').fadeOut();
|
$('.loader').fadeOut();
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
toastr.warning('Something Wrong!', 'warning');
|
toastr.warning('Failed to remove KYC docs', 'warning');
|
||||||
}, 1000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -133,6 +133,16 @@ class csvExport {
|
|||||||
|
|
||||||
|
|
||||||
function removeKYC(element) {
|
function removeKYC(element) {
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
title: "Are you sure?",
|
||||||
|
text: "You need to remove this!",
|
||||||
|
icon: "info",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: "#3085d6",
|
||||||
|
confirmButtonText: "Yes",
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
var id = element.getAttribute('data-id');
|
var id = element.getAttribute('data-id');
|
||||||
var form_action = '<?= base_url("master/kyc/remove/") ?>' + id;
|
var form_action = '<?= base_url("master/kyc/remove/") ?>' + id;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -145,12 +155,12 @@ function removeKYC(element) {
|
|||||||
// console.log(res.status == true);
|
// console.log(res.status == true);
|
||||||
if(res){
|
if(res){
|
||||||
if (res.status == true) {
|
if (res.status == true) {
|
||||||
toastr.success('Remove Done!', 'success');
|
toastr.success('KYC entity removed successfully', 'success');
|
||||||
|
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
toastr.warning('Remove Not Done!', 'warning');
|
toastr.warning('Failed to remove KYC entity', 'warning');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -164,8 +174,8 @@ function removeKYC(element) {
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -396,6 +396,17 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
|
|
||||||
function removePolicies(element) {
|
function removePolicies(element) {
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
title: "Are you sure?",
|
||||||
|
text: "You need to remove this Policy.",
|
||||||
|
icon: "info",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: "#3085d6",
|
||||||
|
confirmButtonText: "Yes",
|
||||||
|
}).then((result) => {
|
||||||
|
|
||||||
|
if (result.isConfirmed) {
|
||||||
var policy_id_for_reload = $('#policy_type_id').val()
|
var policy_id_for_reload = $('#policy_type_id').val()
|
||||||
var id = element.getAttribute('data-id');
|
var id = element.getAttribute('data-id');
|
||||||
var form_action = '<?= base_url("master/policy/policies/remove/") ?>' + id;
|
var form_action = '<?= base_url("master/policy/policies/remove/") ?>' + id;
|
||||||
@ -409,29 +420,28 @@ function removePolicies(element) {
|
|||||||
// console.log(res.status == true);
|
// console.log(res.status == true);
|
||||||
if(res){
|
if(res){
|
||||||
if (res.status == true) {
|
if (res.status == true) {
|
||||||
toastr.success('Remove Done!', 'success');
|
toastr.success('Policy removed successfully', 'success');
|
||||||
|
|
||||||
// $('#branch_table').empty();
|
// $('#branch_table').empty();
|
||||||
|
|
||||||
// location.reload();
|
// location.reload();
|
||||||
window.location.href = '<?= base_url("master/policy/list/") ?>' + policy_id_for_reload;
|
window.location.href = '<?= base_url("master/policy/list/") ?>' + policy_id_for_reload;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
toastr.warning('Remove Not Done!', 'warning');
|
toastr.warning('Failed to remove policy', 'warning');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
console.error(xhr.responseText);
|
console.error(xhr.responseText);
|
||||||
console.error(status, error);
|
console.error(status, error);
|
||||||
setTimeout(function() {
|
|
||||||
$('.loader').fadeOut();
|
$('.loader').fadeOut();
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
toastr.warning('Something Wrong!', 'warning');
|
toastr.warning('Failed to remove policy', 'warning');
|
||||||
}, 1000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -138,6 +138,17 @@ class csvExport {
|
|||||||
|
|
||||||
|
|
||||||
function removePolciyType(element) {
|
function removePolciyType(element) {
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
title: "Are you sure?",
|
||||||
|
text: "You need to remove this!",
|
||||||
|
icon: "info",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: "#3085d6",
|
||||||
|
confirmButtonText: "Yes",
|
||||||
|
}).then((result) => {
|
||||||
|
|
||||||
|
if (result.isConfirmed) {
|
||||||
var id = element.getAttribute('data-id');
|
var id = element.getAttribute('data-id');
|
||||||
var form_action = '<?= base_url("master/policy/remove/") ?>' + id;
|
var form_action = '<?= base_url("master/policy/remove/") ?>' + id;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -150,26 +161,24 @@ function removePolciyType(element) {
|
|||||||
// console.log(res.status == true);
|
// console.log(res.status == true);
|
||||||
if(res){
|
if(res){
|
||||||
if (res.status == true) {
|
if (res.status == true) {
|
||||||
toastr.success('Remove Done!', 'success');
|
toastr.success('Policy type removed successfully', 'success');
|
||||||
|
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
toastr.warning('Remove Not Done!', 'warning');
|
toastr.warning('Failed to remove policy type', 'warning');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
console.error(xhr.responseText);
|
console.error(xhr.responseText);
|
||||||
console.error(status, error);
|
console.error(status, error);
|
||||||
setTimeout(function() {
|
|
||||||
$('.loader').fadeOut();
|
$('.loader').fadeOut();
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
toastr.warning('Something Wrong!', 'warning');
|
toastr.warning('Failed to remove policy type', 'warning');
|
||||||
}, 1000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -507,6 +507,17 @@ function validateForm() {
|
|||||||
|
|
||||||
|
|
||||||
function removeTPABranch(element) {
|
function removeTPABranch(element) {
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
title: "Are you sure?",
|
||||||
|
text: "You need to remove this TPA branch.",
|
||||||
|
icon: "info",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: "#3085d6",
|
||||||
|
confirmButtonText: "Yes",
|
||||||
|
}).then((result) => {
|
||||||
|
|
||||||
|
if (result.isConfirmed) {
|
||||||
var id = element.getAttribute('data-id');
|
var id = element.getAttribute('data-id');
|
||||||
var form_action = '<?= base_url("master/tpa/branch/remove/") ?>' + id;
|
var form_action = '<?= base_url("master/tpa/branch/remove/") ?>' + id;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -519,24 +530,23 @@ function validateForm() {
|
|||||||
// console.log(res.status == true);
|
// console.log(res.status == true);
|
||||||
if(res){
|
if(res){
|
||||||
if (res.status == true) {
|
if (res.status == true) {
|
||||||
toastr.success('Remove Done!', 'success');
|
toastr.success('TPA branch removed successfully', 'success');
|
||||||
|
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
toastr.warning('Remove Not Done!', 'warning');
|
toastr.warning('Failed to remove TPA branch', 'warning');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
console.error(xhr.responseText);
|
console.error(xhr.responseText);
|
||||||
console.error(status, error);
|
console.error(status, error);
|
||||||
setTimeout(function() {
|
|
||||||
$('.loader').fadeOut();
|
$('.loader').fadeOut();
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
toastr.warning('Something Wrong!', 'warning');
|
toastr.warning('Failed to remove TPA branch', 'warning');
|
||||||
}, 1000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -132,6 +132,17 @@ class csvExport {
|
|||||||
|
|
||||||
|
|
||||||
function removeTPA(element) {
|
function removeTPA(element) {
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
title: "Are you sure?",
|
||||||
|
text: "You need to remove this TPA",
|
||||||
|
icon: "info",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: "#3085d6",
|
||||||
|
confirmButtonText: "Yes",
|
||||||
|
}).then((result) => {
|
||||||
|
|
||||||
|
if (result.isConfirmed) {
|
||||||
var id = element.getAttribute('data-id');
|
var id = element.getAttribute('data-id');
|
||||||
var form_action = '<?= base_url("master/tpa/remove/") ?>' + id;
|
var form_action = '<?= base_url("master/tpa/remove/") ?>' + id;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -144,27 +155,24 @@ function removeTPA(element) {
|
|||||||
// console.log(res.status == true);
|
// console.log(res.status == true);
|
||||||
if(res){
|
if(res){
|
||||||
if (res.status == true) {
|
if (res.status == true) {
|
||||||
toastr.success('Remove Done!', 'success');
|
toastr.success('TPA removed successfully', 'success');
|
||||||
|
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
toastr.warning('Remove Not Done!', 'warning');
|
toastr.warning('Failed to remove TPA', 'warning');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
console.error(xhr.responseText);
|
console.error(xhr.responseText);
|
||||||
console.error(status, error);
|
console.error(status, error);
|
||||||
setTimeout(function() {
|
|
||||||
$('.loader').fadeOut();
|
$('.loader').fadeOut();
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
toastr.warning('Something Wrong!', 'warning');
|
toastr.warning('Failed to remove TPA', 'warning');
|
||||||
}, 1000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user