77 lines
2.7 KiB
PHP
77 lines
2.7 KiB
PHP
@extends('layouts.master')
|
|
|
|
@section('title', 'List Unit')
|
|
|
|
@section('content')
|
|
<div class="card shadow-sm">
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
|
<h5 class="mb-0 font-weight-bold">List Unit</h5>
|
|
<a href="{{ route($route.'.create') }}" class="btn btn-sm btn-primary">Tambah Unit</a>
|
|
</div>
|
|
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="row">
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<label for="categoryFilter">Filter Kategori:</label>
|
|
<select id="categoryFilter" class="form-control">
|
|
<option>SEMUA KATEGORI</option>
|
|
@foreach ($categories as $category)
|
|
<option value="{{ $category }}">{{ $category }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<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="category">Kategori</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>
|
|
@endsection
|
|
|
|
@section('js')
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('#categoryFilter').select2({
|
|
placeholder: 'Pilih Kategori',
|
|
});
|
|
});
|
|
|
|
$(document).ready(function() {
|
|
|
|
var table = $('#grid-data');
|
|
$('#categoryFilter').change(function() {
|
|
table.draw();
|
|
});
|
|
});
|
|
</script>
|
|
@endsection
|