final upload form

This commit is contained in:
Fiqh Pratama
2025-10-13 17:28:34 +07:00
parent e8acdd3303
commit 8321df6d2b
13 changed files with 1966 additions and 244 deletions
@@ -66,16 +66,58 @@
<label class="form-label">Total</label>
<input type="string" class="form-control" name="total" id="total" readonly value="{{ $form->total }}">
</div>
<div class="mb-3">
<label class="form-label">Bukti Total</label><br>
<a href="{{ $form->bukti_total }}" target="_blank">Lihat Bukti</a>
</div>
<div class="mb-3">
<label class="form-label">Keterangan</label>
<textarea class="form-control" name="keterangan" readonly>{{ $form->keterangan }}</textarea>
</div>
</div>
<div class="col-lg-12">
<hr class="my-4">
<h5 class="mb-3">Lampiran</h5>
<div class="table-responsive">
<table class="table table-bordered table-striped mb-0" id="entertainment-existing-attachments-table">
<thead class="bg-light">
<tr>
<th style="width: 30%;">Kategori</th>
<th>Nama File</th>
<th style="width: 120px;" class="text-center">Preview</th>
<th style="width: 120px;" class="text-center">Download</th>
</tr>
</thead>
<tbody>
@forelse ($attachments ?? [] as $attachment)
<tr class="entertainment-attachment-row">
<td>{{ $attachment['category_label'] ?? '-' }}</td>
<td>{{ $attachment['filename'] }}</td>
<td class="text-center">
<button type="button"
class="btn btn-sm btn-outline-secondary entertainment-preview-trigger"
data-preview-type="{{ $attachment['preview_type'] }}"
data-preview-source="{{ $attachment['preview_url'] ?? '' }}"
data-download-url="{{ $attachment['download_url'] ?? '' }}"
data-filename="{{ $attachment['filename'] }}">
Preview
</button>
</td>
<td class="text-center">
@if (!empty($attachment['download_url']))
<a href="{{ $attachment['download_url'] }}" class="btn btn-sm btn-outline-success" target="_blank" rel="noopener">Download</a>
@else
<span class="text-muted">Tidak tersedia</span>
@endif
</td>
</tr>
@empty
<tr class="entertainment-empty-row">
<td colspan="4" class="text-center text-muted">Belum ada attachment.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
<div class="col-lg-12">
<div class="mb-3">
<label class="form-label">Status</label>
@@ -433,4 +475,7 @@
$('#total').val('0'); // Reset total to 0
});
</script>
@include('backend.pages.forms.entertainment.partials.attachment-modal')
@include('backend.pages.forms.entertainment.partials.attachment-scripts')
@endsection