MERGE_CODE_MERGE : RV
This commit is contained in:
commit
5e7d91aa23
@ -46,16 +46,13 @@ class BDSReportController extends AdminController
|
||||
$this->PTCOShareDetailsModel = new PTCOShareDetailsModel();
|
||||
$this->coShareStmtDetailsModel = new COShareStmtDetailsModel();
|
||||
$this->policyTypeModel = new PolicyTypeModel();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function Insurer_wise_Data($insurerCategory,$fromDate,$toDate){
|
||||
public function Insurer_wise_Data($insurerCategory, $fromDate, $toDate)
|
||||
{
|
||||
|
||||
$fromDate = \DateTime::createFromFormat('d-m-Y', $fromDate)->format('Y-m-d');
|
||||
$toDate = \DateTime::createFromFormat('d-m-Y', $toDate)->format('Y-m-d');
|
||||
|
||||
if($insurerCategory == 0 || $insurerCategory == 1){
|
||||
try {
|
||||
$sql = "
|
||||
select ins.id,ins.name as insurers,
|
||||
COALESCE(SUM(CASE WHEN pt.action_type = 'inception' and pt.insurer_id = ins.id and ptp.policy_category = $insurerCategory THEN 1 ELSE 0 END), 0) AS Policies,
|
||||
@ -64,28 +61,29 @@ class BDSReportController extends AdminController
|
||||
from insurers ins
|
||||
left join pt_co_share_details pt_co on ins.id = pt_co.insurer_id and pt_co.is_active = 1
|
||||
left join co_share_stmt_details stmt on pt_co.id = stmt.co_share_id and stmt.is_active = 1
|
||||
left join policy_transaction pt on pt_co.pt_id = pt.id and pt.is_active = 1 and pt.policy_issue_date >= $fromDate and pt.policy_issue_date <= $toDate
|
||||
left join policy_transaction pt on pt_co.pt_id = pt.id and pt.is_active = 1 and pt.policy_issue_date >= '$fromDate' and pt.policy_issue_date <= '$toDate'
|
||||
left join policy_type ptp on pt.policy_type_id = ptp.id and ptp.policy_category = $insurerCategory
|
||||
where ins.is_active = 1 and (ptp.policy_category = $insurerCategory or ptp.policy_category is null)
|
||||
group by ins.id
|
||||
";
|
||||
|
||||
$data['insurer_wise_data'] = $this->insurerModel->query($sql)->getResultArray();
|
||||
|
||||
|
||||
}else{
|
||||
$data['message'] = 'Insurer Category Not Valid';
|
||||
log_message('error',$data['message']);
|
||||
|
||||
$data['insurer_wise_data'] = $this->insurerModel->query($sql)->getResultArray();
|
||||
// log_message('error',$this->insurerModel->getLastQuery());
|
||||
// log_message('error',json_encode($data));
|
||||
} catch (\Exception $e) {
|
||||
$data['message'] = 'No data Found';
|
||||
$this->myLogger->logme('error', $e->getMessage());
|
||||
return $data;
|
||||
}
|
||||
return view('bds_report_Insurer_wise_Data',$data);
|
||||
return ($data);
|
||||
}
|
||||
|
||||
public function Bap_Wise_Data($insurerCategory,$fromDate,$toDate){
|
||||
public function Bap_Wise_Data($insurerCategory, $fromDate, $toDate)
|
||||
{
|
||||
$fromDate = \DateTime::createFromFormat('d-m-Y', $fromDate)->format('Y-m-d');
|
||||
$toDate = \DateTime::createFromFormat('d-m-Y', $toDate)->format('Y-m-d');
|
||||
|
||||
if($insurerCategory == 0 || $insurerCategory == 1){
|
||||
try {
|
||||
$sql = "
|
||||
SELECT
|
||||
pot.bap AS bap,
|
||||
@ -93,7 +91,7 @@ class BDSReportController extends AdminController
|
||||
COALESCE(SUM(co.actual_bp_amt + co.actual_tep_amt + co.actual_tp_amt), 0) AS Premium,
|
||||
COALESCE(SUM(co.reward + co.actual_bp_brokerage_amt + co.actual_tep_brokerage_amt + co.actual_tp_brokerage_amt), 0) AS Revenue
|
||||
FROM policy_type AS pot
|
||||
LEFT JOIN policy_transaction AS pt ON pot.id = pt.policy_type_id AND pt.is_active = 1 AND pt.action_type = 'inception' and pt.policy_issue_date >= $fromDate and pt.policy_issue_date <= $toDate
|
||||
LEFT JOIN policy_transaction AS pt ON pot.id = pt.policy_type_id AND pt.is_active = 1 AND pt.action_type = 'inception' and pt.policy_issue_date >= '$fromDate' and pt.policy_issue_date <= '$toDate'
|
||||
LEFT JOIN pt_co_share_details AS ptco ON pt.id = ptco.pt_id AND ptco.is_active = 1
|
||||
LEFT JOIN co_share_stmt_details AS co ON ptco.id = co.co_share_id AND co.is_active = 1
|
||||
WHERE pot.is_active = 1
|
||||
@ -102,20 +100,20 @@ class BDSReportController extends AdminController
|
||||
|
||||
";
|
||||
$data['bap_wise_data'] = $this->policyTypeModel->query($sql)->getResultArray();
|
||||
}else{
|
||||
$data['message'] = 'Insurer Category Not Valid';
|
||||
log_message('error',$data['message']);
|
||||
} catch (\Exception $e) {
|
||||
$data['message'] = 'No Data Found';
|
||||
$this->myLogger->logme('error', $e->getMessage());
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
return view('bds_report_bap_wise_data',$data);
|
||||
|
||||
return ($data);
|
||||
}
|
||||
|
||||
public function irba_report()
|
||||
{
|
||||
|
||||
if ($this->request->getMethod() == 'get') {
|
||||
if ($this->request->is('get')) {
|
||||
$default_start = new \DateTime();
|
||||
$data['default_end'] = $default_start->format('d-m-Y');
|
||||
$data['default_start'] = $default_start->modify('-90 days')->format('d-m-Y');
|
||||
@ -141,24 +139,30 @@ class BDSReportController extends AdminController
|
||||
if ($report_type == 'insurer') {
|
||||
$life = $category == 'life' ? 1 : 0;
|
||||
$viewData = $this->Insurer_wise_Data($life, $fromDate, $toDate);
|
||||
|
||||
if (isset($data['message'])) {
|
||||
return $this->respond(['status' => false, 'message' => $data['message']], 200);
|
||||
}
|
||||
// Ensure $viewData is an array
|
||||
if (!is_array($viewData)) {
|
||||
$viewData = [];
|
||||
}
|
||||
|
||||
|
||||
$html = view('bds_report_Insurer_wise_Data', $viewData);
|
||||
return $this->respond(['status' => true, 'html' => $html], 200);
|
||||
} else if ($report_type == 'bap') {
|
||||
|
||||
$life = $category == 'life' ? 1 : 0;
|
||||
$viewData = $this->Bap_wise_Data($life, $fromDate, $toDate);
|
||||
|
||||
if (isset($data['message'])) {
|
||||
return $this->respond(['status' => false, 'message' => $data['message']], 200);
|
||||
}
|
||||
// Ensure $viewData is an array
|
||||
if (!is_array($viewData)) {
|
||||
$viewData = [];
|
||||
}
|
||||
|
||||
|
||||
$html = view('bds_report_bap_wise_data', $viewData);
|
||||
return $this->respond(['status' => true, 'html' => $html], 200);
|
||||
} else if($report_type == 'bapInsurer'){
|
||||
@ -332,7 +336,6 @@ class BDSReportController extends AdminController
|
||||
$this->myLogger->logme('error', 'Query executed successfully.');
|
||||
// dd(db_connect()->getLastQuery(),$result);
|
||||
return $result;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
|
||||
// Log the exception details for debugging
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
<style>
|
||||
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
@ -10,7 +9,6 @@ table.dataTable tbody td {
|
||||
}
|
||||
|
||||
.col-12 {
|
||||
|
||||
max-width: 98% !important;
|
||||
}
|
||||
|
||||
@ -22,15 +20,16 @@ table.dataTable tbody td {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="col-12">
|
||||
<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;">Employees</h4>
|
||||
</div>
|
||||
<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;">Employees</h4>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
@ -48,91 +47,85 @@ table.dataTable tbody td {
|
||||
<td><?= $data['Premium'] ?></td>
|
||||
<td><?= $data['Revenue'] ?></td>
|
||||
</tr>
|
||||
<?php endforeach?>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Total Amount</th>
|
||||
<th>Grand Total</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
// Select the table and footer cells
|
||||
const table = document.querySelector("#tickets-table");
|
||||
const tbody = table.querySelector("tbody");
|
||||
const footer = table.querySelector("tfoot tr");
|
||||
$(document).ready(function() {
|
||||
var ticketsTable = $('#scroll-horizontal-datatable');
|
||||
|
||||
let totalPolicies = 0;
|
||||
let totalPremium = 0;
|
||||
let totalRevenue = 0;
|
||||
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: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Insurer-Wise-Report-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'Insurer-Wise-Report-List',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
},
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 10, // Set default number of rows per page (optional)
|
||||
ordering: false,
|
||||
footerCallback: function(row, data, start, end, display) {
|
||||
var api = this.api();
|
||||
|
||||
// Loop through each row in the table body and accumulate totals
|
||||
tbody.querySelectorAll("tr").forEach(row => {
|
||||
const policies = parseInt(row.cells[1].textContent) || 0;
|
||||
const premium = parseFloat(row.cells[2].textContent.replace(/[^0-9.-]+/g, "")) || 0;
|
||||
const revenue = parseFloat(row.cells[3].textContent.replace(/[^0-9.-]+/g, "")) || 0;
|
||||
// Helper function to parse numbers
|
||||
var parseNumber = function(value) {
|
||||
return typeof value === 'string' ?
|
||||
parseFloat(value.replace(/[\$,]/g, '')) :
|
||||
typeof value === 'number' ? value : 0;
|
||||
};
|
||||
|
||||
totalPolicies += policies;
|
||||
totalPremium += premium;
|
||||
totalRevenue += revenue;
|
||||
});
|
||||
// Calculate total for each column
|
||||
var totalPolicies = api.column(1).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
|
||||
// Append totals to the footer
|
||||
footer.innerHTML = `
|
||||
<th>Grand Total</th>
|
||||
<th>${totalPolicies}</th>
|
||||
<th>${totalPremium.toFixed(2)}</th>
|
||||
<th>${totalRevenue.toFixed(2)}</th>
|
||||
`;
|
||||
var totalPremium = api.column(2).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
|
||||
var totalRevenue = api.column(3).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
|
||||
// Update the footer with totals
|
||||
$(api.column(1).footer()).html(totalPolicies.toLocaleString());
|
||||
$(api.column(2).footer()).html("₹ " + totalPremium.toLocaleString(undefined, { minimumFractionDigits: 2 }));
|
||||
$(api.column(3).footer()).html("₹ " + totalRevenue.toLocaleString(undefined, { minimumFractionDigits: 2 }));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.error("Table not found.");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(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: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 10, // Set default number of rows per page (optional)
|
||||
ordering: false,
|
||||
});
|
||||
} else {
|
||||
console.error("Table atet found.");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
<style>
|
||||
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
@ -10,7 +9,6 @@ table.dataTable tbody td {
|
||||
}
|
||||
|
||||
.col-12 {
|
||||
|
||||
max-width: 98% !important;
|
||||
}
|
||||
|
||||
@ -22,16 +20,18 @@ table.dataTable tbody td {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="col-12">
|
||||
<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;">Employees</h4>
|
||||
</div>
|
||||
<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;">Employees</h4>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="scroll-horizontal-datatable" class="table w-100 nowrap"> <thead class="bg-light">
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th>Insurer</th>
|
||||
<th>Policies</th>
|
||||
@ -47,92 +47,85 @@ table.dataTable tbody td {
|
||||
<td><?= $data['Premium'] ?></td>
|
||||
<td><?= $data['Revenue'] ?></td>
|
||||
</tr>
|
||||
<?php endforeach?>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Total Amount</th>
|
||||
<th>Grand Total</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
// Select the table and footer cells
|
||||
const table = document.querySelector("#tickets-table");
|
||||
const tbody = table.querySelector("tbody");
|
||||
const footer = table.querySelector("tfoot tr");
|
||||
$(document).ready(function() {
|
||||
var ticketsTable = $('#scroll-horizontal-datatable');
|
||||
|
||||
let totalPolicies = 0;
|
||||
let totalPremium = 0;
|
||||
let totalRevenue = 0;
|
||||
|
||||
// Loop through each row in the table body and accumulate totals
|
||||
tbody.querySelectorAll("tr").forEach(row => {
|
||||
const policies = parseInt(row.cells[1].textContent) || 0;
|
||||
const premium = parseFloat(row.cells[2].textContent.replace(/[^0-9.-]+/g, "")) || 0;
|
||||
const revenue = parseFloat(row.cells[3].textContent.replace(/[^0-9.-]+/g, "")) || 0;
|
||||
|
||||
totalPolicies += policies;
|
||||
totalPremium += premium;
|
||||
totalRevenue += revenue;
|
||||
});
|
||||
|
||||
// Append totals to the footer
|
||||
footer.innerHTML = `
|
||||
<th>Grand Total</th>
|
||||
<th>${totalPolicies}</th>
|
||||
<th>${totalPremium.toFixed(2)}</th>
|
||||
<th>${totalRevenue.toFixed(2)}</th>
|
||||
`;
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(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: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
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: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Bap-Wise-Report-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'Bap-Wise-Report-List',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
},
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 10, // Set default number of rows per page (optional)
|
||||
ordering: false,
|
||||
footerCallback: function(row, data, start, end, display) {
|
||||
var api = this.api();
|
||||
|
||||
}
|
||||
// Helper function to parse numbers
|
||||
var parseNumber = function(value) {
|
||||
return typeof value === 'string' ?
|
||||
parseFloat(value.replace(/[\$,]/g, '')) :
|
||||
typeof value === 'number' ? value : 0;
|
||||
};
|
||||
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 10, // Set default number of rows per page (optional)
|
||||
ordering: false,
|
||||
});
|
||||
} else {
|
||||
console.error("Table atet found.");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
// Calculate total for each column
|
||||
var totalPolicies = api.column(1).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
|
||||
var totalPremium = api.column(2).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
|
||||
var totalRevenue = api.column(3).data().reduce(function(a, b) {
|
||||
return parseNumber(a) + parseNumber(b);
|
||||
}, 0);
|
||||
|
||||
// Update the footer with totals
|
||||
$(api.column(1).footer()).html(totalPolicies.toLocaleString());
|
||||
$(api.column(2).footer()).html("₹ " + totalPremium.toLocaleString(undefined, { minimumFractionDigits: 2 }));
|
||||
$(api.column(3).footer()).html("₹ " + totalRevenue.toLocaleString(undefined, { minimumFractionDigits: 2 }));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.error("Table not found.");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@ -12,15 +12,15 @@
|
||||
<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="fa fa-calendar"></i>
|
||||
<span></span> <i class="fa fa-caret-down"></i>
|
||||
</div>
|
||||
<input type="hidden" id="startDate" value=<?=$default_start?>>
|
||||
<input type="hidden" id="endDate" value=<?= $default_end?>>
|
||||
<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="fa fa-calendar"></i>
|
||||
<span></span> <i class="fa fa-caret-down"></i>
|
||||
</div>
|
||||
<input type="hidden" id="startDate" value=<?= $default_start ?>>
|
||||
<input type="hidden" id="endDate" value=<?= $default_end ?>>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
@ -28,19 +28,19 @@
|
||||
<select name="category" class="form-control" id="category" required>
|
||||
<option value="">Select</option>
|
||||
<?php foreach ($categories as $category => $key) : ?>
|
||||
<option value="<?=$key?>"><?= $category?></option>
|
||||
<?php endforeach ?>
|
||||
<option value="<?= $key ?>"><?= $category ?></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="<?=$key?>"><?= $reports?></option>
|
||||
<?php endforeach?>
|
||||
<option value="<?= $key ?>"><?= $reports ?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -59,8 +59,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="report"></div>
|
||||
<div class="card mb-1">
|
||||
|
||||
<div id="report"></div>
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
@ -68,28 +70,29 @@
|
||||
var end = $('#endDate').val();
|
||||
|
||||
var start = moment(start, 'DD/MM/YYYY');
|
||||
var end = moment(end, 'DD/MM/YYYY');
|
||||
var end = moment(end, 'DD/MM/YYYY');
|
||||
|
||||
function cb(start, end) {
|
||||
$('#reportrange span').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,
|
||||
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')]
|
||||
$('#reportrange span').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'));
|
||||
}
|
||||
}, cb);
|
||||
|
||||
cb(start, end);
|
||||
});
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
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);
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$('#category').on('click', function(){
|
||||
@ -103,23 +106,23 @@
|
||||
$("#report_type option[value='bapInsurer']").hide();
|
||||
$("#report_type option[value='client']").show();
|
||||
|
||||
}else if (choosed_option == 'nonLife'){
|
||||
$("#report_type option[value='insurer']").show();
|
||||
$("#report_type option[value='bap']").show();
|
||||
$("#report_type option[value='bapClient']").show();
|
||||
$("#report_type option[value='bapInsurer']").show();
|
||||
$("#report_type option[value='client']").hide();
|
||||
} else if (choosed_option == 'nonLife') {
|
||||
$("#report_type option[value='insurer']").show();
|
||||
$("#report_type option[value='bap']").show();
|
||||
$("#report_type option[value='bapClient']").show();
|
||||
$("#report_type option[value='bapInsurer']").show();
|
||||
$("#report_type option[value='client']").hide();
|
||||
}
|
||||
})
|
||||
|
||||
function fetchReportPage(){
|
||||
function fetchReportPage() {
|
||||
|
||||
var fromDate = $('#startDate').val();
|
||||
var toDate = $('#endDate').val();
|
||||
var category = $('#category').val();
|
||||
var report_type = $('#report_type').val();
|
||||
var requestData = {
|
||||
fromDate:fromDate,
|
||||
fromDate: fromDate,
|
||||
toDate: toDate,
|
||||
category: category,
|
||||
report_type: report_type
|
||||
@ -128,14 +131,19 @@
|
||||
var url = '<?= base_url('/bdsReport/irba_report') ?>';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
sendAjaxRequestForGlobal(url, 'POST', requestData, function(response) {
|
||||
if (response.status == true){
|
||||
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);
|
||||
@ -144,6 +152,6 @@
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@ -60,7 +60,7 @@
|
||||
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" type="text/css">
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.3/dist/umd/popper.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.3/dist/umd/popper.min.js"></script>
|
||||
|
||||
<link rel="manifest" href="../manifest.json">
|
||||
|
||||
@ -75,17 +75,15 @@
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.min.css" />
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js"></script>
|
||||
<!-- srinivas -->
|
||||
<script src="https://editor.unlayer.com/embed.js"></script>
|
||||
<!-- <script src="<?= base_url('public/unlayer/js/embed.js').''?>"></script> -->
|
||||
<!-- srinivas -->
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.min.css" />
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js"></script>
|
||||
<!-- srinivas -->
|
||||
<script src="https://editor.unlayer.com/embed.js"></script>
|
||||
<!-- <script src="<?= base_url('public/unlayer/js/embed.js') . '' ?>"></script> -->
|
||||
<!-- srinivas -->
|
||||
<style>
|
||||
|
||||
|
||||
body[data-sidebar-size=condensed]:not([data-layout=compact]):not(.auth-fluid-pages) {
|
||||
min-height: 0;
|
||||
}
|
||||
@ -591,7 +589,7 @@
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php if(get_role_id() == 1 || get_role_id() == 5) { ?>
|
||||
<?php if (get_role_id() == 1 || get_role_id() == 5) { ?>
|
||||
|
||||
<li>
|
||||
<a href="#sidebarDashboards" data-toggle="collapse" class="waves-effect">
|
||||
@ -635,7 +633,7 @@
|
||||
$parsedUrl = parse_url($currentUrl);
|
||||
$baseUrl = $parsedUrl['scheme'] . '://' . $parsedUrl['host'] . '/';
|
||||
$hashedEmail = hash('sha256', $sessionData->email);
|
||||
$redirectUrl = getenv('helpdeskURL') .'/staff/login?' . http_build_query(['token' => $hashedEmail]);
|
||||
$redirectUrl = getenv('helpdeskURL') . '/staff/login?' . http_build_query(['token' => $hashedEmail]);
|
||||
?>
|
||||
<a href="<?php echo $redirectUrl; ?>" target="_blank">
|
||||
<i class="mdi mdi-lifebuoy"></i>
|
||||
@ -652,7 +650,7 @@
|
||||
<div class="collapse" id="sidebarDashboardsmenu">
|
||||
<ul class="nav-second-level">
|
||||
<li>
|
||||
<a href="<?= base_url('/add_image_index') ?>"> Advertisement Images </a>
|
||||
<a href="<?= base_url('/add_image_index') ?>"> Advertisement Images </a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/frontend_content') ?>">Front-end Content</a>
|
||||
@ -669,80 +667,82 @@
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php if((get_role_id() == 1 || get_role_id() == 5) && (in_array(BUSINESS_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team()))) { ?>
|
||||
<?php if ((get_role_id() == 1 || get_role_id() == 5) && (in_array(BUSINESS_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team()))) { ?>
|
||||
|
||||
<li>
|
||||
<a href="#policyTransactions" data-toggle="collapse" class="waves-effect">
|
||||
<i class="mdi mdi-format-list-bulleted"></i>
|
||||
<span class="badge badge-success badge-pill float-right">2</span>
|
||||
<span> Policy Transactions </span>
|
||||
</a>
|
||||
<div class="collapse" id="policyTransactions">
|
||||
<ul class="nav-second-level">
|
||||
<li>
|
||||
<a href="#policyTransactions" data-toggle="collapse" class="waves-effect">
|
||||
<i class="mdi mdi-format-list-bulleted"></i>
|
||||
<a href="#policyTransactions" data-toggle="collapse" class="waves-effect">
|
||||
<i class="mdi mdi-format-list-bulleted"></i>
|
||||
<span class="badge badge-success badge-pill float-right">2</span>
|
||||
<span> Policy Transactions </span>
|
||||
</a>
|
||||
<div class="collapse" id="policyTransactions">
|
||||
<ul class="nav-second-level">
|
||||
<li>
|
||||
<a href="#policyTransactions" data-toggle="collapse" class="waves-effect">
|
||||
<i class="mdi mdi-format-list-bulleted"></i>
|
||||
|
||||
<span>Policy Transactions</span>
|
||||
</a>
|
||||
<div class="collapse" id="policyTransactions">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/inception/list') ?>">Policy</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/endorsement/list') ?>">Endorsement</a>
|
||||
</li>
|
||||
<span>Policy Transactions</span>
|
||||
</a>
|
||||
<div class="collapse" id="policyTransactions">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/inception/list') ?>">Policy</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/endorsement/list') ?>">Endorsement</a>
|
||||
</li>
|
||||
|
||||
<?php if (in_array(FINANCE_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team())) { ?>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/statement/list') ?>">Statement Upload</a>
|
||||
</li>
|
||||
<?php if (in_array(FINANCE_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team())) { ?>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/statement/list') ?>">Statement Upload</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#policyReports" data-toggle="collapse" class="waves-effect">
|
||||
<i class="ri-file-chart-fill"></i>
|
||||
<span> Policy Reports </span>
|
||||
</a>
|
||||
<div class="collapse" id="policyReports">
|
||||
<ul class="nav-third-level">
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/report/list') ?>">BDS</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/report/report-varience-list') ?>">Variance</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/report/report-outstanding-list') ?>">Outstanding</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/bdsReport/irba_report') ?>">IRDA Reports</a>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<li>
|
||||
<a href="#policyMasters" data-toggle="collapse" class="waves-effect">
|
||||
<i class="mdi mdi-timer-sand"></i>
|
||||
<span> Policy Pending Actions </span>
|
||||
</a>
|
||||
<div class="collapse" id="policyReports">
|
||||
<ul class="nav-third-level">
|
||||
<a href="<?= base_url('/policy_tranction/report/report-finance-list') ?>">Finance Team</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (in_array(BUSINESS_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team())) { ?>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/report/report-business-list') ?>">Business Team</a>
|
||||
</li>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#policyReports" data-toggle="collapse" class="waves-effect">
|
||||
<i class="ri-file-chart-fill"></i>
|
||||
<span> Policy Reports </span>
|
||||
</a>
|
||||
<div class="collapse" id="policyReports">
|
||||
<ul class="nav-third-level">
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/report/list') ?>">BDS</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/report/report-varience-list') ?>">Variance</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/report/report-outstanding-list') ?>">Outstanding</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/bdsReport/irba_report') ?>">IRBA Reports</a>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<li>
|
||||
<a href="#policyMasters" data-toggle="collapse" class="waves-effect">
|
||||
<i class="mdi mdi-timer-sand"></i>
|
||||
<span> Policy Pending Actions </span>
|
||||
</a>
|
||||
<div class="collapse" id="policyReports">
|
||||
<ul class="nav-third-level">
|
||||
<a href="<?= base_url('/policy_tranction/report/report-finance-list') ?>">Finance Team</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (in_array(BUSINESS_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team())) { ?>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/report/report-business-list') ?>">Business Team</a>
|
||||
</li>
|
||||
</li></ul></div>
|
||||
|
||||
<li>
|
||||
<a href="#policyMasters" data-toggle="collapse" class="waves-effect">
|
||||
<i class="ri-database-2-line"></i>
|
||||
@ -750,41 +750,42 @@
|
||||
</a>
|
||||
<div class="collapse" id="policyReports">
|
||||
<ul class="nav-third-level">
|
||||
<li>
|
||||
<a href="<?= base_url('/master/cash_deposite/list') ?>">CD Master</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/master/vehicle/list') ?>">Vehicle Master</a>
|
||||
</li>
|
||||
</ul></div>
|
||||
<li>
|
||||
<a href="<?= base_url('/master/cash_deposite/list') ?>">CD Master</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/master/vehicle/list') ?>">Vehicle Master</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="<?= base_url('/dmsSearch') ?>"><i class="ri-book-open-line"></i><span> Documents</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<!-- End Sidebar -->
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<!-- Sidebar -left -->
|
||||
</li>
|
||||
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<!-- Left Sidebar End -->
|
||||
<!-- End Sidebar -->
|
||||
|
||||
<!-- ============================================================== -->
|
||||
<!-- Start Page Content here -->
|
||||
<!-- ============================================================== -->
|
||||
</div>
|
||||
<!-- Sidebar -left -->
|
||||
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
</div>
|
||||
<!-- Left Sidebar End -->
|
||||
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
<!-- ============================================================== -->
|
||||
<!-- Start Page Content here -->
|
||||
<!-- ============================================================== -->
|
||||
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
Loading…
Reference in New Issue
Block a user