128 lines
5.5 KiB
PHP
128 lines
5.5 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="Cari Bimbingan & Konseling"/>
|
|
|
|
<form method="POST" action="{{ route('ticket.cetak') }}">
|
|
@csrf
|
|
<div class="d-flex align-items-center position-relative my-1 ms-2">
|
|
<input type="date" name="start_date" class="form-control form-control-solid w-200px ps-15"/>
|
|
<input type="date" name="end_date" class="form-control form-control-solid w-200px ps-15 ms-2"/>
|
|
<button type="submit" class="btn btn-primary ms-2">Cetak</button/>
|
|
</div>
|
|
</form>
|
|
</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>ID</th>
|
|
<th>Subjek</th>
|
|
<th>Siswa</th>
|
|
<th>Status</th>
|
|
<th>Jenis</th>
|
|
<th>Kasus</th>
|
|
<th>Created</th>
|
|
<th>Chat</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('kepsek.ticket') }}",
|
|
order: [[5, 'desc']],
|
|
stateSave: true,
|
|
columns: [
|
|
{data: null, name: 'id'},
|
|
{data: 'title-post', name: 'title-post'},
|
|
{data: 'siswa', name: 'siswa'},
|
|
{data: 'status', name: 'status'},
|
|
{data: 'jenis', name: 'jenis'},
|
|
{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) {
|
|
if(row.type == 1) {
|
|
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">
|
|
<div class="menu-item px-3">
|
|
<a href="{{ site_url('kepsek', 'ticket/view') }}/${row.id}" class="menu-link px-3" data-kt-docs-table-filter="delete_row">
|
|
Lihat Pesan
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<!--end::Menu-->
|
|
`;
|
|
} else {
|
|
return `-`;
|
|
}
|
|
},
|
|
}
|
|
],
|
|
createdRow: function (row, data, dataIndex) {
|
|
// Set the sequential number starting from 1
|
|
$('td', row).eq(0).html(dataIndex + 1);
|
|
}
|
|
});
|
|
|
|
table.on('draw', function () {
|
|
KTMenu.createInstances();
|
|
});
|
|
|
|
table.search('').draw();
|
|
|
|
// #myInput is a <input type="text"> element
|
|
$('#search').on('keyup change', function () {
|
|
table.search('user|' + 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')
|