Files
prn2026/resources/views/admin/management/wheelchairs/index.blade.php
2026-06-03 08:51:22 +08:00

92 lines
4.4 KiB
PHP

@extends('layouts.app')
@section('title', 'Kerusi Roda')
@section('content')
<div class="page-heading">
<div class="eyebrow">Admin</div>
<div class="d-flex justify-content-between flex-column flex-lg-row gap-3">
<div>
<h1 class="h3 mb-1">Pengurusan Kerusi Roda</h1>
<p class="text-secondary mb-0">Peruntukan, rekod ambil, rekod pulang, keadaan, dan catatan kerusi roda.</p>
</div>
</div>
</div>
@include('admin.management._nav')
<div class="content-panel p-3 p-md-4 mb-4">
<h2 class="h5 mb-3">Tetapkan Peruntukan</h2>
<form method="POST" action="{{ route('admin.management.wheelchairs.store') }}">
@csrf
<div class="row g-3">
<div class="col-md-3">
<label class="form-label" for="election_id">Pilihanraya</label>
<select class="form-select" id="election_id" name="election_id" required>
@foreach ($elections as $election)
<option value="{{ $election->id }}">{{ $election->name }}</option>
@endforeach
</select>
</div>
<div class="col-md-5">
<label class="form-label" for="pusat_mengundi_id">Pusat Mengundi</label>
<select class="form-select" id="pusat_mengundi_id" name="pusat_mengundi_id" required>
@foreach ($pusats as $pusat)
<option value="{{ $pusat->id }}">{{ $pusat->code }} - {{ $pusat->name }}</option>
@endforeach
</select>
</div>
<div class="col-md-2">
<label class="form-label" for="allocated_quantity">Jumlah</label>
<input class="form-control" id="allocated_quantity" name="allocated_quantity" type="number" min="0" value="0" required>
</div>
<div class="col-md-2 d-flex align-items-end">
<button class="btn btn-primary w-100" type="submit"><i class="bi bi-save me-1"></i>Simpan</button>
</div>
<div class="col-12">
<label class="form-label" for="notes">Nota</label>
<textarea class="form-control" id="notes" name="notes" rows="2"></textarea>
</div>
</div>
</form>
</div>
<div class="content-panel p-0 overflow-hidden">
<div class="table-responsive">
<table class="table table-hover align-middle mb-0">
<thead>
<tr>
<th>Pusat Mengundi</th>
<th>Peruntukan</th>
<th>Diambil</th>
<th>Dipulang</th>
<th>Belum Dipulang</th>
<th>Baki Boleh Diambil</th>
<th class="text-end no-sort">Tindakan</th>
</tr>
</thead>
<tbody>
@forelse ($allocations as $allocation)
<tr>
<td>
<div class="fw-semibold">{{ $allocation->pusatMengundi?->code }} - {{ $allocation->pusatMengundi?->name }}</div>
<div class="small text-secondary">{{ $allocation->election?->name }}</div>
</td>
<td>{{ $allocation->allocated_quantity }}</td>
<td>{{ $service->takenQuantity($allocation) }}</td>
<td>{{ $service->returnedQuantity($allocation) }}</td>
<td><span class="badge text-bg-warning">{{ $service->outstandingQuantity($allocation) }}</span></td>
<td><span class="badge text-bg-success">{{ $service->availableQuantity($allocation) }}</span></td>
<td class="text-end"><a class="btn btn-sm btn-outline-primary" href="{{ route('admin.management.wheelchairs.show', $allocation) }}">Urus</a></td>
</tr>
@empty
<tr><td colspan="7" class="text-center text-secondary py-4">Tiada peruntukan kerusi roda.</td></tr>
@endforelse
</tbody>
</table>
</div>
</div>
<div class="mt-3">{{ $allocations->links() }}</div>
@endsection