FIX_CODEMERGE
This commit is contained in:
parent
89b2857896
commit
7e4302b3ec
@ -646,4 +646,5 @@ $routes->post("ticketSave", "ThzController::ticketSave");
|
||||
$routes->get("ticketList", "ThzController::ticketList");
|
||||
$routes->post("ticketConversationSave", "ThzController::ticketConversationSave");
|
||||
$routes->get("ticketConversationList", "ThzController::ticketConversationList");
|
||||
$routes->get('ticketAssigning',"ThzController::ticketAssigning");
|
||||
$routes->get('ticketAssigning',"ThzController::ticketAssigning");
|
||||
$routes->post('ticketAutoFetchDetails',"ThzController::ticketAutoFetchDetails");
|
||||
@ -40,25 +40,18 @@ class ThzMasterModel extends Model
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
public function ticketAutoFetchDetails(){
|
||||
public function ticketAutoFetchDetails($client_id ,$mobile){
|
||||
|
||||
$autofetch_sql = "SELECT
|
||||
employees.id,employees.client_id,
|
||||
employees.client_branch_id as branch_id,
|
||||
employees.mobile,
|
||||
employees.emp_code,
|
||||
employees.name,
|
||||
employee_polices.client_policy_id as policy_id
|
||||
FROM employees
|
||||
LEFT JOIN employee_polices
|
||||
ON employee_polices.employee_id = employees.id
|
||||
WHERE employees.emp_status IN ('active','draft','enrolled')
|
||||
AND employees.is_active = 1
|
||||
AND employees.mobile = " . $mobile . "
|
||||
AND employees.client_id = " . $client_id . "
|
||||
ORDER BY employees.id DESC";
|
||||
|
||||
$result = $this->db->query($autofetch_sql)->getResultArray();
|
||||
$result = $this->db->table('employees e')
|
||||
->select('e.id, e.email_personal, e.client_id, e.client_branch_id as branch_id, e.mobile, e.emp_code, e.name, ep.client_policy_id as policy_id')
|
||||
->join('employee_polices ep', 'ep.employee_id = e.id AND ep.is_active = 1', 'left')
|
||||
->whereIn('e.emp_status', ['active', 'draft', 'enrolled'])
|
||||
->where('e.is_active', 1)
|
||||
->where('e.mobile', $mobile)
|
||||
->where('e.client_id', $client_id)
|
||||
->groupBy('e.client_id')
|
||||
->get()
|
||||
->getResultArray();
|
||||
|
||||
return $result;
|
||||
|
||||
|
||||
@ -429,6 +429,7 @@
|
||||
|
||||
.search-bar input {
|
||||
width: 100%;
|
||||
padding-right: 40px; /* make space for the button */
|
||||
border-radius: 10px !important;
|
||||
background-color: #F4F4F4;
|
||||
box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.2);
|
||||
@ -510,9 +511,35 @@
|
||||
font-weight: 600!important;
|
||||
}
|
||||
|
||||
body{
|
||||
padding-right: 0px !important;
|
||||
}
|
||||
.btn-ternary {
|
||||
color: #fff !important;
|
||||
background-color: #E26728;
|
||||
border-color: #E26728; }
|
||||
.btn-ternary:hover {
|
||||
color: #fff !important;
|
||||
background-color: #B9501F;
|
||||
border-color: #A6471C; }
|
||||
.btn-ternary:focus, .btn-ternary.focus {
|
||||
color: #fff !important;
|
||||
background-color: #B9501F;
|
||||
border-color: #A6471C;
|
||||
box-shadow: 0 0 0 0.15rem rgba(226, 103, 40, 0.5); }
|
||||
.btn-ternary.disabled, .btn-ternary:disabled {
|
||||
color: #fff !important;
|
||||
background-color: #E26728;
|
||||
border-color: #E26728; }
|
||||
.btn-ternary:not(:disabled):not(.disabled):active, .btn-ternary:not(:disabled):not(.disabled).active,
|
||||
.show > .btn-ternary.dropdown-toggle {
|
||||
color: #fff !important;
|
||||
background-color: #A6471C;
|
||||
border-color: #933E19; }
|
||||
.btn-ternary:not(:disabled):not(.disabled):active:focus, .btn-ternary:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .btn-ternary:dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.15rem rgba(226, 103, 40, 0.5); }
|
||||
|
||||
.btn-border-radius{ .border-radius: 10px !important; }
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@ -1,12 +1,54 @@
|
||||
<style>
|
||||
.table th,
|
||||
/* .table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
} */
|
||||
|
||||
table {
|
||||
border-collapse: separate !important;
|
||||
border-spacing : 0 8px !important; /* spacing only between rows */
|
||||
}
|
||||
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !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;
|
||||
}
|
||||
|
||||
tbody td {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
/* table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
} */
|
||||
|
||||
.col-12 {
|
||||
|
||||
@ -17,13 +59,16 @@ table.dataTable tbody td {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.dataTables_filter input {
|
||||
padding-right: 30px; /* space for icon */
|
||||
background: url('https://cdn.jsdelivr.net/npm/@mdi/svg/svg/magnify.svg') no-repeat right 8px center;
|
||||
background-size: 16px;
|
||||
}
|
||||
|
||||
.right-align-input {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.addbtnStyle {
|
||||
margin-left: 20px !important;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.table th:nth-child(1),
|
||||
@ -54,7 +99,7 @@ table.dataTable tbody td {
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<thead class="bg-light">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Ticket Number</th>
|
||||
<th>Name</th>
|
||||
@ -131,28 +176,58 @@ table.dataTable tbody td {
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<form id="ticketForm">
|
||||
<div class="modal-header">
|
||||
<!-- <div class="modal-header">
|
||||
<h4 class="modal-title" id="modalLabel">New Ticket</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div> -->
|
||||
<div class="modal-header flex-column">
|
||||
|
||||
<!-- first row -->
|
||||
<div class="d-flex w-100 justify-content-between align-items-center">
|
||||
<h4 class="modal-title mb-0" id="modalLabel">New Ticket</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
|
||||
<!-- second row -->
|
||||
<div class="form-row mt-3 w-100">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="client_id">Client</label>
|
||||
<select class="form-control" id="client_id" name="client_id">
|
||||
<option value="">Select Client</option>
|
||||
<?php if(isset($client_list)) { ?>
|
||||
<?php foreach ($client_list as $c) { ?>
|
||||
<option value="<?= $c->id ?>"><?= $c->client_name ?> (<?= $c->short_name ?>) </option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-5">
|
||||
<label for="mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="mobile"
|
||||
name="mobile" placeholder="Enter Mobile"
|
||||
pattern="^[0-9]{10}$" required
|
||||
title="Please enter a valid 10-digit mobile number">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-1" style="padding:27.5px 0 0 0;">
|
||||
<button type="button" class="btn btn-primary" style="padding: 0 10px !important; border-radius:13px;" onclick="getAutoFetchDetails()"><i class="mdi mdi-cached" style="font-size:24px; color:#fff !important;"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="form-row">
|
||||
<input type="hidden" id="thz_id" name="thz_id">
|
||||
<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">
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="name">Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="Enter Name" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="mobile"
|
||||
name="mobile" placeholder="Enter Mobile"
|
||||
pattern="^[0-9]{10}$" required
|
||||
title="Please enter a valid 10-digit mobile number">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="email">Email Id<span class="text-danger">*</span></label>
|
||||
<input type="email" class="form-control" id="email"
|
||||
@ -169,7 +244,9 @@ table.dataTable tbody td {
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="policy_no">Policy Number</label>
|
||||
<input type="text" class="form-control" id="policy_no" name="policy_no" placeholder="Enter Policy Number">
|
||||
<select class="form-control" id="policy_no" name="policy_no" onchange="changevalue()">
|
||||
<option value="" selected data-id="">Select Policy</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
@ -181,18 +258,8 @@ table.dataTable tbody td {
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="subject">Subject</label>
|
||||
<input type="text" class="form-control" id="subject" name="subject" placeholder="Enter Subject">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="message">Message</label>
|
||||
<!-- <input type="text" class="form-control" id="message" name="message" placeholder="Enter Message"> -->
|
||||
<textarea class="form-control" id="message" name="message" placeholder="Enter Message" rows="4"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<!-- <div class="form-group col-md-6">
|
||||
<label for="status">Status</label>
|
||||
<select class="form-control" id="status" name="status">
|
||||
<option value="">Select Status</option>
|
||||
@ -201,7 +268,7 @@ table.dataTable tbody td {
|
||||
<option value="Resolved">Resolved</option>
|
||||
<option value="Closed">Closed</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="assign_to">Assign To</label>
|
||||
@ -215,10 +282,21 @@ table.dataTable tbody td {
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="subject">Subject</label>
|
||||
<input type="text" class="form-control" id="subject" name="subject" placeholder="Enter Subject">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="message">Message</label>
|
||||
<!-- <input type="text" class="form-control" id="message" name="message" placeholder="Enter Message"> -->
|
||||
<textarea class="form-control" id="message" name="message" placeholder="Enter Message" rows="4"></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" onclick="submitTicket()">Submit</button>
|
||||
<button type="button" class="btn btn-ternary btn-border-radius" onclick="submitTicket()">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -250,7 +328,7 @@ table.dataTable tbody td {
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" onclick="updateAssignTo()">Submit</button>
|
||||
<button type="button" class="btn btn-ternary btn-border-radius" onclick="updateAssignTo()">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -264,79 +342,73 @@ table.dataTable tbody td {
|
||||
form.reset();
|
||||
document.getElementById('thz_id').value = '';
|
||||
document.getElementById('modalLabel').innerText = "New Ticket";
|
||||
document.getElementById('return_type').innerText = "WEB";
|
||||
document.getElementById('return_type').innerText = "Web";
|
||||
var myModal = new bootstrap.Modal(document.getElementById('ticketModal'));
|
||||
myModal.show();
|
||||
}
|
||||
|
||||
function submitTicket() {
|
||||
var form = document.getElementById('ticketForm');
|
||||
var form = document.getElementById('ticketForm');
|
||||
|
||||
// reset any old error styles
|
||||
form.classList.remove('was-validated');
|
||||
// reset any old error styles
|
||||
form.classList.remove('was-validated');
|
||||
|
||||
var name = document.getElementById('name').value.trim();
|
||||
var mobile = document.getElementById('mobile').value.trim();
|
||||
var email = document.getElementById('email').value.trim();
|
||||
var ticketType = document.getElementById('ticket_type').value.trim();
|
||||
|
||||
var name = document.getElementById('name').value.trim();
|
||||
var mobile = document.getElementById('mobile').value.trim();
|
||||
var email = document.getElementById('email').value.trim();
|
||||
var ticketType= document.getElementById('ticket_type').value.trim();
|
||||
// Validation checks
|
||||
if (name === "" || mobile === "" || email === "" || ticketType === "") {
|
||||
toastr.warning('Please fill all required fields.', 'warning');
|
||||
form.classList.add('was-validated');
|
||||
return;
|
||||
}
|
||||
|
||||
var mobilePattern = /^[0-9]{10}$/;
|
||||
if (!mobilePattern.test(mobile)) {
|
||||
toastr.warning('Please enter a valid 10-digit mobile number.', 'warning');
|
||||
document.getElementById('mobile').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
var emailPattern = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
|
||||
if (!emailPattern.test(email)) {
|
||||
toastr.warning('Please enter a valid email address.', 'warning');
|
||||
document.getElementById('email').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
var form = document.getElementById("ticketForm"); // your form ID
|
||||
var formData = new FormData(form);
|
||||
|
||||
$.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('ticketList?return_type=web') ?>";
|
||||
} else {
|
||||
toastr.error(response.message, 'error');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
toastr.error("Something went wrong!", 'error');
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (name === "" || mobile === "" || email === "" || ticketType === "") {
|
||||
toastr.warning('Please fill all required fields.', 'warning');
|
||||
form.classList.add('was-validated');
|
||||
return;
|
||||
}
|
||||
|
||||
var mobilePattern = /^[0-9]{10}$/;
|
||||
if (!mobilePattern.test(mobile)) {
|
||||
toastr.warning('Please enter a valid 10-digit mobile number.', 'warning');
|
||||
document.getElementById('mobile').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
var emailPattern = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
|
||||
if (!emailPattern.test(email)) {
|
||||
toastr.warning('Please enter a valid email address.', 'warning');
|
||||
document.getElementById('email').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
var form = document.getElementById("ticketForm"); // your form ID
|
||||
var formData = new FormData(form);
|
||||
|
||||
let obj = {};
|
||||
formData.forEach((value, key) => obj[key] = value);
|
||||
// obj["return_type"] = "web";
|
||||
|
||||
$.ajax({
|
||||
url: "<?= base_url('ticketSave') ?>",
|
||||
type: "POST",
|
||||
data: JSON.stringify(obj),
|
||||
contentType: "application/json",
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
if (response.status === "success") {
|
||||
toastr.success(response.message, 'success');
|
||||
$('#ticketModal').modal('hide');
|
||||
form.reset();
|
||||
window.location.href = "<?= base_url('ticketList?return_type=web') ?>";
|
||||
} else {
|
||||
toastr.error(response.message, 'error');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
toastr.error("Something went wrong!", 'error');
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
function openAssignee(button) {
|
||||
document.getElementById('hidden_thz_id').value = "";
|
||||
@ -354,7 +426,93 @@ table.dataTable tbody td {
|
||||
var myModal = new bootstrap.Modal(document.getElementById('AssignModal'));
|
||||
myModal.show();
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function getAutoFetchDetails() {
|
||||
var client_id = document.getElementById('client_id').value.trim();
|
||||
var mobile = document.getElementById('mobile').value.trim();
|
||||
|
||||
// reset fields
|
||||
document.getElementById('name').value = "";
|
||||
document.getElementById('email').value = "";
|
||||
document.getElementById('empcode').value = "";
|
||||
document.getElementById('branch_id').value = "";
|
||||
document.getElementById('policy_id').value = "";
|
||||
|
||||
// reset select dropdown
|
||||
var policySelect = document.getElementById('policy_no');
|
||||
policySelect.innerHTML = '<option value="" data-id="">Select Policy</option>';
|
||||
|
||||
if (client_id === "") {
|
||||
toastr.warning('Please Select Client.', 'warning');
|
||||
return;
|
||||
}
|
||||
|
||||
if (mobile === "") {
|
||||
toastr.warning('Please Enter a mobile number.', 'warning');
|
||||
return;
|
||||
}
|
||||
|
||||
var mobilePattern = /^[0-9]{10}$/;
|
||||
if (!mobilePattern.test(mobile)) {
|
||||
toastr.warning('Please enter a valid 10-digit mobile number.', 'warning');
|
||||
document.getElementById('mobile').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: "<?= base_url('ticketAutoFetchDetails') ?>",
|
||||
type: "POST",
|
||||
data: { client_id: client_id, mobile: mobile },
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
if (response.status === "success") {
|
||||
let client = response.data.client_details[0];
|
||||
let policies = response.data.policy_details;
|
||||
|
||||
document.getElementById('name').value = client.name || "";
|
||||
document.getElementById('email').value = client.email_personal || "";
|
||||
document.getElementById('empcode').value = client.emp_code || "";
|
||||
document.getElementById('branch_id').value = client.branch_id || "";
|
||||
|
||||
if (policies && policies.length > 0) {
|
||||
policies.forEach(function(p) {
|
||||
let opt = document.createElement("option");
|
||||
opt.value = p.policy_no;
|
||||
opt.text = p.policy_no;
|
||||
opt.setAttribute("data-id", p.policy_id);
|
||||
policySelect.appendChild(opt);
|
||||
});
|
||||
|
||||
// If you want to auto-select the first real policy instead of "Select Policy"
|
||||
policySelect.value = policies[0].policy_no;
|
||||
document.getElementById('policy_no').value = policies[0].policy_no || "";
|
||||
document.getElementById('policy_id').value = policies[0].policy_id;
|
||||
}
|
||||
} else {
|
||||
toastr.warning(response.message || "No details found.", 'warning');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
toastr.error("Something went wrong!", 'error');
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function changevalue() {
|
||||
var select = document.getElementById('policy_no');
|
||||
var selectedOption = select.options[select.selectedIndex];
|
||||
var policyId = selectedOption.getAttribute("data-id");
|
||||
document.getElementById('policy_id').value = policyId || "";
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
function updateAssignTo(){
|
||||
console.log('function called then call the api then refresh the updateAssignTo');
|
||||
@ -370,9 +528,11 @@ table.dataTable tbody td {
|
||||
$(document).ready(function() {
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
// Initialize select2
|
||||
$("#client_id").select2();
|
||||
$("#ticket_type").select2();
|
||||
$("#status").select2();
|
||||
$("#assign_to").select2();
|
||||
$("#policy_no").select2();
|
||||
$("#modal_assignee").select2();
|
||||
});
|
||||
|
||||
@ -380,43 +540,53 @@ $(document).ready(function() {
|
||||
$(document).ready(function() {
|
||||
|
||||
var ticketsTable = $('#scroll-horizontal-datatable');
|
||||
$('#scroll-horizontal-datatable_filter').prepend('<i class="mdi mdi-magnify"></i>');
|
||||
|
||||
if (ticketsTable.length) {
|
||||
|
||||
ticketsTable.DataTable({
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'ticket-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'ticket-List',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
},
|
||||
},
|
||||
{
|
||||
text: 'New ticket',
|
||||
className: 'buttons-html5 addbtnStyle',
|
||||
action: function(e, dt, node, config) {
|
||||
openTicket()
|
||||
}
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 25, // Set default number of rows per page (optional)
|
||||
ordering: false,
|
||||
});
|
||||
ticketsTable.DataTable({
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [
|
||||
{
|
||||
text: '<i class="mdi mdi-plus"></i> Create New Ticket',
|
||||
className: 'btn btn-ternary btn-border-radius text-white mr-2',
|
||||
attr: { style: "color:#fff !important;" },
|
||||
action: function(e, dt, node, config) {
|
||||
openTicket();
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'collection',
|
||||
text: ' Export <i class="mdi mdi-menu-down"></i>',
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'ticket-List'
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: ' Excel',
|
||||
title: 'ticket-List',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true,
|
||||
pageLength: 25,
|
||||
ordering: false,
|
||||
});
|
||||
|
||||
} else {
|
||||
console.error("Table Not found.");
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user