[add] Feature Sort at Munaqosah
This commit is contained in:
parent
f9d05450d9
commit
96739a9d9f
|
@ -28,10 +28,27 @@
|
|||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-center my-3">
|
||||
<h5 class="card-title mb-0">Munaqosah Santri</h5>
|
||||
<div class="d-flex flex-wrap gap-2 mb-3">
|
||||
<select id="filterColumn" class="form-select w-auto">
|
||||
<option value="">Filter</option>
|
||||
<option value="0">Nama Santri</option>
|
||||
<option value="4">Tahun Angkatan</option>
|
||||
<option value="5">Al Qur'an Isi</option>
|
||||
<option value="5">Al Hadis Isi</option>
|
||||
<option value="6">Presentase Qur'an</option>
|
||||
</select>
|
||||
|
||||
<button id="sortAsc" class="btn btn-primary">
|
||||
<i class='bx bx-sort-a-z'></i> Ascending
|
||||
</button>
|
||||
<button id="sortDesc" class="btn btn-secondary">
|
||||
<i class='bx bx-sort-z-a'></i> Descending
|
||||
</button>
|
||||
<button id="btnExcel" class="btn btn-success">
|
||||
<i class='bx bx-file'></i> Export Excel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tabel Riwayat -->
|
||||
<div class="table-responsive">
|
||||
|
@ -98,6 +115,190 @@
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
|
||||
@if(session('success'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-center my-3">
|
||||
<h5 class="card-title mb-0">Munaqosah Astra</h5>
|
||||
<button id="btnExcelAstra" class="btn btn-success">
|
||||
<i class='bx bx-file'></i> Export Excel
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Tabel Riwayat -->
|
||||
<div class="table-responsive">
|
||||
<table id="dataTableAstra" class="table table-striped table-bordered">
|
||||
<thead class="custom-thead">
|
||||
<tr>
|
||||
<th>Tanggal</th>
|
||||
<th>Nama Santri</th>
|
||||
<th>NIS</th>
|
||||
<th>Tahun Angkatan</th>
|
||||
<th>Al-Qur'an Isi</th>
|
||||
<th>Persentase Qur'an</th>
|
||||
<th>Al-Hadis Isi</th>
|
||||
<th>Persentase Hadis</th>
|
||||
<th>Nilai N</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($riwayat as $item)
|
||||
@if(str_starts_with($item->user->nis, 'A'))
|
||||
<tr>
|
||||
<td>{{ $item->created_at->format('Y-m-d') }}</td>
|
||||
<td>{{ $item->user->name ?? '—' }}</td>
|
||||
<td>{{ $item->user->nis ?? '—' }}</td>
|
||||
<td>{{ $item->tahun_angkatan }}</td>
|
||||
<td>{{ $item->alquran }}</td>
|
||||
<td>{{ number_format(($item->alquran / 606) * 100, 2) }}%</td>
|
||||
<td>{{ $item->alhadis }}</td>
|
||||
<td>{{ number_format(($item->alhadis / 1997) * 100, 2) }}%</td>
|
||||
<td>{{ number_format($item->nilai_n, 2) }}</td>
|
||||
<td>{{ $item->status }}</td>
|
||||
<td>
|
||||
@if($item->munaqosah_status === 'Sedang di Verifikasi')
|
||||
<!-- Tombol Verifikasi -->
|
||||
<form action="{{ route('munaqosah.verify', $item->id) }}" method="POST"
|
||||
style="display:inline;">
|
||||
@csrf
|
||||
<button type="submit" class="mb-1 btn btn-success btn-sm">
|
||||
<i class='bx bxs-check-circle'></i> Verifikasi
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<!-- Tombol Tolak -->
|
||||
<form action="{{ route('munaqosah.reject', $item->id) }}" method="POST"
|
||||
style="display:inline;">
|
||||
@csrf
|
||||
<button type="submit" class="mb-1 btn btn-warning btn-sm">
|
||||
<i class='bx bxs-x-circle'></i> Tolak
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<!-- Tombol Delete dengan SweetAlert -->
|
||||
<button class="mb-1 btn btn-danger btn-sm btn-delete"
|
||||
data-id="{{ $item->id }}">
|
||||
<i class='bx bxs-trash'></i> Delete
|
||||
</button>
|
||||
@else
|
||||
<span class="badge bg-info">Selesai</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
|
||||
@if(session('success'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-center my-3">
|
||||
<h5 class="card-title mb-0">Munaqosah Astri</h5>
|
||||
<button id="btnExcelAstri" class="btn btn-success">
|
||||
<i class='bx bx-file'></i> Export Excel
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Tabel Riwayat -->
|
||||
<div class="table-responsive">
|
||||
<table id="dataTableAstri" class="table table-striped table-bordered">
|
||||
<thead class="custom-thead">
|
||||
<tr>
|
||||
<th>Tanggal</th>
|
||||
<th>Nama Santri</th>
|
||||
<th>NIS</th>
|
||||
<th>Tahun Angkatan</th>
|
||||
<th>Al-Qur'an Isi</th>
|
||||
<th>Persentase Qur'an</th>
|
||||
<th>Al-Hadis Isi</th>
|
||||
<th>Persentase Hadis</th>
|
||||
<th>Nilai N</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($riwayat as $item)
|
||||
@if(str_starts_with($item->user->nis, 'I'))
|
||||
<tr>
|
||||
<td>{{ $item->created_at->format('Y-m-d') }}</td>
|
||||
<td>{{ $item->user->name ?? '—' }}</td>
|
||||
<td>{{ $item->user->nis ?? '—' }}</td>
|
||||
<td>{{ $item->tahun_angkatan }}</td>
|
||||
<td>{{ $item->alquran }}</td>
|
||||
<td>{{ number_format(($item->alquran / 606) * 100, 2) }}%</td>
|
||||
<td>{{ $item->alhadis }}</td>
|
||||
<td>{{ number_format(($item->alhadis / 1997) * 100, 2) }}%</td>
|
||||
<td>{{ number_format($item->nilai_n, 2) }}</td>
|
||||
<td>{{ $item->status }}</td>
|
||||
<td>
|
||||
@if($item->munaqosah_status === 'Sedang di Verifikasi')
|
||||
<!-- Tombol Verifikasi -->
|
||||
<form action="{{ route('munaqosah.verify', $item->id) }}" method="POST"
|
||||
style="display:inline;">
|
||||
@csrf
|
||||
<button type="submit" class="mb-1 btn btn-success btn-sm">
|
||||
<i class='bx bxs-check-circle'></i> Verifikasi
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<!-- Tombol Tolak -->
|
||||
<form action="{{ route('munaqosah.reject', $item->id) }}" method="POST"
|
||||
style="display:inline;">
|
||||
@csrf
|
||||
<button type="submit" class="mb-1 btn btn-warning btn-sm">
|
||||
<i class='bx bxs-x-circle'></i> Tolak
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<!-- Tombol Delete dengan SweetAlert -->
|
||||
<button class="mb-1 btn btn-danger btn-sm btn-delete"
|
||||
data-id="{{ $item->id }}">
|
||||
<i class='bx bxs-trash'></i> Delete
|
||||
</button>
|
||||
@else
|
||||
<span class="badge bg-info">Selesai</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- SweetAlert2 -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
@ -138,10 +339,8 @@
|
|||
</script>
|
||||
|
||||
<!-- DataTables CSS & JS -->
|
||||
<link rel="stylesheet"
|
||||
href="https://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css">
|
||||
<link rel="stylesheet"
|
||||
href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.dataTables.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.dataTables.min.css">
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js">
|
||||
|
@ -151,7 +350,7 @@
|
|||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
var table = $('#dataTable').DataTable({
|
||||
var table = $('#dataTableAstri, #dataTableAstra, #dataTable').DataTable({
|
||||
responsive: true,
|
||||
dom: 'Bfrtip',
|
||||
buttons: [],
|
||||
|
@ -164,11 +363,18 @@
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Event untuk tombol export
|
||||
$('#btnExcelAstra').on('click', function () {
|
||||
table.button('.buttons-excel').trigger();
|
||||
});
|
||||
$('#btnExcelAstri').on('click', function () {
|
||||
table.button('.buttons-excel').trigger();
|
||||
});
|
||||
$('#btnExcel').on('click', function () {
|
||||
table.button('.buttons-excel').trigger();
|
||||
});
|
||||
|
||||
// Tambahkan tombol export
|
||||
new $.fn.dataTable.Buttons(table, {
|
||||
buttons: [
|
||||
|
@ -182,6 +388,13 @@ className: 'buttons-excel',
|
|||
});
|
||||
|
||||
table.buttons().container().appendTo($('.dataTables_wrapper'));
|
||||
$('#sortAsc').on('click', function () {
|
||||
table.order([$('#filterColumn').val(), 'asc']).draw();
|
||||
});
|
||||
|
||||
$('#sortDesc').on('click', function () {
|
||||
table.order([$('#filterColumn').val(), 'desc']).draw();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -196,12 +409,5 @@ className: 'buttons-excel',
|
|||
color: #012970;
|
||||
}
|
||||
</style>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
@endsection
|
|
@ -1,5 +1,5 @@
|
|||
@extends('layouts.app-none')
|
||||
@section('title', 'Login | SR Klasifikasi')
|
||||
<title>Login | SR Klasifikasi</title>
|
||||
@section('content')
|
||||
|
||||
<section class="section register min-vh-100 d-flex flex-column align-items-center justify-content-center py-4">
|
||||
|
|
Loading…
Reference in New Issue