Files
portal-api/resources/views/admin/payment/index.blade.php
T
2025-07-24 16:18:27 +07:00

93 lines
4.3 KiB
PHP

@extends("admin.main")
@section("content")
@if(auth()->guard('admins')->user()->can('manager payment'))
<div class="card card-primary card-outline">
<div class="card-header">
<a href="{{ route('payment.create') }}" class="btn btn-outline-secondary">
<i class="fas fa-plus"></i> Add New Payment Method
</a>
</div>
<div class="card-body">
<table class="table table-invoice table-bordered">
<thead>
<tr>
<th style="width: 10px">
<label for=""></label><input type="checkbox" name="check" class="check-all" id="">
</th>
<th>Name</th>
<th>AccountNo</th>
<th>Bank Name</th>
<th>Logo</th>
<th>Type</th>
<th>Status</th>
<th style="width: 40px"></th>
<th style="width: 40px"></th>
</tr>
</thead>
<tbody>
@if($payments->count())
@foreach($payments->all() as $item)
<tr>
<td class="text-center">
<input type="checkbox" name="id[]" id="" value="{{ $item->id }}">
</td>
<td class="text-center">
{{ $item->name }}
</td>
<td class="text-center">
{{ $item->accountNo }}
</td>
<td class="text-center">
{{ $item->bankName }}
</td>
<td class="text-center">
@if($item->logo)
<img src="{{ $item->logo }}" width="100" alt="Logo {{ $item->name }}">
@endif
</td>
<td class="text-center">
{{ $item->type == 1 ? "Auto Banking" : "Manual" }}
</td>
<td class="text-center">
{!! $item->getStatus() !!}
</td>
<td>
<a class="btn btn-warning btn-sm"
href="{{ route('payment.edit',['id' => $item->id]) }}">
<i class="fas fa-user-edit"></i>
</a>
</td>
<td>
@if(auth()->guard('admins')->user()->can('delete payment'))
<form method="post" class="d-inline"
action="{{ route('payment.destroy', ['id' => $item->id]) }}">
@csrf
@method('delete')
<button type="submit" data-toggle="tooltip" data-placement="top" title=""
class="btn btn-sm btn-danger" data-original-title="Xoá">
<i class="fas fa-trash"></i>
</button>
</form>
@endif
</td>
@endforeach
@endif
</tbody>
</table>
</div>
<div class="card-footer">
{{ $payments->withQueryString()->links() }}
</div>
</div>
@else
<div class="alert alert-danger alert-dismissible">
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Payment
management department</h5>
</div>
@endif
@endsection