MIF_E31210049/resources/views/admin/app/content/pengajuan/index.blade.php

106 lines
5.7 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>Skor Preferensi</th>
<th>Status Pengajuan</th>
<th>Tanggal Ditambahkan</th>
@if (Auth::user()->level == 1)
<th>Aksi</th>
@endif
</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>
@if (Auth::user()->level == 1)
<td>
@if($data->status == 0)
<button class="btn btn-secondary btn-sm dropdown-toggle" type="button"
id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
Aksi
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="{{ app_url('pengajuan-nasabah') . '/accept' }}/{{ $data->id_pengajuan }}">Terima</a>
<a class="dropdown-item" href="{{ app_url('pengajuan-nasabah') . '/decline' }}/{{ $data->id_pengajuan }}">Tolak</a>
</div>
@endif
</td>
@endif
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script>
$('#data-table').dataTable();
</script>
@endpush
@include('components.theme.pages.footer')