Merge branch 'dev' into test
This commit is contained in:
commit
238bc0d88f
@ -58,6 +58,8 @@ $routes->post('save_deposit', 'ClientController::saveDeposit');
|
||||
|
||||
$routes->get("list/(:any)", "ClientController::editClientOnboarding/$1");
|
||||
|
||||
$routes->get("remove/(:any)", "ClientController::removeClientOnboarding/$1");
|
||||
|
||||
|
||||
$routes->group("general", ["filter" => "authMVC"], function($routes){
|
||||
$routes->post("create", "ClientController::createClientGeneralInfo");
|
||||
@ -159,7 +161,7 @@ $routes->group("/master", ["filter" => "authMVC"], function($routes){
|
||||
$routes->post("createpost", "MasterController::createKycDocs");
|
||||
$routes->get("editget/(:any)", "MasterController::editKYCGet/$1");
|
||||
$routes->post("edit", "MasterController::editKYCDocs");
|
||||
$routes->get("list", "MasterController::tpaBranchList");
|
||||
// $routes->get("list", "MasterController::tpaBranchList");
|
||||
$routes->get("list/(:any)", "MasterController::kycDocsList/$1");
|
||||
|
||||
});
|
||||
|
||||
@ -102,6 +102,29 @@ class ClientController extends AdminController
|
||||
// $this->loadLayout('client_onboarding', $data);
|
||||
}
|
||||
|
||||
|
||||
public function removeClientOnboarding($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error', 'Edit Client Onboarding function called');
|
||||
$headerData['page_name'] = 'Edit Client Onboarding';
|
||||
|
||||
$this->clientModel->update($id, ['is_active' => 0]);
|
||||
|
||||
// $this->clientBranchModel->where('client_id', $id)->update(['is_active' => 0]);
|
||||
// $this->clientRMModel->where('client_id', $id)->update(['is_active' => 0]);
|
||||
|
||||
|
||||
$data['clientList'] = $this->clientModel->getCreatedByUserName();
|
||||
$data['client_rm'] = $this->clientRMModel->getAllClientRM();
|
||||
|
||||
echo view('layout/header', $headerData);
|
||||
echo view('client_list', $data);
|
||||
echo view('layout/footer');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function clientOnboarding()
|
||||
{
|
||||
|
||||
@ -211,7 +234,7 @@ class ClientController extends AdminController
|
||||
$editData['policyGridData'] = $this->policyGridModel->findAll();
|
||||
|
||||
|
||||
$editData['client'] = $this->clientModel->where(['id' => $id, 'is_active' => 1])->first();
|
||||
$editData['client'] = $this->clientModel->where(['id' => $id])->first();
|
||||
$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_relation'] = $this->clientRMModel->where(['client_id' => $id, 'is_active' => 1])->findAll();
|
||||
@ -235,6 +258,14 @@ class ClientController extends AdminController
|
||||
$data = $this->request->getPost();
|
||||
$data['created_by'] = get_session_userid();
|
||||
$data['client_logo'] = $file_name;
|
||||
|
||||
|
||||
if (!isset($data['is_download_btn'])) {
|
||||
$data['is_download_btn'] = 0;
|
||||
} elseif ($data['is_download_btn']) {
|
||||
$data['is_download_btn'] = 1;
|
||||
}
|
||||
|
||||
$insert = $this->clientModel->insert($data);
|
||||
if($insert){
|
||||
$client_data = $this->clientModel->where(['id' => $insert, 'is_active' => 1])->first();
|
||||
@ -254,10 +285,16 @@ class ClientController extends AdminController
|
||||
$id = $this->request->getPost('PrimaryKey');
|
||||
$data = $this->request->getPost();
|
||||
$data['updated_by'] = get_session_userid();
|
||||
if(!empty($file_name)){
|
||||
$data['client_logo'] = $file_name;
|
||||
if (!isset($data['is_download_btn'])) {
|
||||
$data['is_download_btn'] = 0;
|
||||
} elseif ($data['is_download_btn']) {
|
||||
$data['is_download_btn'] = 1;
|
||||
}
|
||||
|
||||
|
||||
$update = $this->clientModel->update($id,$data);
|
||||
|
||||
|
||||
if($update){
|
||||
return $this->respond(['status' => true,'code' => 200,'data' => $data], 200);
|
||||
}else{
|
||||
@ -523,7 +560,11 @@ class ClientController extends AdminController
|
||||
$data['claims_incurred_amount'] = $this->request->getPost('claims_incurred_amount');
|
||||
$data['is_addon'] = $this->request->getPost('is_addon');
|
||||
|
||||
|
||||
if (!isset($data['is_addon'])) {
|
||||
$data['is_addon'] = 0;
|
||||
} elseif ($data['is_addon']) {
|
||||
$data['is_addon'] = 1;
|
||||
}
|
||||
|
||||
|
||||
$data['policy_start_date'] = change_date_format($this->request->getPost('policy_start_date'), 'd-m-Y', 'Y-m-d');
|
||||
@ -579,6 +620,13 @@ class ClientController extends AdminController
|
||||
$data['claims_incurred_amount'] = $this->request->getPost('claims_incurred_amount');
|
||||
$data['is_addon'] = $this->request->getPost('is_addon');
|
||||
|
||||
|
||||
if (!isset($data['is_addon'])) {
|
||||
$data['is_addon'] = 0;
|
||||
} elseif ($data['is_addon']) {
|
||||
$data['is_addon'] = 1;
|
||||
}
|
||||
|
||||
$data['updated_by'] = get_session_userid();
|
||||
$insert = $this->clientPolicyModel->update($id,$data);
|
||||
$lastQuery = $this->clientPolicyModel->getLastQuery();
|
||||
|
||||
@ -579,11 +579,19 @@ class MasterController extends AdminController
|
||||
|
||||
$this->myLogger->logme('error','Kyc Docs CREATE function called');
|
||||
$data = $this->request->getPost();
|
||||
// print_r($data);die;
|
||||
|
||||
if($data['kyc_type_id'] == ''){
|
||||
// PrimaryKey
|
||||
$data['kyc_type_id'] =$data['PrimaryKey'];
|
||||
}
|
||||
// print_r($data);die;
|
||||
|
||||
$data['created_by'] = get_session_userid();
|
||||
$insert = $this->kycDocsModel->insert($data);
|
||||
|
||||
if($insert){
|
||||
$kycDocsData = $this->kycDocsModel->where('kyc_type_id', $this->request->getPost('kyc_type_id'))->findAll();
|
||||
$kycDocsData = $this->kycDocsModel->where('kyc_type_id', $data['kyc_type_id'])->findAll();
|
||||
echo json_encode(array("status" => true , 'data' => $kycDocsData));
|
||||
}else{
|
||||
echo json_encode(array("status" => false));
|
||||
@ -615,8 +623,11 @@ class MasterController extends AdminController
|
||||
|
||||
public function kycDocsList($id = null)
|
||||
{
|
||||
|
||||
$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
|
||||
@ -765,7 +776,7 @@ class MasterController extends AdminController
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error','Edit KYC Onboarding function called');
|
||||
$headerData['page_name'] = 'Edit KYC Master';
|
||||
$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();
|
||||
@ -798,9 +809,9 @@ class MasterController extends AdminController
|
||||
|
||||
// $editData['policies'] = $this->policesModel->where(['policy_type_id' => $id, 'is_active' => 1])->findAll();
|
||||
|
||||
|
||||
$policies = $this->policesModel->where(['policy_type_id' => $id, 'is_active' => 1])->findAll();
|
||||
|
||||
// print_r($id);die;
|
||||
foreach ($policies as $policy) {
|
||||
// Retrieve the insurer information
|
||||
$insurer = $this->insurerModel->find($policy['insurer_id']);
|
||||
@ -816,8 +827,8 @@ class MasterController extends AdminController
|
||||
|
||||
|
||||
// Return JSON response
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($editData);
|
||||
// header('Content-Type: application/json');
|
||||
// echo json_encode($editData);
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
@ -124,6 +124,19 @@ class ClientPolicyModel extends Model
|
||||
->groupBy('client_policy.client_id', $id) // Group by insurer_id
|
||||
->get()
|
||||
->getResult();
|
||||
|
||||
// return $this->db->table('client_policy')
|
||||
// ->select('insurers.name as insurer_name, insurers.short_name as insurer_short')
|
||||
// ->select('clients.client_name as client_name')
|
||||
// ->select('MAX(client_policy.id) as max_id') // or any other appropriate aggregate function
|
||||
// ->join('clients', 'clients.id = client_policy.client_id')
|
||||
// ->join('insurers', 'insurers.id = client_policy.insurer_id')
|
||||
// ->where('client_policy.client_id', $id)
|
||||
// ->groupBy('client_policy.insurer_id')
|
||||
// ->groupBy('client_policy.client_id')
|
||||
// ->get()
|
||||
// ->getResult();
|
||||
|
||||
}
|
||||
|
||||
public function getinsurerswithinsurenceid($insurerId){
|
||||
|
||||
@ -5,9 +5,8 @@ use App\Models\PolicyPremium1Model;
|
||||
use App\Models\PolicyPremium2Model;
|
||||
use App\Models\PolicyGridModel;
|
||||
use CodeIgniter\Model;
|
||||
use App\Models\PolicyGridModel;
|
||||
use App\Models\PolicyPremium1Model;
|
||||
use App\Models\PolicyPremium2Model;
|
||||
// use App\Models\PolicyPremium1Model;
|
||||
// use App\Models\PolicyPremium2Model;
|
||||
|
||||
class PolicesModel extends Model
|
||||
{
|
||||
|
||||
@ -1,3 +1,65 @@
|
||||
<style>
|
||||
.switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 60px;
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
.switch input {
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.slider {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #ccc;
|
||||
-webkit-transition: .4s;
|
||||
transition: .4s;
|
||||
}
|
||||
|
||||
.slider:before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
height: 19px;
|
||||
width: 19px;
|
||||
left: 4px;
|
||||
bottom: 4px;
|
||||
background-color: white;
|
||||
-webkit-transition: .4s;
|
||||
transition: .4s;
|
||||
}
|
||||
|
||||
input:checked + .slider {
|
||||
background-color: #2196F3;
|
||||
}
|
||||
|
||||
input:focus + .slider {
|
||||
box-shadow: 0 0 1px #2196F3;
|
||||
}
|
||||
|
||||
input:checked + .slider:before {
|
||||
-webkit-transform: translateX(26px);
|
||||
-ms-transform: translateX(26px);
|
||||
transform: translateX(26px);
|
||||
}
|
||||
|
||||
/* Rounded sliders */
|
||||
.slider.round {
|
||||
border-radius: 34px;
|
||||
}
|
||||
|
||||
.slider.round:before {
|
||||
border-radius: 50%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="tab-pane fade active show" id="general-q-tab">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@ -106,7 +168,7 @@
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="gst">Logo</label>
|
||||
<input type="file" name="client_logo" id="client_logo" onchange="PreviewImage();"><br>
|
||||
<input type="file" name="client_logo" id="client_logo" accept="image/*" onchange="PreviewImage();"><br>
|
||||
<i class="text">( Image dimensions 100 x 100 pixels and size of 200KB. )</i>
|
||||
</div>
|
||||
<div class="form-group col-md-6 float-right" style="position: relative;top: 20px;">
|
||||
@ -115,10 +177,15 @@
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input value="1" type="checkbox" name="is_download_btn" <?= (isset($client['is_download_btn']) && $client['is_download_btn'] == 1) ? 'checked' : '' ?>>
|
||||
<label>Download Excel</label>
|
||||
<label class="switch">
|
||||
<input id="is_download_btn" type="checkbox" name="is_download_btn" <?= (isset($client['is_download_btn']) && $client['is_download_btn'] == 1) ? 'checked' : '' ?>>
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
<label for="is_download_btn">Enable Client Export Option</label>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="btnSubmit">Submit</button>
|
||||
@ -132,211 +199,233 @@
|
||||
</div>
|
||||
<!-- end -->
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const switchCheckbox = document.getElementById('switch-checkbox');
|
||||
const switchInner = document.querySelector('.switch-inner');
|
||||
|
||||
var PrimaryKey = $('#general_PrimaryKey').val();
|
||||
var form_action = '';
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#client_logo').change(function() {
|
||||
validateFile(this);
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$("#general_form").submit(function(event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
var $submitButton = $('#general_form').find('button[type="submit"]');
|
||||
$submitButton.prop('disabled', true); // Disable the submit button
|
||||
|
||||
var isValid = $('#general_form').parsley().validate();
|
||||
if (!isValid) {
|
||||
$submitButton.prop('disabled', false);
|
||||
console.log('Form is Empty', 'Warning');
|
||||
return ;
|
||||
}
|
||||
|
||||
if(PrimaryKey === ''){
|
||||
form_action = '<?= base_url("client/general/create"); ?>';
|
||||
}else{
|
||||
form_action = '<?= base_url("client/general/edit"); ?>';
|
||||
}
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
var formData = new FormData($('#general_form')[0]);
|
||||
var OptionsHTML1 = ''
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: form_action,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
console.log(res);
|
||||
|
||||
if(res){
|
||||
setTimeout(function() {
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
$('#kyc_tab').click();
|
||||
var message = (PrimaryKey === '') ? 'Client General Info Created successfully' : 'Client General Info Updated successfully';
|
||||
toastr.success(message, 'Success');
|
||||
$submitButton.prop('disabled', false);
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
$('#client_id').val(res.data.id);
|
||||
$('#client_id_relation').val(res.data.id);
|
||||
$('#relation_PrimaryKey').val(res.data.id);
|
||||
$('#client_id_branch').val(res.data.id);
|
||||
$('#client_id_for_client_branch').val(res.data.id);
|
||||
$('#client_id_policy').val(res.data.id);
|
||||
$('#policy_PrimaryKey').val(res.data.id);
|
||||
$('#client_id_kyc').val(res.data.id);
|
||||
$('#kyc_PrimaryKey').val(res.data.id);
|
||||
$('#Client_id').val(res.data.id);
|
||||
$('#entity_type').val(res.data.entity_type_id);
|
||||
|
||||
|
||||
var client_id_for_file = res.data.id;
|
||||
console.log()
|
||||
|
||||
if(PrimaryKey === ''){
|
||||
$.ajax({
|
||||
url: '<?= base_url("client/kyc/list/"); ?>' + res.data.entity_type_id,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function (res) {
|
||||
|
||||
console.log('kyc docs', res);
|
||||
var tbody = $('#tbody');
|
||||
tbody.empty();
|
||||
|
||||
$.each(res.data, function (index, item) {
|
||||
var row = `<tr>
|
||||
<td> ${item.file_name}</td>
|
||||
<td id="form_${item.id}" style=""><form class="ajax" ><input class="file-input__input" type="file" name="file_name">
|
||||
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" class="form-control" value="${item.id}" name="kyc_doc_type_id" />
|
||||
<input type="hidden" name="client_id" id="id_for_kyc_file" value="${client_id_for_file}"/>
|
||||
<button class="btn btn-sm btn-primary submit" style="position: relative;right: 80px;">Submit</button></form></td>
|
||||
<td id="name_${item.id}" style="display:none;"></td>
|
||||
<td><i data-id="${item.id}" class="mdi mdi-delete btnKycDelete" style="font-size:18px;"></i></td>
|
||||
</tr>`;
|
||||
tbody.append(row);
|
||||
});
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
$submitButton.prop('disabled', false);
|
||||
if (xhr.status === 404) {
|
||||
toastr.warning('Resource not found', 'Warning');
|
||||
} else if (xhr.status === 500) {
|
||||
toastr.warning('Internal server error', 'Warning');
|
||||
} else {
|
||||
toastr.warning('Unknown error occurred', 'Warning');
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
switchInner.addEventListener('click', function() {
|
||||
switchCheckbox.checked = !switchCheckbox.checked;
|
||||
switchInner.style.transform = switchCheckbox.checked ? 'translateX(100%)' : 'translateX(0)';
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function onlyNumbers(event){
|
||||
var charcode;
|
||||
charcode = event.which || event.keyCode;
|
||||
if(charcode>= 48 && charcode <= 57)return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
function PreviewImage() {
|
||||
var oFReader = new FileReader();
|
||||
oFReader.readAsDataURL(document.getElementById("client_logo").files[0]);
|
||||
|
||||
oFReader.onload = function (oFREvent) {
|
||||
document.getElementById("uploadPreview").src = oFREvent.target.result;
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
// function validateFile(input) {
|
||||
// const file = input.files[0];
|
||||
// const allowedExtensions = ["jpg", "jpeg", "png"];
|
||||
// const fileExtension = file.name.split(".").pop().toLowerCase();
|
||||
<script>
|
||||
|
||||
// if (!allowedExtensions.includes(fileExtension)) {
|
||||
// toastr.warning('Only JPG, JPEG, PNG files are allowed.', 'Invalid file type.');
|
||||
// document.getElementById("uploadPreview").src = "http://ssl.gstatic.com/accounts/ui/avatar_2x.png";
|
||||
// input.value = "";
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
var PrimaryKey = $('#general_PrimaryKey').val();
|
||||
var form_action = '';
|
||||
|
||||
function validateFile(input) {
|
||||
const file = input.files[0];
|
||||
const allowedExtensions = ["jpg", "jpeg", "png"];
|
||||
const fileExtension = file.name.split(".").pop().toLowerCase();
|
||||
$(document).ready(function() {
|
||||
$('#client_logo').change(function() {
|
||||
validateFile(this);
|
||||
});
|
||||
});
|
||||
|
||||
// Check if the file extension is allowed
|
||||
if (!allowedExtensions.includes(fileExtension)) {
|
||||
toastr.warning('Only JPG, JPEG, PNG files are allowed.', 'Invalid file type.');
|
||||
document.getElementById("uploadPreview").src = "";
|
||||
$("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png");
|
||||
input.value = "";
|
||||
return;
|
||||
}
|
||||
$(document).ready(function () {
|
||||
|
||||
// Check file size
|
||||
const fileSize = file.size / 1024; // in KB
|
||||
if (fileSize > 200) {
|
||||
toastr.warning('Maximum file size allowed is 200KB.', 'File size exceeds limit.');
|
||||
$("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png");
|
||||
input.value = "";
|
||||
return;
|
||||
}
|
||||
$("#general_form").submit(function(event) {
|
||||
|
||||
// Check image dimensions
|
||||
const img = new Image();
|
||||
img.onload = function() {
|
||||
if (this.width !== 100 || this.height !== 100) {
|
||||
toastr.warning('Image dimensions should be 100x100 pixels.', 'Invalid image dimensions.');
|
||||
$("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png");
|
||||
input.value = "";
|
||||
return;
|
||||
event.preventDefault();
|
||||
|
||||
var $submitButton = $('#general_form').find('button[type="submit"]');
|
||||
$submitButton.prop('disabled', true); // Disable the submit button
|
||||
|
||||
var isValid = $('#general_form').parsley().validate();
|
||||
if (!isValid) {
|
||||
$submitButton.prop('disabled', false);
|
||||
console.log('Form is Empty', 'Warning');
|
||||
return ;
|
||||
}
|
||||
|
||||
if(PrimaryKey === ''){
|
||||
form_action = '<?= base_url("client/general/create"); ?>';
|
||||
}else{
|
||||
form_action = '<?= base_url("client/general/edit"); ?>';
|
||||
}
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
var formData = new FormData($('#general_form')[0]);
|
||||
var OptionsHTML1 = ''
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: form_action,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
console.log(res);
|
||||
|
||||
if(res){
|
||||
setTimeout(function() {
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
$('#kyc_tab').click();
|
||||
|
||||
$('#btnBranchAdd').show();
|
||||
$('#BtnAdd').show();
|
||||
$('#relation_form').show();
|
||||
$('#btnBranchAdd').show();
|
||||
|
||||
var message = (PrimaryKey === '') ? 'Client General Info Created successfully' : 'Client General Info Updated successfully';
|
||||
toastr.success(message, 'Success');
|
||||
$submitButton.prop('disabled', false);
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
$('#client_id').val(res.data.id);
|
||||
$('#general_PrimaryKey').val(res.data.id);
|
||||
$('#client_id_relation').val(res.data.id);
|
||||
$('#relation_PrimaryKey').val(res.data.id);
|
||||
$('#client_id_branch').val(res.data.id);
|
||||
$('#client_id_for_client_branch').val(res.data.id);
|
||||
$('#client_id_policy').val(res.data.id);
|
||||
$('#policy_PrimaryKey').val(res.data.id);
|
||||
$('#client_id_kyc').val(res.data.id);
|
||||
$('#kyc_PrimaryKey').val(res.data.id);
|
||||
$('#Client_id').val(res.data.id);
|
||||
$('#entity_type').val(res.data.entity_type_id);
|
||||
|
||||
|
||||
var client_id_for_file = res.data.id;
|
||||
console.log()
|
||||
|
||||
if(PrimaryKey === ''){
|
||||
$.ajax({
|
||||
url: '<?= base_url("client/kyc/list/"); ?>' + res.data.entity_type_id,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function (res) {
|
||||
|
||||
console.log('kyc docs', res);
|
||||
var tbody = $('#tbody');
|
||||
tbody.empty();
|
||||
|
||||
$.each(res.data, function (index, item) {
|
||||
var row = `<tr>
|
||||
<td> ${item.file_name}</td>
|
||||
<td id="form_${item.id}" style=""><form class="ajax" ><input class="file-input__input" type="file" name="file_name">
|
||||
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" class="form-control" value="${item.id}" name="kyc_doc_type_id" />
|
||||
<input type="hidden" name="client_id" id="id_for_kyc_file" value="${client_id_for_file}"/>
|
||||
<button class="btn btn-sm btn-primary submit" style="position: relative;right: 80px;">Submit</button></form></td>
|
||||
<td id="name_${item.id}" style="display:none;"></td>
|
||||
<td><i data-id="${item.id}" class="mdi mdi-delete btnKycDelete" style="font-size:18px;"></i></td>
|
||||
</tr>`;
|
||||
tbody.append(row);
|
||||
});
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
$submitButton.prop('disabled', false);
|
||||
if (xhr.status === 404) {
|
||||
toastr.warning('Resource not found', 'Warning');
|
||||
} else if (xhr.status === 500) {
|
||||
toastr.warning('Internal server error', 'Warning');
|
||||
} else {
|
||||
toastr.warning('Unknown error occurred', 'Warning');
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function onlyNumbers(event){
|
||||
var charcode;
|
||||
charcode = event.which || event.keyCode;
|
||||
if(charcode>= 48 && charcode <= 57)return true;
|
||||
return false;
|
||||
}
|
||||
// If both size and dimensions are valid, you can proceed with your logic here
|
||||
// For example, you can display the image
|
||||
const reader = new FileReader();
|
||||
reader.onload = function(e) {
|
||||
document.getElementById("uploadPreview").src = e.target.result;
|
||||
|
||||
function PreviewImage() {
|
||||
var oFReader = new FileReader();
|
||||
oFReader.readAsDataURL(document.getElementById("client_logo").files[0]);
|
||||
|
||||
oFReader.onload = function (oFREvent) {
|
||||
document.getElementById("uploadPreview").src = oFREvent.target.result;
|
||||
};
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
};
|
||||
img.src = URL.createObjectURL(file);
|
||||
}
|
||||
|
||||
|
||||
// function validateFile(input) {
|
||||
// const file = input.files[0];
|
||||
// const allowedExtensions = ["jpg", "jpeg", "png"];
|
||||
// const fileExtension = file.name.split(".").pop().toLowerCase();
|
||||
|
||||
// if (!allowedExtensions.includes(fileExtension)) {
|
||||
// toastr.warning('Only JPG, JPEG, PNG files are allowed.', 'Invalid file type.');
|
||||
// document.getElementById("uploadPreview").src = "http://ssl.gstatic.com/accounts/ui/avatar_2x.png";
|
||||
// input.value = "";
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
function validateFile(input) {
|
||||
const file = input.files[0];
|
||||
const allowedExtensions = ["jpg", "jpeg", "png"];
|
||||
const fileExtension = file.name.split(".").pop().toLowerCase();
|
||||
|
||||
// Check if the file extension is allowed
|
||||
if (!allowedExtensions.includes(fileExtension)) {
|
||||
toastr.warning('Only JPG, JPEG, PNG files are allowed.', 'Invalid file type.');
|
||||
document.getElementById("uploadPreview").src = "";
|
||||
$("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png");
|
||||
input.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
// Check file size
|
||||
const fileSize = file.size / 1024; // in KB
|
||||
if (fileSize > 200) {
|
||||
toastr.warning('Maximum file size allowed is 200KB.', 'File size exceeds limit.');
|
||||
$("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png");
|
||||
input.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
// Check image dimensions
|
||||
const img = new Image();
|
||||
img.onload = function() {
|
||||
if (this.width !== 100 || this.height !== 100) {
|
||||
toastr.warning('Image dimensions should be 100x100 pixels.', 'Invalid image dimensions.');
|
||||
$("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png");
|
||||
input.value = "";
|
||||
return;
|
||||
}
|
||||
// If both size and dimensions are valid, you can proceed with your logic here
|
||||
// For example, you can display the image
|
||||
const reader = new FileReader();
|
||||
reader.onload = function(e) {
|
||||
document.getElementById("uploadPreview").src = e.target.result;
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
};
|
||||
img.src = URL.createObjectURL(file);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
@ -5,12 +5,12 @@
|
||||
<div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
|
||||
<h4 class="header-title" style="position: relative;">Client Deposit-</h4>
|
||||
<h4 class="header-title" style="position: relative;">Client Deposit - <?php print_r($clientData[0]->client_name);?><?php?></h4>
|
||||
|
||||
</div>
|
||||
<div class="col-6" style="text-align: right; position: relative;top: 53px;">
|
||||
<!-- <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>
|
||||
</div> -->
|
||||
</div>
|
||||
<table class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
@ -27,8 +27,8 @@
|
||||
<tr>
|
||||
<?php foreach ($clientData as $value): ?>
|
||||
<td>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php echo $value->insurer_name;?>
|
||||
|
||||
</td>
|
||||
@ -76,7 +76,7 @@
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'ClientList',
|
||||
title: 'Client_Deposit',
|
||||
className: 'my_class',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
|
||||
@ -53,7 +53,8 @@
|
||||
class="text-danger">*</span></label>
|
||||
<input class="form-control" type="file" name="file_name" multiple="true" id="kyc_docs_file" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4 align-self-end">
|
||||
<!-- <div class="form-group col-md-4 align-self-end"> -->
|
||||
<div class="form-group col-md-4" style="margin-top: 42px;">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"id="btnSubmit">Upload</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -164,7 +165,7 @@
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.success('File Uloaded successfully', 'Success');
|
||||
toastr.success('File Uploaded successfully', 'Success');
|
||||
}, 500);
|
||||
}
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
<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/deposit/{$row->id}"); ?>"><i class="mdi mdi-cash mr-2 text-muted font-18 vertical-middle"></i>Deposit</a>
|
||||
<a class="dropdown-item" href="#"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||
<a class="dropdown-item" href="<?= base_url("client/remove/"); ?><?= $row->id;?>"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@ -39,7 +39,7 @@ body {
|
||||
<h4 class="header-title" style="position: relative;">Client Onboarding <?php if(isset($client)) {echo ' - ' . $client['client_name']; } ?></h4>
|
||||
</div>
|
||||
<div class="col-6" style="text-align: right;">
|
||||
<!-- <a href="<?= base_url("client/list"); ?>" class="btn btn-primary waves-effect waves-light">Back</a> -->
|
||||
<a href="<?= base_url("client/list"); ?>"><i class="fas fa-arrow-left" style="font-size: 17px;"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -121,3 +121,82 @@ body {
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function client_kyc_docs() {
|
||||
var check_client_id = $('#general_PrimaryKey');
|
||||
|
||||
|
||||
if(check_client_id[0].value == '' || check_client_id[0].value == null || check_client_id[0].value == 0){
|
||||
$('#btnBranchAdd').hide();
|
||||
toastr.warning('Please Add the Client!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
$('#btnBranchAdd').show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function client_relationship_manager() {
|
||||
var check_client_id = $('#general_PrimaryKey');
|
||||
|
||||
|
||||
if(check_client_id[0].value == '' || check_client_id[0].value == null || check_client_id[0].value == 0){
|
||||
$('#relation_form').hide();
|
||||
toastr.warning('Please Add the Client!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
$('#relation_form').show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function client_policies() {
|
||||
var check_client_id = $('#general_PrimaryKey');
|
||||
|
||||
|
||||
if(check_client_id[0].value == '' || check_client_id[0].value == null || check_client_id[0].value == 0){
|
||||
$('#BtnAdd').hide();
|
||||
toastr.warning('Please Add the Client!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
$('#BtnAdd').show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function client_branch_contact() {
|
||||
var check_client_id = $('#general_PrimaryKey');
|
||||
|
||||
|
||||
if(check_client_id[0].value == '' || check_client_id[0].value == null || check_client_id[0].value == 0){
|
||||
$('#btnBranchAdd').hide();
|
||||
toastr.warning('Please Add the Client!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
$('#btnBranchAdd').show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
document.getElementById("kyc_tab").addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
client_kyc_docs();
|
||||
});
|
||||
|
||||
|
||||
document.getElementById("RM_tab").addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
client_relationship_manager();
|
||||
});
|
||||
|
||||
|
||||
document.getElementById("policy_tab").addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
client_policies();
|
||||
});
|
||||
|
||||
|
||||
document.getElementById("branch_tab").addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
client_branch_contact();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -86,8 +86,11 @@
|
||||
<input value="" type="text" class="form-control" placeholder="Policy Status" id="policy_status" readonly>
|
||||
</div>
|
||||
<div >
|
||||
<input value="1" type="checkbox" name="is_addon" id="is_addon">
|
||||
<label >Add On</label>
|
||||
<label class="switch">
|
||||
<input id="is_addon" type="checkbox" name="is_addon" <?= (isset($client['is_addon']) && $client['is_addon'] == 1) ? 'checked' : '' ?>>
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
<label for="is_addon">Is AddOn Policy</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -97,9 +97,11 @@ $(document).ready(function () {
|
||||
}, 1000);
|
||||
console.log(res);
|
||||
$('#insurer_id').val(res.data.id);
|
||||
$('#insurer_General_PrimaryKey').val(res.data.id);
|
||||
$('#insurer_id_branch').val(res.data.id);
|
||||
$('#insurer_branch_contacts_id').click();
|
||||
|
||||
$('#btnBranchAdd').show();
|
||||
var message = "Insurer General Info";
|
||||
toastr.success(message, 'Success');
|
||||
|
||||
|
||||
@ -38,9 +38,12 @@ body {
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 class="header-title" style="position: relative;">Insurer</h4>
|
||||
</div>
|
||||
<!-- <div class="col-6" style="text-align: right;">
|
||||
<a href="<?= base_url("master/insurer/list"); ?>" class="btn btn-primary waves-effect waves-light">Back</a>
|
||||
</div> -->
|
||||
<div class="col-6" style="text-align: right;">
|
||||
<a href="<?= base_url("master/insurer/list"); ?>" >
|
||||
<i class="fas fa-arrow-left" style="font-size: 17px;"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<ul class="nav nav-pills navtab-bg">
|
||||
<li class="nav-item">
|
||||
@ -67,3 +70,24 @@ body {
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
function insurer_branch_contact() {
|
||||
var check_insurer_id = $('#insurer_General_PrimaryKey');
|
||||
|
||||
if(check_insurer_id[0].value == '' || check_insurer_id[0].value == null || check_insurer_id[0].value == 0){
|
||||
$('#btnBranchAdd').hide();
|
||||
toastr.warning('First Add the Insurer!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
$('#btnBranchAdd').show();
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById("insurer_branch_contacts_id").addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
insurer_branch_contact();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@ -157,6 +157,8 @@ $(document).ready(function () {
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
console.log("kyc_docs_form_action");
|
||||
console.log(kyc_docs_form_action);
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: kyc_docs_form_action,
|
||||
@ -170,7 +172,7 @@ $(document).ready(function () {
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log(res);
|
||||
$('#insurer_branch_list tr').remove();
|
||||
$('#kyc_docs_list tr').remove();
|
||||
var insurerBranchTableInsert = ''
|
||||
$.each(res.data, function(index, item) {
|
||||
insurerBranchTableInsert += `
|
||||
@ -180,7 +182,7 @@ $(document).ready(function () {
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
$('#insurer_branch_list').append(insurerBranchTableInsert);
|
||||
$('#kyc_docs_list').append(insurerBranchTableInsert);
|
||||
$('#add_branch').hide();
|
||||
$('#branch_table').show();
|
||||
$('.btnBack').hide();
|
||||
@ -249,8 +251,13 @@ $(document).ready(function () {
|
||||
function loadKYCDocsList() {
|
||||
var base_url = '<?= base_url("master/kyc/kycdocs/list/"); ?>';
|
||||
|
||||
var kyc_docs_action = base_url + kyc_Docs_PrimaryKey;
|
||||
console.log(kyc_docs_action);
|
||||
var kyc_Docs_PrimaryKey_1 = $('#kyc_General_PrimaryKey').val();
|
||||
|
||||
// console.log("kyc_Docs_PrimaryKey_1");
|
||||
// console.log(kyc_Docs_PrimaryKey_1);
|
||||
|
||||
var kyc_docs_action = base_url + kyc_Docs_PrimaryKey_1;
|
||||
// console.log(kyc_docs_action);
|
||||
if (kyc_Docs_PrimaryKey != '') {
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
@ -261,6 +268,8 @@ $(document).ready(function () {
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
console.log("response in", res);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<form role="form" class="parsley-examples" method="post" id="kyc_general_form" enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="kyc_General_PrimaryKey" value="<?= isset($kyc['id']) ? $kyc['id'] : '' ?>"/>
|
||||
<input type="hidden" name="kyc_type_id" id="kyc_type_id" />
|
||||
<input type="hidden" name="kyc_type_id" id="kyc_type_id" value="<?= isset($kyc['id']) ? $kyc['id'] : '' ?>"/>
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
@ -45,8 +45,8 @@ $(document).ready(function () {
|
||||
var form_action = '';
|
||||
if (isValid) {
|
||||
|
||||
console.log("Primary KEy");
|
||||
console.log(PrimaryKey);
|
||||
// console.log("Primary KEy");
|
||||
// console.log(PrimaryKey);
|
||||
if(PrimaryKey === ''){
|
||||
form_action = '<?= base_url("master/kyc/createpost"); ?>';
|
||||
}else{
|
||||
@ -70,9 +70,12 @@ $(document).ready(function () {
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log(res);
|
||||
$('#kyc_type_id').val(res.data.PrimaryKey);
|
||||
$('#kyc_id_docs').val(res.data.PrimaryKey);
|
||||
$('#kyc_type_id').val(res.data.id);
|
||||
$('#kyc_Docs_PrimaryKey').val(res.data.id);
|
||||
$('#kyc_General_PrimaryKey').val(res.data.id);
|
||||
$('#kyc_id_docs').val(res.data.id);
|
||||
$('#kyc_docs_id').click();
|
||||
$('#btnBranchAdd').show();
|
||||
var message = "KYC Entity Type General Info";
|
||||
toastr.success(message, 'Success');
|
||||
},
|
||||
|
||||
@ -38,9 +38,9 @@ body {
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 class="header-title" style="position: relative;">KYC Entity Type</h4>
|
||||
</div>
|
||||
<!-- <div class="col-6" style="text-align: right;">
|
||||
<a href="<?= base_url("master/kyc/list"); ?>" class="btn btn-primary waves-effect waves-light">Back</a>
|
||||
</div> -->
|
||||
<div class="col-6" style="text-align: right;">
|
||||
<a href="<?= base_url("master/kyc/list"); ?>" ><i class="fas fa-arrow-left" style="font-size: 17px;"></i> </a>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="nav nav-pills navtab-bg">
|
||||
<li class="nav-item">
|
||||
@ -67,3 +67,23 @@ body {
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function policy_type_branch_contact() {
|
||||
var check_policy_type_id = $('#kyc_General_PrimaryKey');
|
||||
|
||||
console.log(check_policy_type_id.val());
|
||||
if(check_policy_type_id[0].value == '' || check_policy_type_id[0].value == null || check_policy_type_id[0].value == 0){
|
||||
$('#btnBranchAdd').hide();
|
||||
toastr.warning('First Add the KYC Entity Type!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
$('#btnBranchAdd').show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
document.getElementById("kyc_docs_id").addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
policy_type_branch_contact();
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -3,12 +3,13 @@
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<title><?= isset($page_name) ? $page_name : 'nHance'; ?></title>
|
||||
<title><?= isset($page_name) ? $page_name : 'NHance'; ?></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta content="" name="description" />
|
||||
<meta content="nHANCE" name="nHANCE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
|
||||
|
||||
<!-- App favicon -->
|
||||
<link rel="shortcut icon" href="<?= base_url()."public"; ?>/assets/images/favicon.ico">
|
||||
|
||||
@ -448,7 +449,7 @@
|
||||
|
||||
<!-- LOGO -->
|
||||
<div class="logo-box">
|
||||
<a href="index.html" class="logo logo-dark text-center">
|
||||
<a href="https://localhost/nhance/dashboard/view" class="logo logo-dark text-center">
|
||||
<span class="logo-sm">
|
||||
<img src="<?= base_url()."public"; ?>/assets/images/n.png" alt="" height="24">
|
||||
<!-- <span class="logo-lg-text-light">NHANCE</span> -->
|
||||
@ -459,7 +460,7 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a href="index.html" class="logo logo-light text-center">
|
||||
<a href="https://localhost/nhance/dashboard/view" class="logo logo-light text-center">
|
||||
<span class="logo-sm">
|
||||
<img src="<?= base_url()."public"; ?>/assets/images/n.png" alt="" height="24">
|
||||
</span>
|
||||
@ -501,7 +502,7 @@
|
||||
|
||||
<!-- LOGO -->
|
||||
<div class="logo-box">
|
||||
<a href="index.html" class="logo logo-dark text-center">
|
||||
<a href="https://localhost/nhance/dashboard/view" class="logo logo-dark text-center">
|
||||
<span class="logo-sm">
|
||||
<img src="<?= base_url()."public"; ?>/assets/images/logo-sm-dark.png" alt="" height="24">
|
||||
<!-- <span class="logo-lg-text-light">nHance</span> -->
|
||||
@ -512,7 +513,7 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a href="index.html" class="logo logo-light text-center">
|
||||
<a href="https://localhost/nhance/dashboard/view" class="logo logo-light text-center">
|
||||
<span class="logo-sm">
|
||||
<img src="<?= base_url()."public"; ?>/assets/images/n.png" alt="" height="24">
|
||||
</span>
|
||||
|
||||
@ -205,6 +205,7 @@ $(document).ready(function () {
|
||||
var formData = new FormData($('#tpa_branch_form')[0]);
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$('#policies_list').html("");
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: tpa_branch_form_action,
|
||||
@ -213,6 +214,8 @@ $(document).ready(function () {
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
console.log(res);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
@ -229,9 +232,9 @@ $(document).ready(function () {
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
// $('#policies_list').append(tpaBranchTableInsert);
|
||||
$('#policies_list').html("");
|
||||
loadPoliciesList();
|
||||
$('#policies_list').append(tpaBranchTableInsert);
|
||||
// $('#policies_list').html("");
|
||||
// loadPoliciesList();
|
||||
$('#add_branch').hide();
|
||||
$('#branch_table').show();
|
||||
$('.btnBack').hide();
|
||||
@ -314,8 +317,8 @@ $(document).ready(function () {
|
||||
|
||||
|
||||
$('body').on('click', '#btnSubmit', function() {
|
||||
// $('#policies_list').html("");
|
||||
// loadPoliciesList();
|
||||
$('#policies_list').html("");
|
||||
loadPoliciesList();
|
||||
|
||||
setTimeout(function() {
|
||||
}, 1000) });
|
||||
@ -333,6 +336,9 @@ $(document).ready(function () {
|
||||
url: insurer_branch_action,
|
||||
type: 'GET',
|
||||
success: function(response) {
|
||||
|
||||
console.log("response", response);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
@ -86,9 +86,11 @@ $(document).ready(function () {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
|
||||
$('#policy_type_id').val(res.data.PrimaryKey);
|
||||
|
||||
$('#policy_type_id').val(res.data.id);
|
||||
$('#policytype_General_PrimaryKey').val(res.data.id);
|
||||
$('#policy_id_type').click();
|
||||
$('#btnBranchAdd').show();
|
||||
var message = "Policy Type General Info";
|
||||
toastr.success(message, 'Success');
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'TPAList',
|
||||
title: 'PolicyTypeList',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
}
|
||||
|
||||
@ -38,9 +38,9 @@ body {
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 class="header-title" style="position: relative;">Policy Type</h4>
|
||||
</div>
|
||||
<!-- <div class="col-6" style="text-align: right;">
|
||||
<a href="<?= base_url("master/policy/list"); ?>" class="btn btn-primary waves-effect waves-light">Back</a>
|
||||
</div> -->
|
||||
<div class="col-6" style="text-align: right;">
|
||||
<a href="<?= base_url("master/policy/list"); ?>"><i class="fas fa-arrow-left" style="font-size: 17px;"></i> </a>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="nav nav-pills navtab-bg">
|
||||
<li class="nav-item">
|
||||
@ -67,3 +67,23 @@ body {
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
function policy_type_branch_contact() {
|
||||
var check_policy_type_id = $('#policytype_General_PrimaryKey');
|
||||
|
||||
|
||||
if(check_policy_type_id[0].value == '' || check_policy_type_id[0].value == null || check_policy_type_id[0].value == 0){
|
||||
$('#btnBranchAdd').hide();
|
||||
toastr.warning('First Add the Policy Type!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
$('#btnBranchAdd').show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
document.getElementById("policy_id_type").addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
policy_type_branch_contact();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -74,9 +74,11 @@ $(document).ready(function () {
|
||||
|
||||
console.log(res);
|
||||
$('#tpa_id').val(res.data.id);
|
||||
$('#tpa_General_PrimaryKey').val(res.data.id);
|
||||
$('#tpa_id_branch').val(res.data.id);
|
||||
$('#tpa_branch_contacts_id').click();
|
||||
|
||||
$('#btnBranchAdd').show();
|
||||
var message = "TPA General Info";
|
||||
toastr.success(message, 'Success');
|
||||
|
||||
|
||||
@ -38,9 +38,9 @@ body {
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 class="header-title" style="position: relative;">TPA</h4>
|
||||
</div>
|
||||
<!-- <div class="col-6" style="text-align: right;">
|
||||
<a href="<?= base_url("master/tpa/list"); ?>" class="btn btn-primary waves-effect waves-light">Back</a>
|
||||
</div> -->
|
||||
<div class="col-6" style="text-align: right;">
|
||||
<a href="<?= base_url("master/tpa/list"); ?>"><i class="fas fa-arrow-left" style="font-size: 17px;"></i> </a>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="nav nav-pills navtab-bg">
|
||||
<li class="nav-item">
|
||||
@ -67,3 +67,23 @@ body {
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
function tpa_branch_contact() {
|
||||
var check_tpa_id = $('#tpa_General_PrimaryKey');
|
||||
|
||||
|
||||
if(check_tpa_id[0].value == '' || check_tpa_id[0].value == null || check_tpa_id[0].value == 0){
|
||||
$('#btnBranchAdd').hide();
|
||||
toastr.warning('First Add the TPA!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
$('#btnBranchAdd').show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
document.getElementById("tpa_branch_contacts_id").addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
tpa_branch_contact();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user