CHANGE_ticket full changes
This commit is contained in:
parent
c2becd0338
commit
2dcc7129bb
@ -93,7 +93,8 @@ class ThzController extends BaseController
|
||||
|
||||
$data['page_name'] = "Ticket List";
|
||||
$data['ticket_data'] = $tickets;
|
||||
$data['assignee'] = $this->userModel->where('is_active', 1)->whereIn('role', ['1', '5'])->findAll(); // enga 5-"head" and 1-"admin" role person thaan assignee..
|
||||
$data['assignee'] = $this->userModel->where('is_active', 1)->whereIn('role', ['2', '3','4'])->findAll(); // enga 5-"head" and 1-"admin" assign pannvaga so dropdown la varakudhathu
|
||||
// 2,3,4 remain person varannum.
|
||||
$data['client_list'] = $this->clientModel->getCreatedByUserName();
|
||||
return $this->loadLayout('thz_list', $data);
|
||||
}
|
||||
@ -160,6 +161,8 @@ class ThzController extends BaseController
|
||||
public function ticketConversationList(){
|
||||
|
||||
$data = $this->request->getGet();
|
||||
$data = $this->request->getGet();
|
||||
$returnType = strtolower($this->request->getGet('return_type') ?? 'api');
|
||||
|
||||
$thz_id = $data['thz_id'] ?? null;
|
||||
|
||||
@ -182,7 +185,20 @@ class ThzController extends BaseController
|
||||
return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']))->setStatusCode(404);
|
||||
}
|
||||
|
||||
return $this->response->setJSON((['status' => 'success', 'data' => $result]))->setStatusCode(200);
|
||||
|
||||
if ($returnType === 'api') {
|
||||
return $this->response->setJSON((['status' => 'success', 'data' => $result]))->setStatusCode(200);
|
||||
}else{
|
||||
$toGetRelated = $result['master'][0]['created_by'];
|
||||
$result['related_tickets'] = $this->thzMasterModel
|
||||
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
|
||||
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
|
||||
->where('thz_master.created_by', $toGetRelated)
|
||||
->findAll();
|
||||
$result['assignee'] = $this->userModel->where('is_active', 1)->whereIn('role', ['2', '3','4'])->findAll(); // enga 5-"head" and 1-"admin" assign pannvaga so dropdown la varakudhathu
|
||||
// 2,3,4 remain person varannum.
|
||||
return $this->loadLayout('thz_notes', $result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ class ThzMasterNotesModel extends Model
|
||||
protected $returnType = 'array';
|
||||
protected $useSoftDeletes = false;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = ['thz_id','notes','notes_by','notes_type','created_by','created_at'];
|
||||
protected $allowedFields = ['thz_id','notes','notes_by','created_by','created_at','notes_type'];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
|
||||
|
||||
@ -1,54 +1,84 @@
|
||||
<style>
|
||||
/* .table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
|
||||
/* Force DataTable to allow rounded corners */
|
||||
#scroll-horizontal-datatable {
|
||||
border-collapse: separate !important;
|
||||
border-spacing: 0 8px !important; /* space between rows */
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* HEADER */
|
||||
thead th {
|
||||
background-color: #00999E;
|
||||
color: #fff !important;
|
||||
border-top: 0px solid #fff !important;
|
||||
border-bottom: 0px solid #fff !important;
|
||||
}
|
||||
|
||||
/* .table thead th {
|
||||
vertical-align: bottom;
|
||||
border-bottom: 2px solid #fff;
|
||||
} */
|
||||
|
||||
table {
|
||||
border-collapse: separate !important;
|
||||
border-spacing : 0 8px !important; /* spacing only between rows */
|
||||
/* Rounded header corners */
|
||||
thead th:first-child {
|
||||
border-top-left-radius: 15px !important;
|
||||
border-bottom-left-radius: 15px !important;
|
||||
}
|
||||
thead th:last-child {
|
||||
border-top-right-radius: 15px !important;
|
||||
border-bottom-right-radius: 15px !important;
|
||||
}
|
||||
|
||||
thead {
|
||||
background-color: #00999E; /* header background */
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
thead tr th:first-child {
|
||||
border-top-left-radius: 100px !important;
|
||||
border-bottom-left-radius: 100px !important;
|
||||
}
|
||||
thead tr th:last-child {
|
||||
border-top-right-radius: 100px !important;
|
||||
border-bottom-right-radius: 100px !important;
|
||||
}
|
||||
|
||||
tbody tr {
|
||||
background: #F5FFFF;
|
||||
box-shadow: 0 2px 5px rgba(0,0,0,0.08);
|
||||
border-bottom: 6px solid #fff;
|
||||
border-top: 6px solid #fff;
|
||||
}
|
||||
|
||||
/* BODY ROWS */
|
||||
tbody td {
|
||||
background: #F5FFFF; /* apply bg to td not tr */
|
||||
padding: 12px;
|
||||
border-top: 1px solid #eee;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
thead tr th:first-child {
|
||||
border-top-left-radius: 100px !important;
|
||||
border-bottom-left-radius: 100px !important;
|
||||
}
|
||||
thead tr th:last-child {
|
||||
border-top-right-radius: 100px !important;
|
||||
border-bottom-right-radius: 100px !important;
|
||||
/* Add shadow + spacing row "card" effect */
|
||||
tbody tr {
|
||||
box-shadow: 0 2px 5px rgba(0,0,0,0.08);
|
||||
}
|
||||
|
||||
/* Rounded corners for first + last cell of each row */
|
||||
tbody tr td:first-child {
|
||||
border-top-left-radius: 15px !important;
|
||||
border-bottom-left-radius: 15px !important;
|
||||
}
|
||||
tbody tr td:last-child {
|
||||
border-top-right-radius: 15px !important;
|
||||
border-bottom-right-radius: 15px !important;
|
||||
}
|
||||
|
||||
/* table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
} */
|
||||
/* Hover effect */
|
||||
#scroll-horizontal-datatable tbody tr:hover td {
|
||||
background-color: #e0e0e0;
|
||||
border-top-left-radius: 15px !important;
|
||||
border-bottom-left-radius: 15px !important;
|
||||
}
|
||||
|
||||
/* Search input with icon */
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
.dataTables_filter input {
|
||||
padding-right: 30px;
|
||||
background: url('https://cdn.jsdelivr.net/npm/@mdi/svg/svg/magnify.svg') no-repeat right 8px center;
|
||||
background-size: 16px;
|
||||
}
|
||||
|
||||
/* Optional: control first column width */
|
||||
.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;
|
||||
}
|
||||
|
||||
.col-12 {
|
||||
|
||||
@ -71,19 +101,24 @@ thead tr th:last-child {
|
||||
|
||||
</style>
|
||||
<style>
|
||||
.table th:nth-child(1),
|
||||
/* .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;
|
||||
}
|
||||
} */
|
||||
|
||||
#scroll-horizontal-datatable tbody tr:hover {
|
||||
background-color: #e0e0e0;
|
||||
}
|
||||
|
||||
td .text-muted {
|
||||
font-size: 0.85em; /* smaller than default */
|
||||
color: #6c757d !important; /* Bootstrap muted grey */
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
@ -103,18 +138,13 @@ thead tr th:last-child {
|
||||
<tr>
|
||||
<th>Ticket Number</th>
|
||||
<th>Name</th>
|
||||
<th>Mobile Number</th>
|
||||
<th>Email</th>
|
||||
<th>Emp Code</th>
|
||||
<th>Policy Number</th>
|
||||
<th>Ticket Type</th>
|
||||
<th>Subject</th>
|
||||
<th>Message</th>
|
||||
<th>Status</th>
|
||||
<th>Assignee</th>
|
||||
<?php if(in_array(get_role_id(), [1,2,3]) ) { ?> <!-- admin,manager,acc.m -->
|
||||
<th>ACTION</th>
|
||||
<?php } ?>
|
||||
<th>Assign To</th>
|
||||
<th>Created At</th>
|
||||
<th>Updated At</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -123,42 +153,30 @@ thead tr th:last-child {
|
||||
|
||||
<tr data-id="<?= $row['thz_id']; ?>" style="cursor: pointer;">
|
||||
<td><?php echo $row['thz_id']; ?></td>
|
||||
<td><?php echo $row['name']; ?></td>
|
||||
<td><?php echo $row['mobile']; ?></td>
|
||||
<td><?php echo $row['email']; ?></td>
|
||||
<td><?php echo $row['empcode']; ?></td>
|
||||
<td>
|
||||
<?php echo $row['name']; ?>
|
||||
<span class="text-muted"><?php if (!empty($row['empcode'])): echo '('.$row['empcode'].')'; endif; ?></span><br>
|
||||
<span class="text-muted"><?php if (!empty($row['mobile'])): echo $row['mobile']; endif; ?></span>
|
||||
</td>
|
||||
<td><?php echo $row['policy_no']; ?></td>
|
||||
<td><?php echo $row['ticket_type']; ?></td>
|
||||
<td><?php echo $row['subject']; ?></td>
|
||||
<td><?php echo $row['message']; ?></td>
|
||||
<td><?php echo $row['status']; ?></td>
|
||||
<td><?php echo $row['assignee_name']; ?></td>
|
||||
<?php if(in_array(get_role_id(), [1,2,3]) ) { ?> <!-- admin,manager,acc.m -->
|
||||
<td><?php echo $row['assignee_name']; ?></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<button type="button"
|
||||
class="btn btn-sm btn-primary"
|
||||
data-id="<?= $row['thz_id']; ?>"
|
||||
data-assignee="<?= $row['assign_to']; ?>"
|
||||
data-subject="<?= $row['subject']; ?>"
|
||||
onclick="openAssignee(this)">
|
||||
Assign
|
||||
</button>
|
||||
</div>
|
||||
<!-- <a href="javascript:void(0);"
|
||||
data-toggle="modal"
|
||||
data-target="#AssignModal"
|
||||
data-id="<?= $row['thz_id']; ?>"
|
||||
data-subject="<?= $row['subject']; ?>">
|
||||
<i class="fa fa-users"
|
||||
title="Assign To"
|
||||
style="font-size:15px; color:#555; cursor:pointer; transition:0.2s;"
|
||||
onmouseover="this.style.color='#02a8b5'; this.style.fontSize='17px';"
|
||||
onmouseout="this.style.color='#555'; this.style.fontSize='15px';">
|
||||
</i>
|
||||
</a> -->
|
||||
<?php if (!empty($row['created_at'])):
|
||||
$cdt = new DateTime($row['created_at']);
|
||||
echo $cdt->format('d/m/Y') . "<br><span class='time'>" . $cdt->format('h:i a') . "</span>";
|
||||
endif;
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if (!empty($row['updated_at'])):
|
||||
$udt = new DateTime($row['updated_at']);
|
||||
echo $udt->format('d/m/Y') . "<br><span class='time'>" . $udt->format('h:i a') . "</span>";
|
||||
endif;
|
||||
?>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
@ -222,6 +240,7 @@ thead tr th:last-child {
|
||||
<input type="hidden" id="return_type" name="return_type">
|
||||
<input type="hidden" id="branch_id" name="branch_id">
|
||||
<input type="hidden" id="policy_id" name="policy_id">
|
||||
<input type="hidden" id="created_by" name="created_by" value="<?= get_session_userid(); ?>">
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="name">Name<span class="text-danger">*</span></label>
|
||||
@ -270,17 +289,21 @@ thead tr th:last-child {
|
||||
</select>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="assign_to">Assign To</label>
|
||||
<select class="form-control" id="assign_to" name="assign_to">
|
||||
<option value="">Select Assign To</option>
|
||||
<?php if(isset($assignee)) { ?>
|
||||
<?php foreach ($assignee as $a) { ?>
|
||||
<option value="<?= $a['id']?>"><?= $a['emp_code'] ?> - <?= $a['first_name'] ?> <?= $a['last_name'] ?></option>
|
||||
<!-- // enga 5-"head" and 1-"admin" assign pannvaga dropdown-data la varakudhathu
|
||||
// 2,3,4 dropdown data'va varannum but those role means hide it -->
|
||||
<?php if(in_array(get_role_id(), [2,3,4]) ) { ?>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="assign_to">Assign To</label>
|
||||
<select class="form-control" id="assign_to" name="assign_to">
|
||||
<option value="">Select Assign To</option>
|
||||
<?php if(isset($assignee)) { ?>
|
||||
<?php foreach ($assignee as $a) { ?>
|
||||
<option value="<?= $a['id']?>"><?= $a['emp_code'] ?> - <?= $a['first_name'] ?> <?= $a['last_name'] ?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</select>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="subject">Subject</label>
|
||||
@ -408,25 +431,6 @@ thead tr th:last-child {
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
function openAssignee(button) {
|
||||
document.getElementById('hidden_thz_id').value = "";
|
||||
document.getElementById('modal_assignee').value = "";
|
||||
document.getElementById('assignModalLabel').innerText = "Ticket";
|
||||
|
||||
var id = button.getAttribute('data-id');
|
||||
var subject = button.getAttribute('data-subject');
|
||||
var assignee = button.getAttribute('data-assignee');
|
||||
|
||||
document.getElementById('hidden_thz_id').value = id;
|
||||
document.getElementById('modal_assignee').value = assignee;
|
||||
document.getElementById('assignModalLabel').innerText = "Ticket: " + subject + " (" + id + ")";
|
||||
|
||||
var myModal = new bootstrap.Modal(document.getElementById('AssignModal'));
|
||||
myModal.show();
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function getAutoFetchDetails() {
|
||||
@ -597,7 +601,7 @@ function viewTicket(ticket_id){
|
||||
// $('.loader').fadeIn();
|
||||
// $('.loader-mask').fadeIn();
|
||||
|
||||
let url = '<?= base_url('ThzControllerview/'); ?>' + ticket_id;
|
||||
let url = '<?= base_url('ticketConversationList?return_type=web¬es_ticket_type=Internal&thz_id='); ?>' + ticket_id;
|
||||
window.location.href = url;
|
||||
|
||||
|
||||
|
||||
@ -2,435 +2,418 @@
|
||||
.bg-staff {
|
||||
background-color: #FFF5E5;
|
||||
}
|
||||
|
||||
.notes-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border: 1px solid #00aaff;
|
||||
border-radius: 6px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.notes-box textarea {
|
||||
flex: 1;
|
||||
border: none;
|
||||
outline: none;
|
||||
resize: none;
|
||||
padding: 8px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.icon-buttons {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.btn-icon {
|
||||
background: #008b8b;
|
||||
border: none;
|
||||
color: white;
|
||||
border-radius: 50%;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn-icon i {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.conversation-card{
|
||||
border-radius: 15px !important;
|
||||
box-shadow: 0 1px 4px #000000;
|
||||
}
|
||||
|
||||
.conversation-card,
|
||||
.conversation-card .card-header,
|
||||
.conversation-card .card-body {
|
||||
background: #F5FFFF !important;
|
||||
overflow-y:auto;
|
||||
}
|
||||
.master-card{
|
||||
border-radius: 15px !important;
|
||||
box-shadow: 0 1px 4px #000000;
|
||||
}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card" style="margin-right: 23px;">
|
||||
<div class="card-body">
|
||||
<!-- Header Section -->
|
||||
<div class="row mb-3">
|
||||
<div class="col-6 d-flex align-items-center">
|
||||
<h4 class="mb-0">Ticket</h4>
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
<a href="<?= base_url('ticket/list'); ?>" aria-label="Back to ticket list">
|
||||
<i class="fas fa-arrow-left" style="font-size: 17px;"></i>
|
||||
</a>
|
||||
</div>
|
||||
<style>
|
||||
.related-ticket-card
|
||||
.related-ticket-card .card-header,
|
||||
.related-ticket-card .card-body {
|
||||
background: #F5FFFF !important;
|
||||
overflow-y:auto;
|
||||
box-shadow: 0 1px 4px #000000;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<!-- Title -->
|
||||
<div class="row" id="notes-title" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Ticket ID-<?php echo $master[0]['thz_id']; ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Navigation Tabs -->
|
||||
<ul class="nav nav-pills navtab-bg">
|
||||
<li class="nav-item">
|
||||
<a href="#general-tab" data-toggle="tab" class="nav-link px-2 py-1 active" id="general_tab"
|
||||
aria-expanded="true">
|
||||
<i class="mdi mdi-ticket-account"></i>
|
||||
<span class="d-none d-sm-inline-block">General</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#note-tab" data-toggle="tab" class="nav-link px-2 py-1" id="note_tab"
|
||||
aria-expanded="false">
|
||||
<i class="mdi mdi-note-text"></i>
|
||||
<span class="d-none d-sm-inline-block">Notes</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- Body -->
|
||||
<div class="row" id="notes-body">
|
||||
|
||||
<!-- Tab Content -->
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade show active" id="general-tab">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<form role="form" class="parsley-examples" method="post" id="thz_form_data" onsubmit="submitTicket(event, this)" enctype="multipart/form-data">
|
||||
<div class="form-group">
|
||||
|
||||
<h5>Ticket Master Details</h5>
|
||||
<hr>
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="name">Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="name" placeholder="Enter Name" name="name" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="mobile" placeholder="Enter Mobile" name="mobile" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="email">Email Id<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="email" placeholder="Enter Email" name="Email" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="empcode">Employee code<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="empcode" placeholder="Enter Employee code" name="empcode" required>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="policy_no">Policy Number<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="policy_no" placeholder="Enter Policy Number" name="policy_no" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="ticket_type">Ticket Type<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="ticket_type" name="ticket_type" required>
|
||||
<option value="">Select Ticket Type</option>
|
||||
<option value="Sales">Sales</option>
|
||||
<option value="Service">Service</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="modal_vehicle_no">Subject<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="subject" placeholder="Enter Subject" name="subject" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="message">Message<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="message" placeholder="Enter Message" name="message" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="status">Status<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="status" name="status" required>
|
||||
<option value="">Select Status</option>
|
||||
<option value="Open">Open</option>
|
||||
<option value="In Progress">In Progress</option>
|
||||
<option value="Resolved">Resolved</option>
|
||||
<option value="Closed">Closed</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="assign_to">Assign To<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="Assign_to" name="assign_to" required>
|
||||
<option value="">Select Assignee</option>
|
||||
<?php if(isset($assignee)) { ?>
|
||||
<?php foreach ($assignee as $value) { ?>
|
||||
<option value="<?= $a['id']?>"><?= $a['emp_code'] ?> - <?= $a['first_name'] ?> <?= $a['last_name'] ?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" id="thz_id" name="thz_id">
|
||||
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
</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>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- Left Details -->
|
||||
<div class="col-4" id="notes-body-left">
|
||||
<div class="card master-card" style="background:#F5FFFF;">
|
||||
<div class="card-header d-flex justify-content-between align-items-center" style="background:none; border:none;">
|
||||
<h5 class="mb-0">Details</h5>
|
||||
<a href="javascript:void(0);"
|
||||
onclick="openEditTicket()">
|
||||
<i class="mdi mdi-pencil"
|
||||
title="Edit"
|
||||
style="font-size:15px; color:#555; cursor:pointer; transition:0.2s;"
|
||||
onmouseover="this.style.color='#02a8b5'; this.style.fontSize='17px';"
|
||||
onmouseout="this.style.color='#555'; this.style.fontSize='15px';">
|
||||
</i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-body" style="padding-left: 27px !important; background:#F5FFFF;">
|
||||
<div class="row mb-2 ml-o">
|
||||
<div class="col-5">Ticket ID</div>
|
||||
<div class="col-7 text-end"><?= $master[0]['thz_id'];?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="note-tab">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<form role="form" class="parsley-examples" method="post" id="thz_note_form"
|
||||
enctype="multipart/form-data">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="ticket_note">Add Notes</label>
|
||||
<textarea class="form-control" id="thz_notes" name="notes" rows="3"
|
||||
placeholder="Enter Text"><?= isset($thz_note['notes']) ? $thz_note['notes'] : '' ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div><input type="hidden" id="thz_notes_id">
|
||||
<input type="hidden" id="thz_master_id">
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary" id="thz_note_submit">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5">Name</div>
|
||||
<div class="col-7 text-end"><?= $master[0]['name'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5">Mobile</div>
|
||||
<div class="col-7 text-end"><?= $master[0]['mobile'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5">Policy Number</div>
|
||||
<div class="col-7 text-end"><?= $master[0]['policy_no'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5">Assigned To</div>
|
||||
<div class="col-7 text-end"><?= $master[0]['assignee_name'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5">Status</div>
|
||||
<div class="col-7 text-end"><?= $master[0]['status'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5">Ticket Type</div>
|
||||
<div class="col-7 text-end"><?= $master[0]['ticket_type'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5">Subject</div>
|
||||
<div class="col-7 text-end"><?= $master[0]['subject'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5">Message</div>
|
||||
<div class="col-7 text-end"><?= $master[0]['message'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5">Related Tickets</div>
|
||||
<div class="col-7 text-end">
|
||||
<u class="text-warning">
|
||||
<a href="javascript:void(0);"
|
||||
class="text-warning"
|
||||
data-toggle="modal"
|
||||
data-target="#relatedTicketModal"
|
||||
data-id="<?= $master[0]['created_by']; ?>">
|
||||
View
|
||||
</a>
|
||||
</u>
|
||||
</div>
|
||||
</div> <!-- end col-->
|
||||
|
||||
</div>
|
||||
<!-- add more fields -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="modal fade" id="member_data_modal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myCenterModalLabel"></h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="acm_id">Insured Member<span class="text-danger"></span></label>
|
||||
<select class="form-control" onchange="setMemberData(this)">
|
||||
<option value="0">Select Insured Member</option>
|
||||
<?php if (!empty($member_data)) : ?>
|
||||
<?php foreach ($member_data as $value) : ?>
|
||||
<option value="<?= isset($value['emp_code']) ? $value['emp_code'] : '' ?>"
|
||||
data-empID="<?= isset($value['emp_id']) ? $value['emp_id'] : '' ?>"
|
||||
data-empName="<?= isset($value['emp_name']) ? htmlspecialchars($value['emp_name'], ENT_QUOTES, 'UTF-8') : '' ?>"
|
||||
data-policyNo="<?= isset($value['policy_no']) ? $value['policy_no'] : '' ?>"
|
||||
data-tpaNo="<?= isset($value['tpa_no']) ? $value['tpa_no'] : '' ?>"
|
||||
data-relationship="<?= isset($value['emp_relationship']) ? htmlspecialchars($value['emp_relationship'], ENT_QUOTES, 'UTF-8') : '' ?>">
|
||||
<?= isset($value['emp_name']) && isset($value['emp_relationship'])
|
||||
? htmlspecialchars($value['emp_name'] . ' - ' . $value['emp_relationship'], ENT_QUOTES, 'UTF-8')
|
||||
: 'Unknown Member' ?>
|
||||
</option>
|
||||
<!-- Right Conversation -->
|
||||
|
||||
<div class="col-8">
|
||||
|
||||
<!-- Conversation Card -->
|
||||
<div class="card mb-3 conversation-card">
|
||||
<div class="card-header border-0">
|
||||
<h5 class="mb-0">Conversation</h5>
|
||||
<hr/>
|
||||
</div>
|
||||
|
||||
<div class="card-body pt-0">
|
||||
<?php if(!empty($notes)): ?>
|
||||
<?php foreach($notes as $i => $conv): ?>
|
||||
|
||||
<!-- Top Row: Message + Badge -->
|
||||
<div class="d-flex justify-content-between align-items-start">
|
||||
<p class="mb-1 mr-4"><?= $conv['notes'] ?></p>
|
||||
<?php if(!empty($conv['notes_by'])): ?>
|
||||
<span class="badge bg-warning text-dark"><?= $conv['notes_by'] ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<!-- Bottom Row: Name + Date -->
|
||||
<div class="d-flex justify-content-between small text-muted">
|
||||
<span><i class="mdi mdi-account"></i> <?= $conv['name'] ?></span>
|
||||
<span><?= date("j F Y h:i a", strtotime($conv['created_at'])) ?></span>
|
||||
</div>
|
||||
|
||||
<?php echo $i < count($notes)-1 ? '<hr/>' : ''; ?>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
<p class="text-center"><i>No Data Found</i></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Input Card -->
|
||||
<div class="card">
|
||||
<div class="notes-box">
|
||||
<form id="conversationForm">
|
||||
<textarea class="form-control" id="notes" name="notes" placeholder="Write your notes here..."></textarea>
|
||||
<input type="hidden" id="notes_type" name="notes_type">
|
||||
<input type="hidden" id="thz_id" name="thz_id">
|
||||
<input type="hidden" id="notes_by" name="notes_by" value="Staff">
|
||||
<input type="hidden" id="created_by" name="created_by" value="<?= get_session_userid(); ?>">
|
||||
<div class="icon-buttons">
|
||||
<button type="button" class="btn-icon" onclick="submitConverstionTicket('External')"><i class="mdi mdi-content-save"></i></button>
|
||||
<button type="button" class="btn-icon" onclick="submitConverstionTicket('Internal')"><i class="mdi mdi-email"></i></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a class="btn btn-primary close" data-dismiss="modal" aria-label="Close">Submit</a>
|
||||
</div>
|
||||
</div> <!-- /notes-body -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div id="ticket_conversation_div">
|
||||
<?php include("ticket_conversation.php") ?>
|
||||
</div>
|
||||
|
||||
<?php //include("ticket_form_handler.php") ?>
|
||||
<div class="modal fade" id="EditModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<form id="ticketForm">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="EditModalLabel">Update</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="form-row">
|
||||
<input type="hidden" id="thz_id" name="thz_id">
|
||||
<input type="hidden" id="updated_by" name="updated_by" value="<?= get_session_userid(); ?>">
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="ticket_type">Ticket Type<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="ticket_type" name="ticket_type" required>
|
||||
<option value="">Select Ticket Type</option>
|
||||
<option value="Sales">Sales</option>
|
||||
<option value="Service">Service</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="status">Status</label>
|
||||
<select class="form-control" id="status" name="status">
|
||||
<option value="">Select Status</option>
|
||||
<option value="Open">Open</option>
|
||||
<option value="In Progress">In Progress</option>
|
||||
<option value="Resolved">Resolved</option>
|
||||
<option value="Closed">Closed</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- // enga 5-"head" and 1-"admin" assign pannvaga dropdown-data la varakudhathu
|
||||
// 2,3,4 dropdown data'va varannum but those role means hide it -->
|
||||
<?php if(in_array(get_role_id(), [2,3,4]) ) { ?>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="assign_to">Assign To</label>
|
||||
<select class="form-control" id="assign_to" name="assign_to">
|
||||
<option value="">Select Assign To</option>
|
||||
<?php if(isset($assignee)) { ?>
|
||||
<?php foreach ($assignee as $a) { ?>
|
||||
<option value="<?= $a['id']?>"><?= $a['emp_code'] ?> - <?= $a['first_name'] ?> <?= $a['last_name'] ?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-ternary btn-border-radius" onclick="submitTicket()">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="relatedTicketModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Related Tickets</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<?php foreach($related_tickets as $j => $rt): ?>
|
||||
<div class="card related-ticket-card mb-3">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-start">
|
||||
<h5 class="mb-1"><?php echo $rt['ticket_type']; ?></h5>
|
||||
<small>
|
||||
<?php if (!empty($rt['created_at'])):
|
||||
$cdt = new DateTime($rt['created_at']);
|
||||
echo $cdt->format('d/m/Y') . "<span class='time'>" . $cdt->format('h:i a') . "</span>";
|
||||
endif;
|
||||
?></small>
|
||||
</div>
|
||||
<p class="mb-2"><?php echo $rt['subject']; ?></p>
|
||||
<small><span style="color: green !important;">Status: </span><?php echo $rt['status']; ?></small>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
// Initialize select2
|
||||
$("#ticket_type").select2();
|
||||
$("#status").select2();
|
||||
$("#assign_to").select2();
|
||||
});
|
||||
|
||||
|
||||
function openEditTicket() {
|
||||
|
||||
var form = document.getElementById('ticketForm');
|
||||
form.reset();
|
||||
|
||||
var masterData = <?= json_encode($master[0]); ?>;
|
||||
// console.log("*****");
|
||||
|
||||
function submitClaimForm(event, form) {
|
||||
// console.log(masterData);
|
||||
|
||||
document.getElementById('EditModalLabel').innerText = "Update";
|
||||
|
||||
event.preventDefault();
|
||||
document.getElementById('thz_id').value = masterData.thz_id;
|
||||
document.getElementById('assign_to').value = masterData.assign_to;
|
||||
document.getElementById('status').value = masterData.status;
|
||||
document.getElementById('ticket_type').value = masterData.ticket_type;
|
||||
|
||||
var isValid = $('#ticket_form_data').parsley().validate();
|
||||
|
||||
document.getElementById('EditModalLabel').innerText = "Update Ticket: " + masterData.thz_id ;
|
||||
|
||||
if (!isValid) {
|
||||
toastr.warning('Form validation failed. Please check the required fields.', 'WARNING');
|
||||
return false;
|
||||
var myModal = new bootstrap.Modal(document.getElementById('EditModal'));
|
||||
myModal.show();
|
||||
}
|
||||
|
||||
const formAction = '<?= base_url("ticket/update"); ?>';
|
||||
function submitTicket() {
|
||||
|
||||
var form = document.getElementById("ticketForm"); // your form ID
|
||||
var formData = new FormData(form);
|
||||
|
||||
// Show loader
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
var id = form.querySelector("[name='thz_id']").value;
|
||||
|
||||
// Collect IDs and form data
|
||||
const formData = new FormData(form);
|
||||
|
||||
// AJAX request
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: formAction,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(response) {
|
||||
// Hide loader
|
||||
|
||||
console.log('Form submitted response:', response);
|
||||
|
||||
if (response.status === true) {
|
||||
location.reload();
|
||||
toastr.success(response.message, 'SUCCESS');
|
||||
} else {
|
||||
toastr.error(response.message, 'ERROR');
|
||||
}
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
// Hide loader
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function openFetchEmpDataodal() {
|
||||
var myModal = new bootstrap.Modal(document.getElementById('member_data_modal'));
|
||||
myModal.show();
|
||||
}
|
||||
|
||||
function setMemberData(input) {is_head_approved
|
||||
|
||||
var selectedOption = $(input).find(':selected');
|
||||
|
||||
// Retrieve the data-* attributes
|
||||
var empId = selectedOption.data('empid');
|
||||
var empName = selectedOption.data('empname');
|
||||
var policyNo = selectedOption.data('policyno');
|
||||
var tpaNo = selectedOption.data('tpano');
|
||||
var relationship = selectedOption.data('relationship');
|
||||
|
||||
$('#tpa_no').val(tpaNo);
|
||||
$('#insured_emp_id').val(empId);
|
||||
$('#insured_name').val(empName);
|
||||
$('#policy_no').val(policyNo);
|
||||
|
||||
$('#relationship option').each(function() {
|
||||
if ($(this).text() === relationship) {
|
||||
$(this).prop('selected', true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showConfirmationModal(event) {
|
||||
Swal.fire({
|
||||
title: "Approve Claim Rejection",
|
||||
// text: "Do you want to save this?",
|
||||
icon: "warning",
|
||||
showCancelButton: true,
|
||||
showDenyButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
cancelButtonColor: "#6c757d",
|
||||
denyButtonColor: "#d33",
|
||||
confirmButtonText: "Approve",
|
||||
denyButtonText: "Reject",
|
||||
cancelButtonText: "Cancel"
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$('#is_head_approved').val(1);
|
||||
console.log($('#ticket_form_data')[0])
|
||||
submitClaimForm(event, $('#ticket_form_data')[0]); // Fixed selector
|
||||
} else if (result.isDenied) {
|
||||
// Show second Swal for rejection reason
|
||||
Swal.fire({
|
||||
title: "Rejection Reason",
|
||||
text: "Please provide a reason for rejection",
|
||||
input: "textarea",
|
||||
inputPlaceholder: "Enter your reason here...",
|
||||
icon: "info",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
cancelButtonColor: "#6c757d",
|
||||
confirmButtonText: "Submit",
|
||||
cancelButtonText: "Back"
|
||||
}).then((reasonResult) => {
|
||||
if (reasonResult.isConfirmed) {
|
||||
// Check if reason is not empty
|
||||
if (reasonResult.value && reasonResult.value.trim() !== "") {
|
||||
$('#is_head_approved').val(2);
|
||||
$('#rejection_reason').val(reasonResult.value.trim());
|
||||
console.log($('#ticket_form_data')[0]);
|
||||
$('#head_rejection_reason').val(reasonResult.value.trim());
|
||||
submitClaimForm(event, $('#ticket_form_data')[0]);
|
||||
} else {
|
||||
// Alert if reason is empty
|
||||
Swal.fire({
|
||||
title: "Error",
|
||||
text: "Rejection reason cannot be empty",
|
||||
icon: "error",
|
||||
confirmButtonColor: "#3085d6"
|
||||
}).then(() => {
|
||||
// Go back to the rejection reason dialog
|
||||
showConfirmationModal(event);
|
||||
});
|
||||
}
|
||||
$.ajax({
|
||||
url: "<?= base_url('ticketSave') ?>",
|
||||
type: "POST",
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
if (response.status === "success") {
|
||||
toastr.success(response.message, 'success');
|
||||
$('#ticketModal').modal('hide');
|
||||
form.reset();
|
||||
window.location.href = "<?= base_url('ticketConversationList?return_type=web¬es_ticket_type=Internal&thz_id=') ?>" + id;
|
||||
} else {
|
||||
// If canceled, go back to first Swal
|
||||
showConfirmationModal(event);
|
||||
toastr.error(response.message, 'error');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('#is_head_approved').val(0);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Initialize select2
|
||||
$("#ticket_type").select2();
|
||||
$("#status").select2();
|
||||
$("#assign_to").select2();
|
||||
|
||||
url = '<?= base_url('ThzControllernote/1'); ?>';
|
||||
data = { id : $('#thz_master_id').val(), is_auto_query : 0};
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:data,
|
||||
type:'POST',
|
||||
success: function(res) {
|
||||
if (res.status == true){
|
||||
$('#thz_master_id').val(res.data.thz_id);
|
||||
$('#thz_notes').val(res.data.notes);
|
||||
$('#thz_notes_id').val(res.data.id);
|
||||
$('#thz_notes_by').val('Staff');
|
||||
},
|
||||
error: function(xhr) {
|
||||
toastr.error("Something went wrong!", 'error');
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
},
|
||||
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_note_form").submit(function(event) {
|
||||
|
||||
event.preventDefault();
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
var url = '<?= base_url("/ThzControllernote/2"); ?>';
|
||||
var formData = $(this).serializeArray();
|
||||
var ticket_id = $('#thz_master_id').val();
|
||||
if (ticket_id != null && ticket_id != ''){
|
||||
formData.push({ name: 'thz_id', value: ticket_id});
|
||||
}
|
||||
var primary_key = $('#thz_note_id').val();
|
||||
if (primary_key != null && primary_key != ''){
|
||||
formData.push({ name: 'id', value: primary_key});
|
||||
}
|
||||
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);
|
||||
$('#note_id').val(response.id);
|
||||
// console.log($('#'))
|
||||
|
||||
|
||||
} 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');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
function submitConverstionTicket(notetype) {
|
||||
|
||||
document.getElementById("notes_type").value = notetype;
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
document.getElementById("thz_id").value = urlParams.get('thz_id');
|
||||
|
||||
var form = document.getElementById("conversationForm");
|
||||
var formData = new FormData(form);
|
||||
|
||||
$.ajax({
|
||||
url: "<?= base_url('ticketConversationSave') ?>",
|
||||
type: "POST",
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
if (response.status === "success") {
|
||||
toastr.success(response.message, 'success');
|
||||
$('#ticketModal').modal('hide');
|
||||
form.reset();
|
||||
window.location.href = "<?= base_url('ticketConversationList?return_type=web¬es_ticket_type=Internal&thz_id=') ?>" + id;
|
||||
} else {
|
||||
toastr.error(response.message, 'error');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
toastr.error("Something went wrong!", 'error');
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user