Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
9a4e705849
@ -562,6 +562,7 @@ $routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) {
|
|||||||
$routes->get("ticketList", "ThzController::ticketList");
|
$routes->get("ticketList", "ThzController::ticketList");
|
||||||
$routes->post("ticketConversationSave", "ThzController::ticketConversationSave");
|
$routes->post("ticketConversationSave", "ThzController::ticketConversationSave");
|
||||||
$routes->get("ticketConversationList", "ThzController::ticketConversationList");
|
$routes->get("ticketConversationList", "ThzController::ticketConversationList");
|
||||||
|
$routes->get("ticketHistoryList", "ThzController::ticketHistoryList");
|
||||||
|
|
||||||
$routes->get("hrFileList", "EmployeeRestController::hrFileList");
|
$routes->get("hrFileList", "EmployeeRestController::hrFileList");
|
||||||
$routes->get("hrFileUploadMasters", "EmployeeRestController::hrFileUploadMasters");
|
$routes->get("hrFileUploadMasters", "EmployeeRestController::hrFileUploadMasters");
|
||||||
@ -660,4 +661,5 @@ $routes->get("ticketList", "ThzController::ticketList");
|
|||||||
$routes->post("ticketConversationSave", "ThzController::ticketConversationSave");
|
$routes->post("ticketConversationSave", "ThzController::ticketConversationSave");
|
||||||
$routes->get("ticketConversationList", "ThzController::ticketConversationList");
|
$routes->get("ticketConversationList", "ThzController::ticketConversationList");
|
||||||
$routes->post('ticketAutoFetchDetails',"ThzController::ticketAutoFetchDetails");
|
$routes->post('ticketAutoFetchDetails',"ThzController::ticketAutoFetchDetails");
|
||||||
// $routes->match(['get','post','put'], 'ticketType', 'ThzController::ticketType');
|
$routes->match(['get','post','put'], 'ticketType', 'ThzController::ticketType');
|
||||||
|
$routes->get("ticketHistoryList", "ThzController::ticketHistoryList");
|
||||||
@ -2746,7 +2746,7 @@ class LeadsController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
// print_r($subject); die;
|
// print_r($subject); die;
|
||||||
|
$common = ['module' => "leads", 'pk' =>$lead_id];
|
||||||
if ($recipient_data) {
|
if ($recipient_data) {
|
||||||
foreach ($recipient_data as $recipient) {
|
foreach ($recipient_data as $recipient) {
|
||||||
|
|
||||||
@ -2761,7 +2761,7 @@ class LeadsController extends BaseController
|
|||||||
$string = implode(", ", $cc_mails);
|
$string = implode(", ", $cc_mails);
|
||||||
$bcc_string = implode(", ", $bcc_mails);
|
$bcc_string = implode(", ", $bcc_mails);
|
||||||
|
|
||||||
$res = MailHelper::send_email(['from_mail' => $from_mail, 'mail' => $recipient['email'], 'cc' => $string, 'subject' => $subject, 'message' => $message, 'attachments' => $attachments, 'reply_to' => $reply_to, 'bcc' => $bcc_string]);
|
$res = MailHelper::send_email(['from_mail' => $from_mail, 'mail' => $recipient['email'], 'cc' => $string, 'subject' => $subject, 'message' => $message, 'attachments' => $attachments, 'reply_to' => $reply_to, 'bcc' => $bcc_string, 'common' => $common]);
|
||||||
// !dd($res);
|
// !dd($res);
|
||||||
$result_data[] = ['mail' => $recipient['email'], 'status' => $res];
|
$result_data[] = ['mail' => $recipient['email'], 'status' => $res];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,12 +8,13 @@ use CodeIgniter\HTTP\ResponseInterface;
|
|||||||
|
|
||||||
use App\Models\ThzMasterModel;
|
use App\Models\ThzMasterModel;
|
||||||
use App\Models\ThzMasterNotesModel;
|
use App\Models\ThzMasterNotesModel;
|
||||||
|
use App\Models\ThzTypeModel;
|
||||||
|
use App\Models\ThzHistoryModel;
|
||||||
use App\ControllerCleaners\ThzControllerCleaner;
|
use App\ControllerCleaners\ThzControllerCleaner;
|
||||||
use App\Models\UserModel;
|
use App\Models\UserModel;
|
||||||
use App\Models\ClientPolicyModel;
|
use App\Models\ClientPolicyModel;
|
||||||
use App\Models\ClientModel;
|
use App\Models\ClientModel;
|
||||||
use App\Models\TicketMailTemplateModel;
|
use App\Models\TicketMailTemplateModel;
|
||||||
// use App\Models\TicketTypesModel;
|
|
||||||
|
|
||||||
|
|
||||||
class ThzController extends BaseController
|
class ThzController extends BaseController
|
||||||
@ -21,7 +22,8 @@ class ThzController extends BaseController
|
|||||||
|
|
||||||
protected $thzMasterModel;
|
protected $thzMasterModel;
|
||||||
protected $thzMasterNotesModel;
|
protected $thzMasterNotesModel;
|
||||||
|
protected $thzTypeModel;
|
||||||
|
protected $thzHistoryModel;
|
||||||
protected $thzControllerCleaner;
|
protected $thzControllerCleaner;
|
||||||
|
|
||||||
protected $userModel;
|
protected $userModel;
|
||||||
@ -29,12 +31,13 @@ class ThzController extends BaseController
|
|||||||
protected $clientModel;
|
protected $clientModel;
|
||||||
|
|
||||||
protected $ticketMailTemplateModel;
|
protected $ticketMailTemplateModel;
|
||||||
// protected $ticketTypesModel;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->thzMasterModel = new ThzMasterModel();
|
$this->thzMasterModel = new ThzMasterModel();
|
||||||
$this->thzMasterNotesModel = new ThzMasterNotesModel();
|
$this->thzMasterNotesModel = new ThzMasterNotesModel();
|
||||||
|
$this->thzTypeModel = new thzTypeModel();
|
||||||
|
$this->thzHistoryModel = new ThzHistoryModel();
|
||||||
$this->thzControllerCleaner = new ThzControllerCleaner();
|
$this->thzControllerCleaner = new ThzControllerCleaner();
|
||||||
$this->userModel = new UserModel();
|
$this->userModel = new UserModel();
|
||||||
$this->clientPolicyModel = new ClientPolicyModel();
|
$this->clientPolicyModel = new ClientPolicyModel();
|
||||||
@ -55,6 +58,28 @@ class ThzController extends BaseController
|
|||||||
|
|
||||||
$text = "update";
|
$text = "update";
|
||||||
$result = $this->updateTicket($data);
|
$result = $this->updateTicket($data);
|
||||||
|
// here insert history Status.
|
||||||
|
$old = $this->thzMasterModel->where('thz_id', $data['thz_id'])->get()->getRowArray();
|
||||||
|
|
||||||
|
if ($old && isset($data['status'])) {
|
||||||
|
if ($old['status'] != $data['status']) {
|
||||||
|
$history = [
|
||||||
|
'thz_id' => $data['thz_id'],
|
||||||
|
'field_name' => 'status',
|
||||||
|
'display_name' => 'Status',
|
||||||
|
'old_value' => $old['status'],
|
||||||
|
'new_value' => $data['status'],
|
||||||
|
'is_active' => 1
|
||||||
|
];
|
||||||
|
|
||||||
|
if (!empty(get_session_userid())) {
|
||||||
|
$history['created_by'] = get_session_userid();
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->thzHistoryModel->insert($history);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$updateID = $data['thz_id'];
|
$updateID = $data['thz_id'];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -228,43 +253,63 @@ class ThzController extends BaseController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function ticketType()
|
public function ticketType()
|
||||||
// {
|
{
|
||||||
// $method = $this->request->getMethod(); // get, post
|
$method = $this->request->getMethod(); // get, post
|
||||||
|
|
||||||
// if ($method === 'get') {
|
if ($method === 'get') {
|
||||||
|
|
||||||
// $types = $this->ticketTypesModel->where('is_active', 1)->findAll();
|
$types = $this->thzTypeModel->where('is_active', 1)->findAll();
|
||||||
// if (empty($types)) {
|
if (empty($types)) {
|
||||||
// return $this->response->setJSON(['status' => 'error','message' => 'No ticket types found'])->setStatusCode(404);
|
return $this->response->setJSON(['status' => 'error','message' => 'No ticket types found'])->setStatusCode(404);
|
||||||
// }
|
}
|
||||||
// return $this->response->setJSON(['status' => 'success','data' => $types])->setStatusCode(200);
|
return $this->response->setJSON(['status' => 'success','data' => $types])->setStatusCode(200);
|
||||||
|
|
||||||
// }
|
}
|
||||||
|
|
||||||
// if ($method === 'post') {
|
if ($method === 'post') {
|
||||||
|
|
||||||
// $data = $this->request->getPost();
|
$data = $this->request->getPost();
|
||||||
// if (!empty($data['id'])) {
|
if (!empty($data['id'])) {
|
||||||
// $text = "update";
|
$text = "update";
|
||||||
// $result = $this->ticketTypesModel->update($data['id'], $data);
|
$result = $this->thzTypeModel->update($data['id'], $data);
|
||||||
// $updateID = $data['id'];
|
$updateID = $data['id'];
|
||||||
// } else {
|
} else {
|
||||||
// $text = "create";
|
$text = "create";
|
||||||
// $insertID = $this->ticketTypesModel->insert($data);
|
$insertID = $this->thzTypeModel->insert($data);
|
||||||
// $result = true;
|
$result = true;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// $id = isset($insertID) && !empty($insertID) ? $insertID : $updateID ;
|
$id = isset($insertID) && !empty($insertID) ? $insertID : $updateID ;
|
||||||
|
|
||||||
// return $this->response->setJSON([
|
return $this->response->setJSON([
|
||||||
// 'status' => $id ? 'success' : 'error',
|
'status' => $id ? 'success' : 'error',
|
||||||
// 'message' => $id ? "Ticket Type {$text}d successfully " : "Unable to {$text} ticket type. Please try again." ,
|
'message' => $id ? "Ticket Type {$text}d successfully " : "Unable to {$text} ticket type. Please try again." ,
|
||||||
// 'id' => $id
|
'id' => $id
|
||||||
// ])->setStatusCode($id ? 200 : 400);
|
])->setStatusCode($id ? 200 : 400);
|
||||||
// }
|
}
|
||||||
// return $this->response->setJSON(['status' => 'error','message' => 'No ticket types found'])->setStatusCode(404);
|
return $this->response->setJSON(['status' => 'error','message' => 'No ticket types found'])->setStatusCode(404);
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
public function ticketHistoryList()
|
||||||
|
{
|
||||||
|
|
||||||
|
$data = $this->request->getGet();
|
||||||
|
$thz_id = $data['thz_id'];
|
||||||
|
// $details = $this->thzHistoryModal->whereIn('thz_id', $thz_id)->where('is_active', 1)->get()->getResultArray();
|
||||||
|
$details = $this->thzHistoryModel->select('thz_history.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as created_name')
|
||||||
|
->join('user_profiles', 'user_profiles.id = thz_history.created_by', 'left')
|
||||||
|
->where('thz_history.thz_id', $thz_id)->where('thz_history.is_active', 1)->get()->getResultArray();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (empty($details)) {
|
||||||
|
return $this->response->setJSON([ 'status' => 'error','message' => 'No History found'])->setStatusCode(404);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return $this->response->setJSON(['status' => 'success','data' => $details])->setStatusCode(200);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/************************************************** PRIVATE FUNCTIONS ********************************************************/
|
/************************************************** PRIVATE FUNCTIONS ********************************************************/
|
||||||
|
|||||||
@ -322,6 +322,7 @@ class MailHelper
|
|||||||
|
|
||||||
$from_address = isset($params['from_mail']) && !empty($params['from_mail']) ? $params['from_mail'] : getenv('email.fromEmail');
|
$from_address = isset($params['from_mail']) && !empty($params['from_mail']) ? $params['from_mail'] : getenv('email.fromEmail');
|
||||||
// $from_address = "claims@nhanceindia.in";
|
// $from_address = "claims@nhanceindia.in";
|
||||||
|
if(isset($params['common'])){ $params['common']['from_mail'] = $from_address; }
|
||||||
try {
|
try {
|
||||||
$curl = curl_init();
|
$curl = curl_init();
|
||||||
|
|
||||||
|
|||||||
@ -7,5 +7,5 @@ use CodeIgniter\Model;
|
|||||||
class GmailSentHistoryModel extends Model{
|
class GmailSentHistoryModel extends Model{
|
||||||
protected $table = 'gmail_sent_history';
|
protected $table = 'gmail_sent_history';
|
||||||
protected $primaryKey = 'id';
|
protected $primaryKey = 'id';
|
||||||
protected $allowedFields = ["id", "mail", "bcc", "cc", "message", "attachments", "client_id", "client_branch_id", "client_policy_id", "employee_policy_id", "employee_id", "mail_type", "gmail_api_status", "gmail_api_id", "created_by", "created_at", "updated_by", "updated_at", "isactive","received_message"];
|
protected $allowedFields = ["id", "mail", "bcc", "cc", "message", "attachments", "client_id", "client_branch_id", "client_policy_id", "employee_policy_id", "employee_id", "mail_type", "gmail_api_status", "gmail_api_id", "module", "pk", "from_mail", "created_by", "created_at", "updated_by", "updated_at", "isactive","received_message"];
|
||||||
}
|
}
|
||||||
45
app/Models/ThzHistoryModel.php
Normal file
45
app/Models/ThzHistoryModel.php
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
|
class ThzHistoryModel extends Model
|
||||||
|
{
|
||||||
|
protected $table = 'thz_history';
|
||||||
|
protected $primaryKey = 'id';
|
||||||
|
protected $useAutoIncrement = true;
|
||||||
|
protected $returnType = 'array';
|
||||||
|
protected $useSoftDeletes = false;
|
||||||
|
protected $protectFields = true;
|
||||||
|
protected $allowedFields = ['thz_id','field_name','display_name','old_value','new_value','created_by','created_at','is_active'];
|
||||||
|
|
||||||
|
|
||||||
|
protected bool $allowEmptyInserts = false;
|
||||||
|
|
||||||
|
// Dates
|
||||||
|
protected $useTimestamps = false;
|
||||||
|
protected $dateFormat = 'datetime';
|
||||||
|
protected $createdField = 'created_at';
|
||||||
|
protected $updatedField = 'updated_at';
|
||||||
|
protected $deletedField = 'deleted_at';
|
||||||
|
|
||||||
|
// Validation
|
||||||
|
protected $validationRules = [];
|
||||||
|
protected $validationMessages = [];
|
||||||
|
protected $skipValidation = false;
|
||||||
|
protected $cleanValidationRules = true;
|
||||||
|
|
||||||
|
// Callbacks
|
||||||
|
protected $allowCallbacks = true;
|
||||||
|
protected $beforeInsert = [];
|
||||||
|
protected $afterInsert = [];
|
||||||
|
protected $beforeUpdate = [];
|
||||||
|
protected $afterUpdate = [];
|
||||||
|
protected $beforeFind = [];
|
||||||
|
protected $afterFind = [];
|
||||||
|
protected $beforeDelete = [];
|
||||||
|
protected $afterDelete = [];
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -4,9 +4,9 @@ namespace App\Models;
|
|||||||
|
|
||||||
use CodeIgniter\Model;
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
class TicketTypesModel extends Model
|
class ThzTypeModel extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'ticket_types';
|
protected $table = 'thz_type';
|
||||||
protected $primaryKey = 'id';
|
protected $primaryKey = 'id';
|
||||||
protected $useAutoIncrement = true;
|
protected $useAutoIncrement = true;
|
||||||
protected $returnType = 'array';
|
protected $returnType = 'array';
|
||||||
@ -670,6 +670,39 @@ a.app-badge-secondary:focus, a.app-badge-secondary.focus {
|
|||||||
outline: 0;
|
outline: 0;
|
||||||
box-shadow: 0 0 0 0.15rem rgba(226, 103, 40, 0.5); }
|
box-shadow: 0 0 0 0.15rem rgba(226, 103, 40, 0.5); }
|
||||||
|
|
||||||
|
.app-table-head th {
|
||||||
|
background-color: #00999E;
|
||||||
|
color: #fff !important;
|
||||||
|
border-top: 0px solid #fff !important;
|
||||||
|
border-bottom: 0px solid #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-table-body td {
|
||||||
|
background: #F5FFFF;
|
||||||
|
padding: 12px;
|
||||||
|
border-top: 1px solid #eee;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.app-table-head th:first-child {
|
||||||
|
border-top-left-radius: 15px !important;
|
||||||
|
border-bottom-left-radius: 15px !important;
|
||||||
|
}
|
||||||
|
.app-table-head th:last-child {
|
||||||
|
border-top-right-radius: 15px !important;
|
||||||
|
border-bottom-right-radius: 15px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.app-table-body tr td:first-child {
|
||||||
|
border-top-left-radius: 15px !important;
|
||||||
|
border-bottom-left-radius: 15px !important;
|
||||||
|
}
|
||||||
|
.app-table-body tr td:last-child {
|
||||||
|
border-top-right-radius: 15px !important;
|
||||||
|
border-bottom-right-radius: 15px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -7,52 +7,17 @@
|
|||||||
width: 100%;
|
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 {
|
/* .table thead th {
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
border-bottom: 2px solid #fff;
|
border-bottom: 2px solid #fff;
|
||||||
} */
|
} */
|
||||||
|
|
||||||
/* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* BODY ROWS */
|
|
||||||
tbody td {
|
|
||||||
background: #F5FFFF; /* apply bg to td not tr */
|
|
||||||
padding: 12px;
|
|
||||||
border-top: 1px solid #eee;
|
|
||||||
border-bottom: 1px solid #eee;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Add shadow + spacing row "card" effect */
|
/* Add shadow + spacing row "card" effect */
|
||||||
tbody tr {
|
tbody tr {
|
||||||
/* box-shadow: 0 2px 5px rgba(0,0,0,0.08); */
|
/* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Hover effect */
|
/* Hover effect */
|
||||||
#scroll-horizontal-datatable tbody tr:hover td {
|
#scroll-horizontal-datatable tbody tr:hover td {
|
||||||
background-color: #e0e0e0;
|
background-color: #e0e0e0;
|
||||||
@ -123,10 +88,6 @@ tbody tr td:last-child {
|
|||||||
white-space: nowrap !important;
|
white-space: nowrap !important;
|
||||||
} */
|
} */
|
||||||
|
|
||||||
|
|
||||||
.text-custom-black{
|
|
||||||
color: #000000 !important;
|
|
||||||
}
|
|
||||||
.text-custom-grey{
|
.text-custom-grey{
|
||||||
font-size: 0.85em;
|
font-size: 0.85em;
|
||||||
color: #6c757d !important;
|
color: #6c757d !important;
|
||||||
@ -252,7 +213,7 @@ table thead th {
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<table id="scroll-horizontal-datatable" class="table w-100 nowrap text-custom-black text-custom app-font-family">
|
<table id="scroll-horizontal-datatable" class="table w-100 nowrap text-custom-black text-custom app-font-family">
|
||||||
<thead>
|
<thead class="app-table-head">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Ticket ID</th>
|
<th>Ticket ID</th>
|
||||||
<th class="app-text-left">Name</th>
|
<th class="app-text-left">Name</th>
|
||||||
@ -265,7 +226,7 @@ table thead th {
|
|||||||
<th>Updated At</th>
|
<th>Updated At</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody class="app-table-body">
|
||||||
<?php if (isset($ticket_data)) { ?>
|
<?php if (isset($ticket_data)) { ?>
|
||||||
<?php foreach($ticket_data as $index => $row){ ?>
|
<?php foreach($ticket_data as $index => $row){ ?>
|
||||||
|
|
||||||
@ -293,15 +254,17 @@ table thead th {
|
|||||||
<td class="app-text-left"><?php echo $row['assignee_name'] ? $row['assignee_name'] : '-'; ?></td>
|
<td class="app-text-left"><?php echo $row['assignee_name'] ? $row['assignee_name'] : '-'; ?></td>
|
||||||
<td class="app-text-left">
|
<td class="app-text-left">
|
||||||
<?php if (!empty($row['created_at'])):
|
<?php if (!empty($row['created_at'])):
|
||||||
$cdt = new DateTime($row['created_at']);
|
$cd = date("j F Y", strtotime($row['created_at']));
|
||||||
echo $cdt->format('d/m/Y') . "<br><span class='time'> " . $cdt->format('h:i a') . "</span>";
|
$ct = date("h:i a", strtotime($row['created_at']));
|
||||||
|
echo $cd . "<br><span class='time'> " . $ct . "</span>";
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
<td class="app-text-left">
|
<td class="app-text-left">
|
||||||
<?php if (!empty($row['updated_at'])):
|
<?php if (!empty($row['updated_at'])):
|
||||||
$udt = new DateTime($row['updated_at']);
|
$ud = date("j F Y", strtotime($row['updated_at']));
|
||||||
echo $udt->format('d/m/Y') . "<br><span class='time'> " . $udt->format('h:i a') . "</span>";
|
$ut = date("h:i a", strtotime($row['updated_at']));
|
||||||
|
echo $ud . "<br><span class='time'> " . $ut . "</span>";
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
@ -396,7 +359,15 @@ table thead th {
|
|||||||
<option value="">Select Ticket Type</option>
|
<option value="">Select Ticket Type</option>
|
||||||
<option value="Sales" selected >Sales</option>
|
<option value="Sales" selected >Sales</option>
|
||||||
<option value="Service">Service</option>
|
<option value="Service">Service</option>
|
||||||
<!-- <option value="0">+ Add New</option> -->
|
<!-- <option value="0">+ Add New</option>
|
||||||
|
<?php if (!empty($ticket_type)): ?>
|
||||||
|
<?php foreach ($ticket_type as $t): ?>
|
||||||
|
<option value="<?= esc($t['name']) ?>"
|
||||||
|
<?= ($t['name'] === "Sales") ? 'selected' : '' ?>>
|
||||||
|
<?= esc($t['name']) ?>
|
||||||
|
</option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?> -->
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -683,62 +654,66 @@ table thead th {
|
|||||||
document.getElementById('policy_id').value = policyId || "";
|
document.getElementById('policy_id').value = policyId || "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideandshowpolicy() {
|
|
||||||
var select = document.getElementById('ticket_type').value;
|
|
||||||
var policyContainer = document.getElementById('policy_container');
|
|
||||||
|
|
||||||
if (select === 'Service') {
|
|
||||||
policyContainer.style.display = "block"; // show
|
|
||||||
} else {
|
|
||||||
policyContainer.style.display = "none"; // hide
|
|
||||||
document.getElementById('policy_no').value = "";
|
|
||||||
document.getElementById('policy_id').value = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// function hideandshowpolicy() {
|
// function hideandshowpolicy() {
|
||||||
// var select = document.getElementById('ticket_type');
|
// var select = document.getElementById('ticket_type').value;
|
||||||
// var value = select.value;
|
|
||||||
// var policyContainer = document.getElementById('policy_container');
|
// var policyContainer = document.getElementById('policy_container');
|
||||||
|
|
||||||
// if (value === "0") {
|
// if (select === 'Service') {
|
||||||
// let newType = prompt("Enter new ticket type:");
|
// policyContainer.style.display = "block"; // show
|
||||||
// if (newType && newType.trim() !== "") {
|
|
||||||
|
|
||||||
// $.ajax({
|
|
||||||
// url: "<?= base_url('ticketType') ?>",
|
|
||||||
// type: "POST",
|
|
||||||
// data: { name: newType },
|
|
||||||
// dataType: 'json',
|
|
||||||
// success: function(response) {
|
|
||||||
// if (response.status === "success") {
|
|
||||||
|
|
||||||
// let option = new Option(newType, newType);
|
|
||||||
// let addNewOption = select.querySelector('option[value="0"]');
|
|
||||||
// select.insertBefore(option, addNewOption);
|
|
||||||
// select.value = newType;
|
|
||||||
// value = newType;
|
|
||||||
// console.log(response.message);
|
|
||||||
|
|
||||||
// } else { console.log(response.message); value = ""; }
|
|
||||||
// },
|
|
||||||
// error: function(xhr) { console.log("Error: " + xhr.statusText); value = ""; }
|
|
||||||
// });
|
|
||||||
// } else {
|
// } else {
|
||||||
// select.value = "";
|
// policyContainer.style.display = "none"; // hide
|
||||||
// value = "";
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (value === 'Service') {
|
|
||||||
// policyContainer.style.display = "block";
|
|
||||||
// } else {
|
|
||||||
// policyContainer.style.display = "none";
|
|
||||||
// document.getElementById('policy_no').value = "";
|
// document.getElementById('policy_no').value = "";
|
||||||
// document.getElementById('policy_id').value = "";
|
// document.getElementById('policy_id').value = "";
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
function hideandshowpolicy() {
|
||||||
|
var select = document.getElementById('ticket_type');
|
||||||
|
var value = select.value;
|
||||||
|
var policyContainer = document.getElementById('policy_container');
|
||||||
|
|
||||||
|
if (value === "0") {
|
||||||
|
let newType = prompt("Enter new ticket type:");
|
||||||
|
if (newType && newType.trim() !== "") {
|
||||||
|
|
||||||
|
var formData = new FormData(form);
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "<?= base_url('ticketType') ?>",
|
||||||
|
type: "POST",
|
||||||
|
data: formData,
|
||||||
|
processData: false,
|
||||||
|
contentType: false,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(response) {
|
||||||
|
if (response.status === "success") {
|
||||||
|
|
||||||
|
let option = new Option(newType, newType);
|
||||||
|
let addNewOption = select.querySelector('option[value="0"]');
|
||||||
|
select.insertBefore(option, addNewOption);
|
||||||
|
select.value = newType;
|
||||||
|
value = newType;
|
||||||
|
console.log(response.message);
|
||||||
|
|
||||||
|
} else { console.log(response.message); value = ""; }
|
||||||
|
},
|
||||||
|
error: function(xhr) { console.log("Error: " + xhr.statusText); value = ""; }
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
select.value = "";
|
||||||
|
value = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value === 'Service') {
|
||||||
|
policyContainer.style.display = "block";
|
||||||
|
} else {
|
||||||
|
policyContainer.style.display = "none";
|
||||||
|
document.getElementById('policy_no').value = "";
|
||||||
|
document.getElementById('policy_id').value = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@ -1,4 +1,12 @@
|
|||||||
<style>
|
<style>
|
||||||
|
#historytable thead{
|
||||||
|
background-color: #00999E;
|
||||||
|
color: #ffffff !important;
|
||||||
|
}
|
||||||
|
#historytable tbody tr:hover td {
|
||||||
|
background-color: #e0e0e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.notes-box {
|
.notes-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -188,7 +196,7 @@ hr{
|
|||||||
</div>
|
</div>
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Policy Number</div>
|
<div class="col-4 app-subtitle app-text-grey app-font-family">Policy Number</div>
|
||||||
<div class="col-8 app-text text-end app-font-family" style="font-weight: 500 !important;">
|
<div class="col-8 app-text text-end app-font-family app-text-black" style="font-weight: 500 !important;">
|
||||||
<?= (!empty($master[0]['policy_no']) && strtolower($master[0]['policy_no']) !== 'null')
|
<?= (!empty($master[0]['policy_no']) && strtolower($master[0]['policy_no']) !== 'null')
|
||||||
? '<u class="app-text-black">
|
? '<u class="app-text-black">
|
||||||
<a href="javascript:void(0);"
|
<a href="javascript:void(0);"
|
||||||
@ -209,7 +217,20 @@ hr{
|
|||||||
</div>
|
</div>
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Status</div>
|
<div class="col-4 app-subtitle app-text-grey app-font-family">Status</div>
|
||||||
<div class="col-8 app-text app-text-black text-end app-font-family" style="font-weight: 500 !important;"><?= $master[0]['status'];?></div>
|
<div class="col-8 app-text app-text-black text-end app-font-family" style="font-weight: 500 !important;">
|
||||||
|
<?= (!empty($master[0]['status']) && strtolower($master[0]['status']) !== 'null')
|
||||||
|
? '<u class="app-text-black">
|
||||||
|
<a href="javascript:void(0);"
|
||||||
|
class="app-text-black"
|
||||||
|
onclick="statusHistory('.$master[0]['thz_id'].')"
|
||||||
|
data-toggle="modal"
|
||||||
|
data-target="#StatusModal"
|
||||||
|
title="Click to view Status History">'
|
||||||
|
.$master[0]['status'].'
|
||||||
|
</a>
|
||||||
|
</u>'
|
||||||
|
: 'N/A'; ?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Ticket Type</div>
|
<div class="col-4 app-subtitle app-text-grey app-font-family">Ticket Type</div>
|
||||||
@ -251,7 +272,7 @@ hr{
|
|||||||
<!-- Conversation Card -->
|
<!-- Conversation Card -->
|
||||||
<div class="card mb-3 conversation-card">
|
<div class="card mb-3 conversation-card">
|
||||||
<div class="card-header d-flex justify-content-between align-items-center" style="background:none; border:none; padding-bottom: 0px;">
|
<div class="card-header d-flex justify-content-between align-items-center" style="background:none; border:none; padding-bottom: 0px;">
|
||||||
<p class="sub-title-text app-font-family" >Conversation</p>
|
<p class="sub-title-text app-font-family app-text-black" >Conversation</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body recard-scroll" style="padding:0 27px !important; margin:0 !important; background:#F5FFFF;">
|
<div class="card-body recard-scroll" style="padding:0 27px !important; margin:0 !important; background:#F5FFFF;">
|
||||||
<?php if(!empty($notes)): ?>
|
<?php if(!empty($notes)): ?>
|
||||||
@ -398,9 +419,11 @@ hr{
|
|||||||
<h5 class="app-font-family app-text"><?php echo '# '.$rt['thz_id']." / ".$rt['ticket_type']; ?></h5>
|
<h5 class="app-font-family app-text"><?php echo '# '.$rt['thz_id']." / ".$rt['ticket_type']; ?></h5>
|
||||||
<small classs="app-font-family" style="font-size:7px;">
|
<small classs="app-font-family" style="font-size:7px;">
|
||||||
<?php if (!empty($rt['created_at'])):
|
<?php if (!empty($rt['created_at'])):
|
||||||
$cdt = new DateTime($rt['created_at']);
|
$cd = date("j F Y", strtotime($rt['created_at']));
|
||||||
echo $cdt->format('d/m/Y') . "<span class='time'> " . $cdt->format('h:i a') . "</span>";
|
$ct = date("h:i a", strtotime($rt['created_at']));
|
||||||
endif; ?>
|
echo $cd . " " . $ct;
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
<p class="mt-1 app-font-family"
|
<p class="mt-1 app-font-family"
|
||||||
@ -447,6 +470,22 @@ hr{
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade app-font-family" id="StatusModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
|
<div class="modal-content" style="border-radius:15px;">
|
||||||
|
|
||||||
|
<div class="modal-header" style="border-bottom-width:0;">
|
||||||
|
<h4 class="modal-title title-text app-font-family">Status History</h4>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-body card-scroll container" style="padding:5px 11px 11px 11px!important;">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -567,3 +606,84 @@ hr{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
function statusHistory(thzId) {
|
||||||
|
$.ajax({
|
||||||
|
url: "<?= base_url('ticketHistoryList?thz_id=') ?>" + thzId,
|
||||||
|
type: "GET",
|
||||||
|
dataType: "json",
|
||||||
|
success: function(response) {
|
||||||
|
let container = $(".container");
|
||||||
|
container.empty(); // clear old content
|
||||||
|
|
||||||
|
if (response.status === "success" && response.data.length > 0) {
|
||||||
|
let table = `
|
||||||
|
<table id="historytable" class="table table-bordered table-sm app-font-family">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="app-text-white">S.No</th>
|
||||||
|
<th class="app-text-white">Old Value</th>
|
||||||
|
<th class="app-text-white">New Value</th>
|
||||||
|
<th class="app-text-white">Updated By</th>
|
||||||
|
<th class="app-text-white">Date/Time</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
`;
|
||||||
|
|
||||||
|
response.data.forEach((row, index) => {
|
||||||
|
table += `
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left; vertical-align:middle;">${index + 1}</td>
|
||||||
|
<td style="text-align:left; vertical-align:middle;">${row.old_value ?? '-'}</td>
|
||||||
|
<td style="text-align:left; vertical-align:middle;">${row.new_value ?? '-'}</td>
|
||||||
|
<td style="text-align:left; vertical-align:middle;">${row.created_name ?? '-'}</td>
|
||||||
|
<td style="text-align:left; vertical-align:middle;">${row.created_at
|
||||||
|
? (() => {
|
||||||
|
let dt = new Date(row.created_at);
|
||||||
|
|
||||||
|
let dateStr = dt.toLocaleDateString('en-GB', {
|
||||||
|
day: '2-digit',
|
||||||
|
month: '2-digit',
|
||||||
|
year: 'numeric'
|
||||||
|
});
|
||||||
|
|
||||||
|
let timeStr = dt.toLocaleTimeString('en-US', {
|
||||||
|
hour: '2-digit',
|
||||||
|
minute: '2-digit',
|
||||||
|
hour12: true
|
||||||
|
}).toLowerCase();
|
||||||
|
|
||||||
|
return `${dateStr}<br>${timeStr}`;
|
||||||
|
})()
|
||||||
|
: '-'
|
||||||
|
}</td>
|
||||||
|
</tr>
|
||||||
|
`;
|
||||||
|
});
|
||||||
|
|
||||||
|
table += `</tbody></table>`;
|
||||||
|
container.html(table);
|
||||||
|
} else {
|
||||||
|
container.html(`
|
||||||
|
<div class="d-flex justify-content-center align-items-center" style="height: 50vh; width:100%;">
|
||||||
|
<p class="text-center"><i>${response.message ?? 'No history found'}</i></p>
|
||||||
|
</div>
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#StatusModal").modal("show");
|
||||||
|
},
|
||||||
|
error: function(xhr) {
|
||||||
|
$(".container").html(`
|
||||||
|
<div class="d-flex justify-content-center align-items-center" style="height: 50vh; width:100%;">
|
||||||
|
<p class="text-center"><i>No Data Found</i></p>
|
||||||
|
</div>
|
||||||
|
`);
|
||||||
|
$("#StatusModal").modal("show");
|
||||||
|
// toastr.error("Something went wrong!", "Error");
|
||||||
|
console.error(xhr.responseText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user