diff --git a/resources/views/parents/verification.blade.php b/resources/views/parents/verification.blade.php
index d13cb7f..c46ebbb 100644
--- a/resources/views/parents/verification.blade.php
+++ b/resources/views/parents/verification.blade.php
@@ -3,7 +3,7 @@
@section('title', 'Verifikasi Wali Murid')
@section('content')
-
+
{{-- Header premium --}}
@@ -188,7 +188,7 @@
class="inline-flex items-center gap-2 px-4 py-2.5 rounded-xl bg-gradient-to-r from-emerald-500 to-teal-600 text-white text-sm font-bold shadow-md shadow-emerald-500/30 hover:shadow-lg hover:-translate-y-0.5 hover:brightness-105 transition-all">
Setujui
-
@@ -259,6 +259,73 @@
@endif
+ {{-- Modal Tolak (premium) --}}
+
+
+
+
+ {{-- Header --}}
+
+
+
+
+
+
+
Tolak Akun Wali
+
Wali tidak akan bisa memantau putra/putri
+
+
+
+
+
+ {{-- Body --}}
+
+
+
+
+
+
+ Anda akan menolak akun .
+ Wali tetap bisa login, namun tautan putra/putri ditolak dan ia dapat mengajukan ulang.
+
+
+
+
+
+
+
+ 0/255
+
+
Alasan ini langsung tampil di banner aplikasi wali.
+
+
+ {{-- Footer --}}
+
+
+
+
+
+
+
+
@push('scripts')
@@ -288,32 +355,41 @@ function approveWali(linkId, userName, studentName) {
});
}
-function rejectWali(linkId, userName) {
- Swal.fire({
- title: 'Tolak akun ' + userName + '?',
- html: '
',
- icon: 'warning',
- confirmButtonText: '
Ya, Tolak',
- showCancelButton: true,
- cancelButtonText: 'Batal',
- confirmButtonColor: '#e11d48',
- }).then((result) => {
- if (result.isConfirmed) {
- const reason = document.getElementById('reject-reason') ? document.getElementById('reject-reason').value : '';
- fetch('{{ url('parents/verification') }}/' + linkId + '/reject', {
+function rejectModal() {
+ return {
+ show: false,
+ loading: false,
+ id: null,
+ name: '',
+ reason: '',
+ openReject(linkId, userName) {
+ this.id = linkId;
+ this.name = userName;
+ this.reason = '';
+ this.show = true;
+ },
+ confirmReject() {
+ if (this.loading) return;
+ this.loading = true;
+ fetch('{{ url('parents/verification') }}/' + this.id + '/reject', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content,
'Accept': 'application/json',
},
- body: JSON.stringify({ reason: reason }),
- }).then(r => {
+ body: JSON.stringify({ reason: this.reason }),
+ })
+ .then(r => {
if (r.redirected) window.location.href = r.url;
else location.reload();
+ })
+ .catch(() => {
+ this.loading = false;
+ this.show = false;
});
- }
- });
+ },
+ };
}
@endpush