CHANGE_DASHMENT_ENROLLMENT_ENDORSEMENT : AADHAVAN
This commit is contained in:
parent
6bf965fea9
commit
fdfc0744cb
@ -11,12 +11,14 @@ use CodeIgniter\API\ResponseTrait;
|
||||
|
||||
use App\Models\MessageModel;
|
||||
use App\Models\UserMessageModel;
|
||||
use App\Models\ClientModel;
|
||||
|
||||
class DashboardController extends AdminController
|
||||
{
|
||||
|
||||
use ResponseTrait;
|
||||
protected $messageModel;
|
||||
protected $clientModel;
|
||||
protected $userMessageModel;
|
||||
protected $myLogger;
|
||||
|
||||
@ -26,12 +28,97 @@ class DashboardController extends AdminController
|
||||
$this->messageModel = new MessageModel();
|
||||
$this->userMessageModel = new UserMessageModel();
|
||||
$this->myLogger = \Config\Services::mylogger();
|
||||
$this->clientModel = new ClientModel();
|
||||
}
|
||||
|
||||
public function dashboard()
|
||||
{
|
||||
$data = [];
|
||||
|
||||
|
||||
$results = $this->clientModel->select('clients.id as client_id, clients.client_name, clients.short_name,
|
||||
client_branch.id as client_branch_id, client_branch.branch_name,
|
||||
client_branch.branch_code, employees.id as employee_id,
|
||||
employees.name as employee_name, employees.relationship,
|
||||
employees.emp_code, employees.emp_status, auth_history.user_type')
|
||||
->join('client_branch','clients.id = client_branch.client_id', 'left')
|
||||
->join('employees','client_branch.id = employees.client_branch_id', 'left')
|
||||
->join('auth_history', 'employees.id = auth_history.user_id AND "employee" = auth_history.user_type', 'left')
|
||||
->findAll();
|
||||
|
||||
$groupedData = [];
|
||||
$employeeId = '';
|
||||
foreach ($results as $row) {
|
||||
$clientId = $row['client_id'];
|
||||
$clientName = $row['client_name'];
|
||||
$shortName = $row['short_name'];
|
||||
$branchId = $row['client_branch_id'];
|
||||
$branchName = $row['branch_name'];
|
||||
$branchCode = $row['branch_code'];
|
||||
if($employeeId != $row['employee_id']){
|
||||
$employeeId = $row['employee_id'];
|
||||
}else{
|
||||
$employeeId = null;
|
||||
}
|
||||
$employeeName = $row['employee_name'] ;
|
||||
$employeeRelationship = $row['relationship'] ;
|
||||
$employeeEmpCode = $row['emp_code'] ;
|
||||
$employeeEmpStatus = $row['emp_status'];
|
||||
$employeeUserType = $row['user_type'];
|
||||
|
||||
// Initialize the client entry if it doesn't exist
|
||||
if (!isset($groupedData[$clientId])) {
|
||||
$groupedData[$clientId] = [
|
||||
'client_id' => $clientId,
|
||||
'client_name' => $clientName,
|
||||
'short_name' => $shortName,
|
||||
'branches' => []
|
||||
];
|
||||
}
|
||||
|
||||
// Initialize the branch entry if it doesn't exist
|
||||
if (!isset($groupedData[$clientId]['branches'][$branchId])) {
|
||||
$groupedData[$clientId]['branches'][$branchId] = [
|
||||
'client_branch_id' => $branchId,
|
||||
'branch_name' => $branchName,
|
||||
'branch_code' => $branchCode,
|
||||
'emp_login' => 0,
|
||||
'emp_enroll' => 0,
|
||||
'employees' => []
|
||||
];
|
||||
}
|
||||
if ($employeeId !== null && $employeeRelationship == 'Self') {
|
||||
// Append employee info to the branch's employees list
|
||||
$groupedData[$clientId]['branches'][$branchId]['employees'][] = [
|
||||
'employee_id' => $employeeId,
|
||||
'employee_name' => $employeeName,
|
||||
'relationship' => $employeeRelationship,
|
||||
'emp_code' => $employeeEmpCode,
|
||||
'emp_status' => $employeeEmpStatus,
|
||||
'user_type' => $employeeUserType
|
||||
];
|
||||
if (!empty($employeeUserType)) {
|
||||
$groupedData[$clientId]['branches'][$branchId]['emp_login']++;
|
||||
}
|
||||
|
||||
// Increment emp_enroll if emp_status is not 'draft'
|
||||
if ($employeeEmpStatus !== 'draft') {
|
||||
$groupedData[$clientId]['branches'][$branchId]['emp_enroll']++;
|
||||
}
|
||||
}
|
||||
$employeeId = $row['employee_id'];
|
||||
}
|
||||
|
||||
// Re-index the arrays to match the expected structure
|
||||
foreach ($groupedData as &$client) {
|
||||
$client['branches'] = array_values($client['branches']);
|
||||
}
|
||||
// echo "<pre>";
|
||||
$data['client_branch_emp_list'] = $groupedData;
|
||||
// print_r($data);die;
|
||||
|
||||
echo view('layout/header');
|
||||
echo view('DashBoard');
|
||||
echo view('DashBoard', $data);
|
||||
echo view('layout/footer');
|
||||
}
|
||||
|
||||
|
||||
@ -1 +1,80 @@
|
||||
<h4 class="page-title">Welcome !</h4>
|
||||
<style>
|
||||
|
||||
body {
|
||||
.multiselect-native-select {
|
||||
position: relative;
|
||||
/* bottom: 32px; */
|
||||
select {
|
||||
border: 0 !important;
|
||||
clip: rect(0 0 0 0) !important;
|
||||
height: 1px !important;
|
||||
margin: -1px -1px -1px -3px !important;
|
||||
overflow: hidden !important;
|
||||
padding: 0 !important;
|
||||
position: absolute !important;
|
||||
width: 1px !important;
|
||||
left: 50%;
|
||||
top: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.multiselect-container{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.multiselect-selected-text{
|
||||
float: left !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.navtab-bg .nav-link {
|
||||
margin: 0 5px 10px!important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<div class="row" id="client_add">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
</div>
|
||||
<div class="col-6" style="text-align: right;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<ul class="nav nav-pills navtab-bg">
|
||||
<li class="nav-item">
|
||||
<a href="#endorsement-dash-tab" data-toggle="tab" aria-expanded="false"
|
||||
class="nav-link px-3 py-2 active" id="endorsement_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-contacts"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Endorsement</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#enrollment-dash-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="enrollemnt_tab">
|
||||
<span class="mr-1"><i class="fa fa-file"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Enrollment</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<?php include('enrollment_dash.php'); ?>
|
||||
<?php include('endorsement_dash.php'); ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
4
app/Views/endorsement_dash.php
Normal file
4
app/Views/endorsement_dash.php
Normal file
@ -0,0 +1,4 @@
|
||||
<div class="tab-pane active show" id="endorsement-dash-tab">
|
||||
|
||||
<h1>Endorsement</h1>
|
||||
</div>
|
||||
115
app/Views/enrollment_dash.php
Normal file
115
app/Views/enrollment_dash.php
Normal file
@ -0,0 +1,115 @@
|
||||
<style>
|
||||
.status-option {
|
||||
padding: 0.5rem !important;
|
||||
background-color: darkgrey;
|
||||
}
|
||||
.emp-count-view-click {
|
||||
cursor: pointer;
|
||||
}
|
||||
.emp-status .col-6 {
|
||||
/* padding-bottom: 1rem; */
|
||||
}
|
||||
.emp-status label {
|
||||
font-weight: bold;
|
||||
}
|
||||
.client-branch-label {
|
||||
padding: 0.2rem;
|
||||
border-radius: 0.2rem;
|
||||
display: inline-block;
|
||||
}
|
||||
.scroll-container {
|
||||
display: flex;
|
||||
overflow-x: auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.scroll-item {
|
||||
flex: 0 0 auto;
|
||||
width: 25%; /* Adjust based on the number of items you want to show */
|
||||
box-sizing: border-box;
|
||||
padding: 0 10px;
|
||||
}
|
||||
.center_text{
|
||||
text-align: center;
|
||||
}
|
||||
.card-body {
|
||||
padding: 0rem ;
|
||||
}
|
||||
|
||||
.number_css{
|
||||
font-family: Roboto, sans-serif;
|
||||
color: #343a40;
|
||||
}
|
||||
.label_bottom_reduce{
|
||||
margin-bottom: .0rem;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="tab-pane fade" id="enrollment-dash-tab">
|
||||
|
||||
<div class="row visa_status_count_view">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header"></div>
|
||||
<div class="card-body status-option" id="statusContent" style="padding: 0.5rem !important;background-color: #edf1f5;">
|
||||
<div class="scroll-container">
|
||||
<?php foreach ($client_branch_emp_list as $clients) { ?>
|
||||
<?php foreach ($clients['branches'] as $branches) { ?>
|
||||
<div class="scroll-item">
|
||||
<div class="card">
|
||||
<div class="card-body emp-count-view-click">
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="col-12 center_text" style="background-color: #02a8b5;">
|
||||
<label for="" class="client-branch-label">
|
||||
<?php echo isset($clients['short_name']) ? $clients['short_name'] : 'N/A'; ?> -
|
||||
<?php echo isset($branches['branch_name']) ? $branches['branch_name'] : 'N/A'; ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row emp-status">
|
||||
<div class="col-12 center_text">
|
||||
<span class="number_css" style="font-size: x-large;"><?php echo isset($branches['employees']) ? count($branches['employees']) : '0'; ?></span><br>
|
||||
<i class="fa fa-users" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="col-6 center_text">
|
||||
<span style="font-size: x-large;" class="number_css"><?php echo isset($branches['emp_login']) ? $branches['emp_login'] : '0'; ?></span><br>
|
||||
<label class="label_bottom_reduce" for="" style="color: gray;font-family: var(--bs-body-font-family);font-size: var(--bs-body-font-size);">Logged-In</label>
|
||||
</div>
|
||||
<div class="col-6 center_text">
|
||||
<span style="font-size: x-large;" class="number_css"><?php echo isset($branches['emp_enroll']) ? count($branches['employees']) - $branches['emp_enroll'] : '0'; ?></span><br>
|
||||
<label class="label_bottom_reduce" for="" style="color: gray;font-family: var(--bs-body-font-family);font-size: var(--bs-body-font-size);">Draft</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-6 center_text">
|
||||
<span style="font-size: x-large;" class="number_css"><?php echo isset($branches['emp_login']) ? count($branches['employees']) - $branches['emp_login'] : '0'; ?></span><br>
|
||||
<label class="label_bottom_reduce" for="" style="color: gray;font-family: var(--bs-body-font-family);font-size: var(--bs-body-font-size);">Not Logged-In</label>
|
||||
</div>
|
||||
<div class="col-6 center_text">
|
||||
<span style="font-size: x-large;" class="number_css"><?php echo isset($branches['emp_enroll']) ? $branches['emp_enroll'] : '0'; ?></span><br>
|
||||
<label class="label_bottom_reduce" for="" style="color: gray;font-family: var(--bs-body-font-family);font-size: var(--bs-body-font-size);">Enrolled</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.scroll-container').on('wheel', function(e) {
|
||||
if (e.originalEvent.deltaY < 0) {
|
||||
this.scrollLeft -= 100; // Adjust scroll speed
|
||||
} else {
|
||||
this.scrollLeft += 100; // Adjust scroll speed
|
||||
}
|
||||
e.preventDefault();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
422
app/Views/enrollment_list.php
Normal file
422
app/Views/enrollment_list.php
Normal file
@ -0,0 +1,422 @@
|
||||
<style>
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
.btn .btn-secondary .buttons-csv .buttons-html5 .my_class {
|
||||
position: relative;
|
||||
left: 79px;
|
||||
}
|
||||
|
||||
.visa_status_count_view .card-header {
|
||||
/* background-color: #eb7a76; */
|
||||
background-color: darkgrey;
|
||||
/* padding-bottom: 1px; */
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
#tickets-table_filter {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.click_hover {
|
||||
background: #1aa79c !important;
|
||||
color: #fff !important;
|
||||
border-radius: 5px;
|
||||
box-shadow: 6px 5px 8px 0 #00000036;
|
||||
cursor: pointer;
|
||||
}
|
||||
.click_hover .text-muted{
|
||||
color: #fff !important;
|
||||
}
|
||||
.click_hover span{
|
||||
color: #fff !important;
|
||||
}
|
||||
.card {
|
||||
border-radius: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="row visa_status_count_view">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div id="categoryFilter" style="display: flex;">
|
||||
<select class="form-control" id="clients" onchange="populateBranches()">
|
||||
<option value="0">Select Client</option>
|
||||
<?php foreach ($client_list as $client) { ?>
|
||||
<option value="<?= $client['id'] ?>"><?= $client['client_name'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div id="categoryFilter_11">
|
||||
<select name="branch_id" class="form-control" id="branch_id">
|
||||
<option value="0">Select Branch</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div id="categoryFilter_11">
|
||||
<a href="#" class="btn btn-primary waves-effect waves-light" id="get-emp-list" onclick="fetchEmpolyeeList(event);">Search</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3 text-right view-status-btn">
|
||||
|
||||
<button type="button" class="btn btn-link visa_status_button" onclick="toggleContent()">
|
||||
Status <i id="toggleIcon" class="fas fa-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body status-option" id="statusContent" style="padding: 0.5rem !important;background-color: darkgrey;">
|
||||
<div class="text-center">
|
||||
<div class="row" style="margin-right: -261px;margin-left: 5px;">
|
||||
<div class="col-xl-2 col-md-3">
|
||||
<div class="card">
|
||||
<div class="card-body" id="emp_count_view_click">
|
||||
<div class="d-flex justify-content-between" style="justify-content: center !important;">
|
||||
<div>
|
||||
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="Emp Count">Emp Count</h5>
|
||||
<h3 class="my-2 py-1"><span data-plugin="counterup" id="emp_count_view">0</span></h3>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
<div class="col-xl-2 col-md-3">
|
||||
<div class="card">
|
||||
<div class="card-body" id="emp_enrolled_view_click">
|
||||
<div class="d-flex justify-content-between" style="justify-content: center !important;">
|
||||
<div>
|
||||
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="Enrolled">Enrolled</h5>
|
||||
<h3 class="my-2 py-1"><span data-plugin="counterup" id="emp_enrolled_view">0</span></h3>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
<div class="col-xl-2 col-md-3">
|
||||
<div class="card">
|
||||
<div class="card-body" id="emp_not_enrolled_view_click">
|
||||
<div class="d-flex justify-content-between" style="justify-content: center !important;">
|
||||
<div>
|
||||
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="Not Enrolled">Not Enrolled</h5>
|
||||
<h3 class="my-2 py-1"><span data-plugin="counterup" id="emp_not_enrolled_view">0</span></h3>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
<div class="col-xl-2 col-md-3">
|
||||
<div class="card">
|
||||
<div class="card-body" id="emp_logged_in_view_click">
|
||||
<div class="d-flex justify-content-between" style="justify-content: center !important;">
|
||||
<div>
|
||||
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="Logged-In">Logged-In</h5>
|
||||
<h3 class="my-2 py-1"><span data-plugin="counterup" id="emp_logged_in_view">0</span></h3>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
<div class="col-xl-2 col-md-3">
|
||||
<div class="card">
|
||||
<div class="card-body" id="emp_not_logged_in_view_click">
|
||||
<div class="d-flex justify-content-between" style="justify-content: center !important;">
|
||||
<div>
|
||||
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="Not Logged-In">Not Logged-In</h5>
|
||||
<h3 class="my-2 py-1"><span data-plugin="counterup" id="emp_not_logged_in_view">0</span></h3>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" id="client_list">
|
||||
<div class="col-12">
|
||||
<div class="card" style="">
|
||||
<div class="card-body">
|
||||
<table class="table table-hover m-0 table-centered dt-responsive w-100" cellspacing="0" id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">SNO</th>
|
||||
<th class="font-weight-medium">Name</th>
|
||||
<th class="font-weight-medium">Emp Code</th>
|
||||
<th class="font-weight-medium">Enrolled</th>
|
||||
<th class="font-weight-medium">Logged-In</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="font-12">
|
||||
<!-- Table body -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Center modal content omitted for brevity -->
|
||||
|
||||
<script>
|
||||
function populateBranches() {
|
||||
var clientId = document.getElementById('clients').value;
|
||||
var branchDropdown = document.getElementById('branch_id');
|
||||
|
||||
branchDropdown.innerHTML = '<option value="0">Select Branch</option>';
|
||||
|
||||
if (clientId == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var branches = <?= json_encode($branch_list) ?>;
|
||||
|
||||
branches.forEach(branch => {
|
||||
if (branch.client_id == clientId) {
|
||||
var option = document.createElement('option');
|
||||
option.value = branch.id;
|
||||
option.textContent = branch.branch_name;
|
||||
branchDropdown.appendChild(option);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function filterTable(columnIndex, filterValue) {
|
||||
var table = $('#tickets-table').DataTable();
|
||||
|
||||
// Reset the search filter for all columns
|
||||
table.columns().search('').draw();
|
||||
|
||||
// Apply the filter to the specified column
|
||||
table.column(columnIndex).search(filterValue).draw();
|
||||
}
|
||||
function fetchEmpolyeeList(event) {
|
||||
event.preventDefault();
|
||||
|
||||
var client_id = $('#clients').val();
|
||||
var branch_id = $('#branch_id').val();
|
||||
if (client_id == '0' || branch_id == '0') {
|
||||
alert('Please select values in both dropdowns.');
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url(); ?>' + '/employee/empby_client_clientbranch/' + client_id + '/' + branch_id,
|
||||
method: 'GET',
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Requested-With": "XMLHttpRequest"
|
||||
},
|
||||
success: function(response) {
|
||||
var data = JSON.parse(response);
|
||||
var table = $('#tickets-table').DataTable();
|
||||
table.clear();
|
||||
|
||||
if (data.length === 0) {
|
||||
table.row.add([
|
||||
'',
|
||||
'',
|
||||
'No data available',
|
||||
'',
|
||||
'',
|
||||
''
|
||||
]).draw();
|
||||
return;
|
||||
}
|
||||
var enrolled_count = 0;
|
||||
var loggedIn_count = 0;
|
||||
data.forEach(function(employee, index) {
|
||||
|
||||
if(employee.emp_status !== 'draft'){
|
||||
var enrolled = 'Yes';
|
||||
enrolled_count++;
|
||||
}else{
|
||||
var enrolled = 'No';
|
||||
}
|
||||
|
||||
if(employee.user_type === 'employee'){
|
||||
var loggedIn = 'Yes';
|
||||
loggedIn_count++;
|
||||
}else{
|
||||
var loggedIn = 'No';
|
||||
}
|
||||
|
||||
table.row.add([
|
||||
index + 1,
|
||||
employee.employee_name,
|
||||
employee.emp_code,
|
||||
enrolled,
|
||||
loggedIn
|
||||
]);
|
||||
|
||||
$('#emp_count_view').html(data.length);
|
||||
$('#emp_enrolled_view').html(enrolled_count);
|
||||
$('#emp_not_enrolled_view').html(data.length - enrolled_count);
|
||||
$('#emp_logged_in_view').html(loggedIn_count);
|
||||
$('#emp_not_logged_in_view').html(data.length - loggedIn_count);
|
||||
|
||||
});
|
||||
|
||||
table.draw();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('Error fetching data from API:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#clients').select2();
|
||||
$('#branch_id').select2();
|
||||
var table = $('#tickets-table').DataTable({
|
||||
dom: 'fBrtip',
|
||||
buttons: [
|
||||
{
|
||||
extend: 'copy',
|
||||
text: '<i class="fa fa-copy"></i>',
|
||||
titleAttr: 'Copy',
|
||||
filename: 'Enrollment List'
|
||||
},
|
||||
{
|
||||
extend: 'print',
|
||||
text: '<i class="fa fa-print"></i>',
|
||||
titleAttr: 'Print',
|
||||
filename: 'Enrollment List'
|
||||
},
|
||||
{
|
||||
extend: 'pdf',
|
||||
text: '<i class="fa fa-file-pdf"></i>',
|
||||
titleAttr: 'PDF',
|
||||
filename: 'Enrollment List'
|
||||
},
|
||||
{
|
||||
extend: 'csv',
|
||||
text: '<i class="fa fa-file-csv"></i>',
|
||||
titleAttr: 'CSV',
|
||||
filename: 'Enrollment List'
|
||||
}
|
||||
],
|
||||
initComplete: function() {
|
||||
// Add custom class to the print button
|
||||
$('.buttons-print').addClass('buttons-html5');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#emp_enrolled_view_click').on('click', function() {
|
||||
if ($(this).hasClass('click_hover')) {
|
||||
// $(this).removeClass('click_hover');
|
||||
$('.click_hover').each(function() {
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
table.columns().search('').draw(); // Clear all filters and show all data
|
||||
}else{
|
||||
$('.click_hover').each(function() {
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
$('#emp_enrolled_view_click').addClass('click_hover');
|
||||
filterTable(3, 'Yes'); // Filter "Enrolled" column (4th column, index 3)
|
||||
}
|
||||
});
|
||||
|
||||
$('#emp_not_enrolled_view_click').on('click', function() {
|
||||
if ($(this).hasClass('click_hover')) {
|
||||
// $(this).removeClass('click_hover');
|
||||
$('.click_hover').each(function() {
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
table.columns().search('').draw(); // Clear all filters and show all data
|
||||
}else{
|
||||
$('.click_hover').each(function() {
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
$('#emp_not_enrolled_view_click').addClass('click_hover');
|
||||
filterTable(3, 'No'); // Filter "Enrolled" column (4th column, index 3)
|
||||
}
|
||||
});
|
||||
|
||||
$('#emp_logged_in_view_click').on('click', function() {
|
||||
if ($(this).hasClass('click_hover')) {
|
||||
// $(this).removeClass('click_hover');
|
||||
$('.click_hover').each(function() {
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
table.columns().search('').draw(); // Clear all filters and show all data
|
||||
}else{
|
||||
$('.click_hover').each(function() {
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
$('#emp_logged_in_view_click').addClass('click_hover');
|
||||
filterTable(4, 'Yes'); // Filter "Logged-In" column (5th column, index 4)
|
||||
}
|
||||
});
|
||||
|
||||
$('#emp_not_logged_in_view_click').on('click', function() {
|
||||
if ($(this).hasClass('click_hover')) {
|
||||
// $(this).removeClass('click_hover');
|
||||
$('.click_hover').each(function() {
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
table.columns().search('').draw(); // Clear all filters and show all data
|
||||
}else{
|
||||
$('.click_hover').each(function() {
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
$('#emp_not_logged_in_view_click').addClass('click_hover');
|
||||
filterTable(4, 'No'); // Filter "Logged-In" column (5th column, index 4)
|
||||
}
|
||||
});
|
||||
|
||||
$('#emp_count_view_click').on('click', function() {
|
||||
if ($(this).hasClass('click_hover')) {
|
||||
// $(this).removeClass('click_hover');
|
||||
$('.click_hover').each(function() {
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
table.columns().search('').draw(); // Clear all filters and show all data
|
||||
}else{
|
||||
$('.click_hover').each(function() {
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
$('#emp_count_view_click').addClass('click_hover');
|
||||
table.columns().search('').draw(); // Clear all filters and show all data
|
||||
}
|
||||
});
|
||||
|
||||
toggleContent();
|
||||
});
|
||||
|
||||
function toggleContent() {
|
||||
var content = document.getElementById("statusContent");
|
||||
var toggleIcon = document.getElementById("toggleIcon");
|
||||
if (content.style.display === "none") {
|
||||
content.style.display = "block";
|
||||
toggleIcon.classList.remove("fa-plus");
|
||||
toggleIcon.classList.add("fa-minus");
|
||||
} else {
|
||||
content.style.display = "none";
|
||||
toggleIcon.classList.remove("fa-minus");
|
||||
toggleIcon.classList.add("fa-plus");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -55,6 +55,8 @@
|
||||
<!-- select2 -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" type="text/css">
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.3/dist/umd/popper.min.js"></script>
|
||||
|
||||
<link rel="manifest" href="../manifest.json">
|
||||
|
||||
@ -69,6 +71,10 @@
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.min.css"/>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js"></script>
|
||||
<style>
|
||||
|
||||
|
||||
@ -564,6 +570,9 @@
|
||||
<li>
|
||||
<a href="<?= base_url('/employee/endorsement-list') ?>">Endorsement List</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/employee/enrollment-list') ?>">Enrollment List</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user