MIF_E31211285/Modules/User/Resources/views/ticket/index.blade.php

113 lines
4.6 KiB
PHP

@push('css')
<link href="{{ frontend('plugins/custom/datatables/datatables.bundle.css') }}" rel="stylesheet" type="text/css" />
@endpush
@include('components.theme.pages.header')
<section>
<!-- basic table -->
<div class="row">
<div class="col-12">
<div class="card card-flush">
<div class="card-header flex-nowrap pt-5">
<div>
<div class="d-flex align-items-center position-relative my-1">
<i class="ki-outline ki-magnifier fs-1 position-absolute ms-6"><span class="path1"></span><span class="path2"></span></i>
<input type="text" id="search" class="form-control form-control-solid w-250px ps-15" placeholder="Temukan Tiket"/>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="data-table" class="table align-middle table-row-dashed fs-6 gy-5">
<thead>
<tr class="text-start text-gray-400 fw-bold fs-7 text-uppercase gs-0">
<th>TicketID</th>
<th>Subjek</th>
<th>Status</th>
<th>Prioritas</th>
<th>Created</th>
<th>Action</th>
</tr>
</thead>
<tbody class="text-gray-600 fw-semibold"></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script src="{{ frontend('plugins/custom/datatables/datatables.bundle.js') }}"></script>
<script type="text/javascript">
$(function () {
var table = $('#data-table').DataTable({
processing: true,
serverSide: true,
ajax: "{{ route('user.ticket') }}",
order: [[5, 'desc']],
stateSave: true,
columns: [
{data: 'ticket-invoice', name: 'ticket-invoice'},
{data: 'title-post', name: 'title-post'},
{data: 'status', name: 'status'},
{data: 'priority', name: 'priority'},
{data: 'created_at', name: 'created_at'},
{data: 'action', name: 'action', orderable: false, searchable: false},
],
columnDefs: [
{
targets: -1,
data: null,
orderable: false,
render: function (data, type, row) {
return `
<a href="#" class="btn btn-light btn-active-light-primary btn-sm" data-kt-menu-trigger="click" data-kt-menu-placement="bottom-end" data-kt-menu-flip="top-end">
Aksi
</a>
<!--begin::Menu-->
<div class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-600 menu-state-bg-light-primary fw-bold fs-7 w-125px py-4" data-kt-menu="true">
<!--begin::Menu item-->
<div class="menu-item px-3">
<a href="{{ site_url('user', 'ticket/view') . '/' }}${row.id}" class="menu-link px-3">
Detail
</a>
</div>
<!--begin::Menu item-->
<div class="menu-item px-3">
<a href="#" data-url="{{ site_url('user', 'ticket/delete') }}/${row.id}" class="menu-link px-3 deleteContent">
Delete
</a>
</div>
<!--end::Menu item-->
</div>
<!--end::Menu-->
`;
},
}
],
});
table.on('draw', function () {
KTMenu.createInstances();
});
table.search('').draw();
$('#search').on('keyup change', function () {
table.search(this.value).draw();
});
$('#data-table').on('click', '.deleteContent', function() {
var url = $(this).data('url');
$('#exampleModal').modal('show', {
backdrop: 'static'
});
$('.link').attr('href', url)
})
});
</script>
@endpush
@include('components.theme.pages.footer')