71 lines
2.8 KiB
PHP
71 lines
2.8 KiB
PHP
@extends('layouts.master')
|
|
|
|
@section('content')
|
|
{{-- <div class="container"> --}}
|
|
<div class="card shadow-sm">
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
|
<h5 class="mb-0 font-weight-bold">{{ @$title }}</h5>
|
|
<a href="{{ route($route.'.create') }}" class="btn btn-sm btn-primary float-right">Tambah Sumber Data EF</a>
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="table-responsive">
|
|
<table class="table w-100"
|
|
data-search="true"
|
|
data-toggle="table"
|
|
data-pagination="true"
|
|
data-toolbar="#toolbar"
|
|
data-show-refresh="false"
|
|
data-url="{{route($route.'.grid')}}"
|
|
data-ajax-options='{"xhrFields": {"withCredentials": true}}'
|
|
data-sort-name="ids"
|
|
data-sort-order="desc"
|
|
data-page-size="10"
|
|
data-id-field="id"
|
|
id="grid-data">
|
|
<thead class="table-primary text-primary">
|
|
<tr>
|
|
<th data-width="150" data-field="action">#</th>
|
|
<th data-field="code">Kode</th>
|
|
<th data-field="name">Nama</th>
|
|
<th data-field="description">Deskripsi</th>
|
|
<th data-field="no_baris">Nomor Baris</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{-- </div> --}}
|
|
@endsection
|
|
|
|
@section('js')
|
|
<script>
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// Delete confirmation
|
|
$(document).on('click', '.delete-button', function(e) {
|
|
e.preventDefault();
|
|
var form = $(this).closest('form');
|
|
var name = form.closest('tr').find('td').eq(1).text();
|
|
Swal.fire({
|
|
title: 'Apakah Anda yakin?',
|
|
text: 'Data "' + name + '" akan dihapus secara permanen!',
|
|
icon: 'warning',
|
|
showCancelButton: true,
|
|
confirmButtonColor: '#3085d6',
|
|
cancelButtonColor: '#d33',
|
|
confirmButtonText: 'Ya, hapus!',
|
|
cancelButtonText: 'Batal'
|
|
}).then((result) => {
|
|
if (result.isConfirmed) {
|
|
form.submit();
|
|
}
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
@endsection
|