%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : addictionfreeind ( 1003) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Directory : /home/addictionfreeind/www/admin1/storage/framework/views/ |
Upload File : |
<?php $__env->startPush('datatable-styles'); ?>
<?php echo $__env->make('sections.datatable_css', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopPush(); ?>
<?php $__env->startSection('content'); ?>
<!-- CONTENT WRAPPER START -->
<div class="content-wrapper">
<!-- Add Task Export Buttons Start -->
<div class="d-flex justify-content-between action-bar">
<div id="table-actions" class="d-block d-lg-flex align-items-center">
<?php if (isset($component)) { $__componentOriginaldbb84df4c3a5cbdd95fb35d18ba6410f = $component; } ?>
<?php $component = App\View\Components\Forms\LinkPrimary::resolve(['link' => route('employees.create'),'icon' => 'plus'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('forms.link-primary'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\Forms\LinkPrimary::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'mr-3 openRightModal']); ?>
<?php echo app('translator')->get('app.add'); ?>
<?php echo app('translator')->get('app.employee'); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginaldbb84df4c3a5cbdd95fb35d18ba6410f)): ?>
<?php $component = $__componentOriginaldbb84df4c3a5cbdd95fb35d18ba6410f; ?>
<?php unset($__componentOriginaldbb84df4c3a5cbdd95fb35d18ba6410f); ?>
<?php endif; ?>
</div>
<?php if (isset($component)) { $__componentOriginald48019b35c4ccf364e5d37d92848414c = $component; } ?>
<?php $component = App\View\Components\Datatable\Actions::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('datatable.actions'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\Datatable\Actions::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginald48019b35c4ccf364e5d37d92848414c)): ?>
<?php $component = $__componentOriginald48019b35c4ccf364e5d37d92848414c; ?>
<?php unset($__componentOriginald48019b35c4ccf364e5d37d92848414c); ?>
<?php endif; ?>
</div>
<!-- Add Task Export Buttons End -->
<!-- Task Box Start -->
<div class="d-flex flex-column w-tables rounded mt-3 bg-white table-responsive">
<?php echo $dataTable->table(['class' => 'table table-hover border-0 w-100']); ?>
</div>
<!-- Task Box End -->
</div>
<!-- CONTENT WRAPPER END -->
<?php $__env->stopSection(); ?>
<?php $__env->startPush('scripts'); ?>
<?php echo $__env->make('sections.datatable_js', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<script>
var startDate = null;
var endDate = null;
var lastStartDate = null;
var lastEndDate = null;
<?php if(request('startDate') != '' && request('endDate') != '' ): ?>
startDate = '<?php echo e(request("startDate")); ?>';
endDate = '<?php echo e(request("endDate")); ?>';
<?php endif; ?>
<?php if(request('lastStartDate') !=='' && request('lastEndDate') !=='' ): ?>
lastStartDate = '<?php echo e(request("lastStartDate")); ?>';
lastEndDate = '<?php echo e(request("lastEndDate")); ?>';
<?php endif; ?>
$('#employees-table').on('preXhr.dt', function (e, settings, data) {
const status = $('#status').val();
const employee = $('#employee').val();
const role = $('#role').val();
const gender = $('#gender').val();
const skill = $('#skill').val();
const designation = $('#designation').val();
const department = $('#department').val();
const searchText = $('#search-text-field').val();
data['status'] = status;
data['employee'] = employee;
data['role'] = role;
data['gender'] = gender;
data['skill'] = skill;
data['designation'] = designation;
data['department'] = department;
data['searchText'] = searchText;
/* If any of these following filters are applied, then dashboard conditions will not work */
if (status == "all" || employee == "all" || role == "all" || designation == "all" || searchText == "") {
data['startDate'] = startDate;
data['endDate'] = endDate;
data['lastStartDate'] = lastStartDate;
data['lastEndDate'] = lastEndDate;
}
});
const showTable = () => {
window.LaravelDataTables["employees-table"].draw(false);
}
$('#employee, #status, #role, #gender, #skill, #designation, #department').on('change keyup',
function () {
if ($('#status').val() != "all") {
$('#reset-filters').removeClass('d-none');
} else if ($('#employee').val() != "all") {
$('#reset-filters').removeClass('d-none');
} else if ($('#role').val() != "all") {
$('#reset-filters').removeClass('d-none');
} else if ($('#gender').val() != "all") {
$('#reset-filters').removeClass('d-none');
} else if ($('#designation').val() != "all") {
$('#reset-filters').removeClass('d-none');
} else if ($('#department').val() != "all") {
$('#reset-filters').removeClass('d-none');
} else {
$('#reset-filters').addClass('d-none');
}
showTable();
});
$('#search-text-field').on('keyup', function () {
if ($('#search-text-field').val() != "") {
$('#reset-filters').removeClass('d-none');
showTable();
}
});
$('#reset-filters, #reset-filters-2').click(function () {
$('#filter-form')[0].reset();
$('.filter-box .select-picker').selectpicker("refresh");
$('#reset-filters').addClass('d-none');
showTable();
});
$('#quick-action-type').change(function () {
const actionValue = $(this).val();
if (actionValue != '') {
$('#quick-action-apply').removeAttr('disabled');
if (actionValue == 'change-status') {
$('.quick-action-field').addClass('d-none');
$('#change-status-action').removeClass('d-none');
} else {
$('.quick-action-field').addClass('d-none');
}
} else {
$('#quick-action-apply').attr('disabled', true);
$('.quick-action-field').addClass('d-none');
}
});
$('#quick-action-apply').click(function () {
const actionValue = $('#quick-action-type').val();
if (actionValue == 'delete') {
Swal.fire({
title: "<?php echo app('translator')->get('messages.sweetAlertTitle'); ?>",
text: "<?php echo app('translator')->get('messages.recoverRecord'); ?>",
icon: 'warning',
showCancelButton: true,
focusConfirm: false,
confirmButtonText: "<?php echo app('translator')->get('messages.confirmDelete'); ?>",
cancelButtonText: "<?php echo app('translator')->get('app.cancel'); ?>",
customClass: {
confirmButton: 'btn btn-primary mr-3',
cancelButton: 'btn btn-secondary'
},
showClass: {
popup: 'swal2-noanimation',
backdrop: 'swal2-noanimation'
},
buttonsStyling: false
}).then((result) => {
if (result.isConfirmed) {
applyQuickAction();
}
});
} else {
applyQuickAction();
}
});
$('body').on('click', '.delete-table-row', function () {
var id = $(this).data('user-id');
Swal.fire({
title: "<?php echo app('translator')->get('messages.sweetAlertTitle'); ?>",
text: "<?php echo app('translator')->get('messages.recoverRecord'); ?>",
icon: 'warning',
showCancelButton: true,
focusConfirm: false,
confirmButtonText: "<?php echo app('translator')->get('messages.confirmDelete'); ?>",
cancelButtonText: "<?php echo app('translator')->get('app.cancel'); ?>",
customClass: {
confirmButton: 'btn btn-primary mr-3',
cancelButton: 'btn btn-secondary'
},
showClass: {
popup: 'swal2-noanimation',
backdrop: 'swal2-noanimation'
},
buttonsStyling: false
}).then((result) => {
if (result.isConfirmed) {
var url = "<?php echo e(route('employees.destroy', ':id')); ?>";
url = url.replace(':id', id);
var token = "<?php echo e(csrf_token()); ?>";
$.easyAjax({
type: 'POST',
url: url,
blockUI: true,
data: {
'_token': token,
'_method': 'DELETE'
},
success: function (response) {
if (response.status == "success") {
showTable();
}
}
});
}
});
});
const applyQuickAction = () => {
var rowdIds = $("#employees-table input:checkbox:checked").map(function () {
return $(this).val();
}).get();
var url = "<?php echo e(route('employees.apply_quick_action')); ?>?row_ids=" + rowdIds;
$.easyAjax({
url: url,
container: '#quick-action-form',
type: "POST",
disableButton: true,
buttonSelector: "#quick-action-apply",
data: $('#quick-action-form').serialize(),
blockUI: true,
success: function (response) {
if (response.status == 'success') {
showTable();
resetActionButtons();
deSelectAll();
$('#quick-action-form').hide();
}
}
})
};
$('body').on('change', '.assign_role', function () {
var id = $(this).data('user-id');
var role = $(this).val();
var token = "<?php echo e(csrf_token()); ?>";
if (typeof id !== 'undefined') {
$.easyAjax({
url: "<?php echo e(route('employees.assign_role')); ?>",
type: "POST",
blockUI: true,
container: '#employees-table',
data: {
role: role,
userId: id,
_token: token
},
success: function (response) {
if (response.status == "success") {
window.LaravelDataTables["employees-table"].draw(false);
}
}
})
}
});
$('#designation-setting').click(function () {
const url = "<?php echo e(route('designations.create')); ?>";
$(MODAL_LG + ' ' + MODAL_HEADING).html('...');
$.ajaxModal(MODAL_LG, url);
})
$('.department-setting').click(function () {
const url = "<?php echo e(route('departments.create')); ?>";
$(MODAL_LG + ' ' + MODAL_HEADING).html('...');
$.ajaxModal(MODAL_LG, url);
});
</script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/addictionfreeind/public_html/admin1/resources/views/employees/index.blade.php ENDPATH**/ ?>