CHANGE_UI_Issues - VADIVEL J 2025-09-24
This commit is contained in:
parent
81a58c5495
commit
5a707d9722
@ -1124,6 +1124,9 @@ class TicketController extends BaseController
|
||||
// dd($data['ticket_data']);
|
||||
$data['ticket_type'] = $this->ticketType;
|
||||
$data['trigger_type'] = $this->triggerType;
|
||||
|
||||
$data['page_name'] = "Claims";
|
||||
|
||||
return $this->loadLayout('ticket_mail_template', $data);
|
||||
}
|
||||
|
||||
@ -2190,6 +2193,8 @@ class TicketController extends BaseController
|
||||
|
||||
|
||||
$data['viewer'] = !empty($empView) ? $empView : 0;
|
||||
|
||||
|
||||
// dd($data);
|
||||
return view('ticket_feedback_form', $data);
|
||||
}else{
|
||||
@ -2220,7 +2225,7 @@ class TicketController extends BaseController
|
||||
public function feedbackList(){
|
||||
|
||||
$data['feedback_data'] = $this->ticketMasterModel->select("ticket_master.*,clients.client_name")->join("clients","clients.id = ticket_master.client_id")->where("ticket_master.is_active",1)->where("ticket_master.feedback_json IS NOT NULL", null, false)->where("ticket_master.feedback_json !=", "")->findAll();
|
||||
|
||||
$data['page_name'] = "Claims";
|
||||
// dd($data);
|
||||
$this->loadLayout("ticket_feedback_list",$data);
|
||||
}
|
||||
|
||||
@ -210,7 +210,7 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#datatable-buttons').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
dom: "<'d-flex justify-content-between align-items-center'<'datatable-search'f><'datatable-buttons'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [{
|
||||
|
||||
@ -64,7 +64,7 @@
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h2 style="position: relative;">Claim Dump Upload</h2>
|
||||
<h4 style="position: relative;">Claim Dump Upload</h4>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -7,10 +7,6 @@
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
.col-12 {
|
||||
max-width: 98% !important;
|
||||
}
|
||||
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
@ -7,9 +7,6 @@
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
.col-12 {
|
||||
max-width: 98% !important;
|
||||
}
|
||||
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
@ -33,7 +30,8 @@
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th style="text-align: center;" colspan="8">OPEN</th>
|
||||
<th style="text-align: center;" colspan="5" >CLEARED</th>
|
||||
|
||||
<th style="text-align: center;" colspan="7" >CLEARED</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php foreach ($column_order as $col_name): ?>
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>",
|
||||
dom: "<'d-flex justify-content-between align-items-center'<'datatable-search'f><'datatable-buttons'B>>",
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
|
||||
@ -166,7 +166,8 @@ table.dataTable thead th {
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div>
|
||||
</div><!-- /.modal -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
@ -296,9 +297,10 @@ table.dataTable thead th {
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-2'f><'col-sm-10 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
dom: "<'d-flex justify-content-between align-items-center'<'datatable-search'f><'datatable-buttons'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
|
||||
buttons: [
|
||||
|
||||
{
|
||||
|
||||
@ -47,10 +47,6 @@ body {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.container-fluid {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.user-card {
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
|
||||
@ -11,12 +11,13 @@ option:disabled {
|
||||
<div class="col-xl-12">
|
||||
<div id="accordion1" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<h4 class="m-1">
|
||||
<span>Filters</span>
|
||||
<a id="toggleIcon1" class="text-dark float-right" data-toggle="collapse" href="#collapseTwo"
|
||||
aria-expanded="true">
|
||||
<i id="icon1" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
</h4>
|
||||
<div id="collapseTwo" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion1">
|
||||
<div class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="container-fluid-min">
|
||||
<h2>Endorsement</h2>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
@ -590,7 +590,7 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
dom: "<'d-flex justify-content-between align-items-center'<'datatable-search'f><'datatable-buttons'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [{
|
||||
|
||||
@ -98,7 +98,7 @@
|
||||
</style>
|
||||
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="container-fluid-min">
|
||||
<h2>Enrollment</h2>
|
||||
<div class="row visa_status_count_view">
|
||||
<div class="col-12">
|
||||
|
||||
@ -461,7 +461,7 @@ $('body').on('click', '.reload', function() {
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
dom: "<'d-flex justify-content-between align-items-center'<'datatable-search'f><'datatable-buttons'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
"buttons": [{
|
||||
|
||||
@ -61,7 +61,7 @@
|
||||
</style>
|
||||
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="container-fluid-min">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
|
||||
@ -10,11 +10,12 @@
|
||||
<div class="col-xl-12">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<h4 class="m-1">
|
||||
<span>Filters</span>
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
</h4>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
@ -341,7 +342,7 @@
|
||||
// for datatable
|
||||
$(document).ready(function() {
|
||||
$('#hr_tickets_table').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
dom: "<'d-flex justify-content-between align-items-center'<'datatable-search'f><'datatable-buttons'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
"buttons": [{
|
||||
|
||||
@ -58,8 +58,6 @@
|
||||
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<h3>Inception</h3>
|
||||
<br>
|
||||
<ul class="nav nav-pills navtab-bg">
|
||||
<li class="nav-item d-flex justify-content-center align-items-center">
|
||||
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-1 active-tab" id="general_tab">
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
<style>
|
||||
|
||||
.custom-dropdown-menu {
|
||||
.custom-dropdown-menu {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: #ffffff !important;
|
||||
@ -10,311 +9,312 @@
|
||||
min-width: 10rem;
|
||||
z-index: 9999;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.custom-dropdown-menu .dropdown-item {
|
||||
.custom-dropdown-menu .dropdown-item {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
padding: 0.5rem 1rem !important;
|
||||
color: #212529 !important;
|
||||
text-decoration: none !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
}
|
||||
|
||||
.custom-dropdown-menu .dropdown-item:hover {
|
||||
.custom-dropdown-menu .dropdown-item:hover {
|
||||
background-color: #f8f9fa !important;
|
||||
color: #16181b !important;
|
||||
cursor: pointer !important;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-color{
|
||||
background-color: rgba(52, 174, 178, 1);
|
||||
color: white;
|
||||
border:1px solid rgba(52, 174, 178, 1);
|
||||
}
|
||||
.btn-color {
|
||||
background-color: rgba(52, 174, 178, 1);
|
||||
color: white;
|
||||
border: 1px solid rgba(52, 174, 178, 1);
|
||||
}
|
||||
|
||||
.btn-color:hover{
|
||||
.btn-color:hover {
|
||||
background-color: rgba(41, 139, 142, 1);
|
||||
color: white;
|
||||
border:1px solid rgba(41, 139, 142, 1);
|
||||
}
|
||||
|
||||
border: 1px solid rgba(41, 139, 142, 1);
|
||||
}
|
||||
</style>
|
||||
<div class="row" id="insurer_list">
|
||||
|
||||
<div class="container-fluid-min">
|
||||
<div class="row" id="insurer_list">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body maincard">
|
||||
<!-- <div class="row" style="margin-bottom:1rem;">
|
||||
<div class="card">
|
||||
<div class="card-body maincard">
|
||||
<!-- <div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Insurers</h4>
|
||||
</div>
|
||||
</div> -->
|
||||
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">Name</th>
|
||||
<th class="font-weight-medium">Type</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">Name</th>
|
||||
<th class="font-weight-medium">Type</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php if(is_array($insurerList)) {foreach($insurerList as $row){ ?>
|
||||
<tr>
|
||||
<td><?php echo $row['name']; ?> ( <?php echo $row['short_name']; ?> ) </td>
|
||||
<td><?php echo $row['type']; ?></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item" href="<?= base_url("master/insurer/list/"); ?><?= $row['id'];?>"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a class="dropdown-item" data-id="<?= $row['id'];?>" onclick="removeInsurer(this)"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }}?>
|
||||
<tbody>
|
||||
<?php if (is_array($insurerList)) {
|
||||
foreach ($insurerList as $row) { ?>
|
||||
<tr>
|
||||
<td><?php echo $row['name']; ?> ( <?php echo $row['short_name']; ?> ) </td>
|
||||
<td><?php echo $row['type']; ?></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item" href="<?= base_url("master/insurer/list/"); ?><?= $row['id']; ?>"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a class="dropdown-item" data-id="<?= $row['id']; ?>" onclick="removeInsurer(this)"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- end row -->
|
||||
|
||||
<script>
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const table = document.getElementById("tickets-table");
|
||||
|
||||
|
||||
// Create custom dropdown
|
||||
function createCustomDropdown(row) {
|
||||
// Get the original dropdown items
|
||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||
if (!originalDropdown) return null;
|
||||
|
||||
// Create new dropdown with proper background and spacing
|
||||
const customDropdown = document.createElement('div');
|
||||
customDropdown.className = 'custom-dropdown-menu';
|
||||
|
||||
// Copy inner content while maintaining icon alignment
|
||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||
|
||||
return customDropdown;
|
||||
// Get the original dropdown items
|
||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||
if (!originalDropdown) return null;
|
||||
|
||||
// Create new dropdown with proper background and spacing
|
||||
const customDropdown = document.createElement('div');
|
||||
customDropdown.className = 'custom-dropdown-menu';
|
||||
|
||||
// Copy inner content while maintaining icon alignment
|
||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||
|
||||
return customDropdown;
|
||||
}
|
||||
|
||||
let activeDropdown = null;
|
||||
|
||||
// Add click event listener to rows
|
||||
table.querySelectorAll("tbody tr").forEach(row => {
|
||||
const customDropdown = createCustomDropdown(row);
|
||||
if (!customDropdown) return;
|
||||
|
||||
document.body.appendChild(customDropdown);
|
||||
const customDropdown = createCustomDropdown(row);
|
||||
if (!customDropdown) return;
|
||||
|
||||
row.addEventListener("click", function(event) {
|
||||
// Ignore clicks on the action column
|
||||
if (event.target.closest('td:last-child')) {
|
||||
return;
|
||||
}
|
||||
document.body.appendChild(customDropdown);
|
||||
|
||||
// Hide any active dropdown
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
}
|
||||
row.addEventListener("click", function(event) {
|
||||
// Ignore clicks on the action column
|
||||
if (event.target.closest('td:last-child')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get click position
|
||||
const rect = event.target.getBoundingClientRect();
|
||||
|
||||
// Position the dropdown with some offset
|
||||
customDropdown.style.display = 'block';
|
||||
customDropdown.style.position = 'fixed';
|
||||
customDropdown.style.left = `${rect.left}px`;
|
||||
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||
|
||||
// Set as active dropdown
|
||||
activeDropdown = customDropdown;
|
||||
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
// Preserve click handlers and add auto-close
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function(e) {
|
||||
event.preventDefault(e);
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) {
|
||||
eval(onclickAttr);
|
||||
}
|
||||
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#') {
|
||||
window.location.href = href;
|
||||
}
|
||||
|
||||
// Close the dropdown after handling the click
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
});
|
||||
// Hide any active dropdown
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
}
|
||||
|
||||
// Get click position
|
||||
const rect = event.target.getBoundingClientRect();
|
||||
|
||||
// Position the dropdown with some offset
|
||||
customDropdown.style.display = 'block';
|
||||
customDropdown.style.position = 'fixed';
|
||||
customDropdown.style.left = `${rect.left}px`;
|
||||
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||
|
||||
// Set as active dropdown
|
||||
activeDropdown = customDropdown;
|
||||
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
// Preserve click handlers and add auto-close
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function(e) {
|
||||
event.preventDefault(e);
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) {
|
||||
eval(onclickAttr);
|
||||
}
|
||||
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#') {
|
||||
window.location.href = href;
|
||||
}
|
||||
|
||||
// Close the dropdown after handling the click
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Close dropdown when clicking outside
|
||||
document.addEventListener("click", function() {
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>" ,
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'InsurerList',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'ADD',
|
||||
className: 'btn btn-color',
|
||||
action: function () {
|
||||
window.location.href = "<?= base_url("master/insurer/create"); ?>";
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'d-flex justify-content-between align-items-center'<'datatable-search'f><'datatable-buttons'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'InsurerList',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
}
|
||||
},
|
||||
paging: true ,
|
||||
{
|
||||
text: 'ADD',
|
||||
className: 'btn btn-color',
|
||||
action: function() {
|
||||
window.location.href = "<?= base_url("master/insurer/create"); ?>";
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true,
|
||||
});
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
const btnExport = document.querySelector("#btnExport");
|
||||
const tableElement = document.querySelector("#tickets-table");
|
||||
const btnExport = document.querySelector("#btnExport");
|
||||
const tableElement = document.querySelector("#tickets-table");
|
||||
|
||||
btnExport.addEventListener("click", () => {
|
||||
const obj = new csvExport(tableElement);
|
||||
const csvData = obj.exportCsv();
|
||||
const blob = new Blob([csvData], { type: "text/csv" });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = "UserList.csv";
|
||||
a.click();
|
||||
btnExport.addEventListener("click", () => {
|
||||
const obj = new csvExport(tableElement);
|
||||
const csvData = obj.exportCsv();
|
||||
const blob = new Blob([csvData], {
|
||||
type: "text/csv"
|
||||
});
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = "UserList.csv";
|
||||
a.click();
|
||||
|
||||
setTimeout(() => {
|
||||
URL.revokeObjectURL(url);
|
||||
}, 500);
|
||||
});
|
||||
setTimeout(() => {
|
||||
URL.revokeObjectURL(url);
|
||||
}, 500);
|
||||
});
|
||||
|
||||
|
||||
class csvExport {
|
||||
constructor(table, header = true) {
|
||||
this.table = table;
|
||||
this.rows = Array.from(table.querySelectorAll("tr"));
|
||||
if (!header && this.rows[0].querySelectorAll("th").length) {
|
||||
this.rows.shift();
|
||||
}
|
||||
}
|
||||
|
||||
exportCsv() {
|
||||
const lines = [];
|
||||
const ncols = this._longestRow();
|
||||
for (const row of this.rows) {
|
||||
let line = "";
|
||||
for (let i = 0; i < ncols - 1; i++) { // Exclude the last column
|
||||
if (row.children[i] !== undefined) {
|
||||
line += csvExport.safeData(row.children[i]);
|
||||
}
|
||||
line += i !== ncols - 2 ? "," : ""; // Adjusted for the last column exclusion
|
||||
class csvExport {
|
||||
constructor(table, header = true) {
|
||||
this.table = table;
|
||||
this.rows = Array.from(table.querySelectorAll("tr"));
|
||||
if (!header && this.rows[0].querySelectorAll("th").length) {
|
||||
this.rows.shift();
|
||||
}
|
||||
lines.push(line);
|
||||
}
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
||||
_longestRow() {
|
||||
return this.rows.reduce((length, row) => (row.childElementCount > length ? row.childElementCount : length), 0);
|
||||
}
|
||||
exportCsv() {
|
||||
const lines = [];
|
||||
const ncols = this._longestRow();
|
||||
for (const row of this.rows) {
|
||||
let line = "";
|
||||
for (let i = 0; i < ncols - 1; i++) { // Exclude the last column
|
||||
if (row.children[i] !== undefined) {
|
||||
line += csvExport.safeData(row.children[i]);
|
||||
}
|
||||
line += i !== ncols - 2 ? "," : ""; // Adjusted for the last column exclusion
|
||||
}
|
||||
lines.push(line);
|
||||
}
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
||||
static safeData(td) {
|
||||
let data = td.textContent;
|
||||
//Replace all double quote to two double quotes
|
||||
data = data.replace(/"/g, `""`);
|
||||
//Replace , and \n to double quotes
|
||||
data = /[",\n"]/.test(data) ? `"${data}"` : data;
|
||||
return data;
|
||||
_longestRow() {
|
||||
return this.rows.reduce((length, row) => (row.childElementCount > length ? row.childElementCount : length), 0);
|
||||
}
|
||||
|
||||
static safeData(td) {
|
||||
let data = td.textContent;
|
||||
//Replace all double quote to two double quotes
|
||||
data = data.replace(/"/g, `""`);
|
||||
//Replace , and \n to double quotes
|
||||
data = /[",\n"]/.test(data) ? `"${data}"` : data;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function removeInsurer(element) {
|
||||
|
||||
Swal.fire({
|
||||
title: "Are you sure?",
|
||||
text: "You need to remove this insurer.",
|
||||
icon: "info",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
confirmButtonText: "Yes",
|
||||
title: "Are you sure?",
|
||||
text: "You need to remove this insurer.",
|
||||
icon: "info",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
confirmButtonText: "Yes",
|
||||
}).then((result) => {
|
||||
|
||||
if (result.isConfirmed) {
|
||||
var id = element.getAttribute('data-id');
|
||||
var form_action = '<?= base_url("master/insurer/remove/") ?>' + id;
|
||||
$.ajax({
|
||||
url: form_action,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
// console.log(res.status == true);
|
||||
if(res){
|
||||
if (res.status == true) {
|
||||
toastr.success('Insurer removed successfully', 'success');
|
||||
location.reload();
|
||||
} else {
|
||||
toastr.warning('Failed to remove insurer', 'warning');
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Failed to remove insurer', 'warning');
|
||||
}
|
||||
});
|
||||
if (result.isConfirmed) {
|
||||
var id = element.getAttribute('data-id');
|
||||
var form_action = '<?= base_url("master/insurer/remove/") ?>' + id;
|
||||
$.ajax({
|
||||
url: form_action,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
// console.log(res.status == true);
|
||||
if (res) {
|
||||
if (res.status == true) {
|
||||
toastr.success('Insurer removed successfully', 'success');
|
||||
location.reload();
|
||||
} else {
|
||||
toastr.warning('Failed to remove insurer', 'warning');
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Failed to remove insurer', 'warning');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
@ -10,11 +10,12 @@
|
||||
<div class="col-xl-12">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<h4 class="m-1">
|
||||
<span>Filters</span>
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
</h4>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,15 +1,16 @@
|
||||
<div class="col-xl-12">
|
||||
<h4 class="ml-1 mb-3"> <span class="font-color-black">IRBA</span> </h4>
|
||||
<h4 class="ml-1 mb-3"> <span class="font-color-black">IRBA</span> </h4>
|
||||
</div>
|
||||
|
||||
<div class="col-xl-12" id="outstanding_filter">
|
||||
<div class="container-fluid-min">
|
||||
<div class="col-xl-12" id="outstanding_filter">
|
||||
<div id="accordion" class="mb-3">
|
||||
<label id="filterAccordion" class="m-1 d-flex justify-content-between align-items-center">
|
||||
<span class="font-color-black">Filters</span>
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
<label id="filterAccordion" class="m-1 d-flex justify-content-between align-items-center">
|
||||
<h4>Filters</h4>
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</label>
|
||||
<div class="card mb-1">
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
@ -19,8 +20,8 @@
|
||||
<div class="form-group col-md-4" id="date_div">
|
||||
<label>Date<span class="text-danger"></span></label>
|
||||
<div class="input-icon">
|
||||
<input type="text" id="reportrange" class="form-control" readonly style="caret-color: transparent;">
|
||||
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
|
||||
<input type="text" id="reportrange" class="form-control" readonly style="caret-color: transparent;">
|
||||
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
|
||||
</div>
|
||||
<input type="hidden" id="startDate" value=<?= $default_start ?>>
|
||||
<input type="hidden" id="endDate" value=<?= $default_end ?>>
|
||||
@ -63,6 +64,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id="report"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
@ -81,7 +86,9 @@
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
locale: { format: 'DD-MM-YYYY' },
|
||||
locale: {
|
||||
format: 'DD-MM-YYYY'
|
||||
},
|
||||
ranges: {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
@ -97,16 +104,16 @@
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$('#category').on('click', function(){
|
||||
$('#category').on('click', function() {
|
||||
|
||||
var choosed_option = $('#category').val();
|
||||
$("#report_type").val('0');
|
||||
if (choosed_option == 'life' ){
|
||||
$("#report_type option[value='insurer']").show();
|
||||
$("#report_type option[value='bap']").hide();
|
||||
$("#report_type option[value='bapClient']").hide();
|
||||
$("#report_type option[value='bapInsurer']").hide();
|
||||
$("#report_type option[value='client']").show();
|
||||
if (choosed_option == 'life') {
|
||||
$("#report_type option[value='insurer']").show();
|
||||
$("#report_type option[value='bap']").hide();
|
||||
$("#report_type option[value='bapClient']").hide();
|
||||
$("#report_type option[value='bapInsurer']").hide();
|
||||
$("#report_type option[value='client']").show();
|
||||
|
||||
} else if (choosed_option == 'nonLife') {
|
||||
$("#report_type option[value='insurer']").show();
|
||||
@ -139,11 +146,11 @@
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
}else{
|
||||
} else {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
let message = response.message;
|
||||
toastr.error(message,'ERROR');
|
||||
toastr.error(message, 'ERROR');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -175,7 +175,7 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
dom: "<'d-flex justify-content-between align-items-center'<'datatable-search'f><'datatable-buttons'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>" ,
|
||||
buttons: [
|
||||
|
||||
@ -129,6 +129,10 @@
|
||||
}
|
||||
|
||||
.container-fluid {
|
||||
padding: 0px 20px 0px 20px !important;
|
||||
}
|
||||
|
||||
.container-fluid-top {
|
||||
padding: 0px 40px 0px 40px !important;
|
||||
}
|
||||
|
||||
@ -1544,6 +1548,13 @@
|
||||
pointer-events: none; /* prevents blocking typing */
|
||||
}
|
||||
|
||||
.datatable-search {
|
||||
margin-right: auto;
|
||||
}
|
||||
.datatable-buttons {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
@ -1992,4 +2003,4 @@
|
||||
<div class="content">
|
||||
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
<div class="container-fluid-top">
|
||||
@ -1,370 +1,371 @@
|
||||
<style>
|
||||
.col-12 {
|
||||
max-width: 98% !important;
|
||||
}
|
||||
.col-12 {
|
||||
max-width: 98% !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div class="row" id="lead_filter_div">
|
||||
<div class="col-12" style="margin-top: -12px;">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<div class="row">
|
||||
<div class="col-md-6" style="position: relative;left: 17px;">
|
||||
<h4 style="text-align: left; margin-left:10px;">Filter</h4>
|
||||
<div class="container-fluid-min">
|
||||
<div class="row" id="lead_filter_div">
|
||||
<div class="col-12" style="margin-top: -12px;">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<div class="row">
|
||||
<div class="col-md-6" style="position: relative;left: 17px;">
|
||||
<h4 style="text-align: left;">Filter</h4>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<a style="text-align: right;" id="toggleIcon" class="text-dark float-right"
|
||||
data-toggle="collapse" href="#collapseOne" aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary"
|
||||
style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<a style="text-align: right;" id="toggleIcon" class="text-dark float-right"
|
||||
data-toggle="collapse" href="#collapseOne" aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary"
|
||||
style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</h5>
|
||||
<div id="collapseOne" class="collapse hide" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
</h5>
|
||||
<div id="collapseOne" class="collapse hide" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_issuer_type"> Issuer Type <span
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_issuer_type" name="filter_issuer_type">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_issuer_type"> Issuer Type <span
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_issuer_type" name="filter_issuer_type">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_lead_type"> Lead Type <span class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_lead_type" name="filter_lead_type">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_lead_type"> Lead Type <span class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_lead_type" name="filter_lead_type">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
if (isset($lead_type) && count($lead_type)) {
|
||||
foreach ($lead_type as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_client_type"> Client Type <span
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_client_type" name="filter_client_type">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_client_type"> Client Type <span
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_client_type" name="filter_client_type">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
if (isset($client_type) && count($client_type)) {
|
||||
foreach ($client_type as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_policy_type"> Policy Type <span
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_policy_type" name="filter_policy_type">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_policy_type"> Policy Type <span
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_policy_type" name="filter_policy_type">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
if (isset($policy_type) && count($policy_type)) {
|
||||
foreach ($policy_type as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['policy_type'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_client_id">Client<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_client_id" name="filter_client_id">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
</div>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_client_id">Client<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_client_id" name="filter_client_id">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_client_branch_id">Client Branch<span
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_client_branch_id"
|
||||
name="filter_client_branch_id">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_client_branch_id">Client Branch<span
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_client_branch_id"
|
||||
name="filter_client_branch_id">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_lead_status">Status<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_lead_status" name="filter_lead_status">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_lead_status">Status<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_lead_status" name="filter_lead_status">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
if (isset($lead_status) && count($lead_status)) {
|
||||
foreach ($lead_status as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12 text-right m-b-0" style="margin-bottom: -15px;">
|
||||
<a href="<?= base_url("/leads/list"); ?>" class="btn btn-secondary"
|
||||
id="clear-filters">Clear</a>
|
||||
<a class="btn btn-primary" id="get-emp-list"
|
||||
onclick="fetchTicketListData();">Submit</a>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12 text-right m-b-0" style="margin-bottom: -15px;">
|
||||
<a href="<?= base_url("/leads/list"); ?>" class="btn btn-secondary"
|
||||
id="clear-filters">Clear</a>
|
||||
<a class="btn btn-primary" id="get-emp-list"
|
||||
onclick="fetchTicketListData();">Submit</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- end page title -->
|
||||
<div id="lead_list_div">
|
||||
<?php include('leads_list.php'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- end page title -->
|
||||
<div id="lead_list_div">
|
||||
<?php include('leads_list.php'); ?>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var filter_client_list = [];
|
||||
var filter_branch_list = [];
|
||||
var filter_client_list = [];
|
||||
var filter_branch_list = [];
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#filter_client_id').select2();
|
||||
$('#filter_client_branch_id').select2();
|
||||
$('#filter_policy_type').select2();
|
||||
$(document).ready(function() {
|
||||
$('#filter_client_id').select2();
|
||||
$('#filter_client_branch_id').select2();
|
||||
$('#filter_policy_type').select2();
|
||||
|
||||
getfilterClientAndBranch()
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#filter_client_id').change(function() {
|
||||
|
||||
let client_id = $(this).val();
|
||||
if (filter_branch_list != '') {
|
||||
// console.log(branch_list[client_id]);
|
||||
let data = filter_branch_list[client_id];
|
||||
appendfilterBranch(data);
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
//----- AJAX FUNCTIONS --------------------------------------------------------------------------------
|
||||
|
||||
function fetchTicketListData() {
|
||||
|
||||
var issuer_type = $('#filter_issuer_type').val();
|
||||
var lead_type = $('#filter_lead_type').val();
|
||||
var policy_type = $('#filter_policy_type').val();
|
||||
var client_type = $('#filter_client_type').val();
|
||||
var status = $('#filter_lead_status').val();
|
||||
var client_id = $('#filter_client_id').val();
|
||||
var client_branch_id = $('#filter_client_branch_id').val();
|
||||
|
||||
var requestData = {
|
||||
issuer: issuer_type,
|
||||
lead_type: lead_type,
|
||||
policy_type_id: policy_type,
|
||||
client_type: client_type,
|
||||
status: status,
|
||||
client_id: client_id,
|
||||
client_branch_id: client_branch_id,
|
||||
};
|
||||
|
||||
console.log("requestData", requestData);
|
||||
|
||||
var url = '<?= base_url('/leads/list') ?>';
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
sendAjaxRequestForGlobal(url, 'POST', requestData, function(response) {
|
||||
|
||||
console.log('Filter Responce', response);
|
||||
|
||||
if (response.status == true) {
|
||||
|
||||
$('#lead_list_div').empty();
|
||||
$('#lead_list_div').html(response.html);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
setTimeout(function(){
|
||||
additionalDropdown();
|
||||
}, 1000);
|
||||
|
||||
} else {
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
let message = response.message;
|
||||
toastr.error(message, 'ERROR');
|
||||
}
|
||||
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
toastr.error('An error occurred while fetching the data.', 'ERROR');
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
getfilterClientAndBranch()
|
||||
});
|
||||
}
|
||||
|
||||
//function for fetch client, branch
|
||||
function getfilterClientAndBranch() {
|
||||
$.ajax({
|
||||
url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>',
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
$(document).ready(function() {
|
||||
$('#filter_client_id').change(function() {
|
||||
|
||||
console.log('getClientAndBranchAndPolicy', res);
|
||||
if (res.status == true) {
|
||||
filter_client_list = res.client_data;
|
||||
filter_branch_list = res.branch_data;
|
||||
appendfilterClients(res.client_data);
|
||||
} else {
|
||||
console.log('No data found');
|
||||
let client_id = $(this).val();
|
||||
if (filter_branch_list != '') {
|
||||
// console.log(branch_list[client_id]);
|
||||
let data = filter_branch_list[client_id];
|
||||
appendfilterBranch(data);
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
})
|
||||
});
|
||||
|
||||
//----- AJAX FUNCTIONS --------------------------------------------------------------------------------
|
||||
|
||||
function fetchTicketListData() {
|
||||
|
||||
var issuer_type = $('#filter_issuer_type').val();
|
||||
var lead_type = $('#filter_lead_type').val();
|
||||
var policy_type = $('#filter_policy_type').val();
|
||||
var client_type = $('#filter_client_type').val();
|
||||
var status = $('#filter_lead_status').val();
|
||||
var client_id = $('#filter_client_id').val();
|
||||
var client_branch_id = $('#filter_client_branch_id').val();
|
||||
|
||||
var requestData = {
|
||||
issuer: issuer_type,
|
||||
lead_type: lead_type,
|
||||
policy_type_id: policy_type,
|
||||
client_type: client_type,
|
||||
status: status,
|
||||
client_id: client_id,
|
||||
client_branch_id: client_branch_id,
|
||||
};
|
||||
|
||||
console.log("requestData", requestData);
|
||||
|
||||
var url = '<?= base_url('/leads/list') ?>';
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
sendAjaxRequestForGlobal(url, 'POST', requestData, function(response) {
|
||||
|
||||
console.log('Filter Responce', response);
|
||||
|
||||
if (response.status == true) {
|
||||
|
||||
$('#lead_list_div').empty();
|
||||
$('#lead_list_div').html(response.html);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
setTimeout(function() {
|
||||
additionalDropdown();
|
||||
}, 1000);
|
||||
|
||||
} else {
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
let message = response.message;
|
||||
toastr.error(message, 'ERROR');
|
||||
}
|
||||
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
toastr.error('An error occurred while fetching the data.', 'ERROR');
|
||||
|
||||
//----- END AJAX FUNCTIONS --------------------------------------------------------------------------------
|
||||
|
||||
|
||||
function appendfilterClients(data) {
|
||||
|
||||
$('#filter_client_id').empty();
|
||||
|
||||
$('#filter_client_id').append($('<option>', {
|
||||
value: 0,
|
||||
text: 'Select'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.client_name,
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
});
|
||||
|
||||
$('#filter_client_id').append(option);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function appendfilterBranch(data) {
|
||||
|
||||
$('#filter_client_branch_id').empty();
|
||||
|
||||
$('#filter_client_branch_id').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.branch_name
|
||||
});
|
||||
$('#filter_client_branch_id').append(option);
|
||||
});
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
|
||||
function additionalDropdown() {
|
||||
const table = document.getElementById("tickets-table");
|
||||
if (!table) return; // Prevent errors if the table is not found
|
||||
let activeDropdown = null;
|
||||
|
||||
function handleDropdownClick(row, event) {
|
||||
// Hide any active dropdown
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
}
|
||||
|
||||
let customDropdown = row.customDropdown;
|
||||
if (!customDropdown) {
|
||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||
if (!originalDropdown) return;
|
||||
|
||||
customDropdown = document.createElement('div');
|
||||
customDropdown.className = 'custom-dropdown-menu';
|
||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||
|
||||
document.body.appendChild(customDropdown);
|
||||
row.customDropdown = customDropdown;
|
||||
|
||||
// Preserve click handlers and add auto-close
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function (e) {
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) eval(onclickAttr);
|
||||
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#') window.location.href = href;
|
||||
|
||||
customDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
|
||||
e.stopPropagation();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Get click position
|
||||
const rect = event.target.getBoundingClientRect();
|
||||
|
||||
// Position the dropdown
|
||||
customDropdown.style.display = 'block';
|
||||
customDropdown.style.position = 'fixed';
|
||||
customDropdown.style.left = `${rect.left}px`;
|
||||
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||
|
||||
activeDropdown = customDropdown;
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
// Add click event listener to rows
|
||||
table.querySelectorAll("tbody tr").forEach(row => {
|
||||
row.addEventListener("click", function (event) {
|
||||
if (!event.target.closest('td:last-child')) {
|
||||
handleDropdownClick(row, event);
|
||||
//function for fetch client, branch
|
||||
function getfilterClientAndBranch() {
|
||||
$.ajax({
|
||||
url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>',
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
|
||||
console.log('getClientAndBranchAndPolicy', res);
|
||||
if (res.status == true) {
|
||||
filter_client_list = res.client_data;
|
||||
filter_branch_list = res.branch_data;
|
||||
appendfilterClients(res.client_data);
|
||||
} else {
|
||||
console.log('No data found');
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Close dropdown when clicking outside
|
||||
document.addEventListener("click", function () {
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
//----- END AJAX FUNCTIONS --------------------------------------------------------------------------------
|
||||
|
||||
|
||||
function appendfilterClients(data) {
|
||||
|
||||
$('#filter_client_id').empty();
|
||||
|
||||
$('#filter_client_id').append($('<option>', {
|
||||
value: 0,
|
||||
text: 'Select'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.client_name,
|
||||
});
|
||||
|
||||
$('#filter_client_id').append(option);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function appendfilterBranch(data) {
|
||||
|
||||
$('#filter_client_branch_id').empty();
|
||||
|
||||
$('#filter_client_branch_id').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.branch_name
|
||||
});
|
||||
$('#filter_client_branch_id').append(option);
|
||||
});
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
|
||||
function additionalDropdown() {
|
||||
const table = document.getElementById("tickets-table");
|
||||
if (!table) return; // Prevent errors if the table is not found
|
||||
let activeDropdown = null;
|
||||
|
||||
function handleDropdownClick(row, event) {
|
||||
// Hide any active dropdown
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
}
|
||||
|
||||
let customDropdown = row.customDropdown;
|
||||
if (!customDropdown) {
|
||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||
if (!originalDropdown) return;
|
||||
|
||||
customDropdown = document.createElement('div');
|
||||
customDropdown.className = 'custom-dropdown-menu';
|
||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||
|
||||
document.body.appendChild(customDropdown);
|
||||
row.customDropdown = customDropdown;
|
||||
|
||||
// Preserve click handlers and add auto-close
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function(e) {
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) eval(onclickAttr);
|
||||
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#') window.location.href = href;
|
||||
|
||||
customDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
|
||||
e.stopPropagation();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Get click position
|
||||
const rect = event.target.getBoundingClientRect();
|
||||
|
||||
// Position the dropdown
|
||||
customDropdown.style.display = 'block';
|
||||
customDropdown.style.position = 'fixed';
|
||||
customDropdown.style.left = `${rect.left}px`;
|
||||
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||
|
||||
activeDropdown = customDropdown;
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Add click event listener to rows
|
||||
table.querySelectorAll("tbody tr").forEach(row => {
|
||||
row.addEventListener("click", function(event) {
|
||||
if (!event.target.closest('td:last-child')) {
|
||||
handleDropdownClick(row, event);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Close dropdown when clicking outside
|
||||
document.addEventListener("click", function() {
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@ -62,7 +62,8 @@
|
||||
border-radius: 6px;
|
||||
position: absolute;
|
||||
z-index: 999;
|
||||
bottom: 125%; /* Show above icon */
|
||||
bottom: 125%;
|
||||
/* Show above icon */
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
font-size: 12px;
|
||||
@ -73,7 +74,8 @@
|
||||
.info-tooltip::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 100%; /* Arrow below tooltip */
|
||||
top: 100%;
|
||||
/* Arrow below tooltip */
|
||||
left: 50%;
|
||||
margin-left: -5px;
|
||||
border-width: 5px;
|
||||
@ -86,25 +88,29 @@
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* dont forgot it keep it safe card and card body space remover */ /* bcoz in design */
|
||||
.card-body{ margin-top: 0px !important; }
|
||||
/* dont forgot it keep it safe card and card body space remover */
|
||||
/* bcoz in design */
|
||||
.card-body {
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
/* this css as per design so not declare in golbal */ /* bcoz in design */
|
||||
#collapseOne{
|
||||
/* this css as per design so not declare in golbal */
|
||||
/* bcoz in design */
|
||||
#collapseOne {
|
||||
border: 1px solid #BFF3F5 !important;
|
||||
border-radius: 10px !important;
|
||||
border-width: 1px !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="row" id="leads_form">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="margin-bottom:1rem;">
|
||||
<div class="container-fluid-min">
|
||||
<div class="row" id="leads_form">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="margin-bottom:1rem;">
|
||||
|
||||
<!-- <div class="col-6" style="align-self: center;">
|
||||
<!-- <div class="col-6" style="align-self: center;">
|
||||
<h4 id="page_title" style="position: relative;">Add Lead</h4>
|
||||
</div>
|
||||
<div class="col-3" style="text-align: right; position: relative; left: 211px;">
|
||||
@ -114,93 +120,93 @@
|
||||
<a href="<?= base_url('leads/list') ?>" type="button" id="btnAdd"
|
||||
class="btn btn-primary waves-effect waves-light">Back</a>
|
||||
</div> -->
|
||||
<h4 class="d-flex align-items-center" style="gap: 8px;">
|
||||
<a href="<?= base_url('leads/list') ?>" style="cursor: pointer;">
|
||||
<i class="mdi mdi-chevron-left" style="font-size: 43px;"></i>
|
||||
</a>
|
||||
<span class="title-text" id="page_title" style="position: relative;">Add Lead</span>
|
||||
</h4>
|
||||
</div>
|
||||
<form role="form" class="parsley-examples" method="post" id="leads_form_id"
|
||||
enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="id" id="leads_primarykey">
|
||||
|
||||
<div class="card" id="collapseOne">
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="lead_type">Lead Type<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="lead_type" name="lead_type" required>
|
||||
<option value="">Select Lead Type</option>
|
||||
<?php
|
||||
if (isset($lead_type) && count($lead_type)) {
|
||||
foreach ($lead_type as $key => $value) {
|
||||
if ($key == 1) {
|
||||
echo "<option value=" . $key . " selected>" . $value . "</option>";
|
||||
} else {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="issuer">Issuer<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="issuer" name="issuer" required>
|
||||
<option value="">Select Issuer</option>
|
||||
<?php
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="d-flex align-items-center" style="gap: 8px;">
|
||||
<a href="<?= base_url('leads/list') ?>" style="cursor: pointer;">
|
||||
<i class="mdi mdi-chevron-left" style="font-size: 43px;"></i>
|
||||
</a>
|
||||
<span class="title-text" id="page_title" style="position: relative;">Add Lead</span>
|
||||
</h4>
|
||||
</div>
|
||||
<form role="form" class="parsley-examples" method="post" id="leads_form_id"
|
||||
enctype="multipart/form-data">
|
||||
|
||||
<!-- <hr> --> <!-- bcoz removed in design -->
|
||||
<input type="hidden" name="id" id="leads_primarykey">
|
||||
|
||||
<!-- client row -->
|
||||
<div class="card" id="collapseOne">
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
<div class="card" id="collapseOne">
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group offset-md-10 col-md-2 freshFields" style="float:right;">
|
||||
<label class="switch">
|
||||
<input id="exixting_client" type="checkbox" name="exixting_client">
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="lead_type">Lead Type<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="lead_type" name="lead_type" required>
|
||||
<option value="">Select Lead Type</option>
|
||||
<?php
|
||||
if (isset($lead_type) && count($lead_type)) {
|
||||
foreach ($lead_type as $key => $value) {
|
||||
if ($key == 1) {
|
||||
echo "<option value=" . $key . " selected>" . $value . "</option>";
|
||||
} else {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="issuer">Issuer<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="issuer" name="issuer" required>
|
||||
<option value="">Select Issuer</option>
|
||||
<?php
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label for="exixting_client" style="position: relative;top: 2px;">Existing Client</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-row">
|
||||
</div>
|
||||
|
||||
<!-- <hr> --> <!-- bcoz removed in design -->
|
||||
|
||||
<!-- client row -->
|
||||
<div class="card" id="collapseOne">
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group offset-md-10 col-md-2 freshFields" style="float:right;">
|
||||
<label class="switch">
|
||||
<input id="exixting_client" type="checkbox" name="exixting_client">
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
|
||||
<label for="exixting_client" style="position: relative;top: 2px;">Existing Client</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4 renewalFields" style="display: none;">
|
||||
<label for="client_id">Client<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="client_id" name="client_id">
|
||||
<option value="">Select Client</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-4 renewalFields" style="display: none;">
|
||||
<label for="client_branch_id">Branch<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="client_branch_id" name="client_branch_id"
|
||||
onchange="getBranchData(this,1)">
|
||||
<option value="">Select Branch</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-4 renewalFields" style="display: none;">
|
||||
<label for="client_id">Client<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="client_id" name="client_id">
|
||||
<option value="">Select Client</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- <div class="form-group col-md-3 freshFields">
|
||||
<div class="form-group col-md-4 renewalFields" style="display: none;">
|
||||
<label for="client_branch_id">Branch<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="client_branch_id" name="client_branch_id"
|
||||
onchange="getBranchData(this,1)">
|
||||
<option value="">Select Branch</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- <div class="form-group col-md-3 freshFields">
|
||||
<label for="client_type">Client Type<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="client_type" name="client_type" required>
|
||||
<option value="">Select Client type</option>
|
||||
@ -214,33 +220,33 @@
|
||||
</select>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group col-md-4 freshFields">
|
||||
<label for="entity_type_id">Entity Type<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="entity_type_id" name="entity_type_id" required>
|
||||
<option value="" selected>Select Entity</option>
|
||||
<?php
|
||||
if (isset($entity) && count($entity)) {
|
||||
foreach ($entity as $key => $value) {
|
||||
echo "<option value=" . $value['id'] . ">" . $value['name'] . "</option>";
|
||||
<div class="form-group col-md-4 freshFields">
|
||||
<label for="entity_type_id">Entity Type<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="entity_type_id" name="entity_type_id" required>
|
||||
<option value="" selected>Select Entity</option>
|
||||
<?php
|
||||
if (isset($entity) && count($entity)) {
|
||||
foreach ($entity as $key => $value) {
|
||||
echo "<option value=" . $value['id'] . ">" . $value['name'] . "</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4 freshFields">
|
||||
<label for="client_name">Client Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="client_name" name="client_name"
|
||||
placeholder="Enter Client Name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4 freshFields">
|
||||
<label for="client_name">Client Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="client_name" name="client_name"
|
||||
placeholder="Enter Client Name" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4 freshFields">
|
||||
<label for="client_short_name">Client Short Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="client_short_name" name="client_short_name"
|
||||
placeholder="Enter Client Short Name" onkeyup="validateInput(this, 'clients', 'short_name')" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4 freshFields">
|
||||
<label for="client_short_name">Client Short Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="client_short_name" name="client_short_name"
|
||||
placeholder="Enter Client Short Name" onkeyup="validateInput(this, 'clients', 'short_name')" required>
|
||||
</div>
|
||||
|
||||
<!-- <div class="form-group col-md-3 renewalFields" style="display: none;">
|
||||
<!-- <div class="form-group col-md-3 renewalFields" style="display: none;">
|
||||
<label for="source_policy_id"> Source Policy <span id="base_danger"
|
||||
class="text-danger">*</span></label>
|
||||
<select class="form-control" id="source_policy_id" name="source_policy_id">
|
||||
@ -258,162 +264,165 @@
|
||||
<input type="text" class="form-control" id="source_policy_end_date" name="source_policy_end_date" readonly>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<label for="pan">PAN<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="pan" placeholder="Enter PAN Number"
|
||||
data-parsley-error-message="Invalid PAN Number. Example: ABCDE1234F" name="pan"
|
||||
data-parsley-trigger="change" data-parsley-pattern="^[A-Z]{5}[0-9]{4}[A-Z]$">
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end client row -->
|
||||
<!-- end client row -->
|
||||
|
||||
<!-- <hr> --> <!-- bcoz removed in design -->
|
||||
<!-- <hr> --> <!-- bcoz removed in design -->
|
||||
|
||||
<!-- branch row-->
|
||||
<div class="card" id="collapseOne">
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
<!-- branch row-->
|
||||
<div class="card" id="collapseOne">
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="gst">GST<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="gst" placeholder="Enter GST Number"
|
||||
data-parsley-error-message="Invalid GST Number. Example: 12ABCDE1234F5Z6" name="gst"
|
||||
data-parsley-trigger="change"
|
||||
data-parsley-pattern="^\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}$" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="client_branch">Branch Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="branch_name" name="branch_name"
|
||||
placeholder="Enter Branch Name" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="client_branch">Branch Code<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="branch_code" name="branch_code"
|
||||
placeholder="Enter Branch Code" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4 renewalFields">
|
||||
<label for="contact_person_summary">Contact Person</label>
|
||||
<select class="form-control" name="contact_person_summary" id="contact_person_summary">
|
||||
<option value="">Select a Contact</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4 freshFields">
|
||||
<label for="client_branch">Contact Person Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="contact_person_name" name="contact_person_name"
|
||||
placeholder="Enter Contact Name" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="contact_person_mobile">Contact Person Mobile<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="contact_person_mobile"
|
||||
name="contact_person_mobile" placeholder="Enter Contact Mobile" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="contact_person_email">Contact Person Email<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="contact_person_email"
|
||||
name="contact_person_email" placeholder="Enter Contact Email" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="gst">GST<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="gst" placeholder="Enter GST Number"
|
||||
data-parsley-error-message="Invalid GST Number. Example: 12ABCDE1234F5Z6" name="gst"
|
||||
data-parsley-trigger="change"
|
||||
data-parsley-pattern="^\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}$" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="client_branch">Branch Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="branch_name" name="branch_name"
|
||||
placeholder="Enter Branch Name" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="client_branch">Branch Code<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="branch_code" name="branch_code"
|
||||
placeholder="Enter Branch Code" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4 renewalFields">
|
||||
<label for="contact_person_summary">Contact Person</label>
|
||||
<select class="form-control" name="contact_person_summary" id="contact_person_summary">
|
||||
<option value="">Select a Contact</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4 freshFields">
|
||||
<label for="client_branch">Contact Person Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="contact_person_name" name="contact_person_name"
|
||||
placeholder="Enter Contact Name" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="contact_person_mobile">Contact Person Mobile<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="contact_person_mobile"
|
||||
name="contact_person_mobile" placeholder="Enter Contact Mobile" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="contact_person_email">Contact Person Email<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="contact_person_email"
|
||||
name="contact_person_email" placeholder="Enter Contact Email" required>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- policy row -->
|
||||
<div class="card" id="collapseOne">
|
||||
<div class="card-body">
|
||||
<div id="dynamic-form-container"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <hr> --> <!-- bcoz removed in design -->
|
||||
|
||||
<!-- other row -->
|
||||
<div class="card" id="collapseOne">
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group offset-md-9 col-md-3" style="float:right;">
|
||||
<label class="switch">
|
||||
<input id="is_insurer_auto_mail" type="checkbox" name="is_insurer_auto_mail">
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
<label for="is_insurer_auto_mail" style="position: relative;top: 2px;">Insurer Auto Mail</label>
|
||||
</div>
|
||||
|
||||
<!-- policy row -->
|
||||
<div class="card" id="collapseOne">
|
||||
<div class="card-body">
|
||||
<div id="dynamic-form-container"></div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
</div>
|
||||
<!-- <hr> --> <!-- bcoz removed in design -->
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="salse_person_id">Sales Person<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="salse_person_id" name="salse_person_id" multiple required>
|
||||
<option value="">Select Sales Person</option>
|
||||
<?php if (isset($salse_team)) { ?>
|
||||
<?php foreach ($salse_team as $value) { ?>
|
||||
<option value="<?= $value['id']; ?>">
|
||||
<?= $value['first_name']; ?>
|
||||
</option>
|
||||
<!-- other row -->
|
||||
<div class="card" id="collapseOne">
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group offset-md-9 col-md-3" style="float:right;">
|
||||
<label class="switch">
|
||||
<input id="is_insurer_auto_mail" type="checkbox" name="is_insurer_auto_mail">
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
<label for="is_insurer_auto_mail" style="position: relative;top: 2px;">Insurer Auto Mail</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="salse_person_id">Sales Person<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="salse_person_id" name="salse_person_id" multiple required>
|
||||
<option value="">Select Sales Person</option>
|
||||
<?php if (isset($salse_team)) { ?>
|
||||
<?php foreach ($salse_team as $value) { ?>
|
||||
<option value="<?= $value['id']; ?>">
|
||||
<?= $value['first_name']; ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="status"> Status <span id="base_danger" class="text-danger">*</span></label>
|
||||
<select class="form-control" id="lead_status" name="status" required>
|
||||
<option value="" selected>Select Status</option>
|
||||
<?php
|
||||
if (isset($lead_status) && count($lead_status)) {
|
||||
foreach ($lead_status as $key => $value) {
|
||||
if ($key == 'queued') {
|
||||
echo "<option value=" . $key . " selected>" . $value . "</option>";
|
||||
} else {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
<div class="form-group col-md-4">
|
||||
<label for="status"> Status <span id="base_danger" class="text-danger">*</span></label>
|
||||
<select class="form-control" id="lead_status" name="status" required>
|
||||
<option value="" selected>Select Status</option>
|
||||
<?php
|
||||
if (isset($lead_status) && count($lead_status)) {
|
||||
foreach ($lead_status as $key => $value) {
|
||||
if ($key == 'queued') {
|
||||
echo "<option value=" . $key . " selected>" . $value . "</option>";
|
||||
} else {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="">Next Reminder Date<span class="text-danger"></span></label>
|
||||
<div class="input-icon">
|
||||
<input type="text" class="form-control" id="next_reminder_date" name="next_reminder_date" placeholder="DD/MM/YYYY">
|
||||
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="notes">Remarks</label>
|
||||
<textarea class="form-control" id="notes" name="notes" rows="4"></textarea>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="">Next Reminder Date<span class="text-danger"></span></label>
|
||||
<div class="input-icon">
|
||||
<input type="text" class="form-control" id="next_reminder_date" name="next_reminder_date" placeholder="DD/MM/YYYY">
|
||||
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="notes">Remarks</label>
|
||||
<textarea class="form-control" id="notes" name="notes" rows="4"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0" id="submitButton">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="lead_form_submit_btn" >Submit</button>
|
||||
</div>
|
||||
<div class="form-group text-right m-b-0" id="submitButton">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="lead_form_submit_btn">Submit</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end form row -->
|
||||
</div><!-- end form row -->
|
||||
|
||||
<?php include("newClientModal.php") ?>
|
||||
</div>
|
||||
|
||||
|
||||
<?php include("newClientModal.php") ?>
|
||||
|
||||
|
||||
<script>
|
||||
@ -499,8 +508,8 @@
|
||||
// }
|
||||
}
|
||||
});
|
||||
}else if (lead_type == 3) {
|
||||
|
||||
} else if (lead_type == 3) {
|
||||
|
||||
if ($('#client_id option[value="add_client"]').length === 0) {
|
||||
$('#client_id').prepend($('<option>', {
|
||||
value: 'add_client',
|
||||
@ -508,43 +517,43 @@
|
||||
}));
|
||||
}
|
||||
$("#source_policy_id").removeAttr("required");
|
||||
$("#source_policy_id").closest("div") .find("label .text-danger").remove();
|
||||
$("#source_policy_id").closest("div").find("label .text-danger").remove();
|
||||
$("#source_policy_id").hide();
|
||||
$('#source_policy_id').closest('.form-group').hide();
|
||||
|
||||
$("#source_policy_start_date").removeAttr("required");
|
||||
$("#source_policy_start_date").closest("div") .find("label .text-danger").remove();
|
||||
$("#source_policy_start_date").closest("div").find("label .text-danger").remove();
|
||||
$("#source_policy_start_date").hide();
|
||||
$('#source_policy_start_date').closest('.form-group').hide();
|
||||
|
||||
$("#source_policy_end_date").removeAttr("required");
|
||||
$("#source_policy_end_date").closest("div") .find("label .text-danger").remove();
|
||||
$("#source_policy_end_date").closest("div").find("label .text-danger").remove();
|
||||
$("#source_policy_end_date").hide();
|
||||
$('#source_policy_end_date').closest('.form-group').hide();
|
||||
|
||||
|
||||
|
||||
|
||||
} else if (lead_type != 3) {
|
||||
$("#source_policy_id").prop("required",true);
|
||||
$("#source_policy_id").prop("required", true);
|
||||
$("#source_policy_start_date").prop("required", true);
|
||||
$("#source_policy_end_date").prop("required", true);
|
||||
|
||||
$("#source_policy_id").show();
|
||||
$("#source_policy_start_date").show();
|
||||
$("#source_policy_start_date").show();
|
||||
$("#source_policy_id").show();
|
||||
$("#source_policy_start_date").show();
|
||||
$("#source_policy_start_date").show();
|
||||
|
||||
$('#source_policy_id').closest('.form-group').find('label').show();
|
||||
$('#source_policy_start_date').closest('.form-group').find('label').show();
|
||||
$('#source_policy_end_date').closest('.form-group').find('label').show();
|
||||
$('#source_policy_id').closest('.form-group').find('label').show();
|
||||
$('#source_policy_start_date').closest('.form-group').find('label').show();
|
||||
$('#source_policy_end_date').closest('.form-group').find('label').show();
|
||||
|
||||
// Check if the asterisk doesn't already exist, then add it
|
||||
let $label = $("#source_policy_id").closest("div") .find("label");
|
||||
let $label = $("#source_policy_id").closest("div").find("label");
|
||||
|
||||
if ($label.find(".text-danger").length === 0) {
|
||||
$label.append(' <span class="text-danger">*</span>');
|
||||
}
|
||||
|
||||
let $label2 = $("#source_policy_start_date").closest("div") .find("label");
|
||||
let $label2 = $("#source_policy_start_date").closest("div").find("label");
|
||||
|
||||
if ($label2.find(".text-danger").length === 0) {
|
||||
$label2.append(' <span class="text-danger">*</span>');
|
||||
@ -563,7 +572,7 @@
|
||||
|
||||
}
|
||||
|
||||
if(lead_type != 1){
|
||||
if (lead_type != 1) {
|
||||
dataIncrement = 1;
|
||||
// updateRenewalFields(dataIncrement);
|
||||
|
||||
@ -623,8 +632,8 @@
|
||||
maxDate: "today"
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
//------------------------------ GET DATA ( EDIT, BRANCH, POLICY ) ---------------------------------------------------------------------------
|
||||
|
||||
//view and edit Lead data function ( NOT IN USE DON'T DELETE )
|
||||
@ -700,7 +709,7 @@
|
||||
|
||||
let lead_type = $('#lead_type').val();
|
||||
var policyStartDate = $("#source_policy_start_date");
|
||||
if(lead_type == 3){
|
||||
if (lead_type == 3) {
|
||||
policyStartDate = $("#policy_start_date");
|
||||
}
|
||||
console.log('Selected Dates:', selectedDates);
|
||||
@ -801,7 +810,7 @@
|
||||
//client branch data
|
||||
function getBranchData(input, inputType) {
|
||||
|
||||
if (inputType == 1 ) {
|
||||
if (inputType == 1) {
|
||||
var client_branch_id = $(input).val();
|
||||
} else {
|
||||
client_branch_id = input;
|
||||
@ -826,11 +835,11 @@
|
||||
$('#pan').val(res.data.pan);
|
||||
$('#branch_name').val(res.data.branch_name);
|
||||
$('#branch_code').val(res.data.branch_code);
|
||||
allContacts = res.contact;
|
||||
allContacts = res.contact;
|
||||
$('#contact_person_summary').empty();
|
||||
$('#contact_person_summary').append($('<option>', {
|
||||
value: "",
|
||||
text: "Select a Contact"
|
||||
value: "",
|
||||
text: "Select a Contact"
|
||||
}));
|
||||
|
||||
res.contact.forEach((value, key) => {
|
||||
@ -845,8 +854,8 @@
|
||||
text: display_value
|
||||
}));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
// $('#contact_person_name').val(res?.contact?.name || '');
|
||||
// $('#contact_person_mobile').val(res?.contact?.mobile || '');
|
||||
// $('#contact_person_email').val(res?.contact?.email || '');
|
||||
@ -911,7 +920,7 @@
|
||||
|
||||
console.log("res.data.source_policy_start_date", res.data.source_policy_start_date)
|
||||
console.log("res.data.source_policy_end_date", res.data.source_policy_end_date)
|
||||
|
||||
|
||||
$('#source_policy_start_date').val(res.data.source_policy_start_date);
|
||||
$('#source_policy_end_date').val(res.data.source_policy_end_date);
|
||||
|
||||
@ -1024,7 +1033,7 @@
|
||||
console.log(response.message, 'SUCCESS');
|
||||
$('#appendArea_' + dataIncrement).append(response.data);
|
||||
|
||||
console.log("Policy Type ID : ",policy_type_id);
|
||||
console.log("Policy Type ID : ", policy_type_id);
|
||||
if (policy_type_id == 1 || policy_type_id == 6 || policy_type_id == 7) {
|
||||
|
||||
let newId = 'appendAreaForClaim_' + dataIncrement;
|
||||
@ -1052,10 +1061,10 @@
|
||||
$('.lifeClaimFields').show();
|
||||
} else {
|
||||
|
||||
if(lead_type == 1){
|
||||
if (lead_type == 1) {
|
||||
updateRenewalFields(dataIncrement);
|
||||
}
|
||||
|
||||
|
||||
// let incurred_claim_date_id = 'incurred_claim_date_' + dataIncrement;
|
||||
let incurred_claim_date_id = 'incurred_claim_date';
|
||||
var incurred_claim_datepicker = flatpickr("#" + incurred_claim_date_id, {
|
||||
@ -1070,10 +1079,10 @@
|
||||
console.log('Extracted increment:', increment);
|
||||
|
||||
var policyStartDate = $("#source_policy_start_date");
|
||||
if(lead_type == 3){
|
||||
if (lead_type == 3) {
|
||||
policyStartDate = $("#policy_start_date");
|
||||
}
|
||||
|
||||
|
||||
console.log('Selected Dates:', selectedDates);
|
||||
console.log('policy start date instance', policyStartDate)
|
||||
console.log('Policy Start Date:', policyStartDate.val());
|
||||
@ -1121,8 +1130,8 @@
|
||||
newRow.className = 'form-row dynamic-form-row';
|
||||
|
||||
if (increment > 1) {
|
||||
const hrElement = document.createElement('hr');
|
||||
container.appendChild(hrElement);
|
||||
const hrElement = document.createElement('hr');
|
||||
container.appendChild(hrElement);
|
||||
}
|
||||
|
||||
// Main div
|
||||
@ -1458,8 +1467,8 @@
|
||||
console.log('Lead Type:', lead_type);
|
||||
|
||||
let increment = input.id.split('_').pop(); // Extract increment
|
||||
if(lead_type == 1){
|
||||
return;
|
||||
if (lead_type == 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
let input_id = input.id;
|
||||
@ -1476,9 +1485,9 @@
|
||||
policyStartDateInput = $('#source_policy_start_date');
|
||||
console.log('Using Source Policy Start Date:', sourcePolicyDateVal);
|
||||
} else if (policyStartDateVal) {
|
||||
if(input_id == "policy_start_date_1"){
|
||||
if (input_id == "policy_start_date_1") {
|
||||
policyStartDateInput = $('#policy_start_date_1');
|
||||
}else{
|
||||
} else {
|
||||
policyStartDateInput = $('#policy_start_date');
|
||||
}
|
||||
console.log('Using Policy Start Date:', policyStartDateVal);
|
||||
@ -1522,7 +1531,7 @@
|
||||
|
||||
let annualised_claims = policy_run_days > 0 ? (incurred_claims / policy_run_days) * 365 : 0;
|
||||
// let annualised_claims_roundoff = annualised_claims.toFixed(2);
|
||||
let annualised_claims_roundoff = Math.trunc(annualised_claims);
|
||||
let annualised_claims_roundoff = Math.trunc(annualised_claims);
|
||||
|
||||
console.log('Annualised Claims:', annualised_claims);
|
||||
console.log('Annualised Claims (Rounded):', annualised_claims_roundoff);
|
||||
@ -1531,9 +1540,9 @@
|
||||
let premium_as_on_date = Number($('#premium_date').val()) || 0;
|
||||
console.log('Premium as on Date:', premium_as_on_date);
|
||||
|
||||
let incurred_claim_ratio = (incurred_claims > 0 && premium_as_on_date > 0)
|
||||
? (incurred_claims / premium_as_on_date) * 100
|
||||
: 0;
|
||||
let incurred_claim_ratio = (incurred_claims > 0 && premium_as_on_date > 0) ?
|
||||
(incurred_claims / premium_as_on_date) * 100 :
|
||||
0;
|
||||
let incurred_claim_ratio_roundoff = isFinite(incurred_claim_ratio) ? incurred_claim_ratio.toFixed(2) : 0;
|
||||
console.log('Incurred Claim Ratio:', incurred_claim_ratio);
|
||||
console.log('Incurred Claim Ratio (Rounded):', incurred_claim_ratio_roundoff);
|
||||
@ -1541,8 +1550,8 @@
|
||||
|
||||
let earned_premium = premium_as_on_date > 0 ? (premium_as_on_date / 365) * policy_run_days : 0;
|
||||
// let earned_premium_roundoff = earned_premium.toFixed(2);
|
||||
let earned_premium_roundoff = Math.trunc(earned_premium);
|
||||
|
||||
let earned_premium_roundoff = Math.trunc(earned_premium);
|
||||
|
||||
console.log('Earned Premium:', earned_premium);
|
||||
console.log('Earned Premium (Rounded):', earned_premium_roundoff);
|
||||
$('#earned_premium').val(earned_premium_roundoff);
|
||||
@ -1709,8 +1718,8 @@
|
||||
|
||||
$('#contact_person_summary').empty();
|
||||
$('#contact_person_summary').append($('<option>', {
|
||||
value: "",
|
||||
text: "Select a Contact"
|
||||
value: "",
|
||||
text: "Select a Contact"
|
||||
}));
|
||||
|
||||
$("#gst").val("");
|
||||
@ -1737,8 +1746,8 @@
|
||||
$("#client_branch_id").prop("selectedIndex", 0);
|
||||
$("#source_policy_id").empty();
|
||||
$('#source_policy_id').append($('<option>', {
|
||||
value: "",
|
||||
text: "Select a Policy"
|
||||
value: "",
|
||||
text: "Select a Policy"
|
||||
}));
|
||||
$("#pan").val("");
|
||||
|
||||
@ -1768,7 +1777,7 @@
|
||||
flatpickr("#" + incurred_claim_date_id, {
|
||||
dateFormat: "d/m/Y",
|
||||
allowInput: false,
|
||||
onChange: function (selectedDates) {
|
||||
onChange: function(selectedDates) {
|
||||
try {
|
||||
let increment = this.input.id.split('_').pop();
|
||||
let policyStartDate = $("#source_policy_start_date");
|
||||
@ -2053,7 +2062,7 @@
|
||||
$('#source_policy_start_date').closest('.form-group').show();
|
||||
$('#source_policy_end_date').closest('.form-group').show();
|
||||
|
||||
}else{
|
||||
} else {
|
||||
|
||||
$('#source_policy_id').hide();
|
||||
$('#source_policy_start_date').hide();
|
||||
@ -2124,12 +2133,12 @@
|
||||
});
|
||||
}
|
||||
|
||||
$('#exixting_client').change(function () {
|
||||
$('#exixting_client').change(function() {
|
||||
|
||||
$('#contact_person_summary').empty();
|
||||
$('#contact_person_summary').append($('<option>', {
|
||||
value: "",
|
||||
text: "Select a Contact"
|
||||
value: "",
|
||||
text: "Select a Contact"
|
||||
}));
|
||||
|
||||
$("#gst").val("");
|
||||
@ -2202,6 +2211,4 @@
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
</script>
|
||||
@ -1,43 +1,37 @@
|
||||
<style>
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
}
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
.col-12 {
|
||||
|
||||
|
||||
max-width: 98% !important;
|
||||
}
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
.right-align-input {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.right-align-input {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.center-align-input {
|
||||
text-align: center;
|
||||
}
|
||||
.center-align-input {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="col-12">
|
||||
<h4 class="ml-1 mb-3"> <span class="font-color-black">Outstanding</span> </h4>
|
||||
</div>
|
||||
|
||||
<div class="col-12" id="outstanding_filter">
|
||||
<div class="container-fluid-min">
|
||||
<div class="col-12" id="outstanding_filter">
|
||||
<div id="accordion" class="mb-3">
|
||||
<label id="filterAccordion" class="m-1 d-flex justify-content-between align-items-center">
|
||||
<span class="font-color-black">Filters</span>
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
<h4>Filters</h4>
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</label>
|
||||
<div class="card mb-1">
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
@ -45,16 +39,16 @@ table.dataTable tbody td {
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<label for="client_branch">Client<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="client_id" name="client_id">
|
||||
<option value="0">Select Client</option>
|
||||
<?php
|
||||
if (isset($clients) && count($clients)) {
|
||||
foreach ($clients as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['client_name'] . "</option>";
|
||||
}
|
||||
if (isset($clients) && count($clients)) {
|
||||
foreach ($clients as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['client_name'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div> -->
|
||||
@ -64,10 +58,10 @@ table.dataTable tbody td {
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="insurer_id" name="insurer_id">
|
||||
<option value="0" selected>Select Insurer</option>
|
||||
<?php if(isset($insurer) && count($insurer)){ ?>
|
||||
<?php foreach ($insurer as $value) { ?>
|
||||
<option value="<?= $value['id']?>"><?= $value['name']?></option>
|
||||
<?php } ?>
|
||||
<?php if (isset($insurer) && count($insurer)) { ?>
|
||||
<?php foreach ($insurer as $value) { ?>
|
||||
<option value="<?= $value['id'] ?>"><?= $value['name'] ?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
@ -77,10 +71,10 @@ table.dataTable tbody td {
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="insurer_id" name="insurer_id">
|
||||
<option value="0" selected>Select Insurer Branch</option>
|
||||
<?php if(isset($insurer) && count($insurer)){ ?>
|
||||
<?php foreach ($insurer as $value) { ?>
|
||||
<option value="<?= $value['id']?>"><?= $value['name']?></option>
|
||||
<?php } ?>
|
||||
<?php if (isset($insurer) && count($insurer)) { ?>
|
||||
<?php foreach ($insurer as $value) { ?>
|
||||
<option value="<?= $value['id'] ?>"><?= $value['name'] ?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
@ -90,30 +84,30 @@ table.dataTable tbody td {
|
||||
<select class="form-control" id="policy_type_id" name="policy_type_id">
|
||||
<option value="0">Select Policy Type</option>
|
||||
<?php
|
||||
if (isset($policy_types) && count($policy_types)) {
|
||||
foreach ($policy_types as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['policy_type'] . "</option>";
|
||||
}
|
||||
if (isset($policy_types) && count($policy_types)) {
|
||||
foreach ($policy_types as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['policy_type'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<label for="client_branch">Issuer<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="issuer" name="issuer" required>
|
||||
<option value="0">Select Issure</option>
|
||||
<?php
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div> -->
|
||||
|
||||
<!-- </div>
|
||||
<!-- </div>
|
||||
|
||||
<div class="form-row"> -->
|
||||
|
||||
@ -123,11 +117,11 @@ table.dataTable tbody td {
|
||||
onchange="hideDateField()">
|
||||
<option value="0">Select Date Type</option>
|
||||
<?php
|
||||
if (isset($date_type) && count($date_type)) {
|
||||
foreach ($date_type as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
}
|
||||
if (isset($date_type) && count($date_type)) {
|
||||
foreach ($date_type as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div> -->
|
||||
@ -135,7 +129,7 @@ table.dataTable tbody td {
|
||||
<div class="form-group col-md-4" style="display: true;" id="date_div">
|
||||
<label>Statement Month<span class="text-danger"></span></label>
|
||||
<div class="input-icon">
|
||||
<input type="text" id="reportrange" class="form-control" readonly style="caret-color: transparent;">
|
||||
<input type="text" id="reportrange" class="form-control" readonly style="caret-color: transparent;">
|
||||
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
|
||||
</div>
|
||||
<!--
|
||||
@ -164,319 +158,319 @@ table.dataTable tbody td {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12" id="outstanding_list">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Outstanding Report</h4>
|
||||
</div>
|
||||
|
||||
<div class="col-12" id="outstanding_list">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Outstanding Report</h4>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th>S.No</th>
|
||||
<!-- <th>Client Name</th> -->
|
||||
<th>Insurer</th>
|
||||
<th>Insurer<br> Branch</th>
|
||||
<th>Statement<br> Month</th>
|
||||
<th>Statement<br> No</th>
|
||||
<th>Invoice No</th>
|
||||
<th>Invoice Status</th>
|
||||
<th>Invoice Date</th>
|
||||
<th>Invoice Amount</th>
|
||||
<th>Realization <br>Amount</th>
|
||||
<th>Outstanding <br>Amount</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
// dd($outstanting_list);
|
||||
if (isset($outstanting_list)) { ?>
|
||||
<?php foreach($outstanting_list as $index => $row){ ?>
|
||||
<div class="table-responsive">
|
||||
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<td><?= $index + 1 ?></td>
|
||||
<td><?php echo $row['short_name']; ?></td>
|
||||
<td><?php echo $row['branch_name']; ?></td>
|
||||
<td><?php echo change_date_format($row['month'],'Y-m-d','Y-m') ?></td>
|
||||
<td><?php echo $row['stmt_sno']; ?></td>
|
||||
<td><?php echo $row['invoice_no']; ?></td>
|
||||
<td class="center-align-input"><?php echo isset($row['invoice_status']) ? $row['invoice_status'] : ' - '; ?></td>
|
||||
<td><?php echo change_date_format($row['invoice_date'],'Y-m-d','d-M-Y'); ?></td>
|
||||
<td class="right-align-input"><?php echo isset($row['invoice_amount']) ? $row['invoice_amount'] : '0.00'; ?></td>
|
||||
<td class="right-align-input"><?php echo isset($row['total_paid']) ? $row['total_paid'] : '0.00'; ?></td>
|
||||
<td class="right-align-input"><?php echo isset($row['outstanding_amount']) ? $row['outstanding_amount'] : '0.00'; ?></td>
|
||||
<th>S.No</th>
|
||||
<!-- <th>Client Name</th> -->
|
||||
<th>Insurer</th>
|
||||
<th>Insurer<br> Branch</th>
|
||||
<th>Statement<br> Month</th>
|
||||
<th>Statement<br> No</th>
|
||||
<th>Invoice No</th>
|
||||
<th>Invoice Status</th>
|
||||
<th>Invoice Date</th>
|
||||
<th>Invoice Amount</th>
|
||||
<th>Realization <br>Amount</th>
|
||||
<th>Outstanding <br>Amount</th>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
<div>
|
||||
// dd($outstanting_list);
|
||||
if (isset($outstanting_list)) { ?>
|
||||
<?php foreach ($outstanting_list as $index => $row) { ?>
|
||||
<tr>
|
||||
<td><?= $index + 1 ?></td>
|
||||
<td><?php echo $row['short_name']; ?></td>
|
||||
<td><?php echo $row['branch_name']; ?></td>
|
||||
<td><?php echo change_date_format($row['month'], 'Y-m-d', 'Y-m') ?></td>
|
||||
<td><?php echo $row['stmt_sno']; ?></td>
|
||||
<td><?php echo $row['invoice_no']; ?></td>
|
||||
<td class="center-align-input"><?php echo isset($row['invoice_status']) ? $row['invoice_status'] : ' - '; ?></td>
|
||||
<td><?php echo change_date_format($row['invoice_date'], 'Y-m-d', 'd-M-Y'); ?></td>
|
||||
<td class="right-align-input"><?php echo isset($row['invoice_amount']) ? $row['invoice_amount'] : '0.00'; ?></td>
|
||||
<td class="right-align-input"><?php echo isset($row['total_paid']) ? $row['total_paid'] : '0.00'; ?></td>
|
||||
<td class="right-align-input"><?php echo isset($row['outstanding_amount']) ? $row['outstanding_amount'] : '0.00'; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#collapseOne').on('show.bs.collapse', function () {
|
||||
// When open
|
||||
$('#icon').removeClass('mdi-chevron-down').addClass('mdi-chevron-up');
|
||||
$('#filterAccordion').removeAttr("style"); // remove custom bg/border when open
|
||||
});
|
||||
|
||||
$('#collapseOne').on('hide.bs.collapse', function () {
|
||||
// When closed
|
||||
$('#icon').removeClass('mdi-chevron-up').addClass('mdi-chevron-down');
|
||||
// $('#filterAccordion').css({
|
||||
// "background-color": "#F5FFFF",
|
||||
// "border": "2px solid #F5FFFF",
|
||||
// "border-radius": "10px",
|
||||
// "box-shadow": "0px 4px 4px 0px #00000040"
|
||||
// });
|
||||
});
|
||||
});
|
||||
|
||||
// Datatable document ready
|
||||
$(document).ready(function() {
|
||||
|
||||
var ticketsTable = $('#scroll-horizontal-datatable');
|
||||
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [
|
||||
{
|
||||
extend: 'collection',
|
||||
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
|
||||
className: 'btn app-btn-secondary ',
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
customize: function(xlsx) {
|
||||
var sheet = xlsx.xl.worksheets['sheet1.xml'];
|
||||
var total = 0;
|
||||
|
||||
// Find cells in column AB (28th column in Excel)
|
||||
$('row c[r^="AB"]', sheet).each(function() {
|
||||
var value = parseFloat($('v', this)
|
||||
.text()); // Get the value inside the cell
|
||||
if (!isNaN(value)) {
|
||||
total += value;
|
||||
}
|
||||
});
|
||||
|
||||
// Get the last row index and append the total row
|
||||
var lastRow = $('row:last', sheet);
|
||||
var rowIndex = parseInt(lastRow.attr('r')) +
|
||||
2; // Find the next row index
|
||||
var totalRow = '<row r="' + rowIndex + '">' +
|
||||
'<c t="inlineStr" r="AA' + rowIndex +
|
||||
'"><is><t>Total</t></is></c>' + // Insert "Total" in AA
|
||||
'<c t="n" r="AB' + rowIndex + '"><v>' + total.toFixed(2) +
|
||||
'</v></c>' + // Insert sum in AB
|
||||
'</row>';
|
||||
|
||||
// Append the new total row to the sheet
|
||||
$(sheet).find('sheetData').append(totalRow);
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 25 // Set default number of rows per page (optional)
|
||||
$(document).ready(function() {
|
||||
$('#collapseOne').on('show.bs.collapse', function() {
|
||||
// When open
|
||||
$('#icon').removeClass('mdi-chevron-down').addClass('mdi-chevron-up');
|
||||
$('#filterAccordion').removeAttr("style"); // remove custom bg/border when open
|
||||
});
|
||||
} else {
|
||||
console.error("Table not found.");
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
getURLParams()
|
||||
$('#client_id').select2();
|
||||
$('#insurer_id').select2();
|
||||
$('#policy_type_id').select2();
|
||||
})
|
||||
|
||||
function fetchEmpolyeeList(event) {
|
||||
event.preventDefault(); // Prevent default action
|
||||
|
||||
var start_date = $('#startDate').val();
|
||||
var end_date = $('#endDate').val();
|
||||
var client_id = $('#client_id').val();
|
||||
var insurer_id = $('#insurer_id').val();
|
||||
var policy_type_id = $('#policy_type_id').val();
|
||||
var date_type = $('#date_type').val();
|
||||
var issuer = $('#issuer').val();
|
||||
|
||||
console.log(start_date + '-' + end_date);
|
||||
|
||||
var queryParams = {
|
||||
start_date: start_date,
|
||||
end_date: end_date,
|
||||
client_id: client_id,
|
||||
insurer_id: insurer_id,
|
||||
policy_type_id: policy_type_id,
|
||||
date_type: date_type,
|
||||
issuer: issuer,
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
const apiURL = $('#get-emp-list').attr('href') + "?" + queryString;
|
||||
console.log(apiURL);
|
||||
window.location.href = apiURL;
|
||||
}
|
||||
|
||||
function objectToQueryString(obj) {
|
||||
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
|
||||
}
|
||||
|
||||
function getURLParams() {
|
||||
const url = new URL(window.location.href);
|
||||
const params = new URLSearchParams(url.search);
|
||||
|
||||
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 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 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 issuer = params.get('issuer') || 0; // Default to 0 if not found
|
||||
|
||||
hideDateField(date_type)
|
||||
|
||||
console.log('startDate', startDate)
|
||||
console.log('endDate', endDate)
|
||||
console.log('client_id', client_id)
|
||||
console.log('insurer_id', insurer_id)
|
||||
console.log('policy_type_id', policy_type_id)
|
||||
console.log('date_type', date_type)
|
||||
console.log('issuer', issuer)
|
||||
|
||||
// Log the values or use them as needed
|
||||
console.log('Start Date:', startDate);
|
||||
console.log('End Date:', endDate);
|
||||
|
||||
if (startDate != 0 && endDate != 0) {
|
||||
setTimeout(function() {
|
||||
$('#start_date').val(startDate)
|
||||
$('#end_date').val(endDate)
|
||||
$('#client_id').val(client_id).change()
|
||||
$('#insurer_id').val(insurer_id).change()
|
||||
$('#policy_type_id').val(policy_type_id).change()
|
||||
$('#date_type').val(date_type)
|
||||
$('#issuer').val(issuer)
|
||||
}, 1000)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$(function() {
|
||||
|
||||
const url = new URL(window.location.href);
|
||||
const params = new URLSearchParams(url.search);
|
||||
|
||||
// Get start and end dates from URL parameters, or use default values
|
||||
const startDateParam = params.get('start_date') || moment().subtract(29, 'days').format('DD-MM-YYYY');
|
||||
const endDateParam = params.get('end_date') || moment().format('DD-MM-YYYY');
|
||||
|
||||
// Parse the dates to moment objects
|
||||
var start = moment(startDateParam, 'DD-MM-YYYY');
|
||||
var end = moment(endDateParam, 'DD-MM-YYYY');
|
||||
|
||||
// var start = moment().subtract(29, 'days');
|
||||
// var end = moment();
|
||||
|
||||
function cb(start, end) {
|
||||
// codeword : ***2***
|
||||
// if you cross check means also uncomment "star1star" (***1***)
|
||||
// $('#reportrange span').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
|
||||
$('#reportrange').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
|
||||
$('#startDate').val(start.format('DD-MM-YYYY'));
|
||||
$('#endDate').val(end.format('DD-MM-YYYY'));
|
||||
}
|
||||
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
// autoUpdateInput: false,
|
||||
locale: {
|
||||
format: 'DD-MM-YYYY' // 👈 force input format
|
||||
},
|
||||
ranges: {
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
}
|
||||
}, cb);
|
||||
|
||||
cb(start, end);
|
||||
|
||||
$('#clear-filters').on('click', function() {
|
||||
// Reset all select dropdowns to the first option
|
||||
$('#client_id').val('0').change();
|
||||
$('#insurer_id').val('0').change();
|
||||
$('#policy_type_id').val('0').change();
|
||||
$('#date_type').val('0');
|
||||
$('#issuer').val('0');
|
||||
$('#date_div').hide()
|
||||
|
||||
// Reset the date range picker to default
|
||||
$('#reportrange').data('daterangepicker').setStartDate(moment().subtract(29, 'days'));
|
||||
$('#reportrange').data('daterangepicker').setEndDate(moment());
|
||||
cb(start, end); // Update the displayed date range
|
||||
$('#collapseOne').on('hide.bs.collapse', function() {
|
||||
// When closed
|
||||
$('#icon').removeClass('mdi-chevron-up').addClass('mdi-chevron-down');
|
||||
// $('#filterAccordion').css({
|
||||
// "background-color": "#F5FFFF",
|
||||
// "border": "2px solid #F5FFFF",
|
||||
// "border-radius": "10px",
|
||||
// "box-shadow": "0px 4px 4px 0px #00000040"
|
||||
// });
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
// Datatable document ready
|
||||
$(document).ready(function() {
|
||||
|
||||
function hideDateField(input = null) {
|
||||
let val = $('#date_type').val();
|
||||
var ticketsTable = $('#scroll-horizontal-datatable');
|
||||
|
||||
if (input) {
|
||||
val = input;
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [{
|
||||
extend: 'collection',
|
||||
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
|
||||
className: 'btn app-btn-secondary ',
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
customize: function(xlsx) {
|
||||
var sheet = xlsx.xl.worksheets['sheet1.xml'];
|
||||
var total = 0;
|
||||
|
||||
// Find cells in column AB (28th column in Excel)
|
||||
$('row c[r^="AB"]', sheet).each(function() {
|
||||
var value = parseFloat($('v', this)
|
||||
.text()); // Get the value inside the cell
|
||||
if (!isNaN(value)) {
|
||||
total += value;
|
||||
}
|
||||
});
|
||||
|
||||
// Get the last row index and append the total row
|
||||
var lastRow = $('row:last', sheet);
|
||||
var rowIndex = parseInt(lastRow.attr('r')) +
|
||||
2; // Find the next row index
|
||||
var totalRow = '<row r="' + rowIndex + '">' +
|
||||
'<c t="inlineStr" r="AA' + rowIndex +
|
||||
'"><is><t>Total</t></is></c>' + // Insert "Total" in AA
|
||||
'<c t="n" r="AB' + rowIndex + '"><v>' + total.toFixed(2) +
|
||||
'</v></c>' + // Insert sum in AB
|
||||
'</row>';
|
||||
|
||||
// Append the new total row to the sheet
|
||||
$(sheet).find('sheetData').append(totalRow);
|
||||
}
|
||||
}
|
||||
]
|
||||
}],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 25 // Set default number of rows per page (optional)
|
||||
});
|
||||
} else {
|
||||
console.error("Table not found.");
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
getURLParams()
|
||||
$('#client_id').select2();
|
||||
$('#insurer_id').select2();
|
||||
$('#policy_type_id').select2();
|
||||
})
|
||||
|
||||
function fetchEmpolyeeList(event) {
|
||||
event.preventDefault(); // Prevent default action
|
||||
|
||||
var start_date = $('#startDate').val();
|
||||
var end_date = $('#endDate').val();
|
||||
var client_id = $('#client_id').val();
|
||||
var insurer_id = $('#insurer_id').val();
|
||||
var policy_type_id = $('#policy_type_id').val();
|
||||
var date_type = $('#date_type').val();
|
||||
var issuer = $('#issuer').val();
|
||||
|
||||
console.log(start_date + '-' + end_date);
|
||||
|
||||
var queryParams = {
|
||||
start_date: start_date,
|
||||
end_date: end_date,
|
||||
client_id: client_id,
|
||||
insurer_id: insurer_id,
|
||||
policy_type_id: policy_type_id,
|
||||
date_type: date_type,
|
||||
issuer: issuer,
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
const apiURL = $('#get-emp-list').attr('href') + "?" + queryString;
|
||||
console.log(apiURL);
|
||||
window.location.href = apiURL;
|
||||
}
|
||||
|
||||
if (val != 0) {
|
||||
$('#date_div').show()
|
||||
} else {
|
||||
$('#date_div').hide()
|
||||
function objectToQueryString(obj) {
|
||||
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
|
||||
}
|
||||
|
||||
function getURLParams() {
|
||||
const url = new URL(window.location.href);
|
||||
const params = new URLSearchParams(url.search);
|
||||
|
||||
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 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 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 issuer = params.get('issuer') || 0; // Default to 0 if not found
|
||||
|
||||
hideDateField(date_type)
|
||||
|
||||
console.log('startDate', startDate)
|
||||
console.log('endDate', endDate)
|
||||
console.log('client_id', client_id)
|
||||
console.log('insurer_id', insurer_id)
|
||||
console.log('policy_type_id', policy_type_id)
|
||||
console.log('date_type', date_type)
|
||||
console.log('issuer', issuer)
|
||||
|
||||
// Log the values or use them as needed
|
||||
console.log('Start Date:', startDate);
|
||||
console.log('End Date:', endDate);
|
||||
|
||||
if (startDate != 0 && endDate != 0) {
|
||||
setTimeout(function() {
|
||||
$('#start_date').val(startDate)
|
||||
$('#end_date').val(endDate)
|
||||
$('#client_id').val(client_id).change()
|
||||
$('#insurer_id').val(insurer_id).change()
|
||||
$('#policy_type_id').val(policy_type_id).change()
|
||||
$('#date_type').val(date_type)
|
||||
$('#issuer').val(issuer)
|
||||
}, 1000)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$(function() {
|
||||
|
||||
const url = new URL(window.location.href);
|
||||
const params = new URLSearchParams(url.search);
|
||||
|
||||
// Get start and end dates from URL parameters, or use default values
|
||||
const startDateParam = params.get('start_date') || moment().subtract(29, 'days').format('DD-MM-YYYY');
|
||||
const endDateParam = params.get('end_date') || moment().format('DD-MM-YYYY');
|
||||
|
||||
// Parse the dates to moment objects
|
||||
var start = moment(startDateParam, 'DD-MM-YYYY');
|
||||
var end = moment(endDateParam, 'DD-MM-YYYY');
|
||||
|
||||
// var start = moment().subtract(29, 'days');
|
||||
// var end = moment();
|
||||
|
||||
function cb(start, end) {
|
||||
// codeword : ***2***
|
||||
// if you cross check means also uncomment "star1star" (***1***)
|
||||
// $('#reportrange span').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
|
||||
$('#reportrange').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
|
||||
$('#startDate').val(start.format('DD-MM-YYYY'));
|
||||
$('#endDate').val(end.format('DD-MM-YYYY'));
|
||||
}
|
||||
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
// autoUpdateInput: false,
|
||||
locale: {
|
||||
format: 'DD-MM-YYYY' // 👈 force input format
|
||||
},
|
||||
ranges: {
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
}
|
||||
}, cb);
|
||||
|
||||
cb(start, end);
|
||||
|
||||
$('#clear-filters').on('click', function() {
|
||||
// Reset all select dropdowns to the first option
|
||||
$('#client_id').val('0').change();
|
||||
$('#insurer_id').val('0').change();
|
||||
$('#policy_type_id').val('0').change();
|
||||
$('#date_type').val('0');
|
||||
$('#issuer').val('0');
|
||||
$('#date_div').hide()
|
||||
|
||||
// Reset the date range picker to default
|
||||
$('#reportrange').data('daterangepicker').setStartDate(moment().subtract(29, 'days'));
|
||||
$('#reportrange').data('daterangepicker').setEndDate(moment());
|
||||
cb(start, end); // Update the displayed date range
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function hideDateField(input = null) {
|
||||
let val = $('#date_type').val();
|
||||
|
||||
if (input) {
|
||||
val = input;
|
||||
}
|
||||
|
||||
if (val != 0) {
|
||||
$('#date_div').show()
|
||||
} else {
|
||||
$('#date_div').hide()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function sendPolicyTransactionID(event, pt_id) {
|
||||
event.preventDefault(); // Prevent default action
|
||||
function sendPolicyTransactionID(event, pt_id) {
|
||||
event.preventDefault(); // Prevent default action
|
||||
|
||||
console.log(pt_id);
|
||||
console.log(pt_id);
|
||||
|
||||
var queryParams = {
|
||||
pt_id: pt_id,
|
||||
};
|
||||
var queryParams = {
|
||||
pt_id: pt_id,
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
const apiURL = $('#get-policy-list').attr('href') + "?" + queryString;
|
||||
console.log(apiURL);
|
||||
window.location.href = apiURL;
|
||||
}
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
const apiURL = $('#get-policy-list').attr('href') + "?" + queryString;
|
||||
console.log(apiURL);
|
||||
window.location.href = apiURL;
|
||||
}
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
@ -144,9 +144,6 @@ table.dataTable tbody td {
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="col-12">
|
||||
<h4 class="ml-1 mb-3"> <span class="font-color-black">Policy</span> </h4>
|
||||
</div>
|
||||
|
||||
<div class="col-12" id="inception_filter">
|
||||
<div id="accordion" class="mb-3">
|
||||
@ -271,7 +268,7 @@ table.dataTable tbody td {
|
||||
<div class="card-body">
|
||||
<div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Policy </h4>
|
||||
<h4 style="position: relative;">Policy List </h4>
|
||||
</div>
|
||||
|
||||
<div class="col-3" id="status_change" style="text-align: right; position: relative;top: 56px; left: 291px;">
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
<style>
|
||||
.custom-dropdown-menu {
|
||||
.custom-dropdown-menu {
|
||||
display: none;
|
||||
position: fixed;
|
||||
background-color: #ffffff !important;
|
||||
border: 1px solid rgba(0,0,0,.15);
|
||||
border: 1px solid rgba(0, 0, 0, .15);
|
||||
border-radius: 0.25rem;
|
||||
padding: 0.5rem 0;
|
||||
min-width: 10rem;
|
||||
z-index: 9999;
|
||||
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
||||
}
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.custom-dropdown-menu .dropdown-item {
|
||||
.custom-dropdown-menu .dropdown-item {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
padding: 0.5rem 1rem !important;
|
||||
@ -24,25 +24,25 @@
|
||||
border: 0 !important;
|
||||
text-decoration: none !important;
|
||||
position: relative !important;
|
||||
}
|
||||
}
|
||||
|
||||
.custom-dropdown-menu .dropdown-item:hover {
|
||||
.custom-dropdown-menu .dropdown-item:hover {
|
||||
background-color: #f8f9fa !important;
|
||||
color: #16181b !important;
|
||||
cursor: pointer !important;
|
||||
}
|
||||
}
|
||||
|
||||
.custom-dropdown-menu .dropdown-item i {
|
||||
.custom-dropdown-menu .dropdown-item i {
|
||||
margin-right: 8px !important;
|
||||
vertical-align: middle !important;
|
||||
}
|
||||
}
|
||||
|
||||
.table tbody tr {
|
||||
.table tbody tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
/* Ensure the dropdown menu has a solid background */
|
||||
.custom-dropdown-menu::before {
|
||||
/* Ensure the dropdown menu has a solid background */
|
||||
.custom-dropdown-menu::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@ -51,26 +51,28 @@
|
||||
bottom: 0;
|
||||
background: #ffffff;
|
||||
z-index: -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Add a subtle backdrop effect */
|
||||
.custom-dropdown-menu::after {
|
||||
/* Add a subtle backdrop effect */
|
||||
.custom-dropdown-menu::after {
|
||||
content: '';
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0,0,0,0.05);
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
z-index: -2;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div class="row" id="policy_list">
|
||||
|
||||
<div class="container-fluid-min">
|
||||
<div class="row" id="policy_list">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body maincard">
|
||||
<!-- <div class="row" style="margin-bottom:1rem;">
|
||||
<div class="card">
|
||||
<div class="card-body maincard">
|
||||
<!-- <div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Policy Type List</h4>
|
||||
</div>
|
||||
@ -78,270 +80,270 @@
|
||||
<a href="<?= base_url("master/policy/create"); ?>" 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 class="row" style="margin-bottom:1rem;">
|
||||
<!-- <div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Policy</h4>
|
||||
</div>
|
||||
</div> -->
|
||||
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">Policy Type</th>
|
||||
<th class="font-weight-medium">Policy Long Name</th>
|
||||
<th class="font-weight-medium">BAP</th>
|
||||
<th class="font-weight-medium">Category</th>
|
||||
<th class="font-weight-medium">BAP Category</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">Policy Type</th>
|
||||
<th class="font-weight-medium">Policy Long Name</th>
|
||||
<th class="font-weight-medium">BAP</th>
|
||||
<th class="font-weight-medium">Category</th>
|
||||
<th class="font-weight-medium">BAP Category</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php if(is_array($policyList)) {foreach($policyList as $row){ ?>
|
||||
<tr>
|
||||
<td><?php echo $row['policy_type']; ?> </td>
|
||||
<td><?php echo $row['long_name']; ?> </td>
|
||||
<td><?php echo $row['bap']; ?></td>
|
||||
<td><?php echo $row['allocg']; ?></td>
|
||||
<td><?php echo $row['alloci']; ?></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item" href="<?= base_url("master/policy/list/"); ?><?= $row['id'];?>"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a class="dropdown-item" data-id="<?= $row['id'];?>" onclick="removePolciyType(this)"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }}?>
|
||||
<tbody>
|
||||
<?php if (is_array($policyList)) {
|
||||
foreach ($policyList as $row) { ?>
|
||||
<tr>
|
||||
<td><?php echo $row['policy_type']; ?> </td>
|
||||
<td><?php echo $row['long_name']; ?> </td>
|
||||
<td><?php echo $row['bap']; ?></td>
|
||||
<td><?php echo $row['allocg']; ?></td>
|
||||
<td><?php echo $row['alloci']; ?></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item" href="<?= base_url("master/policy/list/"); ?><?= $row['id']; ?>"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a class="dropdown-item" data-id="<?= $row['id']; ?>" onclick="removePolciyType(this)"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- end row -->
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const table = document.getElementById("tickets-table");
|
||||
|
||||
|
||||
// Create custom dropdown
|
||||
function createCustomDropdown(row) {
|
||||
// Get the original dropdown items
|
||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||
if (!originalDropdown) return null;
|
||||
|
||||
// Create new dropdown with proper background and spacing
|
||||
const customDropdown = document.createElement('div');
|
||||
customDropdown.className = 'custom-dropdown-menu';
|
||||
|
||||
// Copy inner content while maintaining icon alignment
|
||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||
|
||||
return customDropdown;
|
||||
// Get the original dropdown items
|
||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||
if (!originalDropdown) return null;
|
||||
|
||||
// Create new dropdown with proper background and spacing
|
||||
const customDropdown = document.createElement('div');
|
||||
customDropdown.className = 'custom-dropdown-menu';
|
||||
|
||||
// Copy inner content while maintaining icon alignment
|
||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||
|
||||
return customDropdown;
|
||||
}
|
||||
|
||||
let activeDropdown = null;
|
||||
|
||||
// Add click event listener to rows
|
||||
table.querySelectorAll("tbody tr").forEach(row => {
|
||||
const customDropdown = createCustomDropdown(row);
|
||||
if (!customDropdown) return;
|
||||
|
||||
document.body.appendChild(customDropdown);
|
||||
const customDropdown = createCustomDropdown(row);
|
||||
if (!customDropdown) return;
|
||||
|
||||
row.addEventListener("click", function(event) {
|
||||
// Ignore clicks on the action column
|
||||
if (event.target.closest('td:last-child')) {
|
||||
return;
|
||||
}
|
||||
document.body.appendChild(customDropdown);
|
||||
|
||||
// Hide any active dropdown
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
}
|
||||
row.addEventListener("click", function(event) {
|
||||
// Ignore clicks on the action column
|
||||
if (event.target.closest('td:last-child')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get click position
|
||||
const rect = event.target.getBoundingClientRect();
|
||||
// Hide any active dropdown
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
}
|
||||
|
||||
// Position the dropdown with some offset
|
||||
customDropdown.style.display = 'block';
|
||||
customDropdown.style.position = 'fixed';
|
||||
customDropdown.style.left = `${rect.left}px`;
|
||||
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||
// Get click position
|
||||
const rect = event.target.getBoundingClientRect();
|
||||
|
||||
// Set as active dropdown
|
||||
activeDropdown = customDropdown;
|
||||
// Position the dropdown with some offset
|
||||
customDropdown.style.display = 'block';
|
||||
customDropdown.style.position = 'fixed';
|
||||
customDropdown.style.left = `${rect.left}px`;
|
||||
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
// Preserve click handlers
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) {
|
||||
eval(onclickAttr);
|
||||
}
|
||||
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#') {
|
||||
window.location.href = href;
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
});
|
||||
// Set as active dropdown
|
||||
activeDropdown = customDropdown;
|
||||
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
// Preserve click handlers
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) {
|
||||
eval(onclickAttr);
|
||||
}
|
||||
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#') {
|
||||
window.location.href = href;
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Close dropdown when clicking outside
|
||||
document.addEventListener("click", function() {
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>" ,
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'PolicyTypeList',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
}
|
||||
}
|
||||
],
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'d-flex justify-content-between align-items-center'<'datatable-search'f><'datatable-buttons'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'PolicyTypeList',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
}
|
||||
}],
|
||||
|
||||
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true ,
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true,
|
||||
});
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
const btnExport = document.querySelector("#btnExport");
|
||||
const tableElement = document.querySelector("#tickets-table");
|
||||
const btnExport = document.querySelector("#btnExport");
|
||||
const tableElement = document.querySelector("#tickets-table");
|
||||
|
||||
btnExport.addEventListener("click", () => {
|
||||
const obj = new csvExport(tableElement);
|
||||
const csvData = obj.exportCsv();
|
||||
const blob = new Blob([csvData], { type: "text/csv" });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = "PolicyTypeList.csv";
|
||||
a.click();
|
||||
btnExport.addEventListener("click", () => {
|
||||
const obj = new csvExport(tableElement);
|
||||
const csvData = obj.exportCsv();
|
||||
const blob = new Blob([csvData], {
|
||||
type: "text/csv"
|
||||
});
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = "PolicyTypeList.csv";
|
||||
a.click();
|
||||
|
||||
setTimeout(() => {
|
||||
URL.revokeObjectURL(url);
|
||||
}, 500);
|
||||
});
|
||||
setTimeout(() => {
|
||||
URL.revokeObjectURL(url);
|
||||
}, 500);
|
||||
});
|
||||
|
||||
|
||||
class csvExport {
|
||||
constructor(table, header = true) {
|
||||
this.table = table;
|
||||
this.rows = Array.from(table.querySelectorAll("tr"));
|
||||
if (!header && this.rows[0].querySelectorAll("th").length) {
|
||||
this.rows.shift();
|
||||
}
|
||||
}
|
||||
|
||||
exportCsv() {
|
||||
const lines = [];
|
||||
const ncols = this._longestRow();
|
||||
for (const row of this.rows) {
|
||||
let line = "";
|
||||
for (let i = 0; i < ncols - 1; i++) { // Exclude the last column
|
||||
if (row.children[i] !== undefined) {
|
||||
line += csvExport.safeData(row.children[i]);
|
||||
}
|
||||
line += i !== ncols - 2 ? "," : ""; // Adjusted for the last column exclusion
|
||||
class csvExport {
|
||||
constructor(table, header = true) {
|
||||
this.table = table;
|
||||
this.rows = Array.from(table.querySelectorAll("tr"));
|
||||
if (!header && this.rows[0].querySelectorAll("th").length) {
|
||||
this.rows.shift();
|
||||
}
|
||||
lines.push(line);
|
||||
}
|
||||
return lines.join("\n");
|
||||
|
||||
exportCsv() {
|
||||
const lines = [];
|
||||
const ncols = this._longestRow();
|
||||
for (const row of this.rows) {
|
||||
let line = "";
|
||||
for (let i = 0; i < ncols - 1; i++) { // Exclude the last column
|
||||
if (row.children[i] !== undefined) {
|
||||
line += csvExport.safeData(row.children[i]);
|
||||
}
|
||||
line += i !== ncols - 2 ? "," : ""; // Adjusted for the last column exclusion
|
||||
}
|
||||
lines.push(line);
|
||||
}
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
||||
_longestRow() {
|
||||
return this.rows.reduce((length, row) => (row.childElementCount > length ? row.childElementCount : length), 0);
|
||||
}
|
||||
|
||||
static safeData(td) {
|
||||
let data = td.textContent;
|
||||
//Replace all double quote to two double quotes
|
||||
data = data.replace(/"/g, `""`);
|
||||
//Replace , and \n to double quotes
|
||||
data = /[",\n"]/.test(data) ? `"${data}"` : data;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
_longestRow() {
|
||||
return this.rows.reduce((length, row) => (row.childElementCount > length ? row.childElementCount : length), 0);
|
||||
}
|
||||
|
||||
static safeData(td) {
|
||||
let data = td.textContent;
|
||||
//Replace all double quote to two double quotes
|
||||
data = data.replace(/"/g, `""`);
|
||||
//Replace , and \n to double quotes
|
||||
data = /[",\n"]/.test(data) ? `"${data}"` : data;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function removePolciyType(element) {
|
||||
function removePolciyType(element) {
|
||||
|
||||
Swal.fire({
|
||||
title: "Are you sure?",
|
||||
text: "You need to remove this!",
|
||||
icon: "info",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
confirmButtonText: "Yes",
|
||||
title: "Are you sure?",
|
||||
text: "You need to remove this!",
|
||||
icon: "info",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
confirmButtonText: "Yes",
|
||||
}).then((result) => {
|
||||
|
||||
if (result.isConfirmed) {
|
||||
var id = element.getAttribute('data-id');
|
||||
var form_action = '<?= base_url("master/policy/remove/") ?>' + id;
|
||||
$.ajax({
|
||||
url: form_action,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
// console.log(res.status == true);
|
||||
if(res){
|
||||
if (res.status == true) {
|
||||
toastr.success('Policy type removed successfully', 'success');
|
||||
location.reload();
|
||||
} else {
|
||||
toastr.warning('Failed to remove policy type', 'warning');
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Failed to remove policy type', 'warning');
|
||||
}
|
||||
});
|
||||
}
|
||||
if (result.isConfirmed) {
|
||||
var id = element.getAttribute('data-id');
|
||||
var form_action = '<?= base_url("master/policy/remove/") ?>' + id;
|
||||
$.ajax({
|
||||
url: form_action,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
// console.log(res.status == true);
|
||||
if (res) {
|
||||
if (res.status == true) {
|
||||
toastr.success('Policy type removed successfully', 'success');
|
||||
location.reload();
|
||||
} else {
|
||||
toastr.warning('Failed to remove policy type', 'warning');
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Failed to remove policy type', 'warning');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
@ -1,17 +1,14 @@
|
||||
<div class="col-12">
|
||||
<h4 class="ml-1 mb-3"> <span class="font-color-black">Renewal Policy</span> </h4>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid-min">
|
||||
<div class="col-xl-12">
|
||||
<div id="accordion" class="mb-3">
|
||||
<label id="filterAccordion" class="m-1 d-flex justify-content-between align-items-center">
|
||||
<span class="font-color-black">Filters</span>
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
<h4>Filters</h4>
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</label>
|
||||
<div class="card mb-1">
|
||||
<div class="card mb-1">
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
@ -24,8 +21,8 @@
|
||||
<span></span> <i class="mdi mdi-menu-down"></i>
|
||||
</div> -->
|
||||
<div class="input-icon">
|
||||
<input type="text" id="reportrange" class="form-control" readonly style="caret-color: transparent;">
|
||||
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
|
||||
<input type="text" id="reportrange" class="form-control" readonly style="caret-color: transparent;">
|
||||
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
|
||||
</div>
|
||||
<input type="hidden" id="startDate" value=<?= $default_start ?>>
|
||||
<input type="hidden" id="endDate" value=<?= $default_end ?>>
|
||||
@ -36,11 +33,11 @@
|
||||
<select class="form-control" id="issuer" name="issuer">
|
||||
<option value="">Select Issuer</option>
|
||||
<?php
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
@ -78,168 +75,172 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div id="report"></div>
|
||||
<div id="report"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
let client_list = [];
|
||||
let client_list = [];
|
||||
|
||||
$(document).ready(function() {
|
||||
getClientAndBranchAndPolicy();
|
||||
$('#client_id').select2();
|
||||
})
|
||||
$(document).ready(function() {
|
||||
getClientAndBranchAndPolicy();
|
||||
$('#client_id').select2();
|
||||
})
|
||||
|
||||
$(function() {
|
||||
$(function() {
|
||||
|
||||
var start = $('#startDate').val();
|
||||
var end = $('#endDate').val();
|
||||
var start = $('#startDate').val();
|
||||
var end = $('#endDate').val();
|
||||
|
||||
var start = moment(start, 'DD/MM/YYYY');
|
||||
var end = moment(end, 'DD/MM/YYYY');
|
||||
var start = moment(start, 'DD/MM/YYYY');
|
||||
var end = moment(end, 'DD/MM/YYYY');
|
||||
|
||||
function cb(start, end) {
|
||||
$('#reportrange').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
|
||||
$('#startDate').val(start.format('DD-MM-YYYY'));
|
||||
$('#endDate').val(end.format('DD-MM-YYYY'));
|
||||
}
|
||||
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
locale: { format: 'DD-MM-YYYY' },
|
||||
ranges: {
|
||||
'Today': [moment(), moment()],
|
||||
'Next 7 Days': [moment(), moment().add(6, 'days')], // Next 7 Days
|
||||
'Next 30 Days': [moment(), moment().add(29, 'days')], // Next 30 Days
|
||||
'Next Month': [moment().add(1, 'month').startOf('month'), moment().add(1, 'month').endOf(
|
||||
'month')], // Next Month
|
||||
'Next Year': [moment().add(1, 'year').startOf('year'), moment().add(1, 'year').endOf(
|
||||
'year')], // Next Year
|
||||
'Current Year': [moment().startOf('year'), moment().endOf('year')] // Current Year
|
||||
|
||||
}
|
||||
}, cb);
|
||||
|
||||
cb(start, end);
|
||||
});
|
||||
|
||||
// ----------------------------------------------------------------------------------------------
|
||||
|
||||
function fetchReportPage() {
|
||||
|
||||
var fromDate = $('#startDate').val();
|
||||
var toDate = $('#endDate').val();
|
||||
var client_id = $('#client_id').val();
|
||||
var client_type = $('#client_type').val();
|
||||
var issuer = $('#issuer').val();
|
||||
var requestData = {
|
||||
fromDate: fromDate,
|
||||
toDate: toDate,
|
||||
client_id: client_id,
|
||||
client_type: client_type,
|
||||
issuer: issuer,
|
||||
};
|
||||
console.log(typeof fromDate);
|
||||
var url = '<?= base_url('/bdsReport/renewal_report') ?>';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
sendAjaxRequestForGlobal(url, 'POST', requestData, function(response) {
|
||||
if (response.status == true) {
|
||||
$('#report').html(response.html);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
} else {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
let message = response.message;
|
||||
toastr.error(message, 'ERROR');
|
||||
function cb(start, end) {
|
||||
$('#reportrange').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
|
||||
$('#startDate').val(start.format('DD-MM-YYYY'));
|
||||
$('#endDate').val(end.format('DD-MM-YYYY'));
|
||||
}
|
||||
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
locale: {
|
||||
format: 'DD-MM-YYYY'
|
||||
},
|
||||
ranges: {
|
||||
'Today': [moment(), moment()],
|
||||
'Next 7 Days': [moment(), moment().add(6, 'days')], // Next 7 Days
|
||||
'Next 30 Days': [moment(), moment().add(29, 'days')], // Next 30 Days
|
||||
'Next Month': [moment().add(1, 'month').startOf('month'), moment().add(1, 'month').endOf(
|
||||
'month')], // Next Month
|
||||
'Next Year': [moment().add(1, 'year').startOf('year'), moment().add(1, 'year').endOf(
|
||||
'year')], // Next Year
|
||||
'Current Year': [moment().startOf('year'), moment().endOf('year')] // Current Year
|
||||
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
toastr.error('An error occurred while fetching the report page.', 'ERROR');
|
||||
}
|
||||
}, cb);
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
cb(start, end);
|
||||
});
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------------------------
|
||||
|
||||
//get client , branch, policy data
|
||||
function getClientAndBranchAndPolicy() {
|
||||
$.ajax({
|
||||
url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>',
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
function fetchReportPage() {
|
||||
|
||||
var fromDate = $('#startDate').val();
|
||||
var toDate = $('#endDate').val();
|
||||
var client_id = $('#client_id').val();
|
||||
var client_type = $('#client_type').val();
|
||||
var issuer = $('#issuer').val();
|
||||
var requestData = {
|
||||
fromDate: fromDate,
|
||||
toDate: toDate,
|
||||
client_id: client_id,
|
||||
client_type: client_type,
|
||||
issuer: issuer,
|
||||
};
|
||||
console.log(typeof fromDate);
|
||||
var url = '<?= base_url('/bdsReport/renewal_report') ?>';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
sendAjaxRequestForGlobal(url, 'POST', requestData, function(response) {
|
||||
if (response.status == true) {
|
||||
$('#report').html(response.html);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
console.log('getClientAndBranchAndPolicy', res);
|
||||
if (res.status == true) {
|
||||
client_list = res.client_data;
|
||||
appendClients(res.client_data);
|
||||
} else {
|
||||
console.log('No data found');
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
let message = response.message;
|
||||
toastr.error(message, 'ERROR');
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
|
||||
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
toastr.error('An error occurred while fetching the report page.', 'ERROR');
|
||||
|
||||
//append the clients data
|
||||
function appendClients(data) {
|
||||
$('#client_id').empty();
|
||||
|
||||
$('#client_id').append($('<option>', {
|
||||
value: '0',
|
||||
text: 'Select Client'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.client_name,
|
||||
'data-name': item.client_name,
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
});
|
||||
}
|
||||
|
||||
$('#client_id').append(option).select2();
|
||||
});
|
||||
// ----------------------------------------------------------------------------------------------
|
||||
|
||||
}
|
||||
//get client , branch, policy data
|
||||
function getClientAndBranchAndPolicy() {
|
||||
$.ajax({
|
||||
url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>',
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
|
||||
$('#client_type').on('change', function() {
|
||||
|
||||
var selectedClientType = $(this).val();
|
||||
|
||||
// console.log('selectedClientType', selectedClientType);
|
||||
|
||||
// Clear and add default options for client
|
||||
$('#client_id').empty().append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select Client'
|
||||
}))
|
||||
|
||||
// Populate client options based on selected client type
|
||||
if (selectedClientType) {
|
||||
|
||||
$.each(client_list, function(index, item) {
|
||||
if (item.client_type == selectedClientType) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.client_name,
|
||||
});
|
||||
$('#client_id').append(option);
|
||||
console.log('getClientAndBranchAndPolicy', res);
|
||||
if (res.status == true) {
|
||||
client_list = res.client_data;
|
||||
appendClients(res.client_data);
|
||||
} else {
|
||||
console.log('No data found');
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//append the clients data
|
||||
function appendClients(data) {
|
||||
$('#client_id').empty();
|
||||
|
||||
$('#client_id').append($('<option>', {
|
||||
value: '0',
|
||||
text: 'Select Client'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.client_name,
|
||||
'data-name': item.client_name,
|
||||
});
|
||||
|
||||
$('#client_id').append(option).select2();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// Initialize or refresh Select2 for both dropdowns
|
||||
$('#client_id').select2();
|
||||
});
|
||||
$('#client_type').on('change', function() {
|
||||
|
||||
var selectedClientType = $(this).val();
|
||||
|
||||
// console.log('selectedClientType', selectedClientType);
|
||||
|
||||
// Clear and add default options for client
|
||||
$('#client_id').empty().append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select Client'
|
||||
}))
|
||||
|
||||
// Populate client options based on selected client type
|
||||
if (selectedClientType) {
|
||||
|
||||
$.each(client_list, function(index, item) {
|
||||
if (item.client_type == selectedClientType) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.client_name,
|
||||
});
|
||||
$('#client_id').append(option);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// Initialize or refresh Select2 for both dropdowns
|
||||
$('#client_id').select2();
|
||||
});
|
||||
</script>
|
||||
@ -1,20 +1,17 @@
|
||||
<style>
|
||||
.col-12 {
|
||||
|
||||
max-width: 98% !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<div class="col-12" id="bds_filter">
|
||||
<div class="container-fluid-min">
|
||||
<div class="col-12" id="bds_filter">
|
||||
<div id="accordion" class="mb-3">
|
||||
<label id="filterAccordion" class="m-1 d-flex justify-content-between align-items-center">
|
||||
<span class="font-color-black">Filter</span>
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
<span class="font-color-black">Filter</span>
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</label>
|
||||
<div class="card mb-1">
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
@ -38,7 +35,7 @@
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="insurer_id"> Insurer <span id="base_danger" class="text-danger"></span></label>
|
||||
<select class="form-control" id="insurer_id" name="insurer_id" onchange="getClientPolicyDataBasedOnClientAndInsuer()" >
|
||||
<select class="form-control" id="insurer_id" name="insurer_id" onchange="getClientPolicyDataBasedOnClientAndInsuer()">
|
||||
<option value="0" selected>Select Insurer</option>
|
||||
</select>
|
||||
</div>
|
||||
@ -55,18 +52,18 @@
|
||||
<select class="form-control" id="policy_type_id" name="policy_type_id" onchange="getClientPolicyDataBasedOnClientAndInsuer()">
|
||||
<option value="0">Select Policy Type</option>
|
||||
<?php
|
||||
if (isset($policy_types) && count($policy_types)) {
|
||||
foreach ($policy_types as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['policy_type'] . "</option>";
|
||||
}
|
||||
if (isset($policy_types) && count($policy_types)) {
|
||||
foreach ($policy_types as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['policy_type'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="client_policy_id"> Client Policy <span id="base_danger" class="text-danger"></span></label>
|
||||
<select class="form-control" id="client_policy_id" name="client_policy_id" >
|
||||
<select class="form-control" id="client_policy_id" name="client_policy_id">
|
||||
<option value="0" selected>Select client policy</option>
|
||||
</select>
|
||||
</div>
|
||||
@ -76,25 +73,25 @@
|
||||
<select class="form-control" id="issuer" name="issuer" required>
|
||||
<option value="0">Select Issure</option>
|
||||
<?php
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="user_id">Users<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="user_id" name="user_id" >
|
||||
<select class="form-control" id="user_id" name="user_id">
|
||||
<option value="0">Select user</option>
|
||||
<?php
|
||||
if (isset($users) && count($users)) {
|
||||
foreach ($users as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['first_name'] . "</option>";
|
||||
}
|
||||
if (isset($users) && count($users)) {
|
||||
foreach ($users as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['first_name'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
@ -104,11 +101,11 @@
|
||||
<select class="form-control" id="date_type" name="date_type" onchange="hideDateField(); changeTitle();">
|
||||
<option value="0">Select Date Type</option>
|
||||
<?php
|
||||
if (isset($date_type) && count($date_type)) {
|
||||
foreach ($date_type as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
}
|
||||
if (isset($date_type) && count($date_type)) {
|
||||
foreach ($date_type as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
@ -116,7 +113,7 @@
|
||||
<div class="form-group col-md-3" style="display: none;" id="date_div">
|
||||
<label>Date<span class="text-danger"></span></label>
|
||||
<div class="input-icon">
|
||||
<input type="text" id="reportrange" class="form-control" readonly style="caret-color: transparent;">
|
||||
<input type="text" id="reportrange" class="form-control" readonly style="caret-color: transparent;">
|
||||
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
|
||||
</div>
|
||||
<input type="hidden" id="startDate">
|
||||
@ -125,7 +122,7 @@
|
||||
|
||||
<div class="form-group col-md-12 text-right m-b-0" style="margin-top: 29px;">
|
||||
<a href="<?= base_url("/policy_tranction/report/list"); ?>" class="btn btn-secondary" id="clear-filters">Clear</a>
|
||||
<a href="<?= base_url("/policy_tranction/report/list"); ?>" class="btn btn-primary" id="get-emp-list" onclick="fetchEmpolyeeList(event);">Submit</a>
|
||||
<a href="<?= base_url("/policy_tranction/report/list"); ?>" class="btn btn-primary" id="get-emp-list" onclick="fetchEmpolyeeList(event);">Submit</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -142,429 +139,421 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- end page title -->
|
||||
<div id="file_list">
|
||||
<?php include('report_bds.php'); ?>
|
||||
<!-- end page title -->
|
||||
<div id="file_list">
|
||||
<?php include('report_bds.php'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
let client_list = [];
|
||||
let branch_list = [];
|
||||
let policy_list = [];
|
||||
let insurer_list = [];
|
||||
let insurer_branch_list = [];
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
getClientAndBranchAndPolicy()
|
||||
getURLParams()
|
||||
$('#client_id').select2();
|
||||
$('#client_branch_id').select2();
|
||||
$('#insurer_id').select2();
|
||||
$('#insurer_branch_id').select2();
|
||||
$('#policy_type_id').select2();
|
||||
$('#client_policy_id').select2();
|
||||
$('#user_id').select2();
|
||||
|
||||
})
|
||||
|
||||
function fetchEmpolyeeList(event)
|
||||
{
|
||||
event.preventDefault(); // Prevent default action
|
||||
|
||||
var start_date = $('#startDate').val();
|
||||
var end_date = $('#endDate').val();
|
||||
var client_id = $('#client_id').val();
|
||||
var insurer_id = $('#insurer_id').val();
|
||||
var policy_type_id = $('#policy_type_id').val();
|
||||
var date_type = $('#date_type').val();
|
||||
var issuer = $('#issuer').val();
|
||||
var client_branch_id = $('#client_branch_id').val();
|
||||
var insurer_branch_id = $('#insurer_branch_id').val();
|
||||
var client_policy_id = $('#client_policy_id').val();
|
||||
var user_id = $('#user_id').val();
|
||||
|
||||
|
||||
console.log(start_date + '-' + end_date);
|
||||
|
||||
var queryParams = {
|
||||
start_date: start_date,
|
||||
end_date: end_date,
|
||||
client_id: client_id,
|
||||
insurer_id: insurer_id,
|
||||
policy_type_id: policy_type_id,
|
||||
date_type: date_type,
|
||||
issuer: issuer,
|
||||
client_branch_id: client_branch_id,
|
||||
insurer_branch_id: insurer_branch_id,
|
||||
client_policy_id: client_policy_id,
|
||||
user_id: user_id,
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
const apiURL = $('#get-emp-list').attr('href') + "?" + queryString;
|
||||
console.log(apiURL);
|
||||
window.location.href = apiURL;
|
||||
}
|
||||
|
||||
function objectToQueryString(obj)
|
||||
{
|
||||
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
|
||||
}
|
||||
|
||||
function getURLParams()
|
||||
{
|
||||
const url = new URL(window.location.href);
|
||||
const params = new URLSearchParams(url.search);
|
||||
|
||||
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 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 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 issuer = params.get('issuer') || 0; // Default to 0 if not found
|
||||
const client_branch_id = params.get('client_branch_id') || 0; // Default to 0 if not found
|
||||
const insurer_branch_id = params.get('insurer_branch_id') || 0; // Default to 0 if not found
|
||||
const client_policy_id = params.get('client_policy_id') || 0; // Default to 0 if not found
|
||||
const user_id = params.get('user_id') || 0; // Default to 0 if not found
|
||||
|
||||
hideDateField(date_type)
|
||||
|
||||
console.log('startDate', startDate)
|
||||
console.log('endDate', endDate)
|
||||
console.log('client_id', client_id)
|
||||
console.log('insurer_id', insurer_id)
|
||||
console.log('policy_type_id', policy_type_id)
|
||||
console.log('date_type', date_type)
|
||||
console.log('issuer', issuer)
|
||||
console.log('client_branch_id', client_branch_id)
|
||||
console.log('insurer_branch_id', insurer_branch_id)
|
||||
console.log('client_policy_id', client_policy_id)
|
||||
console.log('user_id', user_id)
|
||||
|
||||
// Log the values or use them as needed
|
||||
console.log('Start Date:', startDate);
|
||||
console.log('End Date:', endDate);
|
||||
|
||||
if (startDate != 0 && endDate != 0) {
|
||||
setTimeout(function(){
|
||||
$('#start_date').val(startDate)
|
||||
$('#end_date').val(endDate)
|
||||
$('#client_id').val(client_id).select2()
|
||||
$('#insurer_id').val(insurer_id).select2()
|
||||
$('#user_id').val(user_id).select2()
|
||||
$('#policy_type_id').val(policy_type_id).select2()
|
||||
$('#date_type').val(date_type).trigger('change');
|
||||
$('#issuer').val(issuer)
|
||||
setTimeout(function(){
|
||||
$('#client_branch_id').val(client_branch_id).select2()
|
||||
$('#insurer_branch_id').val(insurer_branch_id).select2()
|
||||
setTimeout(function(){
|
||||
$('#client_policy_id').val(client_policy_id).select2();
|
||||
}, 1000);
|
||||
}, 2000)
|
||||
},1000)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$(function() {
|
||||
|
||||
const url = new URL(window.location.href);
|
||||
const params = new URLSearchParams(url.search);
|
||||
|
||||
// Get start and end dates from URL parameters, or use default values
|
||||
const startDateParam = params.get('start_date') || moment().subtract(29, 'days').format('DD-MM-YYYY');
|
||||
const endDateParam = params.get('end_date') || moment().format('DD-MM-YYYY');
|
||||
|
||||
// Parse the dates to moment objects
|
||||
var start = moment(startDateParam, 'DD-MM-YYYY');
|
||||
var end = moment(endDateParam, 'DD-MM-YYYY');
|
||||
|
||||
// var start = moment().subtract(29, 'days');
|
||||
// var end = moment();
|
||||
|
||||
function cb(start, end) {
|
||||
$('#reportrange').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
|
||||
$('#startDate').val(start.format('DD-MM-YYYY'));
|
||||
$('#endDate').val(end.format('DD-MM-YYYY'));
|
||||
}
|
||||
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
locale: { format: 'DD-MM-YYYY' },
|
||||
ranges: {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
||||
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
}
|
||||
}, cb);
|
||||
|
||||
cb(start, end);
|
||||
|
||||
$('#clear-filters').on('click', function() {
|
||||
// Reset all select dropdowns to the first option
|
||||
$('#client_id').val('0').change();
|
||||
$('#insurer_id').val('0').change();
|
||||
$('#policy_type_id').val('0').change();
|
||||
$('#date_type').val('0');
|
||||
$('#issuer').val('0');
|
||||
$('#date_div').hide()
|
||||
|
||||
// Reset the date range picker to default
|
||||
$('#reportrange').data('daterangepicker').setStartDate(moment().subtract(29, 'days'));
|
||||
$('#reportrange').data('daterangepicker').setEndDate(moment());
|
||||
cb(start, end); // Update the displayed date range
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function hideDateField(input = null)
|
||||
{
|
||||
let val = $('#date_type').val();
|
||||
|
||||
if(input){
|
||||
val = input;
|
||||
}
|
||||
|
||||
if(val != 0){
|
||||
$('#date_div').show()
|
||||
}else{
|
||||
$('#date_div').hide()
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------
|
||||
|
||||
//featch client, client branch, insurer, insurer branch and client policy list data
|
||||
function getClientAndBranchAndPolicy()
|
||||
{
|
||||
$.ajax({
|
||||
url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>',
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
|
||||
console.log('getClientAndBranchAndPolicy', res);
|
||||
if(res.status == true){
|
||||
client_list = res.client_data;
|
||||
branch_list = res.branch_data;
|
||||
policy_list = res.policy_data;
|
||||
insurer_list = res.insurer_data;
|
||||
insurer_branch_list = res.insurer_branch_data;
|
||||
appendClients(res.client_data);
|
||||
appendInsurer(res.insurer_data);
|
||||
}else{
|
||||
console.log('No data found');
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//append clients for filter
|
||||
function appendClients(data)
|
||||
{
|
||||
$('#client_id').empty();
|
||||
|
||||
$('#client_id').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select Client'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.client_name,
|
||||
'data-cn': item.client_name,
|
||||
'data-ct': item.client_type,
|
||||
class: (item.client_type == 1) ? 'group' : (item.client_type == 2) ? 'individual' : ''
|
||||
});
|
||||
|
||||
$('#client_id').append(option);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//append clients branch for filter
|
||||
function appendBranch(data)
|
||||
{
|
||||
|
||||
$('#client_branch_id').empty();
|
||||
|
||||
$('#client_branch_id').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select Branch'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.branch_name
|
||||
});
|
||||
$('#client_branch_id').append(option);
|
||||
});
|
||||
}
|
||||
|
||||
//append insurer for filter
|
||||
function appendInsurer(data)
|
||||
{
|
||||
$('#insurer_id').empty();
|
||||
|
||||
$('#insurer_id').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select Insurer'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.name,
|
||||
});
|
||||
|
||||
$('#insurer_id').append(option);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//append insurer branch for filter
|
||||
function appendInsurerBranch(data)
|
||||
{
|
||||
|
||||
$('#insurer_branch_id').empty();
|
||||
|
||||
$('#insurer_branch_id').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select Insurer Branch'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.branch_name
|
||||
});
|
||||
$('#insurer_branch_id').append(option);
|
||||
});
|
||||
}
|
||||
|
||||
//append client policy for filter
|
||||
function appendPolicies(data)
|
||||
{
|
||||
// console.log('appendPolicies', data);
|
||||
// console.log('appendPolicies', $('#client_policy_id'));
|
||||
|
||||
$('#client_policy_id').empty();
|
||||
$('#client_policy_id').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select Policy',
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.policy_type + '-' + item.policy_no,
|
||||
});
|
||||
$('#client_policy_id').append(option);
|
||||
});
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
|
||||
//client branch and insurer branch onchange document ready function
|
||||
$(document).ready(function(){
|
||||
|
||||
$('#client_id').change(function(){
|
||||
|
||||
let client_id = $(this).val();
|
||||
console.log('client_id', client_id);
|
||||
|
||||
if(branch_list != '') {
|
||||
// console.log(branch_list[client_id]);
|
||||
let data = branch_list[client_id];
|
||||
appendBranch(data);
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
$('#insurer_id').change(function(){
|
||||
|
||||
let insurer_id = $(this).val();
|
||||
console.log('insurer_id', insurer_id);
|
||||
|
||||
if(insurer_branch_list != '') {
|
||||
// console.log(insurer_branch_list[insurer_id]);
|
||||
let data = insurer_branch_list[insurer_id];
|
||||
appendInsurerBranch(data);
|
||||
}
|
||||
let client_list = [];
|
||||
let branch_list = [];
|
||||
let policy_list = [];
|
||||
let insurer_list = [];
|
||||
let insurer_branch_list = [];
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
getClientAndBranchAndPolicy()
|
||||
getURLParams()
|
||||
$('#client_id').select2();
|
||||
$('#client_branch_id').select2();
|
||||
$('#insurer_id').select2();
|
||||
$('#insurer_branch_id').select2();
|
||||
$('#policy_type_id').select2();
|
||||
$('#client_policy_id').select2();
|
||||
$('#user_id').select2();
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
function fetchEmpolyeeList(event) {
|
||||
event.preventDefault(); // Prevent default action
|
||||
|
||||
//get policy list based on the client, client_branch, insurer, insurer_branch and policy type
|
||||
function getClientPolicyDataBasedOnClientAndInsuer(){
|
||||
var start_date = $('#startDate').val();
|
||||
var end_date = $('#endDate').val();
|
||||
var client_id = $('#client_id').val();
|
||||
var insurer_id = $('#insurer_id').val();
|
||||
var policy_type_id = $('#policy_type_id').val();
|
||||
var date_type = $('#date_type').val();
|
||||
var issuer = $('#issuer').val();
|
||||
var client_branch_id = $('#client_branch_id').val();
|
||||
var insurer_branch_id = $('#insurer_branch_id').val();
|
||||
var client_policy_id = $('#client_policy_id').val();
|
||||
var user_id = $('#user_id').val();
|
||||
|
||||
let client_id = $('#client_id').val() ?? 0;
|
||||
let client_branch_id = $('#client_branch_id').val() ?? 0;
|
||||
let insurer_id = $('#insurer_id').val() ?? 0;
|
||||
let insurer_branch_id = $('#insurer_branch_id').val() ?? 0;
|
||||
let policy_type_id = $('#policy_type_id').val() ?? 0;
|
||||
|
||||
let url = '<?= base_url('util/getClientPolicyDataBasedOnClientAndInsuer/') ?>';
|
||||
console.log(start_date + '-' + end_date);
|
||||
|
||||
let requestData = {
|
||||
client_id: client_id,
|
||||
client_branch_id: client_branch_id,
|
||||
insurer_id: insurer_id,
|
||||
insurer_branch_id: insurer_branch_id,
|
||||
policy_type_id: policy_type_id,
|
||||
var queryParams = {
|
||||
start_date: start_date,
|
||||
end_date: end_date,
|
||||
client_id: client_id,
|
||||
insurer_id: insurer_id,
|
||||
policy_type_id: policy_type_id,
|
||||
date_type: date_type,
|
||||
issuer: issuer,
|
||||
client_branch_id: client_branch_id,
|
||||
insurer_branch_id: insurer_branch_id,
|
||||
client_policy_id: client_policy_id,
|
||||
user_id: user_id,
|
||||
};
|
||||
|
||||
sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) {
|
||||
console.log('Data fetched successfully:', response);
|
||||
|
||||
if (response.status === true) {
|
||||
|
||||
appendPolicies(response.data)
|
||||
|
||||
} else {
|
||||
toastr.warning(response.message, 'WARNING');
|
||||
}
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//for the change title
|
||||
function changeTitle(input){
|
||||
|
||||
let val = $(input).val();
|
||||
if(val == 'statement_month'){
|
||||
$('#bds_title').text(' - Statement Month Wise List')
|
||||
}else{
|
||||
$('#bds_title').text(' - Policy Wise List')
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
const apiURL = $('#get-emp-list').attr('href') + "?" + queryString;
|
||||
console.log(apiURL);
|
||||
window.location.href = apiURL;
|
||||
}
|
||||
|
||||
}
|
||||
function objectToQueryString(obj) {
|
||||
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
|
||||
}
|
||||
|
||||
function getURLParams() {
|
||||
const url = new URL(window.location.href);
|
||||
const params = new URLSearchParams(url.search);
|
||||
|
||||
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 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 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 issuer = params.get('issuer') || 0; // Default to 0 if not found
|
||||
const client_branch_id = params.get('client_branch_id') || 0; // Default to 0 if not found
|
||||
const insurer_branch_id = params.get('insurer_branch_id') || 0; // Default to 0 if not found
|
||||
const client_policy_id = params.get('client_policy_id') || 0; // Default to 0 if not found
|
||||
const user_id = params.get('user_id') || 0; // Default to 0 if not found
|
||||
|
||||
hideDateField(date_type)
|
||||
|
||||
console.log('startDate', startDate)
|
||||
console.log('endDate', endDate)
|
||||
console.log('client_id', client_id)
|
||||
console.log('insurer_id', insurer_id)
|
||||
console.log('policy_type_id', policy_type_id)
|
||||
console.log('date_type', date_type)
|
||||
console.log('issuer', issuer)
|
||||
console.log('client_branch_id', client_branch_id)
|
||||
console.log('insurer_branch_id', insurer_branch_id)
|
||||
console.log('client_policy_id', client_policy_id)
|
||||
console.log('user_id', user_id)
|
||||
|
||||
// Log the values or use them as needed
|
||||
console.log('Start Date:', startDate);
|
||||
console.log('End Date:', endDate);
|
||||
|
||||
if (startDate != 0 && endDate != 0) {
|
||||
setTimeout(function() {
|
||||
$('#start_date').val(startDate)
|
||||
$('#end_date').val(endDate)
|
||||
$('#client_id').val(client_id).select2()
|
||||
$('#insurer_id').val(insurer_id).select2()
|
||||
$('#user_id').val(user_id).select2()
|
||||
$('#policy_type_id').val(policy_type_id).select2()
|
||||
$('#date_type').val(date_type).trigger('change');
|
||||
$('#issuer').val(issuer)
|
||||
setTimeout(function() {
|
||||
$('#client_branch_id').val(client_branch_id).select2()
|
||||
$('#insurer_branch_id').val(insurer_branch_id).select2()
|
||||
setTimeout(function() {
|
||||
$('#client_policy_id').val(client_policy_id).select2();
|
||||
}, 1000);
|
||||
}, 2000)
|
||||
}, 1000)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$(function() {
|
||||
|
||||
const url = new URL(window.location.href);
|
||||
const params = new URLSearchParams(url.search);
|
||||
|
||||
// Get start and end dates from URL parameters, or use default values
|
||||
const startDateParam = params.get('start_date') || moment().subtract(29, 'days').format('DD-MM-YYYY');
|
||||
const endDateParam = params.get('end_date') || moment().format('DD-MM-YYYY');
|
||||
|
||||
// Parse the dates to moment objects
|
||||
var start = moment(startDateParam, 'DD-MM-YYYY');
|
||||
var end = moment(endDateParam, 'DD-MM-YYYY');
|
||||
|
||||
// var start = moment().subtract(29, 'days');
|
||||
// var end = moment();
|
||||
|
||||
function cb(start, end) {
|
||||
$('#reportrange').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
|
||||
$('#startDate').val(start.format('DD-MM-YYYY'));
|
||||
$('#endDate').val(end.format('DD-MM-YYYY'));
|
||||
}
|
||||
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
locale: {
|
||||
format: 'DD-MM-YYYY'
|
||||
},
|
||||
ranges: {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
||||
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
}
|
||||
}, cb);
|
||||
|
||||
cb(start, end);
|
||||
|
||||
$('#clear-filters').on('click', function() {
|
||||
// Reset all select dropdowns to the first option
|
||||
$('#client_id').val('0').change();
|
||||
$('#insurer_id').val('0').change();
|
||||
$('#policy_type_id').val('0').change();
|
||||
$('#date_type').val('0');
|
||||
$('#issuer').val('0');
|
||||
$('#date_div').hide()
|
||||
|
||||
// Reset the date range picker to default
|
||||
$('#reportrange').data('daterangepicker').setStartDate(moment().subtract(29, 'days'));
|
||||
$('#reportrange').data('daterangepicker').setEndDate(moment());
|
||||
cb(start, end); // Update the displayed date range
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function hideDateField(input = null) {
|
||||
let val = $('#date_type').val();
|
||||
|
||||
if (input) {
|
||||
val = input;
|
||||
}
|
||||
|
||||
if (val != 0) {
|
||||
$('#date_div').show()
|
||||
} else {
|
||||
$('#date_div').hide()
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------
|
||||
|
||||
//featch client, client branch, insurer, insurer branch and client policy list data
|
||||
function getClientAndBranchAndPolicy() {
|
||||
$.ajax({
|
||||
url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>',
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
|
||||
console.log('getClientAndBranchAndPolicy', res);
|
||||
if (res.status == true) {
|
||||
client_list = res.client_data;
|
||||
branch_list = res.branch_data;
|
||||
policy_list = res.policy_data;
|
||||
insurer_list = res.insurer_data;
|
||||
insurer_branch_list = res.insurer_branch_data;
|
||||
appendClients(res.client_data);
|
||||
appendInsurer(res.insurer_data);
|
||||
} else {
|
||||
console.log('No data found');
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//append clients for filter
|
||||
function appendClients(data) {
|
||||
$('#client_id').empty();
|
||||
|
||||
$('#client_id').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select Client'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.client_name,
|
||||
'data-cn': item.client_name,
|
||||
'data-ct': item.client_type,
|
||||
class: (item.client_type == 1) ? 'group' : (item.client_type == 2) ? 'individual' : ''
|
||||
});
|
||||
|
||||
$('#client_id').append(option);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//append clients branch for filter
|
||||
function appendBranch(data) {
|
||||
|
||||
$('#client_branch_id').empty();
|
||||
|
||||
$('#client_branch_id').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select Branch'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.branch_name
|
||||
});
|
||||
$('#client_branch_id').append(option);
|
||||
});
|
||||
}
|
||||
|
||||
//append insurer for filter
|
||||
function appendInsurer(data) {
|
||||
$('#insurer_id').empty();
|
||||
|
||||
$('#insurer_id').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select Insurer'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.name,
|
||||
});
|
||||
|
||||
$('#insurer_id').append(option);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//append insurer branch for filter
|
||||
function appendInsurerBranch(data) {
|
||||
|
||||
$('#insurer_branch_id').empty();
|
||||
|
||||
$('#insurer_branch_id').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select Insurer Branch'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.branch_name
|
||||
});
|
||||
$('#insurer_branch_id').append(option);
|
||||
});
|
||||
}
|
||||
|
||||
//append client policy for filter
|
||||
function appendPolicies(data) {
|
||||
// console.log('appendPolicies', data);
|
||||
// console.log('appendPolicies', $('#client_policy_id'));
|
||||
|
||||
$('#client_policy_id').empty();
|
||||
$('#client_policy_id').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select Policy',
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.policy_type + '-' + item.policy_no,
|
||||
});
|
||||
$('#client_policy_id').append(option);
|
||||
});
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
|
||||
//client branch and insurer branch onchange document ready function
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#client_id').change(function() {
|
||||
|
||||
let client_id = $(this).val();
|
||||
console.log('client_id', client_id);
|
||||
|
||||
if (branch_list != '') {
|
||||
// console.log(branch_list[client_id]);
|
||||
let data = branch_list[client_id];
|
||||
appendBranch(data);
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
$('#insurer_id').change(function() {
|
||||
|
||||
let insurer_id = $(this).val();
|
||||
console.log('insurer_id', insurer_id);
|
||||
|
||||
if (insurer_branch_list != '') {
|
||||
// console.log(insurer_branch_list[insurer_id]);
|
||||
let data = insurer_branch_list[insurer_id];
|
||||
appendInsurerBranch(data);
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
//get policy list based on the client, client_branch, insurer, insurer_branch and policy type
|
||||
function getClientPolicyDataBasedOnClientAndInsuer() {
|
||||
|
||||
let client_id = $('#client_id').val() ?? 0;
|
||||
let client_branch_id = $('#client_branch_id').val() ?? 0;
|
||||
let insurer_id = $('#insurer_id').val() ?? 0;
|
||||
let insurer_branch_id = $('#insurer_branch_id').val() ?? 0;
|
||||
let policy_type_id = $('#policy_type_id').val() ?? 0;
|
||||
|
||||
let url = '<?= base_url('util/getClientPolicyDataBasedOnClientAndInsuer/') ?>';
|
||||
|
||||
let requestData = {
|
||||
client_id: client_id,
|
||||
client_branch_id: client_branch_id,
|
||||
insurer_id: insurer_id,
|
||||
insurer_branch_id: insurer_branch_id,
|
||||
policy_type_id: policy_type_id,
|
||||
};
|
||||
|
||||
sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) {
|
||||
console.log('Data fetched successfully:', response);
|
||||
|
||||
if (response.status === true) {
|
||||
|
||||
appendPolicies(response.data)
|
||||
|
||||
} else {
|
||||
toastr.warning(response.message, 'WARNING');
|
||||
}
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//for the change title
|
||||
function changeTitle(input) {
|
||||
|
||||
let val = $(input).val();
|
||||
if (val == 'statement_month') {
|
||||
$('#bds_title').text(' - Statement Month Wise List')
|
||||
} else {
|
||||
$('#bds_title').text(' - Policy Wise List')
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
@ -26,7 +26,7 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="container-fluid-min">
|
||||
<h2>Retail Endorsement</h2>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
@ -332,7 +332,7 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
dom: "<'d-flex justify-content-between align-items-center'<'datatable-search'f><'datatable-buttons'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [{
|
||||
|
||||
@ -8,10 +8,7 @@
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
.col-12 {
|
||||
|
||||
max-width: 98% !important;
|
||||
}
|
||||
|
||||
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
|
||||
@ -45,7 +45,7 @@ table.dataTable tbody td {
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h2 style="position: relative;">Claim Feedback List </h2>
|
||||
<h4 style="position: relative;">Claim Feedback List </h4>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -28,445 +28,449 @@
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="<?= !isset($ticket_data) ? "card" : "" ?>" style="margin-right: 23px;">
|
||||
<div class="card-body">
|
||||
<?php if (!isset($ticket_data)) { ?>
|
||||
<!-- Header Section -->
|
||||
<div class="row mb-3">
|
||||
<div class="col-6 d-flex align-items-center">
|
||||
<h4 class="mb-0">Claim GMC</h4>
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
<a href="<?= base_url('ticket/list'); ?>" aria-label="Back to ticket list">
|
||||
<i class="mdi mdi-arrow-left" style="font-size: 17px;"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<form role="form" class="parsley-examples" method="post" id="ticket_form_data" onsubmit="submitClaimForm(event, this)" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" id="ticket_type_id" name="ticket_type_id" value="1">
|
||||
<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="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 id="accordion1" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h4 class="m-1">
|
||||
Employee details
|
||||
<a id="toggleIcon1" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" aria-expanded="true">
|
||||
<i id="icon1" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
<div class="container-fluid-min">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="<?= !isset($ticket_data) ? "card" : "" ?>" >
|
||||
<div class="card-body">
|
||||
<?php if (!isset($ticket_data)) { ?>
|
||||
<!-- Header Section -->
|
||||
<div class="row mb-3">
|
||||
<div class="col-6 d-flex align-items-center">
|
||||
<h4 class="mb-0">Claim GMC</h4>
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
<a href="<?= base_url('ticket/list'); ?>" aria-label="Back to ticket list">
|
||||
<i class="mdi mdi-arrow-left" style="font-size: 17px;"></i>
|
||||
</a>
|
||||
</h4>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion1">
|
||||
<div class="card-body">
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<form role="form" class="parsley-examples" method="post" id="ticket_form_data" onsubmit="submitClaimForm(event, this)" enctype="multipart/form-data">
|
||||
|
||||
<!-- first_data_points -->
|
||||
<div class="form-row">
|
||||
<input type="hidden" id="ticket_type_id" name="ticket_type_id" value="1">
|
||||
<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="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 col-md-3">
|
||||
<label for="emp_code" class="label-font-size">Employee ID <span class="text-danger">*</span> <i class="mdi mdi-magnify text-danger"
|
||||
aria-hidden="true" onclick="openFetchEmpDataodal(this)"></i> <span
|
||||
class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="emp_code" placeholder="Enter Employee ID"
|
||||
value="<?= isset($ticket_data['emp_code']) ? $ticket_data['emp_code'] : '' ?>"
|
||||
name="emp_code" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="emp_name" class="label-font-size">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="text" class="form-control" id="emp_name" placeholder="Enter Employee Name"
|
||||
value="<?= isset($ticket_data['emp_name']) ? $ticket_data['emp_name'] : '' ?>"
|
||||
name="emp_name" required>
|
||||
</div>
|
||||
<div id="accordion1" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h4 class="m-1">
|
||||
Employee details
|
||||
<a id="toggleIcon1" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" aria-expanded="true">
|
||||
<i id="icon1" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h4>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion1">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="insured_name" class="label-font-size"> Insured Name <span class="text-danger">*</span></label>
|
||||
<input type=hidden id="insured_emp_id" name="insured_emp_id" value="<?= isset($ticket_data['insured_emp_id']) ? $ticket_data['insured_emp_id'] : '' ?>">
|
||||
<input class="form-control" id="insured_name" name="insured_name" value="<?= isset($ticket_data['insured_name']) ? $ticket_data['insured_name'] : '' ?>" required>
|
||||
</div>
|
||||
<!-- first_data_points -->
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="relationship" class="label-font-size"> Relationship <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="relationship" name="relationship" required>
|
||||
<option value="">Select Relationship</option>
|
||||
<?php
|
||||
if (isset($relationshipType) && count($relationshipType)) {
|
||||
foreach ($relationshipType as $key => $value) {
|
||||
$selected = (isset($ticket_data) && $ticket_data['relationship'] == $key) ? 'selected' : '';
|
||||
echo "<option value='$key' $selected>$value</option>";
|
||||
<div class="form-group col-md-3">
|
||||
<label for="emp_code" class="label-font-size">Employee ID <span class="text-danger">*</span> <i class="mdi mdi-magnify text-danger"
|
||||
aria-hidden="true" onclick="openFetchEmpDataodal(this)"></i> <span
|
||||
class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="emp_code" placeholder="Enter Employee ID"
|
||||
value="<?= isset($ticket_data['emp_code']) ? $ticket_data['emp_code'] : '' ?>"
|
||||
name="emp_code" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="emp_name" class="label-font-size">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="text" class="form-control" id="emp_name" placeholder="Enter Employee Name"
|
||||
value="<?= isset($ticket_data['emp_name']) ? $ticket_data['emp_name'] : '' ?>"
|
||||
name="emp_name" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="insured_name" class="label-font-size"> Insured Name <span class="text-danger">*</span></label>
|
||||
<input type=hidden id="insured_emp_id" name="insured_emp_id" value="<?= isset($ticket_data['insured_emp_id']) ? $ticket_data['insured_emp_id'] : '' ?>">
|
||||
<input class="form-control" id="insured_name" name="insured_name" value="<?= isset($ticket_data['insured_name']) ? $ticket_data['insured_name'] : '' ?>" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="relationship" class="label-font-size"> Relationship <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="relationship" name="relationship" required>
|
||||
<option value="">Select Relationship</option>
|
||||
<?php
|
||||
if (isset($relationshipType) && count($relationshipType)) {
|
||||
foreach ($relationshipType as $key => $value) {
|
||||
$selected = (isset($ticket_data) && $ticket_data['relationship'] == $key) ? 'selected' : '';
|
||||
echo "<option value='$key' $selected>$value</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="policy_no" class="label-font-size">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_no" class="label-font-size">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">
|
||||
<label for="emp_mobile" class="label-font-size">Employee Mobile No <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="emp_mobile" placeholder="Enter EMP Mobile"
|
||||
value="<?= isset($ticket_data['emp_mobile']) ? $ticket_data['emp_mobile'] : '' ?>"
|
||||
name="emp_mobile" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="emp_mail" class="label-font-size">Employee Mail ID <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="emp_mail" placeholder="Enter EMP Mail"
|
||||
value="<?= isset($ticket_data['emp_mail']) ? $ticket_data['emp_mail'] : '' ?>"
|
||||
name="emp_mail" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="emp_personal_mail" class="label-font-size">Employee Personal Mail ID</label>
|
||||
<input type="text" class="form-control" id="emp_personal_mail" placeholder="Enter EMP Personal Mail"
|
||||
value="<?= isset($ticket_data['emp_personal_mail']) ? $ticket_data['emp_personal_mail'] : '' ?>"
|
||||
name="emp_personal_mail">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="client_name" class="label-font-size">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 required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="insurer_id" class="label-font-size">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 required>
|
||||
</div>
|
||||
<input type="hidden" id="empIDHidden" onchange="getClientPolicy()">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label class="label-font-size">Policy <span class="text-danger">*</span></label>
|
||||
<select id="emp_client_policy" name="client_policy_id"
|
||||
class="form-control custom-select" required onchange="setMinDateDOA(this.value); setInsurerAndTPAData(this)">
|
||||
<?php if (!empty($ticket_data['client_policy_id'])) { ?>
|
||||
<option value="<?= $ticket_data['client_policy_id'] ?>"><?= $ticket_data['client_policy_id_text'] ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="">Policy</option>
|
||||
<?php } ?>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="tpa_name">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="policy_no" class="label-font-size">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_no" class="label-font-size">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">
|
||||
<label class="label-font-size" for="acm_id">Account Manager <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="acm_id" name="acm_id" required>
|
||||
<!-- <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>";
|
||||
<div class="form-group col-md-3">
|
||||
<label for="emp_mobile" class="label-font-size">Employee Mobile No <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="emp_mobile" placeholder="Enter EMP Mobile"
|
||||
value="<?= isset($ticket_data['emp_mobile']) ? $ticket_data['emp_mobile'] : '' ?>"
|
||||
name="emp_mobile" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="emp_mail" class="label-font-size">Employee Mail ID <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="emp_mail" placeholder="Enter EMP Mail"
|
||||
value="<?= isset($ticket_data['emp_mail']) ? $ticket_data['emp_mail'] : '' ?>"
|
||||
name="emp_mail" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="emp_personal_mail" class="label-font-size">Employee Personal Mail ID</label>
|
||||
<input type="text" class="form-control" id="emp_personal_mail" placeholder="Enter EMP Personal Mail"
|
||||
value="<?= isset($ticket_data['emp_personal_mail']) ? $ticket_data['emp_personal_mail'] : '' ?>"
|
||||
name="emp_personal_mail">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="client_name" class="label-font-size">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 required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="insurer_id" class="label-font-size">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 required>
|
||||
</div>
|
||||
<input type="hidden" id="empIDHidden" onchange="getClientPolicy()">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label class="label-font-size">Policy <span class="text-danger">*</span></label>
|
||||
<select id="emp_client_policy" name="client_policy_id"
|
||||
class="form-control custom-select" required onchange="setMinDateDOA(this.value); setInsurerAndTPAData(this)">
|
||||
<?php if (!empty($ticket_data['client_policy_id'])) { ?>
|
||||
<option value="<?= $ticket_data['client_policy_id'] ?>"><?= $ticket_data['client_policy_id_text'] ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="">Policy</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="tpa_name">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 class="label-font-size" for="acm_id">Account Manager <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="acm_id" name="acm_id" required>
|
||||
<!-- <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>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end first_data_points -->
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<!-- end first_data_points -->
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="accordion2" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h4 class="m-1">
|
||||
Claim Details
|
||||
<i id="infoIcon" class="mdi mdi-information-outline info-icon" title="Click for more details" style="margin-left: 5px;"></i>
|
||||
<?= isset($ticket_data['claim_number']) && !empty($ticket_data['claim_number']) ? '( Claim No : ' . $ticket_data['claim_number'] . ' )' : '' ?>
|
||||
|
||||
|
||||
<a id="toggleIcon1" class="text-dark float-right" data-toggle="collapse" href="#collapseTwo" aria-expanded="true">
|
||||
<i id="icon1" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h4>
|
||||
<div id="collapseTwo" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion2">
|
||||
<div class="card-body">
|
||||
<!-- second_data_points -->
|
||||
<div class="form-row">
|
||||
<div id="accordion2" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h4 class="m-1">
|
||||
Claim Details
|
||||
<i id="infoIcon" class="mdi mdi-information-outline info-icon" title="Click for more details" style="margin-left: 5px;"></i>
|
||||
<?= isset($ticket_data['claim_number']) && !empty($ticket_data['claim_number']) ? '( Claim No : ' . $ticket_data['claim_number'] . ' )' : '' ?>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="claim_status">Status <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="claim_status_id" name="claim_status_id" required>
|
||||
<!-- <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>";
|
||||
|
||||
<a id="toggleIcon1" class="text-dark float-right" data-toggle="collapse" href="#collapseTwo" aria-expanded="true">
|
||||
<i id="icon1" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h4>
|
||||
<div id="collapseTwo" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion2">
|
||||
<div class="card-body">
|
||||
<!-- second_data_points -->
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="claim_status">Status <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="claim_status_id" name="claim_status_id" required>
|
||||
<!-- <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>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="priority">Priority <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="priority" name="priority" required>
|
||||
<!-- <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>";
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="priority">Priority <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="priority" name="priority" required>
|
||||
<!-- <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>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="mode_of_intimation"> Mode of Submission <span
|
||||
class="text-danger">*</span></label>
|
||||
<select class="form-control" id="mode_of_intimation" name="mode_of_intimation" required>
|
||||
<!-- <option value="0">Select Mode</option> -->
|
||||
<?php
|
||||
if (isset($modeOFIntimate) && count($modeOFIntimate)) {
|
||||
foreach ($modeOFIntimate as $key => $value) {
|
||||
$selected = (isset($ticket_data) && $ticket_data['mode_of_intimation'] == $key) ? 'selected' : '';
|
||||
echo "<option value='" . $key . "' $selected>" . $value . "</option>";
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="mode_of_intimation"> Mode of Submission <span
|
||||
class="text-danger">*</span></label>
|
||||
<select class="form-control" id="mode_of_intimation" name="mode_of_intimation" required>
|
||||
<!-- <option value="0">Select Mode</option> -->
|
||||
<?php
|
||||
if (isset($modeOFIntimate) && count($modeOFIntimate)) {
|
||||
foreach ($modeOFIntimate as $key => $value) {
|
||||
$selected = (isset($ticket_data) && $ticket_data['mode_of_intimation'] == $key) ? 'selected' : '';
|
||||
echo "<option value='" . $key . "' $selected>" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="claim_type"> Claim Type <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="claim_type" name="claim_type" required>
|
||||
<!-- <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>";
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="claim_type"> Claim Type <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="claim_type" name="claim_type" required>
|
||||
<!-- <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>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="hospital_name">Hospital Name <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="hospital_name"
|
||||
placeholder="Enter Hospital Name"
|
||||
value="<?= isset($ticket_data['hospital_name']) ? $ticket_data['hospital_name'] : '' ?>"
|
||||
name="hospital_name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="hospital_name">Hospital Name <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="hospital_name"
|
||||
placeholder="Enter Hospital Name"
|
||||
value="<?= isset($ticket_data['hospital_name']) ? $ticket_data['hospital_name'] : '' ?>"
|
||||
name="hospital_name" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="doa">DOA <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="doa" placeholder="Enter DOA"
|
||||
value="<?= isset($ticket_data['doa']) ? $ticket_data['doa'] : '' ?>"
|
||||
name="doa" required>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="doa">DOA <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="doa" placeholder="Enter DOA"
|
||||
value="<?= isset($ticket_data['doa']) ? $ticket_data['doa'] : '' ?>"
|
||||
name="doa" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="dod">DOD <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="dod" placeholder="Enter DOD"
|
||||
value="<?= isset($ticket_data['dod']) ? $ticket_data['dod'] : '' ?>" name="dod" required>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="dod">DOD <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="dod" placeholder="Enter DOD"
|
||||
value="<?= isset($ticket_data['dod']) ? $ticket_data['dod'] : '' ?>" name="dod" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="claim_amount">Claim Amount <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="claim_amount"
|
||||
placeholder="Enter Claim Amount"
|
||||
value="<?= isset($ticket_data['claim_amount']) ? $ticket_data['claim_amount'] : '' ?>"
|
||||
name="claim_amount" required>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" for="claim_amount">Claim Amount <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="claim_amount"
|
||||
placeholder="Enter Claim Amount"
|
||||
value="<?= isset($ticket_data['claim_amount']) ? $ticket_data['claim_amount'] : '' ?>"
|
||||
name="claim_amount" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" id="pod_no_label_1" for="pod_no">POD No with Courier Name <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"
|
||||
value="<?= isset($ticket_data['pod_no']) ? $ticket_data['pod_no'] : '' ?>"
|
||||
name="pod_no">
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="label-font-size" id="pod_no_label_1" for="pod_no">POD No with Courier Name <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"
|
||||
value="<?= isset($ticket_data['pod_no']) ? $ticket_data['pod_no'] : '' ?>"
|
||||
name="pod_no">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end second_data_points -->
|
||||
</div>
|
||||
<!-- end second_data_points -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="accordion3" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h4 class="m-1">
|
||||
Additional Documents
|
||||
<a id="toggleIcon1" class="text-dark float-right" data-toggle="collapse" href="#collapseThree" aria-expanded="true">
|
||||
<i id="icon1" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h4>
|
||||
<div id="collapseThree" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion3">
|
||||
<div class="card-body">
|
||||
<!-- third_data_points -->
|
||||
<div class="form-row">
|
||||
<div id="accordion3" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h4 class="m-1">
|
||||
Additional Documents
|
||||
<a id="toggleIcon1" class="text-dark float-right" data-toggle="collapse" href="#collapseThree" aria-expanded="true">
|
||||
<i id="icon1" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h4>
|
||||
<div id="collapseThree" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion3">
|
||||
<div class="card-body">
|
||||
<!-- third_data_points -->
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-3 up_cnu" style="display: none;">
|
||||
<label class="label-font-size" for="claim_number">Claim Number <span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="claim_number" placeholder="Enter Claim NO"
|
||||
value="<?= isset($ticket_data['claim_number']) ? $ticket_data['claim_number'] : '' ?>"
|
||||
name="claim_number">
|
||||
</div>
|
||||
<div class="form-group col-md-3 up_cnu" style="display: none;">
|
||||
<label class="label-font-size" for="claim_number">Claim Number <span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="claim_number" placeholder="Enter Claim NO"
|
||||
value="<?= isset($ticket_data['claim_number']) ? $ticket_data['claim_number'] : '' ?>"
|
||||
name="claim_number">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 up_cnu" style="display: none;">
|
||||
<label class="label-font-size" for="registration_date">Registration Date</label>
|
||||
<input type="text" class="form-control datepicker" id="registration_date" placeholder="Select Registration Date"
|
||||
value="<?= isset($ticket_data['registration_date']) ? $ticket_data['registration_date'] : '' ?>" name="registration_date">
|
||||
</div>
|
||||
<div class="form-group col-md-3 up_cnu" style="display: none;">
|
||||
<label class="label-font-size" for="registration_date">Registration Date</label>
|
||||
<input type="text" class="form-control datepicker" id="registration_date" placeholder="Select Registration Date"
|
||||
value="<?= isset($ticket_data['registration_date']) ? $ticket_data['registration_date'] : '' ?>" name="registration_date">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 cda_ir" style="display: none;">
|
||||
<label class="label-font-size" for="raised_date">Raised Date</label>
|
||||
<input type="text" class="form-control datepicker" id="raised_date" placeholder="Select Raised Date"
|
||||
value="<?= isset($ticket_data['raised_date']) ? $ticket_data['raised_date'] : '' ?>" name="raised_date">
|
||||
</div>
|
||||
<div class="form-group col-md-3 cda_ir" style="display: none;">
|
||||
<label class="label-font-size" for="raised_date">Raised Date</label>
|
||||
<input type="text" class="form-control datepicker" id="raised_date" placeholder="Select Raised Date"
|
||||
value="<?= isset($ticket_data['raised_date']) ? $ticket_data['raised_date'] : '' ?>" name="raised_date">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 up_qdr" style="display: none;">
|
||||
<label class="label-font-size" for="query_received_date">Query Received Date</label>
|
||||
<input type="text" class="form-control datepicker" id="query_received_date" placeholder="Select Query Received Date"
|
||||
value="<?= isset($ticket_data['query_received_date']) ? $ticket_data['query_received_date'] : '' ?>" name="query_received_date">
|
||||
</div>
|
||||
<div class="form-group col-md-3 up_qdr" style="display: none;">
|
||||
<label class="label-font-size" for="query_received_date">Query Received Date</label>
|
||||
<input type="text" class="form-control datepicker" id="query_received_date" placeholder="Select Query Received Date"
|
||||
value="<?= isset($ticket_data['query_received_date']) ? $ticket_data['query_received_date'] : '' ?>" name="query_received_date">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 rejected" style="display: none;">
|
||||
<label class="label-font-size" for="denial_reason">Denial Reason</label>
|
||||
<input type="text" class="form-control" id="denial_reason" placeholder="Enter Denial Reason"
|
||||
value="<?= isset($ticket_data['denial_reason']) ? $ticket_data['denial_reason'] : '' ?>" name="denial_reason">
|
||||
</div>
|
||||
<div class="form-group col-md-3 rejected" style="display: none;">
|
||||
<label class="label-font-size" for="denial_reason">Denial Reason</label>
|
||||
<input type="text" class="form-control" id="denial_reason" placeholder="Enter Denial Reason"
|
||||
value="<?= isset($ticket_data['denial_reason']) ? $ticket_data['denial_reason'] : '' ?>" name="denial_reason">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 rejected" style="display: none;">
|
||||
<label class="label-font-size" for="denial_date">Denial Date</label>
|
||||
<input type="text" class="form-control datepicker" id="denial_date" placeholder="Select Denial Date"
|
||||
value="<?= isset($ticket_data['denial_date']) ? $ticket_data['denial_date'] : '' ?>" name="denial_date">
|
||||
</div>
|
||||
<div class="form-group col-md-3 rejected" style="display: none;">
|
||||
<label class="label-font-size" for="denial_date">Denial Date</label>
|
||||
<input type="text" class="form-control datepicker" id="denial_date" placeholder="Select Denial Date"
|
||||
value="<?= isset($ticket_data['denial_date']) ? $ticket_data['denial_date'] : '' ?>" name="denial_date">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 approved" style="display: none;">
|
||||
<label class="label-font-size" for="approved_amount">Approved Amount</label> #
|
||||
<input type="text" class="form-control" id="approved_amount" placeholder="Enter Approved Amount"
|
||||
value="<?= isset($ticket_data['approved_amount']) ? $ticket_data['approved_amount'] : '' ?>" name="approved_amount">
|
||||
</div>
|
||||
<div class="form-group col-md-3 approved" style="display: none;">
|
||||
<label class="label-font-size" for="approved_amount">Approved Amount</label> #
|
||||
<input type="text" class="form-control" id="approved_amount" placeholder="Enter Approved Amount"
|
||||
value="<?= isset($ticket_data['approved_amount']) ? $ticket_data['approved_amount'] : '' ?>" name="approved_amount">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 approved" style="display: none;">
|
||||
<label class="label-font-size" for="approved_date">Approved Date</label>
|
||||
<input type="text" class="form-control datepicker" id="approved_date" placeholder="Select Approved Date"
|
||||
value="<?= isset($ticket_data['approved_date']) ? $ticket_data['approved_date'] : '' ?>" name="approved_date">
|
||||
</div>
|
||||
<div class="form-group col-md-3 approved" style="display: none;">
|
||||
<label class="label-font-size" for="approved_date">Approved Date</label>
|
||||
<input type="text" class="form-control datepicker" id="approved_date" placeholder="Select Approved Date"
|
||||
value="<?= isset($ticket_data['approved_date']) ? $ticket_data['approved_date'] : '' ?>" name="approved_date">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6 approved" style="display: none;">
|
||||
<label class="label-font-size" for="approved_letter">Approved Letter</label>
|
||||
<input type="text" class="form-control" id="approved_letter" placeholder="Enter Approved Letter"
|
||||
value="<?= isset($ticket_data['approved_letter']) ? $ticket_data['approved_letter'] : '' ?>" name="approved_letter">
|
||||
</div>
|
||||
<div class="form-group col-md-6 approved" style="display: none;">
|
||||
<label class="label-font-size" for="approved_letter">Approved Letter</label>
|
||||
<input type="text" class="form-control" id="approved_letter" placeholder="Enter Approved Letter"
|
||||
value="<?= isset($ticket_data['approved_letter']) ? $ticket_data['approved_letter'] : '' ?>" name="approved_letter">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6 approved" style="display: none;">
|
||||
<label class="label-font-size" for="approved_description">Approved Description</label>
|
||||
<input type="text" class="form-control" id="approved_description" placeholder="Enter Approved Description"
|
||||
value="<?= isset($ticket_data['approved_description']) ? $ticket_data['approved_description'] : '' ?>" name="approved_description">
|
||||
</div>
|
||||
<div class="form-group col-md-6 approved" style="display: none;">
|
||||
<label class="label-font-size" for="approved_description">Approved Description</label>
|
||||
<input type="text" class="form-control" id="approved_description" placeholder="Enter Approved Description"
|
||||
value="<?= isset($ticket_data['approved_description']) ? $ticket_data['approved_description'] : '' ?>" name="approved_description">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 settled" style="display: none;">
|
||||
<label class="label-font-size" for="utr_details">UTR Details</label>
|
||||
<input type="text" class="form-control" id="utr_details" placeholder="Enter UTR Details"
|
||||
value="<?= isset($ticket_data['utr_details']) ? $ticket_data['utr_details'] : '' ?>" name="utr_details">
|
||||
</div>
|
||||
<div class="form-group col-md-3 settled" style="display: none;">
|
||||
<label class="label-font-size" for="utr_details">UTR Details</label>
|
||||
<input type="text" class="form-control" id="utr_details" placeholder="Enter UTR Details"
|
||||
value="<?= isset($ticket_data['utr_details']) ? $ticket_data['utr_details'] : '' ?>" name="utr_details">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 settled" style="display: none;">
|
||||
<label class="label-font-size" for="settled_date">Settled Date</label>
|
||||
<input type="text" class="form-control datepicker" id="settled_date" placeholder="Select Settled Date"
|
||||
value="<?= isset($ticket_data['settled_date']) ? $ticket_data['settled_date'] : '' ?>" name="settled_date">
|
||||
</div>
|
||||
<div class="form-group col-md-3 settled" style="display: none;">
|
||||
<label class="label-font-size" for="settled_date">Settled Date</label>
|
||||
<input type="text" class="form-control datepicker" id="settled_date" placeholder="Select Settled Date"
|
||||
value="<?= isset($ticket_data['settled_date']) ? $ticket_data['settled_date'] : '' ?>" name="settled_date">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6 settled" style="display: none;">
|
||||
<label class="label-font-size" for="settle_letter">Settle Letter</label>
|
||||
<input type="text" class="form-control" id="settle_letter" placeholder="Enter Settle Letter"
|
||||
value="<?= isset($ticket_data['settle_letter']) ? $ticket_data['settle_letter'] : '' ?>" name="settle_letter">
|
||||
</div>
|
||||
<div class="form-group col-md-6 settled" style="display: none;">
|
||||
<label class="label-font-size" for="settle_letter">Settle Letter</label>
|
||||
<input type="text" class="form-control" id="settle_letter" placeholder="Enter Settle Letter"
|
||||
value="<?= isset($ticket_data['settle_letter']) ? $ticket_data['settle_letter'] : '' ?>" name="settle_letter">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 payment" style="display: none;">
|
||||
<label class="label-font-size" for="pay_initiate_date">Payment Initiate Date</label>
|
||||
<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 class="form-group col-md-3 payment" style="display: none;">
|
||||
<label class="label-font-size" for="pay_initiate_date">Payment Initiate Date</label>
|
||||
<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 class="form-group col-md-3 canceled" style="display: none;">
|
||||
<label class="label-font-size" for="cancel_remark">Cancel Remark</label>
|
||||
<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 class="form-group col-md-3 canceled" style="display: none;">
|
||||
<label class="label-font-size" for="cancel_remark">Cancel Remark</label>
|
||||
<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 class="form-group col-md-3 returned" style="display: none;">
|
||||
<label class="label-font-size" 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-3 returned" style="display: none;">
|
||||
<label class="label-font-size" 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;">
|
||||
<label class="label-font-size" for="awb_no_courier_name">Return AWB No with Courier Name</label>
|
||||
<input type="text" class="form-control" id="awb_no_courier_name" placeholder="eg : 0001/ST Courier"
|
||||
value="<?= isset($ticket_data['awb_no_courier_name']) ? $ticket_data['awb_no_courier_name'] : '' ?>" name="awb_no_courier_name">
|
||||
</div>
|
||||
<div class="form-group col-md-6 returned" style="display: none;">
|
||||
<label class="label-font-size" for="awb_no_courier_name">Return AWB No with Courier Name</label>
|
||||
<input type="text" class="form-control" id="awb_no_courier_name" placeholder="eg : 0001/ST Courier"
|
||||
value="<?= isset($ticket_data['awb_no_courier_name']) ? $ticket_data['awb_no_courier_name'] : '' ?>" name="awb_no_courier_name">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 non_id" style="display: none;">
|
||||
<label class="label-font-size" for="non_id_reason">Non ID Reason <span id="non_id_reason_lable_id" class="text-danger"></span></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>";
|
||||
<div class="form-group col-md-3 non_id" style="display: none;">
|
||||
<label class="label-font-size" for="non_id_reason">Non ID Reason <span id="non_id_reason_lable_id" class="text-danger"></span></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>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end third_data_points -->
|
||||
</div>
|
||||
<!-- end third_data_points -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<?php if (get_role_id() == 5 && isset($ticket_data) && $ticket_data['claim_status_id'] == 8) { ?>
|
||||
<a class="btn btn-secondary waves-effect waves-light mr-1" onclick="showConfirmationModal(event)">Approve Claim Rejection</a>
|
||||
<?php } ?>
|
||||
<!-- <button type="button" class="btn btn-primary waves-effect waves-light mr-1" id="btnApprove" >Approve</button> -->
|
||||
</div>
|
||||
<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>
|
||||
<?php if (get_role_id() == 5 && isset($ticket_data) && $ticket_data['claim_status_id'] == 8) { ?>
|
||||
<a class="btn btn-secondary waves-effect waves-light mr-1" onclick="showConfirmationModal(event)">Approve Claim Rejection</a>
|
||||
<?php } ?>
|
||||
<!-- <button type="button" class="btn btn-primary waves-effect waves-light mr-1" id="btnApprove" >Approve</button> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Info Modal -->
|
||||
<div class="modal fade" id="moreInfoModal" tabindex="-1" role="dialog" aria-labelledby="fullWidthModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-xl" role="document">
|
||||
@ -1197,7 +1201,6 @@
|
||||
$('#tpa_id').val(tap_id);
|
||||
$('#tpa_name').val(tap_name);
|
||||
}
|
||||
|
||||
</script>
|
||||
<script>
|
||||
$("#infoIcon").click(function() {
|
||||
|
||||
@ -8,10 +8,7 @@
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
.col-12 {
|
||||
|
||||
max-width: 98% !important;
|
||||
}
|
||||
|
||||
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
|
||||
@ -1,69 +1,71 @@
|
||||
<div class="row">
|
||||
<!-- <h3 class="ml-3">Claim Reports</h3> -->
|
||||
<div class="col-xl-12">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4" id="date_div">
|
||||
<label>Date<span class="text-danger"></span></label>
|
||||
<div id="reportrange" class="form-control" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%">
|
||||
<i class="mdi mdi-calendar-blank"></i>
|
||||
<span></span> <i class="mdi mdi-menu-down"></i>
|
||||
<div class="container-fluid-min">
|
||||
<div class="row">
|
||||
<!-- <h3 class="ml-3">Claim Reports</h3> -->
|
||||
<div class="col-xl-12">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h4 class="m-1">
|
||||
<span>Filter</span>
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h4>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4" id="date_div">
|
||||
<label>Date<span class="text-danger"></span></label>
|
||||
<div id="reportrange" class="form-control" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%">
|
||||
<i class="mdi mdi-calendar-blank"></i>
|
||||
<span></span> <i class="mdi mdi-menu-down"></i>
|
||||
</div>
|
||||
<input type="hidden" id="startDate" value=<?= $default_start ?>>
|
||||
<input type="hidden" id="endDate" value=<?= $default_end ?>>
|
||||
</div>
|
||||
<input type="hidden" id="startDate" value=<?= $default_start ?>>
|
||||
<input type="hidden" id="endDate" value=<?= $default_end ?>>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Policy Type<span class="text-danger"> *</span></label> <br />
|
||||
<select name="policy_type" class="form-control" id="policy_type" required>
|
||||
<option value="">Select</option>
|
||||
<?php foreach ($policy_type as $policy => $key) : ?>
|
||||
<option value="<?= $policy ?>"><?= $key ?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Report Type<span class="text-danger"> *</span></label> <br />
|
||||
<select class="form-control" id="report_type" required>
|
||||
<option value="0">Select</option>
|
||||
<?php foreach ($report_type as $reports => $key) : ?>
|
||||
<option value="<?= $reports ?>"><?= $key ?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row justify-content-end">
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Policy Type<span class="text-danger"> *</span></label> <br />
|
||||
<select name="policy_type" class="form-control" id="policy_type" required>
|
||||
<option value="">Select</option>
|
||||
<?php foreach ($policy_type as $policy => $key) : ?>
|
||||
<option value="<?= $policy ?>"><?= $key ?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<div class="col-auto">
|
||||
<a href="#" class="btn btn-primary waves-effect waves-light submit-btn" id="get-report-page" onclick="fetchReportPage(event);">Submit</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Report Type<span class="text-danger"> *</span></label> <br />
|
||||
<select class="form-control" id="report_type" required>
|
||||
<option value="0">Select</option>
|
||||
<?php foreach ($report_type as $reports => $key) : ?>
|
||||
<option value="<?= $reports ?>"><?= $key ?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div class="row justify-content-end">
|
||||
|
||||
<div class="col-auto">
|
||||
<a href="#" class="btn btn-primary waves-effect waves-light submit-btn" id="get-report-page" onclick="fetchReportPage(event);">Submit</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="report"></div>
|
||||
</div>
|
||||
<div class="card mb-1">
|
||||
|
||||
<div id="report"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
@ -98,44 +100,43 @@
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
function fetchReportPage() {
|
||||
|
||||
function fetchReportPage() {
|
||||
var fromDate = $('#startDate').val();
|
||||
var toDate = $('#endDate').val();
|
||||
var policy_type = $('#policy_type').val();
|
||||
var report_type = $('#report_type').val();
|
||||
var requestData = {
|
||||
fromDate: fromDate,
|
||||
toDate: toDate,
|
||||
policy_type: policy_type,
|
||||
report_type: report_type
|
||||
};
|
||||
// console.log(requestData);
|
||||
var url = '<?= base_url('/ticket/ticket_reports') ?>';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
sendAjaxRequestForGlobal(url, 'POST', requestData, function(response) {
|
||||
if (response.status == true) {
|
||||
$('#report').html(response.html);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
} else {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
let message = response.message;
|
||||
toastr.error(message, 'ERROR');
|
||||
}
|
||||
|
||||
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
toastr.error('An error occurred while fetching the report page.', 'ERROR');
|
||||
|
||||
var fromDate = $('#startDate').val();
|
||||
var toDate = $('#endDate').val();
|
||||
var policy_type = $('#policy_type').val();
|
||||
var report_type = $('#report_type').val();
|
||||
var requestData = {
|
||||
fromDate: fromDate,
|
||||
toDate: toDate,
|
||||
policy_type: policy_type,
|
||||
report_type: report_type
|
||||
};
|
||||
// console.log(requestData);
|
||||
var url = '<?= base_url('/ticket/ticket_reports') ?>';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
sendAjaxRequestForGlobal(url, 'POST', requestData, function(response) {
|
||||
if (response.status == true) {
|
||||
$('#report').html(response.html);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
}else{
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
let message = response.message;
|
||||
toastr.error(message,'ERROR');
|
||||
}
|
||||
|
||||
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
toastr.error('An error occurred while fetching the report page.', 'ERROR');
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@ -5,249 +5,251 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12" style="margin-top: -12px;">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h2 class="m-3">
|
||||
Claim Filter
|
||||
<div class="container-fluid-min">
|
||||
<div class="row">
|
||||
<div class="col-12" style="margin-top: -12px;">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h4>
|
||||
Filter
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h2>
|
||||
<div id="collapseOne" class="collapse hide" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
</h4>
|
||||
<div id="collapseOne" class="collapse hide" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="ticket_type"> Claim Type <span class="text-danger"></span></label>
|
||||
<select class="form-control" id="ticket_type" name="ticket_type">
|
||||
<option value="0">Select claim Type</option>
|
||||
<?php
|
||||
<div class="form-group col-md-3">
|
||||
<label for="ticket_type"> Claim Type <span class="text-danger"></span></label>
|
||||
<select class="form-control" id="ticket_type" name="ticket_type">
|
||||
<option value="0">Select claim Type</option>
|
||||
<?php
|
||||
if (isset($ticket_type) && count($ticket_type)) {
|
||||
foreach ($ticket_type as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
?>
|
||||
</select>
|
||||
</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>
|
||||
<input type="text" class="form-control" id="pod_no" name="pod_no">
|
||||
</div> -->
|
||||
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="insurer_id">Insurer<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="insurer_id" name="insurer_id">
|
||||
<option value="0">Select Insurer</option>
|
||||
<?php
|
||||
<div class="form-group col-md-3">
|
||||
<label for="insurer_id">Insurer<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="insurer_id" name="insurer_id">
|
||||
<option value="0">Select Insurer</option>
|
||||
<?php
|
||||
if (isset($insurer_list) && count($insurer_list)) {
|
||||
foreach ($insurer_list as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['name'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="tpa_id">TPA<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="tpa_id" name="tpa_id">
|
||||
<option value="0">Select TPA</option>
|
||||
<?php
|
||||
<div class="form-group col-md-3">
|
||||
<label for="tpa_id">TPA<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="tpa_id" name="tpa_id">
|
||||
<option value="0">Select TPA</option>
|
||||
<?php
|
||||
if (isset($tpa_list) && count($tpa_list)) {
|
||||
foreach ($tpa_list as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['name'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="claim_no">Claim No<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="claim_no" name="claim_no">
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="claim_no">Claim No<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="claim_no" name="claim_no">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="client_id"> Corporate Name <span class="text-danger"></span></label>
|
||||
<select class="form-control" id="client_id" name="client_id">
|
||||
<option value="0">Select Corporate</option>
|
||||
<?php
|
||||
<div class="form-group col-md-3">
|
||||
<label for="client_id"> Corporate Name <span class="text-danger"></span></label>
|
||||
<select class="form-control" id="client_id" name="client_id">
|
||||
<option value="0">Select Corporate</option>
|
||||
<?php
|
||||
if (isset($client_list) && count($client_list)) {
|
||||
foreach ($client_list as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['client_name'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="emp_code">Employee ID<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="emp_code" name="emp_code">
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="emp_code">Employee ID<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="emp_code" name="emp_code">
|
||||
</div>
|
||||
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<!-- <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_id" name="tpa_id">
|
||||
</div> -->
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="emp_mobile_no">Employee Mobile No<span
|
||||
class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="emp_mobile_no" name="emp_mobile_no">
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="emp_mobile_no">Employee Mobile No<span
|
||||
class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="emp_mobile_no" name="emp_mobile_no">
|
||||
</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" name="claim_status">
|
||||
<option value="0">Select status</option>
|
||||
<?php /*
|
||||
<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" name="claim_status">
|
||||
<option value="0">Select status</option>
|
||||
<?php /*
|
||||
if (isset($claim_status) && count($claim_status)) {
|
||||
foreach ($claim_status as $key => $value) {
|
||||
echo "<option value=" . $value['id'] . ">" . $value['status'] . "</option>";
|
||||
}
|
||||
}
|
||||
*/ ?>
|
||||
</select>
|
||||
</div>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12 text-right m-b-0" style="margin-bottom: -15px;">
|
||||
<a href="#" class="btn btn-secondary" id="clear-filters">Clear</a>
|
||||
<a class="btn btn-primary" id="get-emp-list" onclick="fetchTicketListData();">Submit</a>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12 text-right m-b-0" style="margin-bottom: -15px;">
|
||||
<a href="#" class="btn btn-secondary" id="clear-filters">Clear</a>
|
||||
<a class="btn btn-primary" id="get-emp-list" onclick="fetchTicketListData();">Submit</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="ticket_list_div">
|
||||
<?php include('ticket_list.php'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- end page title -->
|
||||
<div class="row" id="ticket_list_div">
|
||||
<?php include('ticket_list.php'); ?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
$(document).ready(function() {
|
||||
// Initialize select2
|
||||
$('#client_id').select2();
|
||||
$('#claim_status').select2();
|
||||
$('#insurer_id').select2();
|
||||
$('#tpa_id').select2();
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
$('#ticket_type').on('change',function(){
|
||||
$('#ticket_type').on('change', function() {
|
||||
var ticket_type = $('#ticket_type').val();
|
||||
var claim_status = <?= json_encode($claim_status) ?>;
|
||||
$('#claim_status').empty();
|
||||
$('#claim_status').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select Claim Status'
|
||||
}));
|
||||
value: '',
|
||||
text: 'Select Claim Status'
|
||||
}));
|
||||
|
||||
// console.log('Claim Status:', claim_status);
|
||||
for (var i = 0;i<claim_status.length;i++){
|
||||
if(claim_status[i]['ticket_type'] == ticket_type){
|
||||
for (var i = 0; i < claim_status.length; i++) {
|
||||
if (claim_status[i]['ticket_type'] == ticket_type) {
|
||||
$('#claim_status').append($('<option>', {
|
||||
value: claim_status[i]['id'], // Use 'id' as the value
|
||||
text: claim_status[i]['claim_status'] // Use 'claim_status' as the text
|
||||
value: claim_status[i]['id'], // Use 'id' as the value
|
||||
text: claim_status[i]['claim_status'] // Use 'claim_status' as the text
|
||||
}));
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
function fetchTicketListData() {
|
||||
function fetchTicketListData() {
|
||||
|
||||
var ticket_type = $('#ticket_type').val();
|
||||
var pod_no = $('#pod_no').val();
|
||||
var claim_no = $('#claim_no').val();
|
||||
var emp_code = $('#emp_code').val();
|
||||
var claim_status = $('#claim_status').val();
|
||||
var emp_mobile_no = $('#emp_mobile_no').val();
|
||||
var tpa_id = $('#tpa_id').val();
|
||||
var client_id = $('#client_id').val();
|
||||
var insurer_id = $('#insurer_id').val();
|
||||
var tpa_id = $('#tpa_id').val();
|
||||
var ticket_type = $('#ticket_type').val();
|
||||
var pod_no = $('#pod_no').val();
|
||||
var claim_no = $('#claim_no').val();
|
||||
var emp_code = $('#emp_code').val();
|
||||
var claim_status = $('#claim_status').val();
|
||||
var emp_mobile_no = $('#emp_mobile_no').val();
|
||||
var tpa_id = $('#tpa_id').val();
|
||||
var client_id = $('#client_id').val();
|
||||
var insurer_id = $('#insurer_id').val();
|
||||
var tpa_id = $('#tpa_id').val();
|
||||
|
||||
var requestData = {
|
||||
ticket_type_id: ticket_type,
|
||||
pod_no: pod_no,
|
||||
claim_number: claim_no,
|
||||
emp_code: emp_code,
|
||||
claim_status_id: claim_status,
|
||||
emp_mobile: emp_mobile_no,
|
||||
tpa_id: tpa_id,
|
||||
client_id: client_id,
|
||||
insurer_id: insurer_id,
|
||||
tpa_id: tpa_id,
|
||||
};
|
||||
var requestData = {
|
||||
ticket_type_id: ticket_type,
|
||||
pod_no: pod_no,
|
||||
claim_number: claim_no,
|
||||
emp_code: emp_code,
|
||||
claim_status_id: claim_status,
|
||||
emp_mobile: emp_mobile_no,
|
||||
tpa_id: tpa_id,
|
||||
client_id: client_id,
|
||||
insurer_id: insurer_id,
|
||||
tpa_id: tpa_id,
|
||||
};
|
||||
|
||||
let filterData = requestData;
|
||||
localStorage.setItem('filterData', JSON.stringify(filterData));
|
||||
let filterData = requestData;
|
||||
localStorage.setItem('filterData', JSON.stringify(filterData));
|
||||
|
||||
console.log("requestData", requestData);
|
||||
console.log("requestData", requestData);
|
||||
|
||||
var url = '<?= base_url('/ticket/list') ?>';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
var url = '<?= base_url('/ticket/list') ?>';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
sendAjaxRequestForGlobal(url, 'POST', requestData, function(response) {
|
||||
sendAjaxRequestForGlobal(url, 'POST', requestData, function(response) {
|
||||
|
||||
console.log('Filter Responce', response);
|
||||
console.log('Filter Responce', response);
|
||||
|
||||
if (response.status == true) {
|
||||
$('#ticket_list_div').empty();
|
||||
$('#ticket_list_div').html(response.html);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
} else {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
let message = response.message;
|
||||
toastr.error(message, 'ERROR');
|
||||
}
|
||||
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
toastr.error('An error occurred while fetching the data.', 'ERROR');
|
||||
|
||||
if (response.status == true) {
|
||||
$('#ticket_list_div').empty();
|
||||
$('#ticket_list_div').html(response.html);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
} else {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
let message = response.message;
|
||||
toastr.error(message, 'ERROR');
|
||||
}
|
||||
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
toastr.error('An error occurred while fetching the data.', 'ERROR');
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(document).ready(function() {
|
||||
let filterData = localStorage.getItem('filterData');
|
||||
|
||||
filterData = filterData ? JSON.parse(filterData) : null;
|
||||
|
||||
console.log('Filter Data', filterData);
|
||||
|
||||
if(filterData){
|
||||
if (filterData) {
|
||||
|
||||
var url = '<?= base_url('/ticket/list') ?>';
|
||||
$('.loader').fadeIn();
|
||||
@ -255,29 +257,29 @@ function fetchTicketListData() {
|
||||
|
||||
sendAjaxRequestForGlobal(url, 'POST', filterData, function(response) {
|
||||
|
||||
console.log('Filter Responce', response);
|
||||
|
||||
if (response.status == true) {
|
||||
$('#ticket_list_div').empty();
|
||||
$('#ticket_list_div').html(response.html);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
} else {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
let message = response.message;
|
||||
toastr.error(message, 'ERROR');
|
||||
}
|
||||
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
toastr.error('An error occurred while fetching the data.', 'ERROR');
|
||||
console.log('Filter Responce', response);
|
||||
|
||||
if (response.status == true) {
|
||||
$('#ticket_list_div').empty();
|
||||
$('#ticket_list_div').html(response.html);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
});
|
||||
|
||||
} else {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
let message = response.message;
|
||||
toastr.error(message, 'ERROR');
|
||||
}
|
||||
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
toastr.error('An error occurred while fetching the data.', 'ERROR');
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
});
|
||||
|
||||
$('#ticket_type').val(filterData.ticket_type_id);
|
||||
$('#pod_no').val(filterData.pod_no);
|
||||
@ -295,9 +297,9 @@ function fetchTicketListData() {
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).on('click', '#clear-filters', function (e) {
|
||||
$(document).on('click', '#clear-filters', function(e) {
|
||||
|
||||
e.preventDefault(); // Stops the browser from following the link
|
||||
e.preventDefault(); // Stops the browser from following the link
|
||||
|
||||
console.log('Clear Filters Area');
|
||||
|
||||
@ -312,9 +314,7 @@ function fetchTicketListData() {
|
||||
$('#tpa_id').val('0');
|
||||
$('#client_id').val('0');
|
||||
$('#insurer_id').val('0');
|
||||
|
||||
window.location.href = "<?= base_url("/ticket/list")?>";
|
||||
});
|
||||
|
||||
|
||||
window.location.href = "<?= base_url("/ticket/list") ?>";
|
||||
});
|
||||
</script>
|
||||
@ -1,6 +1,5 @@
|
||||
<style>
|
||||
|
||||
.custom-dropdown-menu {
|
||||
.custom-dropdown-menu {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: #ffffff !important;
|
||||
@ -10,310 +9,312 @@
|
||||
min-width: 10rem;
|
||||
z-index: 9999;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.custom-dropdown-menu .dropdown-item {
|
||||
.custom-dropdown-menu .dropdown-item {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
padding: 0.5rem 1rem !important;
|
||||
color: #212529 !important;
|
||||
text-decoration: none !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
}
|
||||
|
||||
.custom-dropdown-menu .dropdown-item:hover {
|
||||
.custom-dropdown-menu .dropdown-item:hover {
|
||||
background-color: #f8f9fa !important;
|
||||
color: #16181b !important;
|
||||
cursor: pointer !important;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-color{
|
||||
background-color: rgba(52, 174, 178, 1);
|
||||
color: white;
|
||||
border:1px solid rgba(52, 174, 178, 1);
|
||||
}
|
||||
.btn-color {
|
||||
background-color: rgba(52, 174, 178, 1);
|
||||
color: white;
|
||||
border: 1px solid rgba(52, 174, 178, 1);
|
||||
}
|
||||
|
||||
.btn-color:hover{
|
||||
.btn-color:hover {
|
||||
background-color: rgba(41, 139, 142, 1);
|
||||
color: white;
|
||||
border:1px solid rgba(41, 139, 142, 1);
|
||||
}
|
||||
|
||||
border: 1px solid rgba(41, 139, 142, 1);
|
||||
}
|
||||
</style>
|
||||
<div class="row" id="tpa_list">
|
||||
<div class="container-fluid-min">
|
||||
<div class="row" id="tpa_list">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body maincard">
|
||||
<!-- <div class="row" style="margin-bottom:1rem;">
|
||||
<div class="card">
|
||||
<div class="card-body maincard">
|
||||
<!-- <div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">TPA</h4>
|
||||
</div>
|
||||
</div> -->
|
||||
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">Name</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">Name</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php if(is_array($tpaList)) {foreach($tpaList as $row){ ?>
|
||||
<tr>
|
||||
<td><?php echo $row['name']; ?> ( <?php echo $row['short_name']; ?> ) </td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item" href="<?= base_url("master/tpa/list/"); ?><?= $row['id'];?>"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a class="dropdown-item" data-id="<?= $row['id'];?>" onclick="removeTPA(this)"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }}?>
|
||||
<tbody>
|
||||
<?php if (is_array($tpaList)) {
|
||||
foreach ($tpaList as $row) { ?>
|
||||
<tr>
|
||||
<td><?php echo $row['name']; ?> ( <?php echo $row['short_name']; ?> ) </td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item" href="<?= base_url("master/tpa/list/"); ?><?= $row['id']; ?>"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a class="dropdown-item" data-id="<?= $row['id']; ?>" onclick="removeTPA(this)"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- end row -->
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const table = document.getElementById("tickets-table");
|
||||
|
||||
|
||||
// Create custom dropdown
|
||||
function createCustomDropdown(row) {
|
||||
// Get the original dropdown items
|
||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||
if (!originalDropdown) return null;
|
||||
|
||||
// Create new dropdown with proper background and spacing
|
||||
const customDropdown = document.createElement('div');
|
||||
customDropdown.className = 'custom-dropdown-menu';
|
||||
|
||||
// Copy inner content while maintaining icon alignment
|
||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||
|
||||
return customDropdown;
|
||||
// Get the original dropdown items
|
||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||
if (!originalDropdown) return null;
|
||||
|
||||
// Create new dropdown with proper background and spacing
|
||||
const customDropdown = document.createElement('div');
|
||||
customDropdown.className = 'custom-dropdown-menu';
|
||||
|
||||
// Copy inner content while maintaining icon alignment
|
||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||
|
||||
return customDropdown;
|
||||
}
|
||||
|
||||
let activeDropdown = null;
|
||||
|
||||
// Add click event listener to rows
|
||||
table.querySelectorAll("tbody tr").forEach(row => {
|
||||
const customDropdown = createCustomDropdown(row);
|
||||
if (!customDropdown) return;
|
||||
|
||||
document.body.appendChild(customDropdown);
|
||||
const customDropdown = createCustomDropdown(row);
|
||||
if (!customDropdown) return;
|
||||
|
||||
row.addEventListener("click", function(event) {
|
||||
// Ignore clicks on the action column
|
||||
if (event.target.closest('td:last-child')) {
|
||||
return;
|
||||
}
|
||||
document.body.appendChild(customDropdown);
|
||||
|
||||
// Hide any active dropdown
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
}
|
||||
row.addEventListener("click", function(event) {
|
||||
// Ignore clicks on the action column
|
||||
if (event.target.closest('td:last-child')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get click position
|
||||
const rect = event.target.getBoundingClientRect();
|
||||
|
||||
// Position the dropdown with some offset
|
||||
customDropdown.style.display = 'block';
|
||||
customDropdown.style.position = 'fixed';
|
||||
customDropdown.style.left = `${rect.left}px`;
|
||||
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||
|
||||
// Set as active dropdown
|
||||
activeDropdown = customDropdown;
|
||||
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
// Preserve click handlers and add auto-close
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) {
|
||||
eval(onclickAttr);
|
||||
}
|
||||
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#') {
|
||||
window.location.href = href;
|
||||
}
|
||||
|
||||
// Close the dropdown after handling the click
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
});
|
||||
// Hide any active dropdown
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
}
|
||||
|
||||
// Get click position
|
||||
const rect = event.target.getBoundingClientRect();
|
||||
|
||||
// Position the dropdown with some offset
|
||||
customDropdown.style.display = 'block';
|
||||
customDropdown.style.position = 'fixed';
|
||||
customDropdown.style.left = `${rect.left}px`;
|
||||
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||
|
||||
// Set as active dropdown
|
||||
activeDropdown = customDropdown;
|
||||
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
// Preserve click handlers and add auto-close
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) {
|
||||
eval(onclickAttr);
|
||||
}
|
||||
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#') {
|
||||
window.location.href = href;
|
||||
}
|
||||
|
||||
// Close the dropdown after handling the click
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Close dropdown when clicking outside
|
||||
document.addEventListener("click", function() {
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$(document).ready(function(){
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'d-flex justify-content-between align-items-center'<'datatable-search'f><'datatable-buttons'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'TPAList',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'ADD',
|
||||
className: 'btn btn-color',
|
||||
action: function() {
|
||||
window.location.href = "<?= base_url("master/tpa/create"); ?>";
|
||||
}
|
||||
}
|
||||
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>" ,
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'TPAList',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'ADD',
|
||||
className: 'btn btn-color',
|
||||
action: function () {
|
||||
window.location.href = "<?= base_url("master/tpa/create"); ?>";
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
],
|
||||
|
||||
|
||||
language: {
|
||||
search: `
|
||||
language: {
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true ,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true,
|
||||
});
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
const btnExport = document.querySelector("#btnExport");
|
||||
const tableElement = document.querySelector("#tickets-table");
|
||||
const btnExport = document.querySelector("#btnExport");
|
||||
const tableElement = document.querySelector("#tickets-table");
|
||||
|
||||
btnExport.addEventListener("click", () => {
|
||||
const obj = new csvExport(tableElement);
|
||||
const csvData = obj.exportCsv();
|
||||
const blob = new Blob([csvData], { type: "text/csv" });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = "TPAList.csv";
|
||||
a.click();
|
||||
btnExport.addEventListener("click", () => {
|
||||
const obj = new csvExport(tableElement);
|
||||
const csvData = obj.exportCsv();
|
||||
const blob = new Blob([csvData], {
|
||||
type: "text/csv"
|
||||
});
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = "TPAList.csv";
|
||||
a.click();
|
||||
|
||||
setTimeout(() => {
|
||||
URL.revokeObjectURL(url);
|
||||
}, 500);
|
||||
});
|
||||
setTimeout(() => {
|
||||
URL.revokeObjectURL(url);
|
||||
}, 500);
|
||||
});
|
||||
|
||||
|
||||
class csvExport {
|
||||
constructor(table, header = true) {
|
||||
this.table = table;
|
||||
this.rows = Array.from(table.querySelectorAll("tr"));
|
||||
if (!header && this.rows[0].querySelectorAll("th").length) {
|
||||
this.rows.shift();
|
||||
}
|
||||
}
|
||||
|
||||
exportCsv() {
|
||||
const lines = [];
|
||||
const ncols = this._longestRow();
|
||||
for (const row of this.rows) {
|
||||
let line = "";
|
||||
for (let i = 0; i < ncols - 1; i++) { // Exclude the last column
|
||||
if (row.children[i] !== undefined) {
|
||||
line += csvExport.safeData(row.children[i]);
|
||||
}
|
||||
line += i !== ncols - 2 ? "," : ""; // Adjusted for the last column exclusion
|
||||
class csvExport {
|
||||
constructor(table, header = true) {
|
||||
this.table = table;
|
||||
this.rows = Array.from(table.querySelectorAll("tr"));
|
||||
if (!header && this.rows[0].querySelectorAll("th").length) {
|
||||
this.rows.shift();
|
||||
}
|
||||
lines.push(line);
|
||||
}
|
||||
return lines.join("\n");
|
||||
|
||||
exportCsv() {
|
||||
const lines = [];
|
||||
const ncols = this._longestRow();
|
||||
for (const row of this.rows) {
|
||||
let line = "";
|
||||
for (let i = 0; i < ncols - 1; i++) { // Exclude the last column
|
||||
if (row.children[i] !== undefined) {
|
||||
line += csvExport.safeData(row.children[i]);
|
||||
}
|
||||
line += i !== ncols - 2 ? "," : ""; // Adjusted for the last column exclusion
|
||||
}
|
||||
lines.push(line);
|
||||
}
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
||||
_longestRow() {
|
||||
return this.rows.reduce((length, row) => (row.childElementCount > length ? row.childElementCount : length), 0);
|
||||
}
|
||||
|
||||
static safeData(td) {
|
||||
let data = td.textContent;
|
||||
//Replace all double quote to two double quotes
|
||||
data = data.replace(/"/g, `""`);
|
||||
//Replace , and \n to double quotes
|
||||
data = /[",\n"]/.test(data) ? `"${data}"` : data;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
_longestRow() {
|
||||
return this.rows.reduce((length, row) => (row.childElementCount > length ? row.childElementCount : length), 0);
|
||||
}
|
||||
|
||||
static safeData(td) {
|
||||
let data = td.textContent;
|
||||
//Replace all double quote to two double quotes
|
||||
data = data.replace(/"/g, `""`);
|
||||
//Replace , and \n to double quotes
|
||||
data = /[",\n"]/.test(data) ? `"${data}"` : data;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
function removeTPA(element) {
|
||||
|
||||
Swal.fire({
|
||||
title: "Are you sure?",
|
||||
text: "You need to remove this TPA",
|
||||
icon: "info",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
confirmButtonText: "Yes",
|
||||
}).then((result) => {
|
||||
|
||||
function removeTPA(element) {
|
||||
|
||||
Swal.fire({
|
||||
title: "Are you sure?",
|
||||
text: "You need to remove this TPA",
|
||||
icon: "info",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
confirmButtonText: "Yes",
|
||||
}).then((result) => {
|
||||
|
||||
if (result.isConfirmed) {
|
||||
var id = element.getAttribute('data-id');
|
||||
var form_action = '<?= base_url("master/tpa/remove/") ?>' + id;
|
||||
$.ajax({
|
||||
url: form_action,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
// console.log(res.status == true);
|
||||
if(res){
|
||||
if (res.status == true) {
|
||||
toastr.success('TPA removed successfully', 'success');
|
||||
location.reload();
|
||||
} else {
|
||||
toastr.warning('Failed to remove TPA', 'warning');
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Failed to remove TPA', 'warning');
|
||||
}
|
||||
});
|
||||
if (result.isConfirmed) {
|
||||
var id = element.getAttribute('data-id');
|
||||
var form_action = '<?= base_url("master/tpa/remove/") ?>' + id;
|
||||
$.ajax({
|
||||
url: form_action,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
// console.log(res.status == true);
|
||||
if (res) {
|
||||
if (res.status == true) {
|
||||
toastr.success('TPA removed successfully', 'success');
|
||||
location.reload();
|
||||
} else {
|
||||
toastr.warning('Failed to remove TPA', 'warning');
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Failed to remove TPA', 'warning');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user