feat(penilai): tambahkan fitur upload file paparan
- Menambahkan metode edit untuk menampilkan form upload file paparan. - Menambahkan metode storePaparan untuk menyimpan file paparan ke database. - Membuat migrasi untuk menambahkan kolom file_paparan pada tabel penilai. - Menambahkan tampilan edit.blade.php untuk form upload. - Memperbarui tampilan show.blade.php untuk mengarahkan ke form edit. - Menambahkan breadcrumb untuk navigasi ke halaman upload file paparan. - Memperbarui rute untuk mendukung pengeditan dan penyimpanan file paparan.
This commit is contained in:
72
resources/views/penilai/edit.blade.php
Normal file
72
resources/views/penilai/edit.blade.php
Normal file
@@ -0,0 +1,72 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('penilai.edit') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<div class="card-title flex flex-row gap-1.5">
|
||||
Upload File Paparan
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('pembayaran.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('penilai.storePaparan',['id'=> $permohonan->id]) }}" method="POST" class="grid gap-5" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id }}">
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor Registrasi
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input readonly type="text" name="nomor_registrasi" id="nomor_registrasi" class="input w-full @error('nomor_registrasi') border-danger bg-danger-light @enderror" value="{{ old('nomor_registrasi', $permohonan->nomor_registrasi ?? '') }}" placeholder="Nomor Registrasi">
|
||||
@error('nomor_registrasi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Debitur
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input readonly type="text" name="debitur" id="debitur" class="input w-full @error('debitur') border-danger bg-danger-light @enderror" value="{{ old('debitur', $permohonan->debiture->name ?? '') }}" placeholder="Debitur">
|
||||
@error('debitur')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
File Paparan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="file" name="file_paparan" id="file_paparan" class="file-input w-full @error('file_paparan') border-danger bg-danger-light @enderror" accept=".pdf,.jpg,.jpeg,.png">
|
||||
@error('file_paparan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Proses
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts')
|
||||
|
||||
@endpush
|
||||
@@ -560,45 +560,9 @@
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes'
|
||||
}).then((result) => {
|
||||
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: `/penilai/storePaparan/${permohonanId}`,
|
||||
type: "PUT",
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
// window.location.reload();
|
||||
hideLoadingSwal();
|
||||
Swal.fire({
|
||||
title: 'Berhasil!',
|
||||
text: response.message,
|
||||
icon: 'success',
|
||||
confirmButtonText: 'OK'
|
||||
}).then((response) => {
|
||||
if (response.isConfirmed) {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.log('Error checking button status:', error, status, xhr);
|
||||
if (xhr.responseJSON.message) {
|
||||
// window.location.reload();
|
||||
hideLoadingSwal();
|
||||
|
||||
} else {
|
||||
// window.location.reload();
|
||||
hideLoadingSwal();
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
window.location.href = `/penilai/${permohonanId}/edit`;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user