MIF_E31210049/Modules/User/Resources/views/pengajuan/index.blade.php

92 lines
4.3 KiB
PHP

@include('components.theme.pages.header')
<section>
<!-- basic table -->
<div class="row">
<div class="col-12">
<div class="d-flex mb-4">
<h1 class="h3 text-gray-800">{{ $data['subtitle'] }}</h1>
@if (!empty($data['button']))
<!--begin::Action-->
<div class="ml-auto">
@php
$url = $data['module']['url'];
@endphp
<a href="{{ $data['module']['url'] }}" class="btn btn-primary">
{{ explode(' ', $data['module']['name'])[0] }} <span
class="d-none d-sm-inline ps-2">{{ ucfirst(explode(' ', $data['module']['name'])[1]) }}</span>
</a>
</div>
@endif
</div>
<div class="card">
<div class="card-body">
@if (session()->has('success'))
<div class="alert alert-success">
{{ session()->get('success') }}
</div>
@else
@if (session()->has('error'))
<div class="alert alert-danger">
{{ session()->get('error') }}
</div>
@endif
@endif
<!--end::Wrapper-->
<div class="table-responsive">
<table id="data-table" class="table" width="100%">
<thead>
<tr class="text-start">
<th>ID</th>
<th>Nama Nasabah</th>
<th>Uplink AO</th>
<th>Status Pengajuan</th>
<th>Tanggal Ditambahkan</th>
</tr>
</thead>
<tbody>
@php $no = 1; @endphp
@foreach (\App\Models\PengajuanNasabah::all() as $data)
@php
$nasabah = \App\Models\Alternatif::where(
'id_alternatif',
$data->id_nasabah,
)->first();
$uplink = \App\Models\User::where('id', $data->uplink)->first();
@endphp
<tr>
<td>{{ $no++ }}</td>
<td>{{ $nasabah->nama_alternatif }}</td>
<td>{{ $uplink->name }}</td>
<td>{{ round($data->skor, 5) }}</td>
<td>
@php
if ($data->status == 1) {
echo '<span class="mb-1 badge font-medium badge-success py-2 px-3 fs-7">Diterima</span>';
} elseif ($data->status == 0) {
echo '<span class="mb-1 badge font-medium badge-primary py-2 px-3 fs-7">Menunggu Respon</span>';
} else {
echo '<span class="mb-1 badge font-medium badge-danger py-2 px-3 fs-7">Tidak diterima</span>';
}
@endphp
</td>
<td>{{ \Carbon\Carbon::parse($data->created_at)->format('d F Y, H:i:s') }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script>
$('#data-table').dataTable();
</script>
@endpush
@include('components.theme.pages.footer')