added forms country & vehicle running cost (kurang fitur pendukung)
This commit is contained in:
@@ -24,12 +24,14 @@
|
||||
<div class="container-fluid">
|
||||
<div class="card card-primary card-outline">
|
||||
<div class="card-body">
|
||||
<form>
|
||||
<form method="POST" action="{{ route('forms.up-country.store') }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@include('backend.layouts.partials.messages')
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Pilih Rayon</label>
|
||||
<select class="form-control form-control-md">
|
||||
<select class="form-control form-control-md" name="rayon_id" required>
|
||||
<option value="">Pilih Rayon</option>
|
||||
@foreach ($rayons as $rayon)
|
||||
<option value="{{ $rayon->id }}">{{ $rayon->name }}</option>
|
||||
@@ -38,50 +40,50 @@
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Tanggal</label>
|
||||
<input type="date" class="form-control">
|
||||
<input type="date" class="form-control" name="tanggal" required value="{{ old('tanggal') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Tujuan</label>
|
||||
<input type="text" class="form-control">
|
||||
<input type="text" class="form-control" name="tujuan" required value="{{ old('tujuan') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Jarak</label>
|
||||
<input type="number" class="form-control">
|
||||
<input type="number" class="form-control" name="jarak" required value="{{ old('jarak') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Allowance</label>
|
||||
<input type="number" class="form-control">
|
||||
<input type="number" class="form-control" name="allowance" id="allowance" required value="{{ old('allowance') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Transport Dalam Kota</label>
|
||||
<input type="number" class="form-control">
|
||||
<input type="number" class="form-control" name="transport_dalkot" id="transport_dalkot" required value="{{ old('transport_dalkot') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Transport Antar Kota</label>
|
||||
<input type="number" class="form-control">
|
||||
<input type="number" class="form-control" name="transport_ankot" id="transport_ankot" required value="{{ old('transport_ankot') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Hotel</label>
|
||||
<input type="number" class="form-control">
|
||||
<input type="number" class="form-control" name="hotel" id="hotel" required value="{{ old('hotel') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Total</label>
|
||||
<input type="number" class="form-control">
|
||||
<input type="number" class="form-control" name="total" id="total" required value="{{ old('total') }}" readonly>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Bukti 1</label>
|
||||
<input type="file" class="form-control">
|
||||
<input type="file" class="form-control" name="bukti1" value="{{ old('bukti1') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Bukti 2</label>
|
||||
<input type="file" class="form-control">
|
||||
<input type="file" class="form-control" name="bukti2" value="{{ old('bukti2') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Bukti 3</label>
|
||||
<input type="file" class="form-control">
|
||||
<input type="file" class="form-control" name="bukti3" value="{{ old('bukti3') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -92,4 +94,30 @@
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
const allowance = document.getElementById('allowance');
|
||||
const transportDalkot = document.getElementById('transport_dalkot');
|
||||
const transportAnkot = document.getElementById('transport_ankot');
|
||||
const hotel = document.getElementById('hotel');
|
||||
const total = document.getElementById('total');
|
||||
|
||||
// Function to calculate total
|
||||
function calculateTotal() {
|
||||
const allowanceValue = parseInt(allowance.value) || 0;
|
||||
const transportDalkotValue = parseInt(transportDalkot.value) || 0;
|
||||
const transportAnkotValue = parseInt(transportAnkot.value) || 0;
|
||||
const hotelValue = parseInt(hotel.value) || 0;
|
||||
|
||||
total.value = allowanceValue + transportDalkotValue + transportAnkotValue + hotelValue;
|
||||
}
|
||||
|
||||
// Attach event listeners
|
||||
[allowance, transportDalkot, transportAnkot, hotel].forEach(input => {
|
||||
input.addEventListener('input', calculateTotal);
|
||||
});
|
||||
|
||||
// Initial calculation on page load
|
||||
calculateTotal();
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -24,72 +24,101 @@
|
||||
<div class="container-fluid">
|
||||
<div class="card card-primary card-outline">
|
||||
<div class="card-body">
|
||||
<form>
|
||||
<form method="POST" action="{{ route('forms.up-country.update', $form->id) }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@include('backend.layouts.partials.messages')
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Pilih Rayon</label>
|
||||
<select class="form-control form-control-md">
|
||||
<select class="form-control form-control-md" name="rayon_id" required>
|
||||
<option value="">Pilih Rayon</option>
|
||||
@foreach ($rayons as $rayon)
|
||||
<option value="{{ $rayon->id }}">{{ $rayon->name }}</option>
|
||||
<option value="{{ $rayon->id }}" {{ $form->rayon_id == $rayon->id ? 'selected' : '' }}>{{ $rayon->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Tanggal</label>
|
||||
<input type="date" class="form-control">
|
||||
<input type="date" class="form-control" name="tanggal" required value="{{ $form->tanggal }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Tujuan</label>
|
||||
<input type="text" class="form-control">
|
||||
<input type="text" class="form-control" name="tujuan" required value="{{ $form->tujuan }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Jarak</label>
|
||||
<input type="number" class="form-control">
|
||||
<input type="number" class="form-control" name="jarak" required value="{{ $form->jarak }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Allowance</label>
|
||||
<input type="number" class="form-control">
|
||||
<input type="number" class="form-control" name="allowance" id="allowance" required value="{{ $form->allowance }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Transport Dalam Kota</label>
|
||||
<input type="number" class="form-control">
|
||||
<input type="number" class="form-control" name="transport_dalkot" id="transport_dalkot" required value="{{ $form->transport_dalkot }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Transport Antar Kota</label>
|
||||
<input type="number" class="form-control">
|
||||
<input type="number" class="form-control" name="transport_ankot" id="transport_ankot" required value="{{ $form->transport_ankot }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Hotel</label>
|
||||
<input type="number" class="form-control">
|
||||
<input type="number" class="form-control" name="hotel" id="hotel" required value="{{ $form->hotel }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Total</label>
|
||||
<input type="number" class="form-control">
|
||||
<input type="number" class="form-control" name="total" id="total" required value="{{ $form->total }}" readonly>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Bukti 1</label>
|
||||
<input type="file" class="form-control">
|
||||
<input type="file" class="form-control" name="bukti1" value="{{ old('bukti1') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Bukti 2</label>
|
||||
<input type="file" class="form-control">
|
||||
<input type="file" class="form-control" name="bukti2" value="{{ old('bukti2') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Bukti 3</label>
|
||||
<input type="file" class="form-control">
|
||||
<input type="file" class="form-control" name="bukti3" value="{{ old('bukti3') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary ml-2">Submit</button>
|
||||
<button type="submit" class="btn btn-primary ml-2">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
const allowance = document.getElementById('allowance');
|
||||
const transportDalkot = document.getElementById('transport_dalkot');
|
||||
const transportAnkot = document.getElementById('transport_ankot');
|
||||
const hotel = document.getElementById('hotel');
|
||||
const total = document.getElementById('total');
|
||||
|
||||
// Function to calculate total
|
||||
function calculateTotal() {
|
||||
const allowanceValue = parseInt(allowance.value) || 0;
|
||||
const transportDalkotValue = parseInt(transportDalkot.value) || 0;
|
||||
const transportAnkotValue = parseInt(transportAnkot.value) || 0;
|
||||
const hotelValue = parseInt(hotel.value) || 0;
|
||||
|
||||
total.value = allowanceValue + transportDalkotValue + transportAnkotValue + hotelValue;
|
||||
}
|
||||
|
||||
// Attach event listeners
|
||||
[allowance, transportDalkot, transportAnkot, hotel].forEach(input => {
|
||||
input.addEventListener('input', calculateTotal);
|
||||
});
|
||||
|
||||
// Initial calculation on page load
|
||||
calculateTotal();
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -26,9 +26,11 @@
|
||||
<div class="card-body">
|
||||
<h4 class="header-title float-left">List Data Forms Up Country Anda</h4>
|
||||
<p class="float-right mb-2">
|
||||
<a class="btn btn-primary text-white" href="">
|
||||
Add New Expense Up Country
|
||||
</a>
|
||||
@if (auth()->user()->can('forms.country.create'))
|
||||
<a class="btn btn-primary text-white" href="{{ route('forms.up-country.create') }}">
|
||||
Add New Expense Up Country
|
||||
</a>
|
||||
@endif
|
||||
</p>
|
||||
<div class="clearfix"></div>
|
||||
<div class="dataTables_wrapper dt-bootstrap4 mt-2">
|
||||
@@ -45,41 +47,58 @@
|
||||
<th>Tujuan</th>
|
||||
<th>Jarak</th>
|
||||
<th>Allowance</th>
|
||||
<th>Transport Dalkot</th>
|
||||
<th>Transport Ankot</th>
|
||||
<th>Hotel</th>
|
||||
<th>Total</th>
|
||||
<th>Bukti 1</th>
|
||||
<th>Bukti 2</th>
|
||||
<th>Bukti 3</th>
|
||||
<th>Account Number</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>John Doe</td>
|
||||
<td>Rayon 1</td>
|
||||
<td>2021-09-01</td>
|
||||
<td>Surabaya</td>
|
||||
<td>100</td>
|
||||
<td>100000</td>
|
||||
<td>10000</td>
|
||||
<td>5000</td>
|
||||
<td>50000</td>
|
||||
<td>file1.jpg</td>
|
||||
<td>file2.jpg</td>
|
||||
<td>file3.jpg</td>
|
||||
<td>1234567890</td>
|
||||
<td>
|
||||
<a href="" class="btn btn-warning btn-sm">
|
||||
<i class="fas fa-edit text-white"></i>
|
||||
</a>
|
||||
<a href="" class="btn btn-danger btn-sm">
|
||||
<i class="fas fa-trash"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@foreach ($forms as $item)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $item->user->name }}</td>
|
||||
<td>{{ $item->rayon->code }}</td>
|
||||
<td>{{ $item->tanggal }}</td>
|
||||
<td>{{ $item->tujuan }}</td>
|
||||
<td>{{ $item->jarak }} km</td>
|
||||
<td>{{ number_format($item->allowance, 0, ',', '.') }}</td>
|
||||
<td>{{ number_format($item->total, 0, ',', '.') }}</td>
|
||||
<td>{{ $item->bukti1 }}</td>
|
||||
<td>{{ $item->bukti2 }}</td>
|
||||
<td>{{ $item->bukti3 }}</td>
|
||||
<td>{{ $item->account_number }}</td>
|
||||
<td>
|
||||
@if ($item->status == 'On Progress')
|
||||
<span class="badge badge-warning text-white">{{ $item->status }}</span>
|
||||
@elseif ($item->status == 'Completed')
|
||||
<span class="badge badge-success text-white">{{ $item->status }}</span>
|
||||
@else
|
||||
<span class="badge badge-danger text-white">{{ $item->status }}</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if (auth()->user()->can('forms.country.edit'))
|
||||
<a href="{{ route('forms.up-country.edit', $item->id) }}" class="btn btn-warning btn-sm">
|
||||
<i class="fas fa-edit text-white"></i>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if (auth()->user()->can('forms.country.delete'))
|
||||
<form action="{{ route('forms.up-country.destroy', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
@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>Tambahkan Expense Vehicle Running Cost Baru</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">
|
||||
<form method="POST" action="{{ route('forms.vehicle.store') }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@include('backend.layouts.partials.messages')
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Tanggal</label>
|
||||
<input type="datetime-local" class="form-control" name="tanggal" required value="{{ old('tanggal') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Liter Bensin</label>
|
||||
<input type="text" class="form-control" name="liter" required value="{{ old('liter') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Harga Bensin</label>
|
||||
<input type="number" class="form-control" name="harga" required value="{{ old('harga') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Jarak</label>
|
||||
<input type="number" class="form-control" name="jarak" id="jarak" required value="{{ old('jarak') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Keterangan</label>
|
||||
<textarea class="form-control" name="keterangan" id="keterangan" required>
|
||||
{{ old('keterangan') }}
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Tipe Bensin</label>
|
||||
<select class="form-control" name="tipe_bensin" required value="{{ old('tipe_bensin') }}">
|
||||
<option value="pertamax">Pertamax</option>
|
||||
<option value="pertalite">Pertalite</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Nomor Polisi</label>
|
||||
<input type="text" class="form-control" name="nopol" id="nopol" required value="{{ old('nopol') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Bukti 1</label>
|
||||
<input type="file" class="form-control" name="bukti1" value="{{ old('bukti1') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Bukti 2</label>
|
||||
<input type="file" class="form-control" name="bukti2" value="{{ old('bukti2') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Bukti 3</label>
|
||||
<input type="file" class="form-control" name="bukti3" value="{{ old('bukti3') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary ml-2">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
@@ -0,0 +1,88 @@
|
||||
@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>Edit Expense Vehicle Running Cost</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">
|
||||
<form method="POST" action="{{ route('forms.vehicle.update', $form->id) }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@include('backend.layouts.partials.messages')
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Tanggal</label>
|
||||
<input type="datetime-local" class="form-control" name="tanggal" required value="{{ $form->tanggal }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Liter Bensin</label>
|
||||
<input type="text" class="form-control" name="liter" required value="{{ $form->liter }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Harga Bensin</label>
|
||||
<input type="number" class="form-control" name="harga" required value="{{ $form->harga }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Jarak</label>
|
||||
<input type="number" class="form-control" name="jarak" id="jarak" required value="{{ $form->jarak }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Keterangan</label>
|
||||
<textarea class="form-control" name="keterangan" id="keterangan" required>{{ $form->keterangan }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Tipe Bensin</label>
|
||||
<select class="form-control" name="tipe_bensin" required>
|
||||
<option value="pertamax" {{ $form->tipe_bensin == 'pertamax' ? 'selected' : '' }}>Pertamax</option>
|
||||
<option value="pertalite" {{ $form->tipe_bensin == 'pertalite' ? 'selected' : '' }}>Pertalite</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Nomor Polisi</label>
|
||||
<input type="text" class="form-control" name="nopol" id="nopol" required value="{{ $form->nopol }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Bukti 1</label>
|
||||
<input type="file" class="form-control" name="bukti1" value="{{ $form->bukti1 }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Bukti 2</label>
|
||||
<input type="file" class="form-control" name="bukti2" value="{{ $form->bukti2 }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Bukti 3</label>
|
||||
<input type="file" class="form-control" name="bukti3" value="{{ $form->bukti3 }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary ml-2">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
@@ -0,0 +1,109 @@
|
||||
@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>Forms Vehicle Running Cost</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 Forms Vehicle Running Cost Anda</h4>
|
||||
<p class="float-right mb-2">
|
||||
@if (auth()->user()->can('forms.vehicle.create'))
|
||||
<a class="btn btn-primary text-white" href="{{ route('forms.vehicle.create') }}">
|
||||
Add New Expense Vehicle Running Cost
|
||||
</a>
|
||||
@endif
|
||||
</p>
|
||||
<div class="clearfix"></div>
|
||||
<div class="dataTables_wrapper dt-bootstrap4 mt-2">
|
||||
@include('backend.layouts.partials.messages')
|
||||
<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>Nama</th>
|
||||
<th>Tanggal</th>
|
||||
<th>Liter</th>
|
||||
<th>Harga</th>
|
||||
<th>Jarak</th>
|
||||
<th>Tipe Bensin</th>
|
||||
<th>Nomor Polisi</th>
|
||||
<th>Bukti 1</th>
|
||||
<th>Bukti 2</th>
|
||||
<th>Bukti 3</th>
|
||||
<th>Account Number</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($forms as $item)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $item->user->name }}</td>
|
||||
<td>{{ \Carbon\Carbon::parse($item->tanggal)->locale('id')->isoFormat('dddd, D MMMM Y HH:mm:ss') }}</td>
|
||||
<td>{{ $item->liter }}</td>
|
||||
<td>{{ $item->harga }}</td>
|
||||
<td>{{ $item->jarak }}</td>
|
||||
<td>{{ $item->tipe_bensin }}</td>
|
||||
<td>{{ $item->nopol }}</td>
|
||||
<td>{{ $item->bukti1 }}</td>
|
||||
<td>{{ $item->bukti2 }}</td>
|
||||
<td>{{ $item->bukti3 }}</td>
|
||||
<td>{{ $item->account_number }}</td>
|
||||
<td>
|
||||
@if ($item->status == 'On Progress')
|
||||
<span class="badge badge-warning text-white">{{ $item->status }}</span>
|
||||
@elseif ($item->status == 'Completed')
|
||||
<span class="badge badge-success text-white">{{ $item->status }}</span>
|
||||
@else
|
||||
<span class="badge badge-danger text-white">{{ $item->status }}</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if (auth()->user()->can('forms.vehicle.edit'))
|
||||
<a href="{{ route('forms.vehicle.edit', $item->id) }}" class="btn btn-warning btn-sm">
|
||||
<i class="fas fa-edit text-white"></i>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if (auth()->user()->can('forms.vehicle.delete'))
|
||||
<form action="{{ route('forms.vehicle.destroy', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user