MERGE_CODE_MERGE : RV

This commit is contained in:
VENKATESHWARAN 2025-01-28 10:16:00 +05:30
commit 3a4f7b1e83
5 changed files with 91 additions and 56 deletions

View File

@ -20,7 +20,7 @@ class LoginController extends BaseController
// $isLoggedIn = check_session(); // $isLoggedIn = check_session();
$isLoggedIn = check_session(); $isLoggedIn = check_session();
$hasCookie = check_cookie(); $hasCookie = check_cookie();
if ($isLoggedIn || $hasCookie) { if ($isLoggedIn && $hasCookie) {
return redirect()->to(base_url('/dashboard/view')); return redirect()->to(base_url('/dashboard/view'));
} }
return view('login'); return view('login');
@ -91,7 +91,11 @@ class LoginController extends BaseController
{ {
$path = getenv('cookie.Path'); $path = getenv('cookie.Path');
session()->destroy(); session()->destroy();
setcookie('session_data', '', time() - 3600, $path); // setcookie('session_data', '', time() - 3600, $path);
$path = getenv('cookie.Path');
$domain = getenv('cookie.Domain');
$https = getenv('ccokie.secure');
setcookie('session_data',null, time() -3600, $path, $domain, $https, true);
return redirect()->to(base_url('login')); return redirect()->to(base_url('login'));
} }

View File

