sigd/resources/views/modules/tool/calculation/index.blade.php

93 lines
3.6 KiB
PHP

@extends('layouts.master')
@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">{{ @$title }}</h5>
<a href="{{ route($route.'.create') }}" class="btn btn-sm btn-primary float-right">Tambah {{ @$title }}</a>
</div>
<div class="card-body">
<div id="toolbar">
<div class="d-flex gap-3">
<div>
<select id="sector" name = "sector" class="form-control">
<option>SEMUA SEKTOR</option>
@foreach ($sectors as $sector)
<option value="{{ $sector->code }}"
{{ request('sector', null) == $sector->code ? 'selected' : '' }}>
{{ $sector->name }}
</option>
@endforeach
</select>
</div>
<div>
<select name="inventoryYear" id="inventoryYear" class="form-control">
<option>SEMUA TAHUN</option>
@for ($year = date('Y'); $year >= 2000; $year--)
<option value="{{ $year }}"
{{ old('inventoryYear') == $year ? 'selected' : '' }}>
{{ $year }}
</option>
@endfor
</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-field="created_at">Waktu Input</th>
<th data-field="inventory_year">Tahun Inventory</th>
<th data-field="sector">Sektor</th>
<th data-field="status">Status</th>
<th data-field="executed_time">Waktu Eksekusi</th>
<th data-field="finished_time">Waktu Selesai</th>
<th data-field="duration">Durasi</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
@endsection
@section('js')
<script>
$(document).ready(function() {
$('#sector').select2({
placeholder: 'Pilih Kategori',
// allowClear: true,
});
$('#inventoryYear').select2({
placeholder: 'Pilih Tahun',
// allowClear: true,
});
$('#sector').change(function() {
table.draw();
});
$('#inventoryYear').change(function() {
table.draw();
});
});
</script>
@endsection