MERGE_CODE_MERGE : RV
This commit is contained in:
commit
3a4f7b1e83
@ -20,7 +20,7 @@ class LoginController extends BaseController
|
||||
// $isLoggedIn = check_session();
|
||||
$isLoggedIn = check_session();
|
||||
$hasCookie = check_cookie();
|
||||
if ($isLoggedIn || $hasCookie) {
|
||||
if ($isLoggedIn && $hasCookie) {
|
||||
return redirect()->to(base_url('/dashboard/view'));
|
||||
}
|
||||
return view('login');
|
||||
@ -91,7 +91,11 @@ class LoginController extends BaseController
|
||||
{
|
||||
$path = getenv('cookie.Path');
|
||||
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'));
|
||||
}
|
||||
|
||||
|
||||
@ -2215,16 +2215,19 @@ class PolicyTransactionController extends BaseController
|
||||
$is_row_empty = check_row_is_empty_or_null($excel_row);
|
||||
if(!$is_row_empty)
|
||||
{
|
||||
// $excel_row = ExcelSanitizeHelper::sanitizeArrayData($excel_row);
|
||||
$is_source_found = 0;
|
||||
$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_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
|
||||
$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)
|
||||
{
|
||||
$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'])
|
||||
{
|
||||
$is_source_found = 1;
|
||||
@ -2306,9 +2309,9 @@ class PolicyTransactionController extends BaseController
|
||||
$line_items = count($excel_data);
|
||||
// get uploaded month transactions data
|
||||
$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);
|
||||
|
||||
// die;
|
||||
// check policy no,insurer and etc in DB for this month
|
||||
// if all good return true, otherwise return false with messssage
|
||||
$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_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('/[\x{200C}\x{200B}]/u', '', $excel_row[1]);//
|
||||
$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
|
||||
|
||||
foreach ($source_data as $source_key => $source_row)
|
||||
{
|
||||
// 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'])
|
||||
{
|
||||
$is_source_found = 1;
|
||||
|
||||
@ -4,14 +4,14 @@ namespace App\Controllers;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
|
||||
use App\Models\TicketMasterModel;
|
||||
use App\Models\TicketClaimStatusModel;
|
||||
use App\Models\ClientModel;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Kint\Kint;
|
||||
|
||||
use CodeIgniter\API\ResponseTrait;
|
||||
|
||||
use App\Models\TicketMasterModel;
|
||||
|
||||
class TicketController extends BaseController
|
||||
{
|
||||
use ResponseTrait;
|
||||
@ -22,6 +22,9 @@ class TicketController extends BaseController
|
||||
protected $relationshipType;
|
||||
protected $modeOFIntimate;
|
||||
protected $claimType;
|
||||
protected $claimStatus;
|
||||
|
||||
protected $clientModel;
|
||||
protected $ticketMasterModel;
|
||||
|
||||
public function __construct()
|
||||
@ -69,6 +72,9 @@ class TicketController extends BaseController
|
||||
4 => "Death",
|
||||
]
|
||||
];
|
||||
$this->ticketMasterModel = new TicketMasterModel();
|
||||
$this->claimStatus = new TicketClaimStatusModel();
|
||||
$this->clientModel = new ClientModel();
|
||||
}
|
||||
|
||||
public function ticketList()
|
||||
@ -76,8 +82,8 @@ class TicketController extends BaseController
|
||||
if ($this->request->is('get')) {
|
||||
$data['page_name'] = "Claims";
|
||||
$data['ticket_type'] = $this->ticketType;
|
||||
$data['claim_status'] = [];
|
||||
$data['client_list'] = [];
|
||||
$data['claim_status'] = $this->claimStatus->select('id,ticket_type,claim_status')->where('is_active',1)->findAll();
|
||||
$data['client_list'] = $this->clientModel->select('id,client_name')->where('is_active',1)->findAll();
|
||||
|
||||
return $this->loadLayout('ticket_search', $data);
|
||||
|
||||
@ -92,41 +98,28 @@ class TicketController extends BaseController
|
||||
public function ticketSearch()
|
||||
{
|
||||
$search_data = $this->request->getPost();
|
||||
// print_r($search_data); die;
|
||||
|
||||
$data = [
|
||||
[
|
||||
'id' => 1,
|
||||
'status' => 'Approved',
|
||||
'claim_no' => 'CL12345',
|
||||
'tpa_id' => 'TPA001',
|
||||
'emp_name' => 'John Doe',
|
||||
'insurer_name' => 'ABC Insurance',
|
||||
'client_name' => 'XYZ Corp',
|
||||
'tat' => '5 Days',
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'status' => 'Pending',
|
||||
'claim_no' => 'CL12346',
|
||||
'tpa_id' => 'TPA002',
|
||||
'emp_name' => 'Jane Smith',
|
||||
'insurer_name' => 'DEF Insurance',
|
||||
'client_name' => 'LMN Ltd',
|
||||
'tat' => '3 Days',
|
||||
],
|
||||
[
|
||||
'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',
|
||||
],
|
||||
];
|
||||
|
||||
// print_r($search_data);
|
||||
$where = [];
|
||||
foreach ($search_data as $search_objects => $key){
|
||||
if ($key != null && $key != '' && $key!= 0 ){
|
||||
$where[$search_objects] = $key;
|
||||
}
|
||||
}
|
||||
// print_rr($where);
|
||||
$data = $this->ticketMasterModel
|
||||
->select('ticket_master.id, ticket_claim_status.claim_status as status,
|
||||
ticket_master.claim_number as claim_no,ticket_master.tpa_id,ticket_master.emp_name,
|
||||
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')
|
||||
->join('clients','clients.id = ticket_master.client_id and clients.is_active = 1','left')
|
||||
->join('ticket_claim_status','ticket_claim_status.id = ticket_master.claim_status_id and ticket_claim_status.is_active = 1','left')
|
||||
->where('ticket_master.is_active',1)
|
||||
->where($where)
|
||||
->findAll();
|
||||
// print_rr($data);
|
||||
// log_message('error',' Claims Master Data '.json_encode($data));die();
|
||||
// print_rr($data);die();
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ class TicketClaimStatusModel extends Model
|
||||
protected $returnType = 'array';
|
||||
protected $useSoftDeletes = false;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [];
|
||||
protected $allowedFields = ["id", "ticket_type", "claim_status", "created_by", "updated_by", "is_active"];
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
|
||||
@ -10,10 +10,16 @@
|
||||
<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"
|
||||
<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">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</a></div>
|
||||
</div>
|
||||
</h5>
|
||||
<div id="collapseOne" class="collapse hide" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
@ -51,7 +57,7 @@
|
||||
<option value="0">Select Corporate</option>
|
||||
<?php
|
||||
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>";
|
||||
}
|
||||
}
|
||||
@ -79,13 +85,13 @@
|
||||
<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
|
||||
<?php /*
|
||||
if (isset($claim_status) && count($claim_status)) {
|
||||
foreach ($claim_status as $key => $value) {
|
||||
echo "<option value=" . $value['id'] . ">" . $value['status'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
*/ ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -113,6 +119,34 @@
|
||||
|
||||
<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() {
|
||||
|
||||
var ticket_type = $('#ticket_type').val();
|
||||
@ -125,12 +159,12 @@ function fetchTicketListData() {
|
||||
var client_id = $('#client_id').val();
|
||||
|
||||
var requestData = {
|
||||
ticket_type: ticket_type,
|
||||
ticket_type_id: ticket_type,
|
||||
pod_no: pod_no,
|
||||
claim_no: claim_no,
|
||||
emp_code: emp_code,
|
||||
claim_status: claim_status,
|
||||
emp_mobile_no: emp_mobile_no,
|
||||
claim_status_id: claim_status,
|
||||
emp_mobile: emp_mobile_no,
|
||||
tpa_id: tpa_id,
|
||||
client_id: client_id,
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user