FEAT_SEND_AUTO_QUERY_MAIL_SRI
This commit is contained in:
parent
c7945f8fc2
commit
be1b673419
@ -412,6 +412,7 @@ $routes->get('cli/sendZeptoMail', 'MasterController::testZeptoSMTP');
|
||||
|
||||
$routes->cli('cli/processjob', 'JobWorker::processJob');
|
||||
$routes->cli('cli/processjobs', 'JobWorker::processJobs');
|
||||
$routes->cli('cli/sendMailWithAutoQuery','TicketController::sendMailWithAutoQuery');
|
||||
|
||||
$routes->get("processjob", "JobWorker::processJob");
|
||||
$routes->cli('cli/new_gmail_token', 'MasterController::generateNewGmailAPIToken');
|
||||
|
||||
@ -109,6 +109,7 @@ class TicketController extends BaseController
|
||||
'((CLAIM_NO))' => 'claim_number',
|
||||
'((RELATIONSHIP))' => 'relationship',
|
||||
'((POLICY_TYPE))' => 'policy_type',
|
||||
'((AUTO_QUERY_CONTENT))' => 'auto_query_content',
|
||||
];
|
||||
|
||||
$this->ticketMasterModel = new TicketMasterModel();
|
||||
@ -145,9 +146,9 @@ class TicketController extends BaseController
|
||||
if ($action == 1) {
|
||||
$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')
|
||||
ticket_master.claim_number as claim_no,ticket_master.tpa_id,ticket_master.emp_name,
|
||||
insurers.name as insurer_name, clients.client_name,ticket_master.insured_name,clients.short_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')
|
||||
@ -169,9 +170,9 @@ class TicketController extends BaseController
|
||||
// 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')
|
||||
ticket_master.claim_number as claim_no,ticket_master.tpa_id,ticket_master.emp_name,
|
||||
insurers.name as insurer_name, clients.client_name,ticket_master.insured_name,clients.short_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')
|
||||
@ -250,7 +251,7 @@ class TicketController extends BaseController
|
||||
$ticket_data = $this->formatDateForClaim($ticket_data, 'd/m/Y');
|
||||
// dd($ticket_data);
|
||||
$template_data = $this->ticketMasterModel->getTemplateDataByTicketID($ticket_id);
|
||||
if(!empty($template_data)){
|
||||
if (!empty($template_data)) {
|
||||
$template_data['mail_content'] = $this->replacePlaceholders($template_data['mail_content'], $ticket_data);
|
||||
$template_data['subject'] = $this->replacePlaceholders($template_data['subject'], $ticket_data);
|
||||
}
|
||||
@ -423,8 +424,10 @@ class TicketController extends BaseController
|
||||
// action = 1 is read, action 2 is insert/update
|
||||
if ($action == 1) {
|
||||
$ticket_master_id = $this->request->getPost('id');
|
||||
$is_auto_query = $this->request->getPost('is_auto_query');
|
||||
// print_rr($is_auto_query);
|
||||
if (isset($ticket_master_id) && $ticket_master_id != '') {
|
||||
$data = $this->ticketNoteModel->where('is_active', 1)->where('ticket_id', $ticket_master_id)->first();
|
||||
$data = $this->ticketNoteModel->where('is_active', 1)->where('ticket_id', $ticket_master_id)->where('is_auto_query', $is_auto_query)->first();
|
||||
if ($data) {
|
||||
return $this->respond(['status' => true, 'data' => $data], 200);
|
||||
} else {
|
||||
@ -434,10 +437,13 @@ class TicketController extends BaseController
|
||||
} elseif ($action == 2) {
|
||||
$data = $this->request->getPost();
|
||||
// if (isset($data['id']) && $data['id'] != ''){
|
||||
// print_rr($data);die();
|
||||
$status = $this->ticketNoteModel->save($data);
|
||||
$id = isset($data['id']) ? $data['id'] : $this->ticketNoteModel->insertID();
|
||||
|
||||
// }
|
||||
if ($status) {
|
||||
return $this->respond(['status' => true], 200);
|
||||
return $this->respond(['status' => true, 'id' => $id], 200);
|
||||
} else {
|
||||
return $this->respond(['status' => false], 200);
|
||||
}
|
||||
@ -532,12 +538,12 @@ class TicketController extends BaseController
|
||||
|
||||
// Validate Essential Fields
|
||||
if (empty($ticket_data['emp_mail'])) {
|
||||
$this->myLogger->logme('error', "Employee email is missing for Ticket ID : '".$ticket_id ."'");
|
||||
$this->myLogger->logme('error', "Employee email is missing for Ticket ID : '" . $ticket_id . "'");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (empty($subject) || empty($message)) {
|
||||
$this->myLogger->logme('error', "Generated email content is empty for Ticket ID: '".$ticket_id ."'");
|
||||
$this->myLogger->logme('error', "Generated email content is empty for Ticket ID: '" . $ticket_id . "'");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -570,9 +576,9 @@ class TicketController extends BaseController
|
||||
|
||||
if ($value == "emp_code") {
|
||||
$replaceData = $ticket_data[$value] ?? '';
|
||||
}else if($value == "policy_type"){
|
||||
} else if ($value == "policy_type") {
|
||||
$replaceData = str_replace("Claim-", "", $this->ticketType[$ticket_data['ticket_type_id']] ?? "");
|
||||
}else{
|
||||
} else {
|
||||
$replaceData = strtoupper($ticket_data[$value]) ?? '';
|
||||
}
|
||||
|
||||
@ -589,9 +595,9 @@ class TicketController extends BaseController
|
||||
public function sendTrigger($mail_content)
|
||||
{
|
||||
$this->myLogger->logme('error', "Sending email with content");
|
||||
if(!empty($mail_content)){
|
||||
if (!empty($mail_content)) {
|
||||
$response = MailHelper::send_email($mail_content);
|
||||
}else{
|
||||
} else {
|
||||
$response = ['status' => false, 'code' => 404, 'message' => "Mail not sent, mail data empty"];
|
||||
$this->myLogger->logme('error', "Mail not sent, mail data empty");
|
||||
}
|
||||
@ -615,14 +621,14 @@ class TicketController extends BaseController
|
||||
}
|
||||
|
||||
$ticket_data = $this->ticketMasterModel->getTicketDataByTicketID($mail_data['ticket_id']);
|
||||
|
||||
// print_rr($ticket_data);die();
|
||||
if (!$ticket_data) {
|
||||
$this->myLogger->logme('error', "No ticket data found for Ticket ID : " .$mail_data['ticket_id']);
|
||||
$this->myLogger->logme('error', "No ticket data found for Ticket ID : " . $mail_data['ticket_id']);
|
||||
$this->myLogger->logme('error', "Reply mail not send");
|
||||
return null;
|
||||
}
|
||||
|
||||
if(!empty($mail_data)){
|
||||
if (!empty($mail_data)) {
|
||||
$mail_data['mail_content'] = $this->replacePlaceholders($mail_data['mail_content'], $ticket_data);
|
||||
$mail_data['mail_subject'] = $this->replacePlaceholders($mail_data['mail_subject'], $ticket_data);
|
||||
}
|
||||
@ -653,10 +659,10 @@ class TicketController extends BaseController
|
||||
$mail_content = $this->constructMailContent($ticket_id);
|
||||
// print_r($mail_content); die;
|
||||
$mail_responce = $this->sendTrigger($mail_content);
|
||||
}elseif (!empty($auto_mail_enable) && $auto_mail_enable['is_auto_mail'] == 0 ){
|
||||
$this->myLogger->logme('error','Auto Mail Not Sent, Reason: Automail Not Enabled');
|
||||
}else{
|
||||
$this->myLogger->logme('error','Auto Mail Not Sent, Reason: Mail Template Not Created');
|
||||
} elseif (!empty($auto_mail_enable) && $auto_mail_enable['is_auto_mail'] == 0) {
|
||||
$this->myLogger->logme('error', 'Auto Mail Not Sent, Reason: Automail Not Enabled');
|
||||
} else {
|
||||
$this->myLogger->logme('error', 'Auto Mail Not Sent, Reason: Mail Template Not Created');
|
||||
}
|
||||
|
||||
return $mail_responce;
|
||||
@ -733,61 +739,106 @@ class TicketController extends BaseController
|
||||
AND th.is_active = 1
|
||||
ORDER BY
|
||||
th.created_at DESC";
|
||||
$data = $this->ticketHistoryModel->query($sql)->getResultArray();
|
||||
$priorityType = $this->priorityType;
|
||||
$relationshipType = $this->relationshipType;
|
||||
$modeOFIntimate = $this->modeOFIntimate;
|
||||
$claim_type = $this->claimType;
|
||||
foreach ($data as &$row) {
|
||||
if ($row['field_name'] == 'claim_status_id') {
|
||||
$new_old_value = isset($row['old_status_value']) ? $row['old_status_value'] : '-';
|
||||
$new_new_value = $row['new_status_value'];
|
||||
$row['old_value'] = $new_old_value;
|
||||
$row['new_value'] = $new_new_value;
|
||||
} elseif ($row['field_name'] == 'acm_id') {
|
||||
$new_old_value = isset($row['old_account_manager']) ? $row['old_account_manager'] : '-';
|
||||
$new_new_value = $row['new_account_manager'];
|
||||
$row['old_value'] = $new_old_value;
|
||||
$row['new_value'] = $new_new_value;
|
||||
} elseif ($row['field_name'] == 'insured_emp_id') {
|
||||
$new_old_value = isset($row['old_insured_id_name']) ? $row['old_insured_id_name'] : '-';
|
||||
$new_new_value = $row['new_insured_id_name'];
|
||||
$row['old_value'] = $new_old_value;
|
||||
$row['new_value'] = $new_new_value;
|
||||
} elseif ($row['field_name'] == 'priority') {
|
||||
$new_old_value = isset($priorityType[$row['old_value']]) ? $priorityType[$row['old_value']] : '-';
|
||||
$new_new_value = isset($priorityType[$row['new_value']]) ? $priorityType[$row['new_value']] : '-';
|
||||
$row['old_value'] = $new_old_value;
|
||||
$row['new_value'] = $new_new_value;
|
||||
} elseif ($row['field_name'] == 'relationship') {
|
||||
$new_old_value = isset($relationshipType[$row['old_value']]) ? $relationshipType[$row['old_value']] : '-';
|
||||
$new_new_value = isset($relationshipType[$row['new_value']]) ? $relationshipType[$row['new_value']] : '-';
|
||||
$row['old_value'] = $new_old_value;
|
||||
$row['new_value'] = $new_new_value;
|
||||
} elseif ($row['field_name'] == 'mode_of_intimation') {
|
||||
$new_old_value = isset($modeOFIntimate[$row['old_value']]) ? $modeOFIntimate[$row['old_value']] : "-";
|
||||
$new_new_value = isset($modeOFIntimate[$row['old_value']]) ? $modeOFIntimate[$row['old_value']] : "-";
|
||||
$row['old_value'] = $new_old_value;
|
||||
$row['new_value'] = $new_new_value;
|
||||
} elseif ($row['field_name'] == 'claim_type') {
|
||||
$new_old_value = isset($claim_type[$row['ticket_type_id']][$row['old_value']]) ? $claim_type[$row['ticket_type_id']][$row['old_value']] : '-';
|
||||
$new_new_value = isset($claim_type[$row['ticket_type_id']][$row['new_value']])?$claim_type[$row['ticket_type_id']][$row['new_value']]:'-';
|
||||
$row['old_value'] = $new_old_value;
|
||||
$row['new_value'] = $new_new_value;
|
||||
} elseif ($row['field_name'] == 'claim_type') {
|
||||
$new_old_value = isset($claim_type[$row['old_value']]) ? $claim_type[$row['old_value']] : '-';
|
||||
$new_new_value = isset($claim_type[$row['new_value']]) ? $claim_type[$row['new_value']] : '-';
|
||||
$row['old_value'] = $new_old_value;
|
||||
$row['new_value'] = $new_new_value;
|
||||
} else {
|
||||
$new_old_value = isset($row['old_value']) ? $row['old_value'] : '-';
|
||||
$new_new_value = isset($row['new_value']) ? $row['new_value'] : '-';
|
||||
$row['old_value'] = $new_old_value;
|
||||
$row['new_value'] = $new_new_value;
|
||||
$data = $this->ticketHistoryModel->query($sql)->getResultArray();
|
||||
$priorityType = $this->priorityType;
|
||||
$relationshipType = $this->relationshipType;
|
||||
$modeOFIntimate = $this->modeOFIntimate;
|
||||
$claim_type = $this->claimType;
|
||||
foreach ($data as &$row) {
|
||||
if ($row['field_name'] == 'claim_status_id') {
|
||||
$new_old_value = isset($row['old_status_value']) ? $row['old_status_value'] : '-';
|
||||
$new_new_value = $row['new_status_value'];
|
||||
$row['old_value'] = $new_old_value;
|
||||
$row['new_value'] = $new_new_value;
|
||||
} elseif ($row['field_name'] == 'acm_id') {
|
||||
$new_old_value = isset($row['old_account_manager']) ? $row['old_account_manager'] : '-';
|
||||
$new_new_value = $row['new_account_manager'];
|
||||
$row['old_value'] = $new_old_value;
|
||||
$row['new_value'] = $new_new_value;
|
||||
} elseif ($row['field_name'] == 'insured_emp_id') {
|
||||
$new_old_value = isset($row['old_insured_id_name']) ? $row['old_insured_id_name'] : '-';
|
||||
$new_new_value = $row['new_insured_id_name'];
|
||||
$row['old_value'] = $new_old_value;
|
||||
$row['new_value'] = $new_new_value;
|
||||
} elseif ($row['field_name'] == 'priority') {
|
||||
$new_old_value = isset($priorityType[$row['old_value']]) ? $priorityType[$row['old_value']] : '-';
|
||||
$new_new_value = isset($priorityType[$row['new_value']]) ? $priorityType[$row['new_value']] : '-';
|
||||
$row['old_value'] = $new_old_value;
|
||||
$row['new_value'] = $new_new_value;
|
||||
} elseif ($row['field_name'] == 'relationship') {
|
||||
$new_old_value = isset($relationshipType[$row['old_value']]) ? $relationshipType[$row['old_value']] : '-';
|
||||
$new_new_value = isset($relationshipType[$row['new_value']]) ? $relationshipType[$row['new_value']] : '-';
|
||||
$row['old_value'] = $new_old_value;
|
||||
$row['new_value'] = $new_new_value;
|
||||
} elseif ($row['field_name'] == 'mode_of_intimation') {
|
||||
$new_old_value = isset($modeOFIntimate[$row['old_value']]) ? $modeOFIntimate[$row['old_value']] : "-";
|
||||
$new_new_value = isset($modeOFIntimate[$row['old_value']]) ? $modeOFIntimate[$row['old_value']] : "-";
|
||||
$row['old_value'] = $new_old_value;
|
||||
$row['new_value'] = $new_new_value;
|
||||
} elseif ($row['field_name'] == 'claim_type') {
|
||||
$new_old_value = isset($claim_type[$row['ticket_type_id']][$row['old_value']]) ? $claim_type[$row['ticket_type_id']][$row['old_value']] : '-';
|
||||
$new_new_value = isset($claim_type[$row['ticket_type_id']][$row['new_value']]) ? $claim_type[$row['ticket_type_id']][$row['new_value']] : '-';
|
||||
$row['old_value'] = $new_old_value;
|
||||
$row['new_value'] = $new_new_value;
|
||||
} elseif ($row['field_name'] == 'claim_type') {
|
||||
$new_old_value = isset($claim_type[$row['old_value']]) ? $claim_type[$row['old_value']] : '-';
|
||||
$new_new_value = isset($claim_type[$row['new_value']]) ? $claim_type[$row['new_value']] : '-';
|
||||
$row['old_value'] = $new_old_value;
|
||||
$row['new_value'] = $new_new_value;
|
||||
} else {
|
||||
$new_old_value = isset($row['old_value']) ? $row['old_value'] : '-';
|
||||
$new_new_value = isset($row['new_value']) ? $row['new_value'] : '-';
|
||||
$row['old_value'] = $new_old_value;
|
||||
$row['new_value'] = $new_new_value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return ($data);
|
||||
}
|
||||
|
||||
return ($data);
|
||||
public function sendMailWithAutoQuery()
|
||||
{
|
||||
|
||||
$ticket_ids = $this->ticketMessageModel
|
||||
->select('ticket_master.id')
|
||||
->join('ticket_master', 'ticket_master.id = ticket_messages.ticket_id AND ticket_master.is_active = 1 and ticket_master.claim_status_id in (4,17,27,37)')
|
||||
->join('ticket_claim_status AS tcs', 'tcs.id = ticket_messages.claim_status AND (tcs.is_active = 1)')
|
||||
->join('ticket_notes', 'ticket_notes.ticket_id = ticket_messages.ticket_id AND ticket_notes.is_auto_query = 1 AND ticket_notes.is_active = 1')
|
||||
->where('ticket_messages.is_active', 1)
|
||||
->where('ticket_messages.claim_status in (4,17,27,37)')
|
||||
->groupBy('ticket_master.id')
|
||||
->having('DATEDIFF(CURDATE(), MAX(ticket_messages.created_at)) =', 7)
|
||||
->having('count(ticket_messages.id) < ', 6)
|
||||
->findAll();
|
||||
|
||||
|
||||
// var_dump($ticket_ids);die();
|
||||
foreach ($ticket_ids as $ticket) {
|
||||
|
||||
$ticket_id = $ticket['id'];
|
||||
$acm_mails = $this->ticketMasterModel->getTicketDataByTicketID($ticket_id);
|
||||
$ticket_data = $this->ticketMasterModel->getTicketDataByTicketID($ticket_id);
|
||||
|
||||
$template_data = $this->ticketMasterModel->getTemplateDataByTicketID($ticket_id);
|
||||
|
||||
if (!empty($template_data)) {
|
||||
$template_data['mail_content'] = $this->replacePlaceholders($template_data['mail_content'], $ticket_data);
|
||||
$template_data['subject'] = $this->replacePlaceholders($template_data['subject'], $ticket_data);
|
||||
}
|
||||
$emailData = [
|
||||
'mail' => $template_data['emp_mail'],
|
||||
'subject' => $template_data['subject'],
|
||||
'message' => $template_data['mail_content'],
|
||||
'common' => [],
|
||||
'cc' => $acm_mails['common_mails'],
|
||||
'attachments' => []
|
||||
];
|
||||
|
||||
$this->myLogger->logme('error', "Final Reply Email Data");
|
||||
// var_dump($emailData);
|
||||
$this->sendTrigger($emailData);
|
||||
}
|
||||
|
||||
return 'Ticket id\'s : '.json_encode($ticket_ids);
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ class TicketMasterModel extends Model
|
||||
public function getTemplateDataByTicketID($ticket_id)
|
||||
{
|
||||
$template_data = $this
|
||||
->select("ticket_mail_template.*, ticket_master.emp_mail")
|
||||
->select("ticket_mail_template.*, ticket_master.emp_mail,ticket_master.claim_status_id")
|
||||
->join('ticket_claim_status', 'ticket_master.claim_status_id = ticket_claim_status.id and ticket_claim_status.is_active = 1')
|
||||
->join('ticket_mail_template', '
|
||||
ticket_claim_status.trigger_type = ticket_mail_template.trigger_type
|
||||
@ -131,11 +131,13 @@ class TicketMasterModel extends Model
|
||||
clients.client_name,
|
||||
|
||||
insurers.name as insurer_name,
|
||||
tpa.name as tpa_name
|
||||
tpa.name as tpa_name,
|
||||
ticket_notes.note as auto_query_content
|
||||
")
|
||||
->join('clients', 'ticket_master.client_id = clients.id', 'left')
|
||||
->join('insurers', 'ticket_master.insurer_id = insurers.id', 'left')
|
||||
->join('tpa', 'ticket_master.tpa_id = tpa.id', 'left')
|
||||
->join('ticket_notes', 'ticket_master.id = ticket_notes.ticket_id and ticket_notes.is_active = 1 and ticket_notes.is_auto_query = 1','left')
|
||||
->join('user_profiles', 'ticket_master.acm_id = user_profiles.id', 'left')
|
||||
->where('ticket_master.id', $ticket_id)
|
||||
->where('ticket_master.is_active', 1)
|
||||
|
||||
@ -12,7 +12,7 @@ class TicketMessageModel extends Model
|
||||
protected $returnType = 'array';
|
||||
protected $useSoftDeletes = false;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = ['id','sender','ticket_id','mail_subject','emp_mail','mail_content','created_at'];
|
||||
protected $allowedFields = ['id','sender','ticket_id','claim_status','mail_subject','emp_mail','mail_content','created_at'];
|
||||
|
||||
|
||||
// Callbacks
|
||||
|
||||
@ -12,7 +12,7 @@ class TicketNoteModel extends Model
|
||||
protected $returnType = 'array';
|
||||
protected $useSoftDeletes = false;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = ['id','ticket_id','note','created_by','updated_by','is_active'];
|
||||
protected $allowedFields = ['id','ticket_id','note','is_auto_query','created_by','updated_by','is_active'];
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
|
||||
98
app/Views/ticket_auto_query.php
Normal file
98
app/Views/ticket_auto_query.php
Normal file
@ -0,0 +1,98 @@
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<form role="form" class="parsley-examples" method="post" id="ticket_auto_query"
|
||||
enctype="multipart/form-data">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<!-- <label for="ticket_auto_query_note">Add Notes</label> -->
|
||||
<textarea class="form-control" id="ticket_auto_query_note" name="note" rows="3"
|
||||
placeholder="Enter Text"><?= isset($ticket_note['note']) ? $ticket_note['note'] : '' ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div><input type="hidden" id="query_note_id"><input type="hidden"
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary" id="ticket_auto_query_submit">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div> <!-- end col-->
|
||||
</div>
|
||||
<!-- end -->
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
url = '<?= base_url('ticket/note/1')?>';
|
||||
data = { id : $('#ticket_master_id').val() , is_auto_query : 1};
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:data,
|
||||
type: 'POST',
|
||||
success: function(res) {
|
||||
if (res.status == true){
|
||||
$('#ticket_auto_query_note').val(res.data.note);
|
||||
$('#query_note_id').val(res.data.id);
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Went Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
})
|
||||
|
||||
$("#ticket_auto_query").submit(function(event) {
|
||||
|
||||
event.preventDefault();
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
var url = '<?= base_url("/ticket/note/2"); ?>';
|
||||
var formData = $(this).serializeArray();
|
||||
var ticket_id = $('#ticket_master_id').val();
|
||||
if (ticket_id != null && ticket_id != ''){
|
||||
formData.push({ name: 'ticket_id', value: ticket_id});
|
||||
}
|
||||
var primary_key = $('#query_note_id').val();
|
||||
if (primary_key != null && primary_key != ''){
|
||||
formData.push({ name: 'id', value: primary_key});
|
||||
}
|
||||
formData.push({name: 'is_auto_query',value:1})
|
||||
console.log(formData);
|
||||
sendAjaxRequestForGlobal(url, 'POST', formData, function(response) {
|
||||
if (response.status == true) {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.success('Note Added Successfully','Success');
|
||||
// console.log("Respone id is ")
|
||||
// console.log(response.id);
|
||||
$('#query_note_id').val(response.id);
|
||||
|
||||
|
||||
} 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>
|
||||
@ -49,6 +49,13 @@
|
||||
<span class="d-none d-sm-inline-block">History</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#autoQuery-tab" data-toggle="tab" class="nav-link px-2 py-1" id="auto_query_tab"
|
||||
aria-expanded="false">
|
||||
<i class="mdi mdi-robot mr-1"></i>
|
||||
<span class="d-none d-sm-inline-block">Auto Query Content</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Tab Content -->
|
||||
@ -72,6 +79,9 @@
|
||||
<div class="tab-pane fade" id="history-tab">
|
||||
<?php include('ticket_history.php'); ?>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="autoQuery-tab">
|
||||
<?php include('ticket_auto_query.php'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -25,6 +25,20 @@ table.dataTable tbody td {
|
||||
margin-left: 20px !important;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.table th:nth-child(1),
|
||||
.table td:nth-child(1) {
|
||||
max-width: 200px !important;
|
||||
min-width: 100px !important;
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis !important;
|
||||
white-space: nowrap !important;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
@ -52,12 +66,14 @@ table.dataTable tbody td {
|
||||
<?php if (isset($ticket_data)) { ?>
|
||||
<?php foreach($ticket_data as $index => $row){ ?>
|
||||
<tr onclick="viewTicket(<?php echo $row['id']; ?>)">
|
||||
<td><?php echo $row['status']; ?></td>
|
||||
<td data-toggle="tooltip" data-placement="top" title="<?php echo $row['status']; ?>">
|
||||
<span class="status-tooltip"><?php echo $row['status']; ?></span>
|
||||
</td>
|
||||
<td><?php echo $row['claim_no']; ?></td>
|
||||
<td><?php echo $row['tpa_id']; ?></td>
|
||||
<td><?php echo $row['emp_name']; ?></td>
|
||||
<td><?php echo $row['insurer_name']; ?></td>
|
||||
<td><?php echo $row['client_name']; ?></td>
|
||||
<td><?php echo $row['insured_name']; ?></td>
|
||||
<td><?php echo $row['short_name']; ?></td>
|
||||
<td><?php echo $row['tat']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
@ -77,6 +93,10 @@ table.dataTable tbody td {
|
||||
<!-------------------------------------------------------------------------------------------------->
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
});
|
||||
|
||||
// Datatable document ready
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
$(document).ready(function() {
|
||||
url = '<?= base_url('ticket/note/1')?>';
|
||||
data = { id : $('#ticket_master_id').val()};
|
||||
data = { id : $('#ticket_master_id').val(), is_auto_query : 0};
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:data,
|
||||
@ -69,6 +69,10 @@ $(document).ready(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.success('Note Added Successfully','Success');
|
||||
// console.log("Respone id is ")
|
||||
// console.log(response.id);
|
||||
$('#note_id').val(response.id);
|
||||
// console.log($('#'))
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
</div>
|
||||
<div id="ticket_mail_editor" name="content" style="height: 300px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div><input type="hidden" id="claim_status" name="claim_status" value="<?= $reply_data['claim_status_id'] ?>">
|
||||
</div>
|
||||
|
||||
<!-- Submit Button -->
|
||||
|
||||
Loading…
Reference in New Issue
Block a user