Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
a4015fd67f
@ -108,7 +108,7 @@ class ThzController extends BaseController
|
||||
|
||||
$data = $this->request->getGet();
|
||||
|
||||
if ($returnType === 'web' && in_array(get_role_id(), [3, 4])) {
|
||||
if ($returnType === 'web' && in_array(get_role_id(), [4])) {
|
||||
$data['assign_to'] = $data['assign_to'] ?? get_session_userid();
|
||||
}
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@ use App\Models\VehicleModel;
|
||||
use App\Models\PartnerPolicyModel;
|
||||
|
||||
use DOMDocument;
|
||||
use DOMXPath;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Kint\Kint;
|
||||
|
||||
@ -1313,7 +1314,7 @@ class TicketController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
public function convertHtmlToText($html)
|
||||
public function convertHtmlToTextOld($html)
|
||||
{
|
||||
if(!empty($html)){
|
||||
$dom = new DOMDocument();
|
||||
@ -1324,6 +1325,36 @@ class TicketController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
public function convertHtmlToText($html)
|
||||
{
|
||||
if (empty($html)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Remove BOM / strange characters
|
||||
$html = preg_replace('/[\x00-\x1F\x80-\xFF]/', ' ', $html);
|
||||
|
||||
// Load HTML safely
|
||||
$dom = new DOMDocument();
|
||||
libxml_use_internal_errors(true);
|
||||
$dom->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'));
|
||||
|
||||
// Remove style and script tags
|
||||
$xpath = new DOMXPath($dom);
|
||||
foreach ($xpath->query('//style|//script') as $node) {
|
||||
$node->parentNode->removeChild($node);
|
||||
}
|
||||
|
||||
// Extract clean text
|
||||
$text = $dom->textContent;
|
||||
|
||||
// Clean extra spaces
|
||||
$text = preg_replace('/\s+/', ' ', $text);
|
||||
|
||||
return trim($text);
|
||||
}
|
||||
|
||||
|
||||
public function removeTicket()
|
||||
{
|
||||
$ticket_id = $this->request->getGet('ticket_id');
|
||||
|
||||
@ -440,7 +440,7 @@ table.dataTable tbody td {
|
||||
<td class="text-left">
|
||||
<?php if (!empty($row['created_at'])):
|
||||
$cd = date("j F Y", strtotime($row['created_at']));
|
||||
$ct = date("h:i a", strtotime($row['created_at']));
|
||||
$ct = date("h:i A", strtotime($row['created_at']));
|
||||
echo $cd . "<br><span class='time'> " . $ct . "</span>";
|
||||
endif;
|
||||
?>
|
||||
@ -448,7 +448,7 @@ table.dataTable tbody td {
|
||||
<td class="text-left">
|
||||
<?php if (!empty($row['updated_at'])):
|
||||
$ud = date("j F Y", strtotime($row['updated_at']));
|
||||
$ut = date("h:i a", strtotime($row['updated_at']));
|
||||
$ut = date("h:i A", strtotime($row['updated_at']));
|
||||
echo $ud . "<br><span class='time'> " . $ut . "</span>";
|
||||
endif;
|
||||
?>
|
||||
|
||||
@ -90,7 +90,7 @@
|
||||
<td style="overflow: hidden;" class="reload truncate" data-toggle="tooltip" data-placement="top" title="<?php echo $file['file_name'] ?>">
|
||||
<?php echo $file['file_name'] ?>
|
||||
</td>
|
||||
<td><?php echo change_date_format($file['created_at'], 'Y-m-d H:i:s', 'd M Y h:i a') . ' by <strong>' . $file['user_name'] . '</strong>' ?> </td>
|
||||
<td><?php echo change_date_format($file['created_at'], 'Y-m-d H:i:s', 'd M Y h:i A') . ' by <strong>' . $file['user_name'] . '</strong>' ?> </td>
|
||||
<td>
|
||||
<?php if ($file['status'] == "failed") { ?>
|
||||
<span style="color : #BD0707 ;"> <?= $file['status'] ?> </span>
|
||||
|
||||
@ -179,7 +179,7 @@
|
||||
<td><?php echo ucfirst($row['department']) ?> </td>
|
||||
<td><?php echo $row['rules_count'] ?></td>
|
||||
<td><?php echo ucfirst($row['file_status']) ?> </td>
|
||||
<td><?php echo change_date_format($row['created_at'],'Y-m-d H:i:s', 'd M Y h:i a') . ' by <strong>' . $row['created_user_name'] . '</strong>' ?>
|
||||
<td><?php echo change_date_format($row['created_at'],'Y-m-d H:i:s', 'd M Y h:i A') . ' by <strong>' . $row['created_user_name'] . '</strong>' ?>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
|
||||
@ -143,7 +143,7 @@
|
||||
<td><?php echo $file['branch_name'] ?></td>
|
||||
<td><?php echo $file['policy_no'] ?></td>
|
||||
<td><?php echo $file['file_action'] ?></td>
|
||||
<td><?php echo change_date_format($file['created_at'],'Y-m-d H:i:s', 'd M Y h:i a') . ' by <strong>' . $file['first_name'] . '</strong>' ?></td>
|
||||
<td><?php echo change_date_format($file['created_at'],'Y-m-d H:i:s', 'd M Y h:i A') . ' by <strong>' . $file['first_name'] . '</strong>' ?></td>
|
||||
<td><?php echo $file['status']; ?> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
|
||||
@ -279,7 +279,7 @@
|
||||
</span>
|
||||
|
||||
</td>
|
||||
<td><?php echo change_date_format($row['created_at'], 'Y-m-d H:i:s', 'd M Y h:i a') . ' <br> by ' . $row['first_name'] ?></td>
|
||||
<td><?php echo change_date_format($row['created_at'], 'Y-m-d H:i:s', 'd M Y h:i A') . ' <br> by ' . $row['first_name'] ?></td>
|
||||
<td>
|
||||
<?php if ($row['file_status'] != 'failed') { ?>
|
||||
<div class="btn-group dropdown">
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="subject">Subject:</label>
|
||||
<input type="text" class="form-control" id="subject" name="subject" value="Gmail API Test - . <?php echo date('Y-m-d h:i:s');?>" required>
|
||||
<input type="text" class="form-control" id="subject" name="subject" value="Gmail API Test - . <?php echo date('Y-m-d h:i:s A');?>" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="content">Content:</label>
|
||||
|
||||
@ -140,7 +140,7 @@
|
||||
<td class="text-center"><?php echo $employee['manager_name'] ?? 'N/A' ?></td>
|
||||
<td class="text-center"><?php if (!empty($employee['created_at'])):
|
||||
$cd = date("j F Y", strtotime($employee['created_at']));
|
||||
$ct = date("h:i a", strtotime($employee['created_at']));
|
||||
$ct = date("h:i A", strtotime($employee['created_at']));
|
||||
echo $cd . "<br><span class='time'> " . $ct . "</span>";
|
||||
endif; ?></td>
|
||||
<td class="text-center"><?php if ($employee['status'] == 'open') {
|
||||
|
||||
@ -86,7 +86,7 @@ table.dataTable tbody td {
|
||||
<td class="text-left">
|
||||
<?php if (!empty($row['created_at'])):
|
||||
$cd = date("j M Y", strtotime($row['created_at']));
|
||||
$ct = date("h:i a", strtotime($row['created_at']));
|
||||
$ct = date("h:i A", strtotime($row['created_at']));
|
||||
echo $cd . "<br><span class='time'> " . $ct . "</span>";
|
||||
endif;
|
||||
?>
|
||||
@ -94,7 +94,7 @@ table.dataTable tbody td {
|
||||
<td class="text-left">
|
||||
<?php if (!empty($row['updated_at'])):
|
||||
$ud = date("j M Y", strtotime($row['updated_at']));
|
||||
$ut = date("h:i a", strtotime($row['updated_at']));
|
||||
$ut = date("h:i A", strtotime($row['updated_at']));
|
||||
echo $ud . "<br><span class='time'> " . $ut . "</span>";
|
||||
endif;
|
||||
?>
|
||||
|
||||
@ -274,7 +274,7 @@ hr{
|
||||
<!-- Bottom Row: Name + Date -->
|
||||
<div class="d-flex justify-content-between small text-muted" style="padding-top: 5px;">
|
||||
<span class="" style="font-weight: 400 !important;"><i class="mdi mdi-account"></i> <?= $conv['name'] ?></span>
|
||||
<span style="font-size:9px; font-weight: 400 !important;" class=""><?= date("j F Y h:i a", strtotime($conv['created_at'])) ?></span>
|
||||
<span style="font-size:9px; font-weight: 400 !important;" class=""><?= date("j F Y h:i A", strtotime($conv['created_at'])) ?></span>
|
||||
</div>
|
||||
|
||||
<!-- <?php echo $i < count($notes)-1 ? '<hr/>' : ''; ?> -->
|
||||
@ -410,7 +410,7 @@ data-backdrop="static"
|
||||
<small classs="" style="font-size:7px;">
|
||||
<?php if (!empty($rt['created_at'])):
|
||||
$cd = date("j F Y", strtotime($rt['created_at']));
|
||||
$ct = date("h:i a", strtotime($rt['created_at']));
|
||||
$ct = date("h:i A", strtotime($rt['created_at']));
|
||||
echo $cd . " " . $ct;
|
||||
endif;
|
||||
?>
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="mb-3">
|
||||
<div class="text-muted"><i class="mdi mdi-calendar-blank"></i> <?php echo (new DateTime($message['created_at']))->format('j F Y h:i a');?></div>
|
||||
<div class="text-muted"><i class="mdi mdi-calendar-blank"></i> <?php echo (new DateTime($message['created_at']))->format('j F Y h:i A');?></div>
|
||||
</div>
|
||||
<div id="msg_388" class="form-group">
|
||||
<p><?= $message['mail_content'] ?></p>
|
||||
@ -69,7 +69,7 @@
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="mb-3">
|
||||
<div class="text-muted"><i class="mdi mdi-calendar-blank"></i> <?php echo (new DateTime($message['created_at']))->format('j F Y h:i a');?></div>
|
||||
<div class="text-muted"><i class="mdi mdi-calendar-blank"></i> <?php echo (new DateTime($message['created_at']))->format('j F Y h:i A');?></div>
|
||||
</div>
|
||||
<div id="msg_394" class="form-group">
|
||||
<p><?= $message['mail_content'] ?></p>
|
||||
|
||||
@ -333,7 +333,7 @@
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-3 up_cnu" style="display: none;">
|
||||
<label class="label-font-size" for="claim_number">Claim Number <span class="text-danger"></span></label>
|
||||
<label class="label-font-size" for="claim_number">Claim Number</label>
|
||||
<input type="text" class="form-control" id="claim_number" placeholder="Enter Claim NO"
|
||||
value="<?= isset($ticket_data['claim_number']) ? $ticket_data['claim_number'] : '' ?>"
|
||||
name="claim_number">
|
||||
@ -372,7 +372,8 @@
|
||||
<div class="form-group col-md-3 approved" style="display: none;">
|
||||
<label class="label-font-size" for="approved_amount">Approved Amount</label> #
|
||||
<input type="text" class="form-control" id="approved_amount" placeholder="Enter Approved Amount"
|
||||
value="<?= isset($ticket_data['approved_amount']) ? $ticket_data['approved_amount'] : '' ?>" name="approved_amount">
|
||||
value="<?= isset($ticket_data['approved_amount']) ? $ticket_data['approved_amount'] : '' ?>" name="approved_amount"
|
||||
oninput="this.value = this.value.replace(/[^0-9]/g, '');">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 approved" style="display: none;">
|
||||
|
||||
@ -54,7 +54,7 @@
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="modal fade" id="empDetailsModal" role="dialog" aria-labelledby="empDetailsModalLabel" aria-hidden="true">
|
||||
<!-- <div class="modal fade" id="empDetailsModal" role="dialog" aria-labelledby="empDetailsModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -63,6 +63,23 @@
|
||||
onclick="toResetTheModelFields()">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div> -->
|
||||
<div class="modal fade"
|
||||
id="empDetailsModal"
|
||||
tabindex="-1"
|
||||
data-bs-backdrop="static"
|
||||
data-bs-keyboard="false">
|
||||
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Fetch Employee Data</h5>
|
||||
<!-- <button type="button" class="btn-close" data-bs-dismiss="modal"></button> -->
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="accordion">
|
||||
@ -194,16 +211,110 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<!-- <div class="modal-footer">
|
||||
<a class="btn btn-primary" data-dismiss="modal" aria-label="Close"
|
||||
onclick="toResetTheModelFields()">Submit</a>
|
||||
</div> -->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">
|
||||
Submit
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade"
|
||||
id="empDetailsModal"
|
||||
role="dialog"
|
||||
tabindex="-1"
|
||||
data-bs-backdrop="static"
|
||||
data-bs-keyboard="false"
|
||||
aria-labelledby="empDetailsModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="empDetailsModalLabel">Fetch Employee Data</h5>
|
||||
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close" onclick="toResetTheModelFields()">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- your modal body content -->
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a class="btn btn-primary" data-bs-dismiss="modal" aria-label="Close" onclick="toResetTheModelFields()">Submit</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Inline JS right after modal HTML -->
|
||||
<script>
|
||||
|
||||
var empModal; // global modal instance
|
||||
|
||||
// ✅ Initialize after DOM is fully loaded
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
var empModalEl = document.getElementById("empDetailsModal");
|
||||
if (!empModalEl) {
|
||||
console.error("Modal element not found!");
|
||||
return;
|
||||
}
|
||||
|
||||
empModal = new bootstrap.Modal(empModalEl, {
|
||||
backdrop: 'static',
|
||||
keyboard: false
|
||||
});
|
||||
});
|
||||
|
||||
// ✅ FINAL OPEN FUNCTION (RESET → THEN OPEN)
|
||||
function openFetchEmpDataodal() {
|
||||
|
||||
// 1️⃣ FIRST reset everything
|
||||
toResetTheModelFields();
|
||||
|
||||
// 2️⃣ THEN open modal
|
||||
empModal.show();
|
||||
}
|
||||
|
||||
// ✅ FINAL RESET FUNCTION (WORKS FOR INPUT + SELECT + SELECT2)
|
||||
function toResetTheModelFields() {
|
||||
|
||||
var modal = document.getElementById("empDetailsModal");
|
||||
if (!modal) return;
|
||||
|
||||
// ✅ Reset all input fields
|
||||
modal.querySelectorAll("input").forEach(function (el) {
|
||||
el.value = "";
|
||||
});
|
||||
|
||||
// ✅ Reset all select dropdowns
|
||||
modal.querySelectorAll("select").forEach(function (el) {
|
||||
el.selectedIndex = 0;
|
||||
});
|
||||
|
||||
// ✅ Reset Select2 / custom dropdowns
|
||||
if (window.$) {
|
||||
$("#empDetailsModal .SelExample").val(null).trigger("change");
|
||||
}
|
||||
|
||||
// ✅ Optional: Close accordion
|
||||
modal.querySelectorAll(".accordion-content").forEach(function (el) {
|
||||
el.style.display = "none";
|
||||
});
|
||||
|
||||
// ✅ Optional: Reset arrows
|
||||
modal.querySelectorAll(".arrow").forEach(function (el) {
|
||||
el.innerHTML = "➤";
|
||||
});
|
||||
|
||||
console.log("✅ Modal reset completed");
|
||||
}
|
||||
|
||||
var client_list = ''; // local variable for storing the client branch list
|
||||
var branch_list = ''; // local variable for storing the client branch list
|
||||
var policy_list = ''; // local variable for storing the client policy list
|
||||
@ -297,10 +408,10 @@
|
||||
}
|
||||
|
||||
|
||||
function openFetchEmpDataodal() {
|
||||
var myModal = new bootstrap.Modal(document.getElementById('empDetailsModal'));
|
||||
myModal.show();
|
||||
}
|
||||
// function openFetchEmpDataodal() {
|
||||
// var myModal = new bootstrap.Modal(document.getElementById('empDetailsModal'));
|
||||
// myModal.show();
|
||||
// }
|
||||
|
||||
//get client , branch, policy data
|
||||
function getClientAndBranchAndPolicy() {
|
||||
@ -935,7 +1046,8 @@
|
||||
function toResetTheModelFields() {
|
||||
|
||||
$('#emp_mobile_number_for_claim').val('');
|
||||
$('#employee_data_points').val();
|
||||
$('#employee_data_points').val('emp_code').attr('autocomplete', 'off').trigger('change');
|
||||
$('#mobile_emp_client_data_list').val('0').select2();
|
||||
$('#employee_by_number').val('');
|
||||
$('#member_by_number').val('0').select2();
|
||||
$('#emp_client_data_list').val('0').select2();
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
<!-- <td><?php //echo $row['new_value']; ?></td> -->
|
||||
<td><?php echo !empty($row['modified_by'])? $row['modified_by'] : "Created by employee"; ?></td>
|
||||
<!-- <td><?php //echo $row['created_at']; ?></td> -->
|
||||
<td><?php echo date("d-m-Y H:i:s a", strtotime($row['created_at'])) ?? " - "; ?></td>
|
||||
<td><?php echo date("d-m-Y h:i:s A", strtotime($row['created_at'])) ?? " - "; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
@ -1,54 +1,3 @@
|
||||
<style>
|
||||
/* ----- Modal Size: 25% width + 25% height ----- */
|
||||
#New_Ticket_modal .modal-dialog {
|
||||
width: 15%;
|
||||
max-width: 15%;
|
||||
height: 25%;
|
||||
max-height: 25%;
|
||||
margin: auto !important;
|
||||
}
|
||||
|
||||
|
||||
/* Make modal-content fill the dialog & allow flex layout */
|
||||
#New_Ticket_modal .modal-content {
|
||||
height: 50%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* Scroll only inside body */
|
||||
#New_Ticket_modal .modal-body {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/* Footer visible always */
|
||||
#New_Ticket_modal .modal-footer {
|
||||
position: sticky;
|
||||
bottom: 0;
|
||||
background: #fff;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/* ----- Small Height Screens Fix ----- */
|
||||
@media (max-height: 300px) {
|
||||
|
||||
/* Make modal usable but still centered */
|
||||
#New_Ticket_modal .modal-dialog {
|
||||
width: 50%;
|
||||
max-width: 50%;
|
||||
height: 70%;
|
||||
max-height: 70%;
|
||||
}
|
||||
|
||||
/* Adjust body scroll area */
|
||||
#New_Ticket_modal .modal-body {
|
||||
max-height: calc(80vh - 120px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="modal fade" id="New_Ticket_modal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
|
||||
@ -395,7 +395,7 @@
|
||||
<td class="text-left">
|
||||
<?php if (!empty($row['created_at'])):
|
||||
$cd = date("j F Y", strtotime($row['created_at']));
|
||||
$ct = date("h:i a", strtotime($row['created_at']));
|
||||
$ct = date("h:i A", strtotime($row['created_at']));
|
||||
echo $cd . "<br><span class='time'> " . $ct . "</span>";
|
||||
endif;
|
||||
?>
|
||||
@ -403,7 +403,7 @@
|
||||
<td class="text-left">
|
||||
<?php if (!empty($row['updated_at'])):
|
||||
$ud = date("j F Y", strtotime($row['updated_at']));
|
||||
$ut = date("h:i a", strtotime($row['updated_at']));
|
||||
$ut = date("h:i A", strtotime($row['updated_at']));
|
||||
echo $ud . "<br><span class='time'> " . $ut . "</span>";
|
||||
endif;
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user