Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev

This commit is contained in:
Gowtham M 2025-02-27 15:27:20 +05:30
commit 295b9ece91
14 changed files with 1456 additions and 1025 deletions

View File

@ -4834,7 +4834,7 @@ class ClientController extends AdminController
return $this->respond([ return $this->respond([
'status' => false, 'status' => false,
'code' => 404, 'code' => 404,
'message' => 'No data found', 'message' => 'No Employee found',
'param' => $param, 'param' => $param,
'type' => $type, 'type' => $type,
'dataForClientAndInsurer' => $dataForClientAndInsurer, 'dataForClientAndInsurer' => $dataForClientAndInsurer,
@ -4843,7 +4843,7 @@ class ClientController extends AdminController
} }
} }
public function getTheEmpDataForClaimSearchByMobile($param, $type = 'mobile', $client_policy_id = null) public function getTheEmpDataForClaimSearchByMobile($param, $type = 'mobile', $client_policy_id = null, $client_id = null)
{ {
$field_name = 'employees.' . $type; $field_name = 'employees.' . $type;
@ -4866,8 +4866,8 @@ class ClientController extends AdminController
employee_polices.tpa_id AS tpa_no, employee_polices.tpa_id AS tpa_no,
employee_polices.client_policy_id AS policy_id employee_polices.client_policy_id AS policy_id
") ")
->join('clients', 'client_policy.client_id = clients.id', 'left') ->join('clients', 'client_policy.client_id = clients.id')
->join('insurers', 'client_policy.insurer_id = insurers.id', 'left') ->join('insurers', 'client_policy.insurer_id = insurers.id')
->join('tpa', 'client_policy.tpa_id = tpa.id', 'left') ->join('tpa', 'client_policy.tpa_id = tpa.id', 'left')
->join('employees', 'clients.id = employees.client_id') ->join('employees', 'clients.id = employees.client_id')
->join('employee_polices', 'employees.id = employee_polices.employee_id') ->join('employee_polices', 'employees.id = employee_polices.employee_id')
@ -4879,6 +4879,10 @@ class ClientController extends AdminController
->where('employee_polices.is_active', 1) ->where('employee_polices.is_active', 1)
->where($field_name, $param); ->where($field_name, $param);
if (!empty($client_id)) {
$query->where('employees.client_id', $client_id);
}
if (!empty($client_policy_id)) { if (!empty($client_policy_id)) {
$query->where('employee_polices.client_policy_id', $client_policy_id); $query->where('employee_polices.client_policy_id', $client_policy_id);
} }
@ -4902,7 +4906,7 @@ class ClientController extends AdminController
if(!empty($data) && count($data) > 0){ if(!empty($data) && count($data) > 0){
$memberData = $this->employeeModel->getEmployeeByEmployeeCode($data['emp_code'], $data['policy_id']); $memberData = $this->employeeModel->getEmployeeByEmployeeCode($data['emp_code'], $data['policy_id'], $client_id);
$acms = $this->clientRMModel $acms = $this->clientRMModel
->select('user_profiles.id, user_profiles.first_name') ->select('user_profiles.id, user_profiles.first_name')
@ -4935,7 +4939,7 @@ class ClientController extends AdminController
return $this->respond([ return $this->respond([
'status' => false, 'status' => false,
'code' => 404, 'code' => 404,
'message' => 'No data found', 'message' => 'No Employee found',
'param' => $param, 'param' => $param,
'client_policy_id' => $client_policy_id, 'client_policy_id' => $client_policy_id,
'type' => $type, 'type' => $type,

View File

@ -34,6 +34,7 @@ class TicketController extends BaseController
public $claimStatus; public $claimStatus;
public $placeHolders; public $placeHolders;
public $extraFields; public $extraFields;
public $nonIDReason;
protected $clientModel; protected $clientModel;
protected $ticketMasterModel; protected $ticketMasterModel;
@ -98,7 +99,8 @@ class TicketController extends BaseController
4 => "Trigger 4", 4 => "Trigger 4",
5 => "Trigger 5", 5 => "Trigger 5",
6 => "Trigger 6", 6 => "Trigger 6",
7 => "Trigger 7" 7 => "Trigger 7",
8 => "Trigger 8",
]; ];
$this->placeHolders = [ $this->placeHolders = [
@ -114,7 +116,8 @@ class TicketController extends BaseController
'((AUTO_QUERY_CONTENT))' => 'auto_query_content', '((AUTO_QUERY_CONTENT))' => 'auto_query_content',
]; ];
$this->extraFields = [ $this->extraFields = [
1 => ['non_id_reason'],
10 => ['pay_initiate_date'],
3 => ['raised_date'], 3 => ['raised_date'],
4 => ['raised_date'], 4 => ['raised_date'],
5 => ['claim_number', 'registration_date'], 5 => ['claim_number', 'registration_date'],
@ -137,6 +140,13 @@ class TicketController extends BaseController
53 => ['cancel_remark'], 53 => ['cancel_remark'],
58 => ['cancel_remark'], 58 => ['cancel_remark'],
]; ];
$this->nonIDReason = [
"Newborn Baby" => "Newborn Baby",
"Newly Wedded Spouse" => "Newly Wedded Spouse",
"Policy Pending" => "Policy Pending",
"New Joinee" => "New Joinee",
"Exceptional Case" => "Exceptional Case"
];
$this->ticketMasterModel = new TicketMasterModel(); $this->ticketMasterModel = new TicketMasterModel();
$this->claimStatus = new TicketClaimStatusModel(); $this->claimStatus = new TicketClaimStatusModel();
@ -296,7 +306,8 @@ class TicketController extends BaseController
'ticket_type' => $this->ticketType, 'ticket_type' => $this->ticketType,
'priorityType' => $this->priorityType, 'priorityType' => $this->priorityType,
'relationshipType' => $this->relationshipType, 'relationshipType' => $this->relationshipType,
'modeOFIntimate' => $this->modeOFIntimate 'modeOFIntimate' => $this->modeOFIntimate,
'nonIDReason' => $this->nonIDReason
]; ];
switch ($ticket_type) { switch ($ticket_type) {
@ -528,6 +539,12 @@ class TicketController extends BaseController
$ticket_data['settled_date'] = change_date_format($ticket_data['settled_date'], null, $out_put_format); $ticket_data['settled_date'] = change_date_format($ticket_data['settled_date'], null, $out_put_format);
} }
if (empty($ticket_data['pay_initiate_date'])) {
$ticket_data['pay_initiate_date'] = null;
} else {
$ticket_data['pay_initiate_date'] = change_date_format($ticket_data['pay_initiate_date'], null, $out_put_format);
}
return $ticket_data; return $ticket_data;
} }
@ -593,6 +610,17 @@ class TicketController extends BaseController
$data['policy_type'] = $this->ticketType; $data['policy_type'] = $this->ticketType;
$data['placeHolders'] = $this->placeHolders; $data['placeHolders'] = $this->placeHolders;
$data['ticket_data'] = $this->ticketMailTemplateModel->where('is_active', 1)->findAll(); $data['ticket_data'] = $this->ticketMailTemplateModel->where('is_active', 1)->findAll();
foreach ($data['ticket_data'] as $key => $ticket_data) {
$tooltip_array = $this->claimStatus->select('claim_status')->where('ticket_type',$data['ticket_data'][$key]['ticket_type'])->where('trigger_type',$data['ticket_data'][$key]['trigger_type'])->where('is_active',1)->first();
if (isset($tooltip_array) && $tooltip_array != null){
$data['ticket_data'][$key]['tool_tip'] = $tooltip_array['claim_status'];
}else{
$data['ticket_data'][$key]['tool_tip'] =$data['ticket_data'][$key]['template_name'];
}
}
// dd($data['ticket_data']);
$data['ticket_type'] = $this->ticketType; $data['ticket_type'] = $this->ticketType;
$data['trigger_type'] = $this->triggerType; $data['trigger_type'] = $this->triggerType;
return $this->loadLayout('ticket_mail_template', $data); return $this->loadLayout('ticket_mail_template', $data);
@ -621,6 +649,21 @@ class TicketController extends BaseController
} elseif ($action == 2) { } elseif ($action == 2) {
$table_id = (int)$this->request->getPost('id'); $table_id = (int)$this->request->getPost('id');
$data = $this->ticketMailTemplateModel->where('id', $table_id)->where('is_active', 1)->first(); $data = $this->ticketMailTemplateModel->where('id', $table_id)->where('is_active', 1)->first();
if ($data && isset($data['ticket_type']) && isset($data['trigger_type'])) {
$tooltip_array = $this->claimStatus->select('claim_status')
->where('ticket_type', $data['ticket_type'])
->where('trigger_type', $data['trigger_type'])
->where('is_active', 1)
->first();
$data['tool_tip'] = (isset($tooltip_array['claim_status']))
? $tooltip_array['claim_status']
: $data['template_name'];
} else {
// Handle case where $data is null or missing required fields
$data = $data ?: []; // Ensure $data is an array if null
$data['tool_tip'] = $data['template_name'];
}
if ($data) { if ($data) {
return $this->respond(['status' => true, 'data' => $data], 200); return $this->respond(['status' => true, 'data' => $data], 200);
} else { } else {

View File

@ -240,7 +240,7 @@ class EmployeeModel extends Model
return $results; return $results;
} }
public function getEmployeeByEmployeeCode($emp_code, $client_policy_id = null) public function getEmployeeByEmployeeCode($emp_code, $client_policy_id = null, $client_id = null)
{ {
$query = $this->select(" $query = $this->select("
employees.id AS emp_id, employees.id AS emp_id,
@ -257,6 +257,10 @@ class EmployeeModel extends Model
->where('employee_polices.is_active', 1) ->where('employee_polices.is_active', 1)
->where('employees.emp_code', $emp_code); ->where('employees.emp_code', $emp_code);
if(!empty($client_id)){
$query->where('employees.client_id', $client_id);
}
if(!empty($client_policy_id)){ if(!empty($client_policy_id)){
$query->where('employee_polices.client_policy_id', $client_policy_id); $query->where('employee_polices.client_policy_id', $client_policy_id);
} }

View File

@ -69,6 +69,10 @@ class TicketMasterModel extends Model
'cancel_remark', 'cancel_remark',
'awb_no_courier_name', 'awb_no_courier_name',
'non_id_reason',
'head_rejection_reason',
'pay_initiate_date',
]; ];

View File

@ -1314,8 +1314,8 @@ $(document).ready(function(){
$(document).on('change', 'input[type="checkbox"][name="co_share_type[]"]', function() { $(document).on('change', 'input[type="checkbox"][name="co_share_type[]"]', function() {
$('[name="base_premium[]"]').val(""); // $('[name="base_premium[]"]').val("");
$('[name="co_premium[]"]').val(""); // $('[name="co_premium[]"]').val("");
let isAnyChecked = $('input[type="checkbox"][name="co_share_type[]"]:checked').length > 1; let isAnyChecked = $('input[type="checkbox"][name="co_share_type[]"]:checked').length > 1;
@ -1764,7 +1764,7 @@ function checkAndDistributeTax(input)
function amountCalculation(input) { function amountCalculation(input) {
console.log('amountCalculation - ' + input); console.log('amountCalculation : ' + input);
let selectedOption = $('#policy_type_id').find('option:selected'); let selectedOption = $('#policy_type_id').find('option:selected');
let bap = selectedOption.data('bap'); let bap = selectedOption.data('bap');
@ -1816,10 +1816,8 @@ function amountCalculation(input) {
// Calculate GST percentage // Calculate GST percentage
let gst_per = igst; let gst_per = igst;
if (igst === 0) { if (igst === 0) {
console.log('called' + cgst + sgst);
gst_per = parseFloat(cgst) + parseFloat(sgst); gst_per = parseFloat(cgst) + parseFloat(sgst);
// gst_per = (cgst) + (sgst); // gst_per = (cgst) + (sgst);
console.log(gst_per);
} }
console.log('gst_per', gst_per); console.log('gst_per', gst_per);
@ -4267,4 +4265,34 @@ function getCdAmount(cd_ac_pk, increment){
} }
$('#bro_payable_by').on('change', function(){
var columnIndexes = [];
$('#insurerTable thead th').each(function(index) {
if(index == 0){
console.log("columnIndexes is ", index);
}else{
amountCalculation(index);
}
columnIndexes.push(index);
});
console.log("columnIndexes", columnIndexes);
});
$(document).on('change', '#insurerTable input, #insurerTable select, #insurerTable textarea', function() {
console.log('Changed in table:', $(this).attr('name'), 'Value:', $(this).val());
getColumnIndexes()
});
function getColumnIndexes() {
$('#insurerTable thead th').each(function(index) {
if (index === 0) {
console.log("columnIndexes is", index);
} else {
amountCalculation(index);
}
});
}
</script> </script>

View File

@ -319,7 +319,7 @@ table.dataTable tbody td {
<a class="dropdown-item btnEdit" data-id="<?= $row['id'];?>" onclick="getPolicyTransactionDataForEdit('<?= htmlspecialchars($row['id'], ENT_QUOTES) ?>')"> <a class="dropdown-item btnEdit" data-id="<?= $row['id'];?>" onclick="getPolicyTransactionDataForEdit('<?= htmlspecialchars($row['id'], ENT_QUOTES) ?>')">
<i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit <i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit
</a> </a>
<a class="dropdown-item" data-id="<?= $row['id'];?>" onclick="removePolicyTransaction(this, '<?= htmlspecialchars($row['id'], ENT_QUOTES) ?>')"> <a class="dropdown-item delete" data-id="<?= $row['id'];?>" onclick="removePolicyTransaction(this, '<?= htmlspecialchars($row['id'], ENT_QUOTES) ?>')">
<i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete <i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete
</a> </a>
</div> </div>
@ -370,25 +370,25 @@ table.dataTable tbody td {
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
const table = document.getElementById("tickets-table"); const table = document.getElementById("tickets-table");
// Create custom dropdown
function createCustomDropdown(row) { function createCustomDropdown(row) {
// Get the original dropdown items
const originalDropdown = row.querySelector('.dropdown-menu'); const originalDropdown = row.querySelector('.dropdown-menu');
if (!originalDropdown) return null; if (!originalDropdown) return null;
// Create new dropdown with proper background and spacing
const customDropdown = document.createElement('div'); const customDropdown = document.createElement('div');
customDropdown.className = 'custom-dropdown-menu'; customDropdown.className = 'custom-dropdown-menu';
// Copy inner content while maintaining icon alignment const items = originalDropdown.querySelectorAll('.dropdown-item');
customDropdown.innerHTML = originalDropdown.innerHTML; items.forEach(item => {
const newItem = item.cloneNode(true);
newItem.removeAttribute('onclick');
customDropdown.appendChild(newItem);
});
return customDropdown; return customDropdown;
} }
let activeDropdown = null; let activeDropdown = null;
// Add click event listener to rows
table.querySelectorAll("tbody tr").forEach(row => { table.querySelectorAll("tbody tr").forEach(row => {
const customDropdown = createCustomDropdown(row); const customDropdown = createCustomDropdown(row);
if (!customDropdown) return; if (!customDropdown) return;
@ -401,51 +401,56 @@ document.addEventListener("DOMContentLoaded", function () {
return; return;
} }
// Hide any active dropdown // Close any existing dropdown
if (activeDropdown) { if (activeDropdown && activeDropdown !== customDropdown) {
activeDropdown.style.display = 'none'; activeDropdown.style.display = 'none';
} }
// Get click position
const rect = event.target.getBoundingClientRect(); const rect = event.target.getBoundingClientRect();
// Position the dropdown with some offset
customDropdown.style.display = 'block'; customDropdown.style.display = 'block';
customDropdown.style.position = 'fixed'; customDropdown.style.position = 'fixed';
customDropdown.style.left = `${rect.left}px`; customDropdown.style.left = `${rect.left}px`;
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap customDropdown.style.top = `${rect.bottom + 5}px`;
// Set as active dropdown
activeDropdown = customDropdown; activeDropdown = customDropdown;
event.stopPropagation(); event.stopPropagation();
}); });
// Preserve click handlers and add auto-close // Handle clicks on dropdown items
customDropdown.querySelectorAll('.dropdown-item').forEach(item => { customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
item.addEventListener('click', function(e) { item.addEventListener('click', function(e) {
const onclickAttr = this.getAttribute('onclick'); e.preventDefault();
if (onclickAttr) { e.stopPropagation();
eval(onclickAttr);
}
const id = this.getAttribute('data-id');
// Handle edit button
if (this.classList.contains('btnEdit') && id) {
getPolicyTransactionDataForEdit(id);
}
// Handle delete button
else if (this.classList.contains('delete') && id) {
removePolicyTransaction(this, id);
}
// Handle other links
else {
const href = this.getAttribute('href'); const href = this.getAttribute('href');
if (href && href !== '#') { if (href && href !== '#' && href !== 'javascript: void(0);') {
window.location.href = href; window.location.href = href;
} }
}
// Close the dropdown after handling the click // Close dropdown
if (activeDropdown) { if (activeDropdown) {
activeDropdown.style.display = 'none'; activeDropdown.style.display = 'none';
activeDropdown = null; activeDropdown = null;
} }
}, { once: true });
e.stopPropagation();
});
}); });
}); });
// Close dropdown when clicking outside // Close dropdown on outside click
document.addEventListener("click", function() { document.addEventListener("click", function() {
if (activeDropdown) { if (activeDropdown) {
activeDropdown.style.display = 'none'; activeDropdown.style.display = 'none';
@ -1486,7 +1491,7 @@ function onlyNumbers(event)
<script> <script>
$(document).ready(function() { $(document).ready(function() {
getURLParams() // getURLParams()
$('#client_id_for_search').select2(); $('#client_id_for_search').select2();
$('#insurer_id_for_search').select2(); $('#insurer_id_for_search').select2();
$('#policy_type_for_search').select2(); $('#policy_type_for_search').select2();
@ -1531,50 +1536,50 @@ function objectToQueryString(obj)
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&'); return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
} }
function getURLParams() // function getURLParams()
{ // {
const url = new URL(window.location.href); // const url = new URL(window.location.href);
const params = new URLSearchParams(url.search); // const params = new URLSearchParams(url.search);
const startDate = params.get('start_date') || 0; // Default to 0 if not found // const startDate = params.get('start_date') || 0; // Default to 0 if not found
const endDate = params.get('end_date') || 0; // Default to 0 if not found // const endDate = params.get('end_date') || 0; // Default to 0 if not found
const client_id = params.get('client_id') || 0; // Default to 0 if not found // const client_id = params.get('client_id') || 0; // Default to 0 if not found
const insurer_id = params.get('insurer_id') || 0; // Default to 0 if not found // const insurer_id = params.get('insurer_id') || 0; // Default to 0 if not found
const policy_type_id = params.get('policy_type_id') || 0; // Default to 0 if not found // const policy_type_id = params.get('policy_type_id') || 0; // Default to 0 if not found
const date_type = params.get('date_type') || 0; // Default to 0 if not found // const date_type = params.get('date_type') || 0; // Default to 0 if not found
const issuer = params.get('issuer') || 0; // Default to 0 if not found // const issuer = params.get('issuer') || 0; // Default to 0 if not found
const status = params.get('status') || 0; // Default to 0 if not found // const status = params.get('status') || 0; // Default to 0 if not found
hideDateField(date_type) // hideDateField(date_type)
// console.log('startDate', startDate) // // console.log('startDate', startDate)
// console.log('endDate', endDate) // // console.log('endDate', endDate)
// console.log('client_id', client_id) // // console.log('client_id', client_id)
// console.log('insurer_id', insurer_id) // // console.log('insurer_id', insurer_id)
// console.log('policy_type_id', policy_type_id) // // console.log('policy_type_id', policy_type_id)
// console.log('date_type', date_type) // // console.log('date_type', date_type)
// console.log('issuer', issuer) // // console.log('issuer', issuer)
// console.log('status', status) // // console.log('status', status)
// Log the values or use them as needed // // Log the values or use them as needed
// console.log('Start Date:', startDate); // // console.log('Start Date:', startDate);
// console.log('End Date:', endDate); // // console.log('End Date:', endDate);
if (startDate != 0 && endDate != 0) { // if (startDate != 0 && endDate != 0) {
setTimeout(function(){ // setTimeout(function(){
$('#start_date').val(startDate) // $('#start_date').val(startDate)
$('#end_date').val(endDate) // $('#end_date').val(endDate)
$('#client_id_for_search').val(client_id).change() // $('#client_id_for_search').val(client_id).change()
$('#insurer_id_for_search').val(insurer_id).change() // $('#insurer_id_for_search').val(insurer_id).change()
$('#policy_type_for_search').val(policy_type_id).change() // $('#policy_type_for_search').val(policy_type_id).change()
$('#date_type').val(date_type) // $('#date_type').val(date_type)
$('#issuer_for_search').val(issuer) // $('#issuer_for_search').val(issuer)
$('#policy_status_for_search').val(status) // $('#policy_status_for_search').val(status)
},1000) // },1000)
} // }
} // }
$(function() { $(function() {

View File

@ -24,28 +24,28 @@
<li class="nav-item"> <li class="nav-item">
<a href="#general-tab" data-toggle="tab" class="nav-link px-2 py-1 active" id="general_tab" <a href="#general-tab" data-toggle="tab" class="nav-link px-2 py-1 active" id="general_tab"
aria-expanded="true"> aria-expanded="true">
<i class="mdi mdi-contacts mr-1"></i> <i class="mdi mdi-ticket-account"></i>
<span class="d-none d-sm-inline-block">General</span> <span class="d-none d-sm-inline-block">General</span>
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a href="#reply-tab" data-toggle="tab" class="nav-link px-2 py-1" id="reply_tab" <a href="#reply-tab" data-toggle="tab" class="nav-link px-2 py-1" id="reply_tab"
aria-expanded="false"> aria-expanded="false">
<i class="fa fa-file mr-1"></i> <i class="mdi mdi-message-processing"></i>
<span class="d-none d-sm-inline-block">Reply</span> <span class="d-none d-sm-inline-block">Reply</span>
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a href="#note-tab" data-toggle="tab" class="nav-link px-2 py-1" id="note_tab" <a href="#note-tab" data-toggle="tab" class="nav-link px-2 py-1" id="note_tab"
aria-expanded="false"> aria-expanded="false">
<i class="mdi mdi-account-switch mr-1"></i> <i class="mdi mdi-note-text"></i>
<span class="d-none d-sm-inline-block">Note</span> <span class="d-none d-sm-inline-block">Notes</span>
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a href="#history-tab" data-toggle="tab" class="nav-link px-2 py-1" id="history_tab" <a href="#history-tab" data-toggle="tab" class="nav-link px-2 py-1" id="history_tab"
aria-expanded="false"> aria-expanded="false">
<i class="mdi mdi-source-branch mr-1"></i> <i class="mdi mdi-history"></i>
<span class="d-none d-sm-inline-block">History</span> <span class="d-none d-sm-inline-block">History</span>
</a> </a>
</li> </li>
@ -235,9 +235,44 @@ function showConfirmationModal(event) {
console.log($('#ticket_form_data')[0]) console.log($('#ticket_form_data')[0])
submitClaimForm(event, $('#ticket_form_data')[0]); // Fixed selector submitClaimForm(event, $('#ticket_form_data')[0]); // Fixed selector
} else if (result.isDenied) { } else if (result.isDenied) {
// Show second Swal for rejection reason
Swal.fire({
title: "Rejection Reason",
text: "Please provide a reason for rejection",
input: "textarea",
inputPlaceholder: "Enter your reason here...",
icon: "info",
showCancelButton: true,
confirmButtonColor: "#3085d6",
cancelButtonColor: "#6c757d",
confirmButtonText: "Submit",
cancelButtonText: "Back"
}).then((reasonResult) => {
if (reasonResult.isConfirmed) {
// Check if reason is not empty
if (reasonResult.value && reasonResult.value.trim() !== "") {
$('#is_head_approved').val(2); $('#is_head_approved').val(2);
console.log($('#ticket_form_data')[0]) $('#rejection_reason').val(reasonResult.value.trim());
submitClaimForm(event, $('#ticket_form_data')[0]); // Fixed selector console.log($('#ticket_form_data')[0]);
$('#head_rejection_reason').val(reasonResult.value.trim());
submitClaimForm(event, $('#ticket_form_data')[0]);
} else {
// Alert if reason is empty
Swal.fire({
title: "Error",
text: "Rejection reason cannot be empty",
icon: "error",
confirmButtonColor: "#3085d6"
}).then(() => {
// Go back to the rejection reason dialog
showConfirmationModal(event);
});
}
} else {
// If canceled, go back to first Swal
showConfirmationModal(event);
}
});
} else { } else {
$('#is_head_approved').val(0); $('#is_head_approved').val(0);
return false; return false;

View File

@ -21,80 +21,16 @@
<input type="hidden" id="ticket_master_id" name="ticket_master_id" value="<?= isset($ticket_data['id']) ? $ticket_data['id'] : '' ?>"> <input type="hidden" id="ticket_master_id" name="ticket_master_id" value="<?= isset($ticket_data['id']) ? $ticket_data['id'] : '' ?>">
<input type="hidden" id="is_head_approved" name="is_head_approved" value="<?= isset($ticket_data['is_head_approved']) ? $ticket_data['is_head_approved'] : '' ?>"> <input type="hidden" id="is_head_approved" name="is_head_approved" value="<?= isset($ticket_data['is_head_approved']) ? $ticket_data['is_head_approved'] : '' ?>">
<input type="hidden" id="extra_fields_array_for_validate" name="extra_fields_array_for_validate" value='<?= isset($extra_fields_array_for_validate) && !empty($extra_fields_array_for_validate) ? json_encode($extra_fields_array_for_validate) : "[]" ?>'> <input type="hidden" id="extra_fields_array_for_validate" name="extra_fields_array_for_validate" value='<?= isset($extra_fields_array_for_validate) && !empty($extra_fields_array_for_validate) ? json_encode($extra_fields_array_for_validate) : "[]" ?>'>
<input type="hidden" id="head_rejection_reason" name="head_rejection_reason">
<div class="form-group"> <div class="form-group">
<h5>Employee Details</h5>
<hr>
<!-- first_data_points -->
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-3">
<label for="claim_status">Status<span class="text-danger"></span></label>
<select class="form-control" id="claim_status_id" name="claim_status_id">
<!-- <option value="0">Select status</option> -->
<?php
if (isset($claim_status) && count($claim_status)) {
foreach ($claim_status as $key => $value) {
$selected = (isset($ticket_data) && $ticket_data['claim_status_id'] == $value['id']) ? 'selected' : '';
echo "<option value=" . $value['id'] . " $selected>" . $value['claim_status'] . "</option>";
}
}
?>
</select>
</div>
<div class="form-group col-md-3">
<label for="priority">Priority<span class="text-danger"></span></label>
<select class="form-control" id="priority" name="priority">
<!-- <option value="0">Select Priority</option> -->
<?php
if (isset($priorityType) && count($priorityType)) {
foreach ($priorityType as $key => $value) {
$selected = (isset($ticket_data) && $ticket_data['priority'] == $key) ? 'selected' : '';
echo "<option value=" . $key . " $selected>" . $value . "</option>";
}
}
?>
</select>
</div>
<div class="form-group col-md-3">
<label for="acm_id">Account Manager<span class="text-danger"></span></label>
<select class="form-control" id="acm_id" name="acm_id">
<!-- <option value="0">Select Account Manager</option> -->
<?php
if (isset($acms) && count($acms)) {
foreach ($acms as $key => $value) {
$selected = (isset($ticket_data) && $ticket_data['acm_id'] == $value['id']) ? 'selected' : '';
echo "<option value=" . $value['id'] . " $selected >" . $value['first_name'] . "</option>";
}
}
?>
</select>
</div>
<div class="form-group col-md-3">
<label for="policy_no">Policy No<span class="text-danger"></span></label>
<input type="text" class="form-control" id="policy_no"
value="<?= isset($ticket_data['policy_no']) ? $ticket_data['policy_no'] : '' ?>"
name="policy_no" placeholder="Policy Number" >
</div>
<div class="form-group col-md-3">
<label for="insurer_id">Insurer<span class="text-danger"></span></label>
<input type=hidden id="insurer_id" name="insurer_id" value="<?= isset($ticket_data['insurer_id']) ? $ticket_data['insurer_id'] : '' ?>">
<input type=text class="form-control" id="insurer_name" placeholder="Insurer" value="<?= isset($ticket_data['insurer_name']) ? $ticket_data['insurer_name'] : '' ?>" readonly>
</div>
<div class="form-group col-md-3">
<label for="tpa_id">TPA<span class="text-danger"></span></label>
<input type=hidden id="tpa_id" name="tpa_id" value="<?= isset($ticket_data['tpa_id']) ? $ticket_data['tpa_id'] : '' ?>">
<input type=text class="form-control" id="tpa_name" placeholder="TPA" value="<?= isset($ticket_data['tpa_name']) ? $ticket_data['tpa_name'] : '' ?>" readonly>
</div>
<div class="form-group col-md-3">
<label for="client_name">Corporate Name<span class="text-danger"></span></label>
<input type="hidden" id="client_id" name="client_id" value="<?= isset($ticket_data['client_id']) ? $ticket_data['client_id'] : '' ?>">
<input type="text" class="form-control" id="client_name" placeholder="Client" value="<?= isset($ticket_data['client_name']) ? $ticket_data['client_name'] : '' ?>" readonly>
</div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="emp_code">Employee ID &nbsp; <i class="fa fa-search text-danger" <label for="emp_code">Employee ID &nbsp; <i class="fa fa-search text-danger"
aria-hidden="true" onclick="openFetchEmpDataodal(this)"></i> <span aria-hidden="true" onclick="openFetchEmpDataodal(this)"></i> <span
@ -104,13 +40,6 @@
name="emp_code"> name="emp_code">
</div> </div>
<div class="form-group col-md-3">
<label for="tpa_id">TPA ID<span class="text-danger"></span></label>
<input type="text" class="form-control" id="tpa_no" placeholder="Enter TPA ID"
value="<?= isset($ticket_data['tpa_no']) ? $ticket_data['tpa_no'] : '' ?>"
name="tpa_no">
</div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="emp_name">Employee Name<span class="text-danger"></span></label> <label for="emp_name">Employee Name<span class="text-danger"></span></label>
<input type=hidden id="emp_id" name="emp_id" value="<?= isset($ticket_data['emp_id']) ? $ticket_data['emp_id'] : '' ?>"> <input type=hidden id="emp_id" name="emp_id" value="<?= isset($ticket_data['emp_id']) ? $ticket_data['emp_id'] : '' ?>">
@ -140,6 +69,20 @@
</select> </select>
</div> </div>
<div class="form-group col-md-3">
<label for="policy_no">Policy No<span class="text-danger"></span></label>
<input type="text" class="form-control" id="policy_no"
value="<?= isset($ticket_data['policy_no']) ? $ticket_data['policy_no'] : '' ?>"
name="policy_no" placeholder="Policy Number" >
</div>
<div class="form-group col-md-3">
<label for="tpa_id">TPA ID<span class="text-danger"></span></label>
<input type="text" class="form-control" id="tpa_no" placeholder="Enter TPA ID"
value="<?= isset($ticket_data['tpa_no']) ? $ticket_data['tpa_no'] : '' ?>"
name="tpa_no">
</div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="emp_mobile">Employee Mobile No<span class="text-danger"></span></label> <label for="emp_mobile">Employee Mobile No<span class="text-danger"></span></label>
<input type="text" class="form-control" id="emp_mobile" placeholder="Enter EMP Mobile" <input type="text" class="form-control" id="emp_mobile" placeholder="Enter EMP Mobile"
@ -154,6 +97,78 @@
name="emp_mail"> name="emp_mail">
</div> </div>
<div class="form-group col-md-3">
<label for="client_name">Corporate Name<span class="text-danger"></span></label>
<input type="hidden" id="client_id" name="client_id" value="<?= isset($ticket_data['client_id']) ? $ticket_data['client_id'] : '' ?>">
<input type="text" class="form-control" id="client_name" placeholder="Client" value="<?= isset($ticket_data['client_name']) ? $ticket_data['client_name'] : '' ?>" readonly>
</div>
<div class="form-group col-md-3">
<label for="insurer_id">Insurer<span class="text-danger"></span></label>
<input type=hidden id="insurer_id" name="insurer_id" value="<?= isset($ticket_data['insurer_id']) ? $ticket_data['insurer_id'] : '' ?>">
<input type=text class="form-control" id="insurer_name" placeholder="Insurer" value="<?= isset($ticket_data['insurer_name']) ? $ticket_data['insurer_name'] : '' ?>" readonly>
</div>
<div class="form-group col-md-3">
<label for="tpa_id">TPA<span class="text-danger"></span></label>
<input type=hidden id="tpa_id" name="tpa_id" value="<?= isset($ticket_data['tpa_id']) ? $ticket_data['tpa_id'] : '' ?>">
<input type=text class="form-control" id="tpa_name" placeholder="TPA" value="<?= isset($ticket_data['tpa_name']) ? $ticket_data['tpa_name'] : '' ?>" readonly>
</div>
<div class="form-group col-md-3">
<label for="acm_id">Account Manager<span class="text-danger"></span></label>
<select class="form-control" id="acm_id" name="acm_id">
<!-- <option value="0">Select Account Manager</option> -->
<?php
if (isset($acms) && count($acms)) {
foreach ($acms as $key => $value) {
$selected = (isset($ticket_data) && $ticket_data['acm_id'] == $value['id']) ? 'selected' : '';
echo "<option value=" . $value['id'] . " $selected >" . $value['first_name'] . "</option>";
}
}
?>
</select>
</div>
</div>
<!-- end first_data_points -->
<h5>Claim Details</h5>
<hr>
<!-- second_data_points -->
<div class="form-row">
<div class="form-group col-md-3">
<label for="claim_status">Status<span class="text-danger"></span></label>
<select class="form-control" id="claim_status_id" name="claim_status_id">
<!-- <option value="0">Select status</option> -->
<?php
if (isset($claim_status) && count($claim_status)) {
foreach ($claim_status as $key => $value) {
$selected = (isset($ticket_data) && $ticket_data['claim_status_id'] == $value['id']) ? 'selected' : '';
echo "<option value=" . $value['id'] . " $selected>" . $value['claim_status'] . "</option>";
}
}
?>
</select>
</div>
<div class="form-group col-md-3">
<label for="priority">Priority<span class="text-danger"></span></label>
<select class="form-control" id="priority" name="priority">
<!-- <option value="0">Select Priority</option> -->
<?php
if (isset($priorityType) && count($priorityType)) {
foreach ($priorityType as $key => $value) {
$selected = (isset($ticket_data) && $ticket_data['priority'] == $key) ? 'selected' : '';
echo "<option value=" . $key . " $selected>" . $value . "</option>";
}
}
?>
</select>
</div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="mode_of_intimation"> Mode of Intimation <span <label for="mode_of_intimation"> Mode of Intimation <span
class="text-danger"></span></label> class="text-danger"></span></label>
@ -215,12 +230,21 @@
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="pod_no">POD No<span class="text-danger"></span></label> <label id="pod_no_label_1" for="pod_no">POD No<span id="pod_no_label_1_span" class="text-danger"></span></label>
<input type="text" class="form-control" id="pod_no" placeholder="Enter POD NO" <input type="text" class="form-control" id="pod_no" placeholder="Enter POD NO"
value="<?= isset($ticket_data['pod_no']) ? $ticket_data['pod_no'] : '' ?>" value="<?= isset($ticket_data['pod_no']) ? $ticket_data['pod_no'] : '' ?>"
name="pod_no"> name="pod_no">
</div> </div>
</div>
<!-- end second_data_points -->
<h5>Additional Details</h5>
<hr>
<!-- third_data_points -->
<div class="form-row">
<div class="form-group col-md-3 up_cnu" style="display: none;"> <div class="form-group col-md-3 up_cnu" style="display: none;">
<label for="claim_number">Claim Number<span class="text-danger"></span></label> <label for="claim_number">Claim Number<span class="text-danger"></span></label>
<input type="text" class="form-control" id="claim_number" placeholder="Enter Claim NO" <input type="text" class="form-control" id="claim_number" placeholder="Enter Claim NO"
@ -294,16 +318,21 @@
value="<?= isset($ticket_data['settle_letter']) ? $ticket_data['settle_letter'] : '' ?>" name="settle_letter"> value="<?= isset($ticket_data['settle_letter']) ? $ticket_data['settle_letter'] : '' ?>" name="settle_letter">
</div> </div>
<div class="form-group col-md-3 returned" style="display: none;"> <div class="form-group col-md-3 payment" style="display: none;">
<label for="return_remark">Return Remark</label> <label for="pay_initiate_date">Payment Initiate Date</label>
<textarea class="form-control" id="return_remark" placeholder="Enter Return Remark" name="return_remark"><?= isset($ticket_data['return_remark']) ? $ticket_data['return_remark'] : '' ?></textarea> <input type="text" class="form-control datepicker" id="pay_initiate_date" placeholder="Select Payment Initiate Date"
value="<?= isset($ticket_data['pay_initiate_date']) ? $ticket_data['pay_initiate_date'] : '' ?>" name="pay_initiate_date">
</div> </div>
<div class="form-group col-md-3 canceled" style="display: none;"> <div class="form-group col-md-3 canceled" style="display: none;">
<label for="cancel_remark">Cancel Remark</label> <label for="cancel_remark">Cancel Remark</label>
<textarea class="form-control" id="cancel_remark" placeholder="Enter Cancel Remark" name="cancel_remark"><?= isset($ticket_data['cancel_remark']) ? $ticket_data['cancel_remark'] : '' ?></textarea> <textarea class="form-control" id="cancel_remark" rows="1" placeholder="Enter Cancel Remark" name="cancel_remark"><?= isset($ticket_data['cancel_remark']) ? $ticket_data['cancel_remark'] : '' ?></textarea>
</div> </div>
<div class="form-group col-md-3 returned" style="display: none;">
<label for="return_remark">Return Remark</label>
<textarea class="form-control" id="return_remark" rows="1" placeholder="Enter Return Remark" name="return_remark"><?= isset($ticket_data['return_remark']) ? $ticket_data['return_remark'] : '' ?></textarea>
</div>
<div class="form-group col-md-6 returned" style="display: none;"> <div class="form-group col-md-6 returned" style="display: none;">
<label for="awb_no_courier_name">AWB No with Courier Name</label> <label for="awb_no_courier_name">AWB No with Courier Name</label>
@ -311,7 +340,24 @@
value="<?= isset($ticket_data['awb_no_courier_name']) ? $ticket_data['awb_no_courier_name'] : '' ?>" name="awb_no_courier_name"> value="<?= isset($ticket_data['awb_no_courier_name']) ? $ticket_data['awb_no_courier_name'] : '' ?>" name="awb_no_courier_name">
</div> </div>
<div class="form-group col-md-3 non_id" style="display: none;">
<label for="non_id_reason">Non ID Reason</label>
<select class="form-control" id="non_id_reason" name="non_id_reason">
<option value="">Select Reason</option>
<?php
if (isset($nonIDReason) && count($nonIDReason)) {
foreach ($nonIDReason as $key => $value) {
$selected = (isset($ticket_data) && $ticket_data['non_id_reason'] == $key) ? 'selected' : '';
echo "<option value='" . $key . "' $selected>" . $value . "</option>";
}
}
?>
</select>
</div> </div>
</div>
<!-- end third_data_points -->
</div> </div>
<div class="form-group col-md-12 text-right m-b-0" style="margin-top: 29px;"> <div class="form-group col-md-12 text-right m-b-0" style="margin-top: 29px;">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Submit</button> <button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
@ -337,12 +383,9 @@
// } // }
// }); // });
</script> </script>
<script> <script>
let GlobelExtraFields = []; let GlobelExtraFields = [];
$(document).ready(function() { $(document).ready(function() {
@ -357,12 +400,34 @@ $(document).ready(function() {
allowInput: false allowInput: false
}); });
flatpickr("#raised_date", { dateFormat: "d/m/Y", allowInput: false }); flatpickr("#raised_date", {
flatpickr("#registration_date", { dateFormat: "d/m/Y", allowInput: false }); dateFormat: "d/m/Y",
flatpickr("#query_received_date", { dateFormat: "d/m/Y", allowInput: false }); allowInput: false
flatpickr("#denial_date", { dateFormat: "d/m/Y", allowInput: false }); });
flatpickr("#approved_date", { dateFormat: "d/m/Y", allowInput: false }); flatpickr("#registration_date", {
flatpickr("#settled_date", { dateFormat: "d/m/Y", allowInput: false }); dateFormat: "d/m/Y",
allowInput: false
});
flatpickr("#query_received_date", {
dateFormat: "d/m/Y",
allowInput: false
});
flatpickr("#denial_date", {
dateFormat: "d/m/Y",
allowInput: false
});
flatpickr("#approved_date", {
dateFormat: "d/m/Y",
allowInput: false
});
flatpickr("#settled_date", {
dateFormat: "d/m/Y",
allowInput: false
});
flatpickr("#pay_initiate_date", {
dateFormat: "d/m/Y",
allowInput: false
});
// updateClaimStatusDisplay("<?= isset($ticket_data['claim_status_id']) ? $ticket_data['claim_status_id'] : 0 ?>") // updateClaimStatusDisplay("<?= isset($ticket_data['claim_status_id']) ? $ticket_data['claim_status_id'] : 0 ?>")
var extraFields = <?= json_encode(isset($extra_fields) ? $extra_fields : []); ?>; var extraFields = <?= json_encode(isset($extra_fields) ? $extra_fields : []); ?>;
@ -408,7 +473,7 @@ $(document).ready(function() {
function updateClaimStatusDisplay(value) { function updateClaimStatusDisplay(value) {
// Hide all sections and remove required attribute from their inputs and textareas // Hide all sections and remove required attribute from their inputs and textareas
let sections = $('.cda_ir, .settled, .approved, .rejected, .up_qdr, .up_cnu, .canceled, .returned'); let sections = $('.cda_ir, .settled, .approved, .rejected, .up_qdr, .up_cnu, .canceled, .returned, .payment, .non_id');
sections.hide().find('input, textarea').removeAttr('required'); sections.hide().find('input, textarea').removeAttr('required');
// Determine which section to show // Determine which section to show
@ -429,11 +494,22 @@ function updateClaimStatusDisplay(value) {
showClass = '.canceled'; showClass = '.canceled';
} else if (value == 14) { // RETURNED } else if (value == 14) { // RETURNED
showClass = '.returned'; showClass = '.returned';
} else if (value == 1) { // NON ID
showClass = '.non_id';
} else if (value == 10) { // PAYMENT INITIATED
showClass = '.payment';
} }
// Show the relevant section and enable required attributes // Show the relevant section and enable required attributes
if (showClass) { if (showClass) {
$(showClass).show().find('input, textarea').attr('required', true); // $(showClass).show().find('input, textarea').attr('required', true);
$(showClass).show().find('input, textarea').attr('required', true).each(function() {
var $label = $("label[for='" + $(this).attr('id') + "']");
if ($label.length && !$label.find('.text-danger').length) {
$label.append(' <span class="text-danger">*</span>');
}
});
} }
} }
@ -455,7 +531,7 @@ function claimStatusFieldChanges(fields) {
var $label = $parentDiv.find("label[for='" + fieldId + "']"); var $label = $parentDiv.find("label[for='" + fieldId + "']");
if ($label.length && !$label.find(".text-danger").length) { if ($label.length && !$label.find(".text-danger").length) {
$label.append(' <span class="text-danger">*</span>'); // $label.append(' <span class="text-danger">*</span>');
} }
} }
}); });
@ -477,7 +553,7 @@ function claimStatusFieldRemoveREquired(fields, remove_or_add, thirdClass) {
var $label = $parentDiv.find("label[for='" + fieldId + "']"); var $label = $parentDiv.find("label[for='" + fieldId + "']");
// if(remove_or_add == false){ // if(remove_or_add == false){
// $parentDiv.find("label[for='" + fieldId + "'] .text-danger").remove(); // $parentDiv.find("label[for='" + fieldId + "'] .text-danger").remove();
// console.log('one', remove_or_add); // // console.log('one', remove_or_add);
// }else{ // }else{
// if ($label.length && !$label.find(".text-danger").length) { // if ($label.length && !$label.find(".text-danger").length) {
// $label.append(' <span class="text-danger">*</span>'); // $label.append(' <span class="text-danger">*</span>');
@ -509,18 +585,97 @@ $(document).on("input", function (event) {
if ($parentDiv.length) { if ($parentDiv.length) {
let thirdClass = $parentDiv.attr("class").split(" ")[2] || ""; let thirdClass = $parentDiv.attr("class").split(" ")[2] || "";
console.log('thirdClass', thirdClass); console.log('thirdClass', thirdClass);
addRequiredFieldSymbolByClass(thirdClass);
// addRequiredFieldSymbol(targetId);
if (thirdClass) { if (thirdClass) {
// console.log("fields",fields);
claimStatusFieldRemoveREquired(fields, false, thirdClass); claimStatusFieldRemoveREquired(fields, false, thirdClass);
let $label = $(thirdClass).find("label"); $(thirdClass).each(function() {
if ($label.length && !$label.find(".text-danger").length) { let $label = $(this).find("label");
$label.append(' <span class="text-danger">*</span>'); $label.each(function() {
if (!$(this).find(".text-danger").length) {
$(this).append(' <span class="text-danger">*</span>');
} }
});
});
} else { } else {
claimStatusFieldRemoveREquired($field, false, ''); claimStatusFieldRemoveREquired($field, false, '');
console.log("In Else Condition");
} }
} }
} }
}); });
function addRequiredFieldSymbol(field_name) {
// Find the field with the given name
var $field = $(`[name="${field_name}"]`);
if ($field.length) {
// Find the parent div of this field
var $parentDiv = $field.closest('div');
if ($parentDiv.length) {
// Get the classes as an array
var classes = $parentDiv.attr('class') ? $parentDiv.attr('class').split(/\s+/) : [];
if (classes.length > 0) {
// Get the last class in the array
var lastClass = classes[classes.length - 1];
// Find all divs with this last class
var $allDivsWithClass = $(`.${lastClass}`);
// Add asterisk to all labels within these divs
$allDivsWithClass.each(function() {
var $label = $(this).find('label');
if ($label.length && !$label.find('.text-danger').length) {
$label.append(' <span class="text-danger">*</span>');
}
});
console.log(`Added required symbol to ${$allDivsWithClass.length} labels with class "${lastClass}"`);
} else {
console.warn(`Parent div for field "${field_name}" has no classes`);
}
} else {
console.warn(`No parent div found for field name="${field_name}"`);
}
} else {
console.warn(`No field found with name="${field_name}"`);
}
}
function addRequiredFieldSymbolByClass(className) {
// Find all divs with the specified class
var $divsWithClass = $(`.${className}`);
if ($divsWithClass.length) {
// Add asterisk to all labels within these divs
$divsWithClass.each(function() {
var $label = $(this).find('label');
if ($label.length && !$label.find('.text-danger').length) {
$label.append(' <span class="text-danger">*</span>');
}
});
console.log(`Added required symbol to ${$divsWithClass.length} labels with class "${className}"`);
} else {
console.warn(`No divs found with class="${className}"`);
}
}
$('#mode_of_intimation').change(function(){
console.log("function called");
var mode_of_intimation = $('#mode_of_intimation').val();
console.log('mode of ',mode_of_intimation);
if (mode_of_intimation == 2){
$('#pod_no').attr('required', 'required');
$('#pod_no_label_1_span').text("*");
}else{
$('#pod_no').removeAttr('required', false);
$('#pod_no_label_1_span').text("");
}
})
</script> </script>

View File

@ -25,92 +25,18 @@
<?php } ?> <?php } ?>
<form role="form" class="parsley-examples" method="post" id="ticket_form_data" onsubmit="submitClaimForm(event, this)" <form role="form" class="parsley-examples" method="post" id="ticket_form_data" onsubmit="submitClaimForm(event, this)"
enctype="multipart/form-data"> enctype="multipart/form-data">
<div class="form-group">
<div class="form-row">
<input type="hidden" id="ticket_master_id" name="ticket_master_id" value="<?= isset($ticket_data['id']) ? $ticket_data['id'] : '' ?>"> <input type="hidden" id="ticket_master_id" name="ticket_master_id" value="<?= isset($ticket_data['id']) ? $ticket_data['id'] : '' ?>">
<input type="hidden" id="is_head_approved" name="is_head_approved" value="<?= isset($ticket_data['is_head_approved']) ? $ticket_data['is_head_approved'] : '' ?>"> <input type="hidden" id="is_head_approved" name="is_head_approved" value="<?= isset($ticket_data['is_head_approved']) ? $ticket_data['is_head_approved'] : '' ?>">
<input type="hidden" id="extra_fields_array_for_validate" name="extra_fields_array_for_validate" value='<?= isset($extra_fields_array_for_validate) && !empty($extra_fields_array_for_validate) ? json_encode($extra_fields_array_for_validate) : "[]" ?>'> <input type="hidden" id="extra_fields_array_for_validate" name="extra_fields_array_for_validate" value='<?= isset($extra_fields_array_for_validate) && !empty($extra_fields_array_for_validate) ? json_encode($extra_fields_array_for_validate) : "[]" ?>'>
<div class="form-group col-md-3"> <div class="form-group">
<label for="claim_status">Status<span class="text-danger"></span></label>
<select class="form-control" id="claim_status_id" name="claim_status_id">
<!-- <option value="0">Select status</option> -->
<?php
if (isset($claim_status) && count($claim_status)) {
foreach ($claim_status as $key => $value) {
$selected = (isset($ticket_data) && $ticket_data['claim_status_id'] == $value['id']) ? 'selected' : '';
echo "<option value=" . $value['id'] . " $selected>" . $value['claim_status'] . "</option>";
}
}
?>
</select>
</div>
<div class="form-group col-md-3"> <h5>Employee Details</h5>
<label for="acm_id">Account Manager<span class="text-danger"></span></label> <hr>
<select class="form-control" id="acm_id" name="acm_id">
<!-- <option value="0">Select Account Manager</option> -->
<?php
if (isset($acms) && count($acms)) {
foreach ($acms as $key => $value) {
$selected = (isset($ticket_data) && $ticket_data['acm_id'] == $value['id']) ? 'selected' : '';
echo "<option value=" . $value['id'] . " $selected>" . $value['first_name'] . "</option>";
}
}
?>
</select>
</div>
<div class="form-group col-md-3"> <!-- first_data_points -->
<label for="client_name">Corporate Name<span class="text-danger"></span></label> <div class="form-row">
<input type="hidden" id="client_id" name="client_id" value="<?= isset($ticket_data['client_id']) ? $ticket_data['client_id'] : '' ?>">
<input type="text" class="form-control" id="client_name" placeholder="Client" value="<?= isset($ticket_data['client_name']) ? $ticket_data['client_name'] : '' ?>" readonly>
</div>
<div class="form-group col-md-3">
<label for="insurer_id">Insurer<span class="text-danger"></span></label>
<input type=hidden id="insurer_id" name="insurer_id" value="<?= isset($ticket_data['insurer_id']) ? $ticket_data['insurer_id'] : '' ?>">
<input type=text class="form-control" id="insurer_name" placeholder="Insurer" value="<?= isset($ticket_data['insurer_name']) ? $ticket_data['insurer_name'] : '' ?>" readonly>
</div>
<div class="form-group col-md-3">
<label for="policy_no">Policy No<span class="text-danger"></span></label>
<input type="text" class="form-control" id="policy_no"
value="<?= isset($ticket_data['policy_no']) ? $ticket_data['policy_no'] : '' ?>"
name="policy_no">
</div>
<div class="form-group col-md-3">
<label for="ticket_type_id"> Policy Type <span class="text-danger"></span></label>
<select class="form-control readonly-select" id="ticket_type_id" name="ticket_type_id" readonly>
<?php
if (isset($ticket_type) && count($ticket_type)) {
foreach ($ticket_type as $key => $value) {
if($key != 1){
$selected = (isset($ticket_data) && $ticket_data['ticket_type_id'] == $key) ? 'selected' : ((isset($selected_ticket_type) && $selected_ticket_type == $key) ? 'selected' : '');
echo "<option value='" . $key . "' $selected>" . $value . "</option>";
}
}
}
?>
</select>
</div>
<div class="form-group col-md-3">
<label for="claim_type"> Claim Type <span class="text-danger"></span></label>
<select class="form-control" id="claim_type" name="claim_type">
<!-- <option value="0">Select claim Type</option> -->
<?php
if (isset($claim_type) && count($claim_type)) {
foreach ($claim_type as $key => $value) {
$selected = (isset($ticket_data) && $ticket_data['claim_type'] == $key) ? 'selected' : '';
echo "<option value='" . $key . "' $selected>" . $value . "</option>";
}
}
?>
</select>
</div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="emp_code">Employee ID &nbsp; <i class="fa fa-search text-danger" <label for="emp_code">Employee ID &nbsp; <i class="fa fa-search text-danger"
@ -120,7 +46,6 @@
name="emp_code"> name="emp_code">
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="emp_name">Employee Name<span class="text-danger"></span></label> <label for="emp_name">Employee Name<span class="text-danger"></span></label>
<input type=hidden id="emp_id" name="emp_id" value="<?= isset($ticket_data['emp_id']) ? $ticket_data['emp_id'] : '' ?>"> <input type=hidden id="emp_id" name="emp_id" value="<?= isset($ticket_data['emp_id']) ? $ticket_data['emp_id'] : '' ?>">
@ -143,6 +68,94 @@
name="emp_mail"> name="emp_mail">
</div> </div>
<div class="form-group col-md-3">
<label for="policy_no">Policy No<span class="text-danger"></span></label>
<input type="text" class="form-control" id="policy_no"
value="<?= isset($ticket_data['policy_no']) ? $ticket_data['policy_no'] : '' ?>"
name="policy_no">
</div>
<div class="form-group col-md-3">
<label for="client_name">Corporate Name<span class="text-danger"></span></label>
<input type="hidden" id="client_id" name="client_id" value="<?= isset($ticket_data['client_id']) ? $ticket_data['client_id'] : '' ?>">
<input type="text" class="form-control" id="client_name" placeholder="Client" value="<?= isset($ticket_data['client_name']) ? $ticket_data['client_name'] : '' ?>" readonly>
</div>
<div class="form-group col-md-3">
<label for="insurer_id">Insurer<span class="text-danger"></span></label>
<input type=hidden id="insurer_id" name="insurer_id" value="<?= isset($ticket_data['insurer_id']) ? $ticket_data['insurer_id'] : '' ?>">
<input type=text class="form-control" id="insurer_name" placeholder="Insurer" value="<?= isset($ticket_data['insurer_name']) ? $ticket_data['insurer_name'] : '' ?>" readonly>
</div>
<div class="form-group col-md-3">
<label for="acm_id">Account Manager<span class="text-danger"></span></label>
<select class="form-control" id="acm_id" name="acm_id">
<!-- <option value="0">Select Account Manager</option> -->
<?php
if (isset($acms) && count($acms)) {
foreach ($acms as $key => $value) {
$selected = (isset($ticket_data) && $ticket_data['acm_id'] == $value['id']) ? 'selected' : '';
echo "<option value=" . $value['id'] . " $selected>" . $value['first_name'] . "</option>";
}
}
?>
</select>
</div>
</div>
<!-- end first_data_points -->
<h5>Claim Details</h5>
<hr>
<!-- second_data_points -->
<div class="form-row">
<div class="form-group col-md-3">
<label for="ticket_type_id"> Policy Type <span class="text-danger"></span></label>
<select class="form-control readonly-select" id="ticket_type_id" name="ticket_type_id" readonly>
<?php
if (isset($ticket_type) && count($ticket_type)) {
foreach ($ticket_type as $key => $value) {
if($key != 1){
$selected = (isset($ticket_data) && $ticket_data['ticket_type_id'] == $key) ? 'selected' : ((isset($selected_ticket_type) && $selected_ticket_type == $key) ? 'selected' : '');
echo "<option value='" . $key . "' $selected>" . $value . "</option>";
}
}
}
?>
</select>
</div>
<div class="form-group col-md-3">
<label for="claim_status">Status<span class="text-danger"></span></label>
<select class="form-control" id="claim_status_id" name="claim_status_id">
<!-- <option value="0">Select status</option> -->
<?php
if (isset($claim_status) && count($claim_status)) {
foreach ($claim_status as $key => $value) {
$selected = (isset($ticket_data) && $ticket_data['claim_status_id'] == $value['id']) ? 'selected' : '';
echo "<option value=" . $value['id'] . " $selected>" . $value['claim_status'] . "</option>";
}
}
?>
</select>
</div>
<div class="form-group col-md-3">
<label for="claim_type"> Claim Type <span class="text-danger"></span></label>
<select class="form-control" id="claim_type" name="claim_type">
<!-- <option value="0">Select claim Type</option> -->
<?php
if (isset($claim_type) && count($claim_type)) {
foreach ($claim_type as $key => $value) {
$selected = (isset($ticket_data) && $ticket_data['claim_type'] == $key) ? 'selected' : '';
echo "<option value='" . $key . "' $selected>" . $value . "</option>";
}
}
?>
</select>
</div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="date_of_join">Date of joining<span class="text-danger"></span></label> <label for="date_of_join">Date of joining<span class="text-danger"></span></label>
@ -196,6 +209,14 @@
value="<?= isset($ticket_data['si_amt']) ? $ticket_data['si_amt'] : '' ?>" value="<?= isset($ticket_data['si_amt']) ? $ticket_data['si_amt'] : '' ?>"
name="si_amt"> name="si_amt">
</div> </div>
</div>
<!-- end second_data_points -->
<h5>Additional Details</h5>
<hr>
<!-- third_data_points -->
<div class="form-row">
<div class="form-group col-md-3 approved" style="display: none;"> <div class="form-group col-md-3 approved" style="display: none;">
<label for="approved_amount">Approved Amount</label> <label for="approved_amount">Approved Amount</label>
@ -233,16 +254,15 @@
value="<?= isset($ticket_data['settle_letter']) ? $ticket_data['settle_letter'] : '' ?>" name="settle_letter"> value="<?= isset($ticket_data['settle_letter']) ? $ticket_data['settle_letter'] : '' ?>" name="settle_letter">
</div> </div>
<div class="form-group col-md-3 returned" style="display: none;">
<label for="return_remark">Return Remark</label>
<textarea class="form-control" id="return_remark" placeholder="Enter Return Remark" name="return_remark"><?= isset($ticket_data['return_remark']) ? $ticket_data['return_remark'] : '' ?></textarea>
</div>
<div class="form-group col-md-3 canceled" style="display: none;"> <div class="form-group col-md-3 canceled" style="display: none;">
<label for="cancel_remark">Cancel Remark</label> <label for="cancel_remark">Cancel Remark</label>
<textarea class="form-control" id="cancel_remark" placeholder="Enter Cancel Remark" name="cancel_remark"><?= isset($ticket_data['cancel_remark']) ? $ticket_data['cancel_remark'] : '' ?></textarea> <textarea class="form-control" id="cancel_remark" rows="1" placeholder="Enter Cancel Remark" name="cancel_remark"><?= isset($ticket_data['cancel_remark']) ? $ticket_data['cancel_remark'] : '' ?></textarea>
</div> </div>
<div class="form-group col-md-3 returned" style="display: none;">
<label for="return_remark">Return Remark</label>
<textarea class="form-control" id="return_remark" rows="1" placeholder="Enter Return Remark" name="return_remark"><?= isset($ticket_data['return_remark']) ? $ticket_data['return_remark'] : '' ?></textarea>
</div>
<div class="form-group col-md-6 returned" style="display: none;"> <div class="form-group col-md-6 returned" style="display: none;">
<label for="awb_no_courier_name">AWB No with Courier Name</label> <label for="awb_no_courier_name">AWB No with Courier Name</label>
@ -250,7 +270,10 @@
value="<?= isset($ticket_data['awb_no_courier_name']) ? $ticket_data['awb_no_courier_name'] : '' ?>" name="awb_no_courier_name"> value="<?= isset($ticket_data['awb_no_courier_name']) ? $ticket_data['awb_no_courier_name'] : '' ?>" name="awb_no_courier_name">
</div> </div>
</div> </div>
<!-- end third_data_points -->
</div> </div>
<div class="form-group col-md-12 text-right m-b-0" style="margin-top: 29px;"> <div class="form-group col-md-12 text-right m-b-0" style="margin-top: 29px;">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" <button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
@ -399,9 +422,10 @@ console.log('fields', fields);
console.log('$field id', $field); console.log('$field id', $field);
let $parentDiv = $field.closest("div"); let $parentDiv = $field.closest("div");
console.log('$parentDiv', $parentDiv); console.log('$parentDiv', $parentDiv);
// addRequiredFieldSymbol(targetId);
if ($parentDiv.length) { if ($parentDiv.length) {
let thirdClass = $parentDiv.attr("class").split(" ")[2] || ""; let thirdClass = $parentDiv.attr("class").split(" ")[2] || "";
addRequiredFieldSymbolByClass(thirdClass);
console.log('thirdClass', thirdClass); console.log('thirdClass', thirdClass);
if (thirdClass) { if (thirdClass) {
@ -416,5 +440,61 @@ console.log('fields', fields);
} }
} }
}); });
// function addRequiredFieldSymbol(field_name) {
// // Find the field with the given name
// var $field = $(`[name="${field_name}"]`);
// if ($field.length) {
// // Find the parent div of this field
// var $parentDiv = $field.closest('div');
// if ($parentDiv.length) {
// // Get the classes as an array
// var classes = $parentDiv.attr('class') ? $parentDiv.attr('class').split(/\s+/) : [];
// if (classes.length > 0) {
// // Get the last class in the array
// var lastClass = classes[classes.length - 1];
// // Find all divs with this last class
// var $allDivsWithClass = $(`.${lastClass}`);
// // Add asterisk to all labels within these divs
// $allDivsWithClass.each(function() {
// var $label = $(this).find('label');
// if ($label.length && !$label.find('.text-danger').length) {
// $label.append(' <span class="text-danger">*</span>');
// }
// });
// console.log(`Added required symbol to ${$allDivsWithClass.length} labels with class "${lastClass}"`);
// } else {
// console.warn(`Parent div for field "${field_name}" has no classes`);
// }
// } else {
// console.warn(`No parent div found for field name="${field_name}"`);
// }
// } else {
// console.warn(`No field found with name="${field_name}"`);
// }
// }
function addRequiredFieldSymbolByClass(className) {
// Find all divs with the specified class
var $divsWithClass = $(`.${className}`);
if ($divsWithClass.length) {
// Add asterisk to all labels within these divs
$divsWithClass.each(function() {
var $label = $(this).find('label');
if ($label.length && !$label.find('.text-danger').length) {
$label.append(' <span class="text-danger">*</span>');
}
});
console.log(`Added required symbol to ${$divsWithClass.length} labels with class "${className}"`);
} else {
console.warn(`No divs found with class="${className}"`);
}
}
</script> </script>

View File

@ -76,48 +76,37 @@ if(!isset($view_ticket_page)){
<div id="mobileSearch" class="search-method"> <div id="mobileSearch" class="search-method">
<div class="row"> <div class="row">
<div class="col-md-5" style="display:true;"> <div class="col-md-3" style="display:true;">
<div class="form-group"> <div class="form-group">
<label>Employee Data Points</label> <label>Employee Data Points</label>
<select name="employee_data_points" id="employee_data_points" <select name="employee_data_points" id="employee_data_points"
class="form-control"> class="form-control">
<option value="mobile">Employee Mobile Number</option> <option value="mobile">Mobile Number</option>
<option value="emp_code">Employee ID</option> <option value="emp_code">Employee ID</option>
</select> </select>
</div> </div>
</div> </div>
<div class="col-md-5"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
<label id="employee_data_points_label">Employee Mobile Number</label> <label>Client</label>
<select id="mobile_emp_client_data_list" name="client"
class="form-control custom-select">
<option value="0">Select Client</option>
</select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label id="employee_data_points_label">Mobile Number</label>
<input class="form-control" type="text" id="emp_mobile_number_for_claim" <input class="form-control" type="text" id="emp_mobile_number_for_claim"
name="mobile_numbers" onkeypress="return onlyNumbers(event)" name="mobile_numbers" onkeypress="return onlyNumbers(event)"
maxlength="10"> maxlength="10">
</div> </div>
<div class="text-danger" id="error_dis"></div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 9px;">
<br>
<button class="btn btn-primary"
onclick="getTheEmpDataForClaimSearchByMobile(this)">Search</button>
</div>
</div>
</div>
</div> </div>
<div id="emp_member_policy_div" style="display:true;"> <div class="col-md-6">
<div class="row">
<div class="col-md-5" style="display:none;">
<div class="form-group">
<label>Employee</label>
<select name="employee_by_number" id="employee_by_number"
class="form-control SelExample">
<option value="0">Select Employee</option>
</select>
</div>
</div>
<div class="col-md-5">
<div class="form-group"> <div class="form-group">
<label>Insured List</label> <label>Insured List</label>
<select name="employee_by_number" id="member_by_number" <select name="employee_by_number" id="member_by_number"
@ -126,6 +115,18 @@ if(!isset($view_ticket_page)){
</select> </select>
</div> </div>
</div> </div>
<div class="col-md-4">
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 9px; float:right;">
<br>
<button class="btn btn-primary"
onclick="getTheEmpDataForClaimSearchByMobile(this)">Search</button>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -296,6 +297,7 @@ function getClientAndBranchAndPolicy() {
branch_list = res.branch_data; branch_list = res.branch_data;
policy_list = res.policy_data; policy_list = res.policy_data;
appendClients(res.client_data); appendClients(res.client_data);
appendClientsForMobileSearch(res.client_data);
} else { } else {
console.log('No data found'); console.log('No data found');
} }
@ -329,6 +331,26 @@ function appendClients(data) {
} }
//append the clients data for mobile search to the modal
function appendClientsForMobileSearch(data) {
$('#mobile_emp_client_data_list').empty();
$('#mobile_emp_client_data_list').append($('<option>', {
value: '0',
text: 'Select Client'
}));
$.each(data, function(index, item) {
var option = $('<option>', {
value: item.id,
text: item.short_name,
});
$('#mobile_emp_client_data_list').append(option).select2();
});
}
//append the clients branch data to the modal //append the clients branch data to the modal
function appendBranch(data) { function appendBranch(data) {
$('#emp_client_branch_data_list').empty(); $('#emp_client_branch_data_list').empty();
@ -365,7 +387,8 @@ function appendPolicy(data) {
if (ticket_type == 1) { if (ticket_type == 1) {
if(item.policy_type_id == 2 || item.policy_type_id == 3 || item.policy_type_id == 4 ||item.policy_type_id == 5) { if (item.policy_type_id == 2 || item.policy_type_id == 3 || item.policy_type_id == 4 || item
.policy_type_id == 5) {
var option = $('<option>', { var option = $('<option>', {
value: item.id, value: item.id,
text: item.policy_type + '-' + item.policy_no, text: item.policy_type + '-' + item.policy_no,
@ -513,18 +536,22 @@ function getTheEmpDataForClaimSearchByMobile(input, searchType = null) {
let type = $('#employee_data_points').val() let type = $('#employee_data_points').val()
let param = $('#emp_mobile_number_for_claim').val() let param = $('#emp_mobile_number_for_claim').val()
let client_policy_id = $('#emp_client_policy_data_list').val() let client_policy_id = $('#emp_client_policy_data_list').val()
let client_id = $('#mobile_emp_client_data_list').val()
if (searchType == 'client') { if (searchType == 'client') {
type = 'emp_code'; type = 'emp_code';
param = $(input).val(); param = $(input).val();
client_id = $('#emp_client_data_list').val()
} }
let url = '<?= base_url('util/getTheEmpDataForClaimSearchByMobile/') ?>' + param + '/' + type + '/' + client_policy_id; let url = '<?= base_url('util/getTheEmpDataForClaimSearchByMobile/') ?>' + param + '/' + type + '/' +
client_policy_id + '/' + client_id;
// Data to send in the AJAX request // Data to send in the AJAX request
let requestData = { let requestData = {
param: param, param: param,
type: type, type: type,
client_policy_id: client_policy_id, client_policy_id: client_policy_id,
client_id: client_id,
}; };
// Show loader // Show loader
@ -536,7 +563,7 @@ function getTheEmpDataForClaimSearchByMobile(input, searchType = null) {
sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) { sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) {
console.log('Data fetched successfully:', response); console.log('Data fetched successfully:', response);
if (response.status) { if (response.status == true) {
console.log(response.message, 'SUCCESS'); console.log(response.message, 'SUCCESS');
if (searchType == 'client') { if (searchType == 'client') {
appendMember(response.memberData, 'search_by_client_member'); appendMember(response.memberData, 'search_by_client_member');
@ -716,20 +743,43 @@ function setMemberData(input) {
if (tpaNo == "") { if (tpaNo == "") {
$('#claim_status_id').val(1) $('#claim_status_id').val(1)
$('#non_id_reason').attr('required', true);
var $label = $("label[for='non_id_reason']");
if ($label.length && !$label.find('.text-danger').length) {
$label.append(' <span class="text-danger">*</span>');
}
} else { } else {
$('#claim_status_id').val(2) $('#claim_status_id').val(2)
$('#non_id_reason').attr('required', false);
var $label = $("label[for='non_id_reason']");
$label.text("");
} }
} }
// $('#employee_data_points').on('change', function() {
// let value = $(this).val()
// if (value == "mobile") {
// $('#employee_data_points_label').text('Employee Mobile Number')
// } else {
// $('#employee_data_points_label').text('Employee ID')
// }
// })
$('#employee_data_points').on('change', function() { $('#employee_data_points').on('change', function() {
let value = $(this).val();
let $label = $('#employee_data_points_label');
let $input = $('#emp_mobile_number_for_claim');
let value = $(this).val()
if (value == "mobile") { if (value == "mobile") {
$('#employee_data_points_label').text('Employee Mobile Number') $label.text('Employee Mobile Number');
$input.attr('onkeypress', 'return onlyNumbers(event)').attr('maxlength', '10');
} else { } else {
$('#employee_data_points_label').text('Employee ID') $label.text('Employee ID');
$input.removeAttr('onkeypress maxlength');
} }
}) });
function toResetTheModelFields() { function toResetTheModelFields() {

View File

@ -5,7 +5,7 @@
<table id="scroll-horizontal-datatable" class="table w-100"> <table id="scroll-horizontal-datatable" class="table w-100">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th>Field</th> <th>Label</th>
<!-- <th>Old Value</th> <!-- <th>Old Value</th>
<th>New Value</th> --> <th>New Value</th> -->
<th>Change</th> <th>Change</th>

View File

@ -74,11 +74,11 @@ table.dataTable tbody td {
title=" <?php title=" <?php
if ($row['claim_status_id'] == 8) { if ($row['claim_status_id'] == 8) {
if ($row['is_head_approved'] == 0) { if ($row['is_head_approved'] == 0) {
echo 'Waiting For Head Approvel'; echo 'Waiting for approvel';
} elseif ($row['is_head_approved'] == 1) { } elseif ($row['is_head_approved'] == 1) {
echo 'Head Approved'; echo 'Rejection approved';
} elseif ($row['is_head_approved'] == 2) { } elseif ($row['is_head_approved'] == 2) {
echo 'Head Rejected'; echo 'Rejection not approved';
} else { } else {
echo $row['status']; echo $row['status'];
} }

View File

@ -77,7 +77,16 @@ table.dataTable tbody td {
<?php if (isset($ticket_data)) { ?> <?php if (isset($ticket_data)) { ?>
<?php foreach ($ticket_data as $index => $row) { ?> <?php foreach ($ticket_data as $index => $row) { ?>
<tr> <tr>
<td><?php echo $row['template_name'] ?? ""; ?></td> <td> <?php echo $row['template_name'] ?? ""; ?> &nbsp;
<i class="fe-alert-circle"
style="color: #000;"
aria-hidden="true"
data-toggle="tooltip"
data-placement="top"
title="<?php echo "Status : ". ($row['tool_tip'] ?? ''); ?>"></i>
</td>
<td><?php echo $ticket_type[$row['ticket_type']] ?? ""; ?></td> <td><?php echo $ticket_type[$row['ticket_type']] ?? ""; ?></td>
<td><?php echo $trigger_type[$row['trigger_type']] ?? ""; ?></td> <td><?php echo $trigger_type[$row['trigger_type']] ?? ""; ?></td>
<td><?= $row['is_auto_mail'] == 1 ? 'Auto' : "Manual" ?></td> <td><?= $row['is_auto_mail'] == 1 ? 'Auto' : "Manual" ?></td>
@ -171,6 +180,12 @@ table.dataTable tbody td {
</div> </div>
<div class="form-group col-md-6">
<label for="claim_status_for_template">Claim Status</label>
<input type="text" readonly id="claim_status_for_template" class="form-control" />
</div>
</div> </div>
<div class="form-row"> <div class="form-row">
@ -192,11 +207,14 @@ table.dataTable tbody td {
style="border:none;right: 6px;width: auto;position: absolute;z-index: 1;top: 17px;height: 32px;float: right;"> style="border:none;right: 6px;width: auto;position: absolute;z-index: 1;top: 17px;height: 32px;float: right;">
<option value="">PlaceHolders</option> <option value="">PlaceHolders</option>
<?php foreach ($placeHolders as $key => $value): ?> <?php foreach ($placeHolders as $key => $value): ?>
<?php // if($value == 'member_name' || $value == 'member_mobile' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'client_name'){ ?>member_mobile <?php // if($value == 'member_name' || $value == 'member_mobile' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'client_name'){
<?php $valueChange = str_replace('_', ' ', $value); $valueChange = ucwords($valueChange); ?> ?>member_mobile
<?php $valueChange = str_replace('_', ' ', $value);
$valueChange = ucwords($valueChange); ?>
<option value="<?php echo $key; ?>"><?php echo $valueChange; ?></option> <option value="<?php echo $key; ?>"><?php echo $valueChange; ?></option>
</option> </option>
<?php //} ?> <?php //}
?>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
</div> </div>
@ -216,7 +234,11 @@ table.dataTable tbody td {
</div><!-- /.modal --> </div><!-- /.modal -->
<!--------------------------------------------------------------------------------------------------> <!-------------------------------------------------------------------------------------------------->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</script>
<script> <script>
// Datatable document ready // Datatable document ready
$(document).ready(function() { $(document).ready(function() {
@ -481,6 +503,7 @@ function getMailTemplateData(id) {
$('#primaryKey').val(res.data.id); $('#primaryKey').val(res.data.id);
$('#policy_type').val(res.data.ticket_type).change(); $('#policy_type').val(res.data.ticket_type).change();
$('#trigger_type').val(res.data.trigger_type).change(); $('#trigger_type').val(res.data.trigger_type).change();
$('#claim_status_for_template').val(res.data.tool_tip);
$('.jodit-wysiwyg').html(res.data.mail_content); $('.jodit-wysiwyg').html(res.data.mail_content);
// Set the auto mail switch // Set the auto mail switch

View File

@ -19,7 +19,7 @@
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-primary" onclick="submitToRedirectTicketNewUrl(this)">submit</button> <button type="button" class="btn btn-primary" onclick="submitToRedirectTicketNewUrl(this)">Submit</button>
</div> </div>
</div> </div>
</div> </div>