2024-12-12 18:18:26 +07:00
|
|
|
@extends('layouts.app')
|
|
|
|
|
|
|
|
|
|
@section('title')
|
|
|
|
|
Dashboard
|
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
|
|
@section('admin-content')
|
|
|
|
|
<section class="content-header">
|
|
|
|
|
<div class="container-fluid">
|
|
|
|
|
<div class="row mb-2">
|
|
|
|
|
<div class="col-sm-6">
|
|
|
|
|
<h1>Data Master Cost Centre</h1>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-sm-6">
|
|
|
|
|
<ol class="breadcrumb float-sm-right">
|
|
|
|
|
<li class="breadcrumb-item"><a href="{{ route('dashboard.index') }}">Dashboard</a></li>
|
|
|
|
|
</li>
|
|
|
|
|
</ol>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
<section class="content">
|
|
|
|
|
<div class="container-fluid">
|
|
|
|
|
<div class="card card-primary card-outline">
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<h4 class="header-title float-left">List Data Cost Centre</h4>
|
|
|
|
|
<p class="float-right mb-2">
|
2024-12-13 19:34:33 +07:00
|
|
|
@if (Auth::user()->can('cost.create'))
|
|
|
|
|
<a class="btn btn-primary text-white" href="{{ route('admin.cost.create') }}">
|
|
|
|
|
Add New Cost Centre
|
|
|
|
|
</a>
|
|
|
|
|
@endif
|
2024-12-12 18:18:26 +07:00
|
|
|
</p>
|
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
|
<div class="dataTables_wrapper dt-bootstrap4 mt-2">
|
|
|
|
|
@include('backend.layouts.partials.messages')
|
2025-01-02 18:21:03 +07:00
|
|
|
<div class="table-responsive">
|
|
|
|
|
<table id="dataTable"
|
|
|
|
|
class="table table-bordered table-striped table-head-fixed dataTable dtr-inline"
|
|
|
|
|
style="width:100%">
|
|
|
|
|
<thead class="bg-light text-capitalize">
|
|
|
|
|
<tr>
|
|
|
|
|
<th>#</th>
|
|
|
|
|
<th>Code</th>
|
|
|
|
|
<th>Nama</th>
|
|
|
|
|
<th>Aksi</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
@foreach ($costs as $cost)
|
|
|
|
|
<tr>
|
|
|
|
|
<td>{{ $loop->index + 1 }}</td>
|
|
|
|
|
<td>{{ $cost->code }}</td>
|
|
|
|
|
<td>{{ $cost->name }}</td>
|
|
|
|
|
<td>
|
2025-01-08 14:12:45 +07:00
|
|
|
@if (auth()->user()->can('cost.edit'))
|
2025-01-02 18:21:03 +07:00
|
|
|
<a class="btn btn-success btn-sm text-white" href="{{ route('admin.cost.edit', $cost->id) }}">Edit</a>
|
|
|
|
|
@endif
|
2025-01-08 14:12:45 +07:00
|
|
|
@if (auth()->user()->can('cost.delete'))
|
2025-01-02 18:21:03 +07:00
|
|
|
<a class="btn btn-danger text-white btn-sm" href="javascript:void(0);"
|
|
|
|
|
onclick="event.preventDefault(); if(confirm('Are you sure you want to delete?')) { document.getElementById('delete-form-{{ $cost->id }}').submit(); }">
|
|
|
|
|
{{ __('Delete') }}
|
|
|
|
|
</a>
|
2024-12-12 18:18:26 +07:00
|
|
|
|
2025-01-02 18:21:03 +07:00
|
|
|
<form id="delete-form-{{ $cost->id }}"
|
|
|
|
|
action="{{ route('admin.cost.destroy', $cost->id) }}"
|
|
|
|
|
method="POST" style="display: none;">
|
|
|
|
|
@method('DELETE')
|
|
|
|
|
@csrf
|
|
|
|
|
</form>
|
|
|
|
|
@endif
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
@endforeach
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
2024-12-12 18:18:26 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
|
|
@section('scripts')
|
|
|
|
|
<script>
|
2024-12-26 15:07:24 +07:00
|
|
|
$(document).ready(function () {
|
|
|
|
|
if ($('#dataTable').length) {
|
|
|
|
|
$('#dataTable').DataTable({
|
2025-01-02 18:21:03 +07:00
|
|
|
responsive: false,
|
2024-12-26 15:07:24 +07:00
|
|
|
dom: 'Bfrtip',
|
|
|
|
|
buttons: [
|
|
|
|
|
'excel', 'pdf', 'print'
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
2024-12-12 18:18:26 +07:00
|
|
|
</script>
|
|
|
|
|
@endsection
|