81 lines
3.1 KiB
PHP
81 lines
3.1 KiB
PHP
<div class="container">
|
|
<div class="card border" style="border-color: #E6ECF5;">
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
|
<h2 class="mb-0">Top-Up</h2>
|
|
<a href="{{ route('top-up.create') }}" class="btn btn-primary">Add</a>
|
|
</div>
|
|
<div class="card-body">
|
|
@if(session('success'))
|
|
<div class="alert alert-success mb-3" role="alert">
|
|
{{ session('success') }}
|
|
</div>
|
|
@endif
|
|
@if(session('error'))
|
|
<div class="alert alert-danger mb-3" role="alert">
|
|
{{ session('error') }}
|
|
</div>
|
|
@endif
|
|
|
|
@if($loading)
|
|
<div class="text-center">
|
|
<div class="spinner-border text-primary" role="status">
|
|
<span class="visually-hidden">Loading...</span>
|
|
</div>
|
|
</div>
|
|
@else
|
|
<table class="table table-bordered table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>Fee Code</th>
|
|
<th>Name</th>
|
|
<th>Value</th>
|
|
<th>Type</th>
|
|
<th>Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse($topUps as $topUp)
|
|
<tr>
|
|
<td>{{ $topUp['fee_code'] ?? '' }}</td>
|
|
<td>{{ $topUp['name'] ?? '' }}</td>
|
|
<td>{{ $topUp['amount'] ?? '' }}</td>
|
|
<td>{{ $topUp['type'] ?? '' }}</td>
|
|
<td>
|
|
<a href="{{ route('top-up.view', ['id' => $topUp['id']]) }}" class="btn btn-sm btn-outline-primary me-1">View</a>
|
|
<a href="{{ route('top-up.edit', ['id' => $topUp['id']]) }}" class="btn btn-sm btn-outline-secondary">Edit</a>
|
|
<!-- Delete not implemented; add if needed -->
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="5" class="text-center">No top-ups found.</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@if(session('success'))
|
|
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
|
<script>
|
|
Swal.fire({
|
|
icon: 'success',
|
|
title: 'Success',
|
|
text: '{{ session('success') }}',
|
|
});
|
|
</script>
|
|
@endif
|
|
|
|
@if(session('error'))
|
|
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
|
<script>
|
|
Swal.fire({
|
|
icon: 'error',
|
|
title: 'Error',
|
|
text: '{{ session('error') }}',
|
|
});
|
|
</script>
|
|
@endif |