@ -2215,16 +2215,19 @@ class PolicyTransactionController extends BaseController
$is_row_empty = check_row_is_empty_or_null($excel_row); $is_row_empty = check_row_is_empty_or_null($excel_row);
if(!$is_row_empty) if(!$is_row_empty)
{ {
// $excel_row = ExcelSanitizeHelper::sanitizeArrayData($excel_row);
$is_source_found = 0; $is_source_found = 0;
$policy_start_date = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[4]);//policy_start_date from excel $policy_start_date = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[4]);//policy_start_date from excel
$policy_end_date = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[5]);//policy_end_date from excel $policy_end_date = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[5]);//policy_end_date from excel
$policy_no = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[1]);//policy_end_date from excel $policy_no = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[1]);//policy_end_date from excel
$policy_no = preg_replace('/[\x{200C}\x{200B}]/u', '', $excel_row[1]);//policy_end_date from excel
$client_name = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[3]);//clientname from excel $client_name = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[3]);//clientname from excel
$endorsement_no = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[2]);//policy_end_date from excel $endorsement_no = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[2]);//policy_end_date from excel
// Kint::dump($policy_no);
foreach ($source_data as $source_key => $source_row) foreach ($source_data as $source_key => $source_row)
{ {
$source_endorsement_no = $source_row['endorsement_no'] !== null ? $source_row['endorsement_no'] : ""; $source_endorsement_no = $source_row['endorsement_no'] !== null ? $source_row['endorsement_no'] : null;
// Kint::dump($source_endorsement_no);
if( ($policy_no == $source_row['policy_no']) && $endorsement_no == $source_endorsement_no && change_date_format($policy_start_date,'d-m-Y','Y-m-d') == $source_row['policy_start_date'] && change_date_format($policy_end_date,'d-m-Y','Y-m-d') == $source_row['policy_end_date'] && $client_name == $source_row['client_name']) if( ($policy_no == $source_row['policy_no']) && $endorsement_no == $source_endorsement_no && change_date_format($policy_start_date,'d-m-Y','Y-m-d') == $source_row['policy_start_date'] && change_date_format($policy_end_date,'d-m-Y','Y-m-d') == $source_row['policy_end_date'] && $client_name == $source_row['client_name'])
{ {
$is_source_found = 1; $is_source_found = 1;
@ -2306,9 +2309,9 @@ class PolicyTransactionController extends BaseController
$line_items = count($excel_data); $line_items = count($excel_data);
// get uploaded month transactions data // get uploaded month transactions data
$source_data = $this->PTCOShareDetailsModel->getNonReconcileredPolicyTransactions(insurer_id:$file['insurer_id'],insurer_branch_id:$file['branch_id']); $source_data = $this->PTCOShareDetailsModel->getNonReconcileredPolicyTransactions(insurer_id:$file['insurer_id'],insurer_branch_id:$file['branch_id']);
// Kint::dump($source_data);die; // Kint::dump($source_data);//die;
// Kint::dump($excel_data); // Kint::dump($excel_data);
// die;
// check policy no,insurer and etc in DB for this month // check policy no,insurer and etc in DB for this month
// if all good return true, otherwise return false with messssage // if all good return true, otherwise return false with messssage
$data_to_update = []; $data_to_update = [];
@ -2322,13 +2325,14 @@ class PolicyTransactionController extends BaseController
$policy_start_date = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[4]);//policy_start_date from excel $policy_start_date = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[4]);//policy_start_date from excel
$policy_end_date = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[5]);//policy_end_date from excel $policy_end_date = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[5]);//policy_end_date from excel
$policy_no = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[1]);//policy_end_date from excel $policy_no = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[1]);//policy_end_date from excel
$policy_no = preg_replace('/[\x{200C}\x{200B}]/u', '', $excel_row[1]);//
$client_name = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[3]);//clientname from excel $client_name = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[3]);//clientname from excel
$endorsement_no = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[2]);//policy_end_date from excel $endorsement_no = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[2]);//policy_end_date from excel
foreach ($source_data as $source_key => $source_row) foreach ($source_data as $source_key => $source_row)
{ {
// Kint::dump(change_date_format($excel_row[3],'d-m-Y','Y-m-d')); // Kint::dump(change_date_format($excel_row[3],'d-m-Y','Y-m-d'));
$source_endorsement_no = $source_row['endorsement_no'] !== null ? $source_row['endorsement_no'] : ""; $source_endorsement_no = $source_row['endorsement_no'] !== null ? $source_row['endorsement_no'] : null;
if( ($policy_no == $source_row['policy_no']) && $endorsement_no == $source_endorsement_no && change_date_format($policy_start_date,'d-m-Y','Y-m-d') == $source_row['policy_start_date'] && change_date_format($policy_end_date,'d-m-Y','Y-m-d') == $source_row['policy_end_date'] && $client_name == $source_row['client_name']) if( ($policy_no == $source_row['policy_no']) && $endorsement_no == $source_endorsement_no && change_date_format($policy_start_date,'d-m-Y','Y-m-d') == $source_row['policy_start_date'] && change_date_format($policy_end_date,'d-m-Y','Y-m-d') == $source_row['policy_end_date'] && $client_name == $source_row['client_name'])
{ {
$is_source_found = 1; $is_source_found = 1;

View File

@ -4,14 +4,14 @@ namespace App\Controllers;
use App\Controllers\BaseController; use App\Controllers\BaseController;
use CodeIgniter\HTTP\ResponseInterface; use CodeIgniter\HTTP\ResponseInterface;
use App\Models\TicketMasterModel;
use App\Models\TicketClaimStatusModel;
use App\Models\ClientModel;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Kint\Kint; use Kint\Kint;
use CodeIgniter\API\ResponseTrait; use CodeIgniter\API\ResponseTrait;
use App\Models\TicketMasterModel;
class TicketController extends BaseController class TicketController extends BaseController
{ {
use ResponseTrait; use ResponseTrait;
@ -22,6 +22,9 @@ class TicketController extends BaseController
protected $relationshipType; protected $relationshipType;
protected $modeOFIntimate; protected $modeOFIntimate;
protected $claimType; protected $claimType;
protected $claimStatus;
protected $clientModel;
protected $ticketMasterModel; protected $ticketMasterModel;
public function __construct() public function __construct()
@ -69,6 +72,9 @@ class TicketController extends BaseController
4 => "Death", 4 => "Death",
] ]
]; ];
$this->ticketMasterModel = new TicketMasterModel();
$this->claimStatus = new TicketClaimStatusModel();
$this->clientModel = new ClientModel();
} }
public function ticketList() public function ticketList()
@ -76,8 +82,8 @@ class TicketController extends BaseController
if ($this->request->is('get')) { if ($this->request->is('get')) {
$data['page_name'] = "Claims"; $data['page_name'] = "Claims";
$data['ticket_type'] = $this->ticketType; $data['ticket_type'] = $this->ticketType;
$data['claim_status'] = []; $data['claim_status'] = $this->claimStatus->select('id,ticket_type,claim_status')->where('is_active',1)->findAll();
$data['client_list'] = []; $data['client_list'] = $this->clientModel->select('id,client_name')->where('is_active',1)->findAll();
return $this->loadLayout('ticket_search', $data); return $this->loadLayout('ticket_search', $data);
@ -92,41 +98,28 @@ class TicketController extends BaseController
public function ticketSearch() public function ticketSearch()
{ {
$search_data = $this->request->getPost(); $search_data = $this->request->getPost();
// print_r($search_data); die; // print_r($search_data);
$where = [];
$data = [ foreach ($search_data as $search_objects => $key){
[ if ($key != null && $key != '' && $key!= 0 ){
'id' => 1, $where[$search_objects] = $key;
'status' => 'Approved', }
'claim_no' => 'CL12345', }
'tpa_id' => 'TPA001', // print_rr($where);
'emp_name' => 'John Doe', $data = $this->ticketMasterModel
'insurer_name' => 'ABC Insurance', ->select('ticket_master.id, ticket_claim_status.claim_status as status,
'client_name' => 'XYZ Corp', ticket_master.claim_number as claim_no,ticket_master.tpa_id,ticket_master.emp_name,
'tat' => '5 Days', insurers.name as insurer_name, clients.client_name,
], DATE_FORMAT(ticket_master.created_at, "%d-%m-%Y") as tat')
[ ->join('insurers','insurers.id = ticket_master.insurer_id and insurers.is_active = 1','left')
'id' => 2, ->join('clients','clients.id = ticket_master.client_id and clients.is_active = 1','left')
'status' => 'Pending', ->join('ticket_claim_status','ticket_claim_status.id = ticket_master.claim_status_id and ticket_claim_status.is_active = 1','left')
'claim_no' => 'CL12346', ->where('ticket_master.is_active',1)
'tpa_id' => 'TPA002', ->where($where)
'emp_name' => 'Jane Smith', ->findAll();
'insurer_name' => 'DEF Insurance', // print_rr($data);
'client_name' => 'LMN Ltd', // log_message('error',' Claims Master Data '.json_encode($data));die();
'tat' => '3 Days', // print_rr($data);die();
],
[
'id' => 3,
'status' => 'Rejected',
'claim_no' => 'CL12347',
'tpa_id' => 'TPA003',
'emp_name' => 'Alice Johnson',
'insurer_name' => 'GHI Insurance',
'client_name' => 'PQR Co',
'tat' => '7 Days',
],
];
return $data; return $data;
} }

View File

@ -12,7 +12,7 @@ class TicketClaimStatusModel extends Model
protected $returnType = 'array'; protected $returnType = 'array';
protected $useSoftDeletes = false; protected $useSoftDeletes = false;
protected $protectFields = true; protected $protectFields = true;
protected $allowedFields = []; protected $allowedFields = ["id", "ticket_type", "claim_status", "created_by", "updated_by", "is_active"];
// Callbacks // Callbacks
protected $allowCallbacks = true; protected $allowCallbacks = true;

View File

@ -10,10 +10,16 @@
<div id="accordion" class="mb-3"> <div id="accordion" class="mb-3">
<div class="card mb-1"> <div class="card mb-1">
<h5 class="m-1"> <h5 class="m-1">
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" <div class="row">
<div class="col-md-6">
<h4 style="text-align: left;">Claim 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"> aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i> <i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a></div>
</div>
</h5> </h5>
<div id="collapseOne" class="collapse hide" aria-labelledby="headingOne" data-parent="#accordion"> <div id="collapseOne" class="collapse hide" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body"> <div class="card-body">
@ -51,7 +57,7 @@
<option value="0">Select Corporate</option> <option value="0">Select Corporate</option>
<?php <?php
if (isset($client_list) && count($client_list)) { if (isset($client_list) && count($client_list)) {
foreach ($ticket_type as $key => $value) { foreach ($client_list as $key => $value) {
echo "<option value='" . $value['id'] . "'>" . $value['client_name'] . "</option>"; echo "<option value='" . $value['id'] . "'>" . $value['client_name'] . "</option>";
} }
} }
@ -79,13 +85,13 @@
<label for="claim_status">Status<span class="text-danger"></span></label> <label for="claim_status">Status<span class="text-danger"></span></label>
<select class="form-control" id="claim_status" name="claim_status"> <select class="form-control" id="claim_status" name="claim_status">
<option value="0">Select status</option> <option value="0">Select status</option>
<?php <?php /*
if (isset($claim_status) && count($claim_status)) { if (isset($claim_status) && count($claim_status)) {
foreach ($claim_status as $key => $value) { foreach ($claim_status as $key => $value) {
echo "<option value=" . $value['id'] . ">" . $value['status'] . "</option>"; echo "<option value=" . $value['id'] . ">" . $value['status'] . "</option>";
} }
} }
?> */ ?>
</select> </select>
</div> </div>
@ -113,6 +119,34 @@
<script> <script>
$(document).ready(function() {
// Initialize select2
$('#client_id').select2();
$('#claim_status').select2();
});
$('#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'
}));
// console.log('Claim Status:', claim_status);
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
}));
}
}
})
function fetchTicketListData() { function fetchTicketListData() {
var ticket_type = $('#ticket_type').val(); var ticket_type = $('#ticket_type').val();
@ -125,12 +159,12 @@ function fetchTicketListData() {
var client_id = $('#client_id').val(); var client_id = $('#client_id').val();
var requestData = { var requestData = {
ticket_type: ticket_type, ticket_type_id: ticket_type,
pod_no: pod_no, pod_no: pod_no,
claim_no: claim_no, claim_no: claim_no,
emp_code: emp_code, emp_code: emp_code,
claim_status: claim_status, claim_status_id: claim_status,
emp_mobile_no: emp_mobile_no, emp_mobile: emp_mobile_no,
tpa_id: tpa_id, tpa_id: tpa_id,
client_id: client_id, client_id: client_id,
}; };