@extends('layouts.app')
@push('styles')
<!-- DataTables -->
<link
href="{{ asset('assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css') }}"
rel="stylesheet" type="text/css" />
<link
href="{{ asset('assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css') }}"
rel="stylesheet" type="text/css" />
@endpush
@section('content')
<!-- Start Page-content-Wrapper -->
<div class="page-content-wrapper">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-6">
<!-- This column takes half of the width -->
<h4 class="card-title">{{ $title }}</h4>
</div>
<div class="col-md-6 text-end">
<!-- This column takes the other half and aligns content to the right -->
{{-- @can('create '.$menu)
<a href="{{ route($url.'.create') }}"
class="btn btn-sm btn-success mb-2"><i class="fa fa-plus"> </i>Tambah Data</a>
@endcan --}}
</div>
</div>
<?php
$type = $_GET['type'] ?? ''; // Ambil nilai site dari URL
?>
<select name="type" id="type" class="form-control">
<option value="aktif" <?= $type == 'aktif' ? 'selected' : '' ?>>Aktif</option>
<option value="pending" <?= $type == 'pending' ? 'selected' : '' ?>>Pendaftar</option>
</select> <br>
<table id="datatable" class="table table-bordered dt-responsive nowrap"
style="border-collapse: collapse; border-spacing: 0; width: 100%;">
<thead>
<tr>
{{-- <th>No</th> --}}
<th>Nama</th>
<th>No Identitas</th>
<th>Email</th>
<th>No Whatsapp</th>
<th>Tempat / Tanggal Lahir</th>
<th>Pendidikan Terakhir</th>
<th>status</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
@foreach($datas as $data)
{{-- @if ($data->siswa) --}}
<tr>
{{-- <td> {{ $loop->iteration }} </td> --}}
<td> {{ $data->siswa->nama_siswa }} </td>
<td> {{ $data->siswa->no_identitas }} </td>
<td> {{ @$data->siswa->user->email }} </td>
<td> {{ $data->siswa->no_hp_siswa }} </td>
<td> {{ $data->siswa->tempat_lahir }} / {{ $data->siswa->tanggal_lahir }} </td>
<td> {{ $data->siswa->tingkatan_sekolah }} </td>
<td> {{ $data->siswa->status }} </td>
<td>
<form method="POST"
action="{{ route($url.'.destroy', $data->id) }}">
{{ csrf_field() }}
<input type="hidden" name="_method" value="DELETE">
@can('edit '.$menu)
<a href="{{ route($url.'.show', $data->id) }}"
class="btn btn-sm btn-primary"><i class="fa fa-eye"> </i> Detail</a>
@endcan
{{-- @can('delete '.$menu)
<button type="submit" class="btn btn-sm btn-danger"
onclick="return hapus()"><i class="fa fa-trash"></i>
Hapus</button>
@endcan --}}
</form>
</td>
</tr>
{{-- @endif --}}
@endforeach
</tbody>
</table>
</div>
</div>
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- End Page-content -->
@endsection
@push('scripts')
<!-- Required datatable js -->
<script src="{{ asset('assets/libs/datatables.net/js/jquery.dataTables.min.js') }}">
</script>
<script
src="{{ asset('assets/libs/datatables.net-bs4/js/dataTables.bootstrap4.min.js') }}">
</script>
<!-- Buttons examples -->
<script
src="{{ asset('assets/libs/datatables.net-buttons/js/dataTables.buttons.min.js') }}">
</script>
<script
src="{{ asset('assets/libs/datatables.net-buttons-bs4/js/buttons.bootstrap4.min.js') }}">
</script>
<script src="{{ asset('assets/libs/jszip/jszip.min.js') }}"></script>
<script src="{{ asset('assets/libs/pdfmake/build/pdfmake.min.js') }}"></script>
<script src="{{ asset('assets/libs/pdfmake/build/vfs_fonts.js') }}"></script>
<script src="{{ asset('assets/libs/datatables.net-buttons/js/buttons.html5.min.js') }}">
</script>
<script src="{{ asset('assets/libs/datatables.net-buttons/js/buttons.print.min.js') }}">
</script>
<script src="{{ asset('assets/libs/datatables.net-buttons/js/buttons.colVis.min.js') }}">
</script>
<!-- Responsive examples -->
<script
src="{{ asset('assets/libs/datatables.net-responsive/js/dataTables.responsive.min.js') }}">
</script>
<script
src="{{ asset('assets/libs/datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js') }}">
</script>
<!-- Datatable init js -->
<script src="{{ asset('assets/js/pages/datatables.init.js') }}"></script>
<script>
$('#type').on('change', function () {
const url = $(this).val();
if (url) {
window.location.href = "{{url('/')}}/pendaftaran?type=" + url;
}
});
</script>
@endpush
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]