first
This commit is contained in:
42
resources/views/admin/prizes/index.blade.php
Normal file
42
resources/views/admin/prizes/index.blade.php
Normal file
@@ -0,0 +1,42 @@
|
||||
@extends('layouts.app')
|
||||
@section('title', 'Urus Hadiah')
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<div class="text-muted">Susunan cabutan mengikut <code>draw_order</code>.</div>
|
||||
<a href="{{ route('admin.prizes.import') }}" class="btn btn-outline-teal"><i class="bi bi-upload"></i> Import Hadiah</a>
|
||||
</div>
|
||||
|
||||
<div class="card"><div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-koipb table-hover align-middle">
|
||||
<thead><tr><th>Susunan</th><th>Kod</th><th>Hadiah</th><th>Kategori</th><th>Nilai (RM)</th><th>Status</th><th>Pemenang</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
@forelse($prizes as $p)
|
||||
@php $pill = ['belum_dicabut'=>'pill-belum','sedang_dicabut'=>'pill-sedang','disahkan'=>'pill-disahkan','redraw_required'=>'pill-redraw'][$p->status]; @endphp
|
||||
<tr>
|
||||
<td><span class="badge bg-dark2">#{{ $p->draw_order }}</span></td>
|
||||
<td>{{ $p->kod_hadiah ?? '-' }}</td>
|
||||
<td class="fw-semibold">{{ $p->nama_hadiah }}</td>
|
||||
<td>{{ $p->kategori ?? '-' }}</td>
|
||||
<td>{{ $p->nilai_anggaran ? number_format($p->nilai_anggaran, 2) : '-' }}</td>
|
||||
<td><span class="pill {{ $pill }}">{{ $p->statusLabel() }}</span>
|
||||
@if($p->redraw_count) <small class="text-muted">({{ $p->redraw_count }}x redraw)</small>@endif</td>
|
||||
<td>{{ $p->drawResults->firstWhere('status','confirmed')?->member?->nama ?? '-' }}</td>
|
||||
<td class="text-end">
|
||||
<a href="{{ route('admin.prizes.edit', $p) }}" class="btn btn-sm btn-outline-secondary"><i class="bi bi-pencil"></i></a>
|
||||
<form action="{{ route('admin.prizes.destroy', $p) }}" method="POST" class="d-inline" onsubmit="return confirm('Padam hadiah ini?')">
|
||||
@csrf @method('DELETE')
|
||||
<button class="btn btn-sm btn-outline-danger" @disabled($p->status==='disahkan')><i class="bi bi-trash"></i></button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="8" class="text-center text-muted py-4">Tiada hadiah. Sila import senarai hadiah.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ $prizes->links() }}
|
||||
</div></div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user