116 lines
4.4 KiB
PHP
116 lines
4.4 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>Kode Nasabah</th>
|
|
<th>Tanggal</th>
|
|
<th>Aksi</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
@push('scripts')
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
|
|
var table = $('#data-table').DataTable({
|
|
processing: true,
|
|
serverSide: true,
|
|
ajax: "{{ route('nasabah') }}",
|
|
columns: [{
|
|
data: null,
|
|
name: 'id_alternatif'
|
|
},
|
|
{
|
|
data: 'title-post',
|
|
name: 'title-post'
|
|
},
|
|
{
|
|
data: 'kode',
|
|
name: 'kode'
|
|
},
|
|
{
|
|
data: 'created_at',
|
|
name: 'created_at'
|
|
},
|
|
{
|
|
data: null,
|
|
name: 'action',
|
|
orderable: false,
|
|
searchable: false
|
|
},
|
|
],
|
|
columnDefs: [{
|
|
targets: -1,
|
|
data: null,
|
|
orderable: false,
|
|
render: function(data, type, row) {
|
|
return `
|
|
<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="{{ site_url('user', 'nasabah') . '/edit' }}/${row.id_alternatif}">Edit</a>
|
|
<a class="dropdown-item" href="{{ site_url('user', 'nasabah') . '/delete' }}/${row.id_alternatif}">Hapus</a>
|
|
</div>
|
|
`;
|
|
},
|
|
}],
|
|
createdRow: function(row, data, dataIndex) {
|
|
// Set the sequential number starting from 1
|
|
$('td', row).eq(0).html(dataIndex + 1);
|
|
}
|
|
});
|
|
|
|
});
|
|
</script>
|
|
@endpush
|
|
@include('components.theme.pages.footer')
|