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>Tambahkan Expense Up Country 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">
|
2024-12-16 17:01:55 +07:00
|
|
|
<form method="POST" action="{{ route('forms.up-country.store') }}" enctype="multipart/form-data">
|
|
|
|
|
@csrf
|
|
|
|
|
@include('backend.layouts.partials.messages')
|
2024-12-12 18:18:26 +07:00
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-lg-6">
|
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label class="form-label">Pilih Rayon</label>
|
2024-12-16 17:01:55 +07:00
|
|
|
<select class="form-control form-control-md" name="rayon_id" required>
|
2024-12-12 18:18:26 +07:00
|
|
|
<option value="">Pilih Rayon</option>
|
|
|
|
|
@foreach ($rayons as $rayon)
|
|
|
|
|
<option value="{{ $rayon->id }}">{{ $rayon->name }}</option>
|
|
|
|
|
@endforeach
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label class="form-label">Tanggal</label>
|
2024-12-16 17:01:55 +07:00
|
|
|
<input type="date" class="form-control" name="tanggal" required value="{{ old('tanggal') }}">
|
2024-12-12 18:18:26 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label class="form-label">Tujuan</label>
|
2024-12-16 17:01:55 +07:00
|
|
|
<input type="text" class="form-control" name="tujuan" required value="{{ old('tujuan') }}">
|
2024-12-12 18:18:26 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label class="form-label">Jarak</label>
|
2024-12-16 17:01:55 +07:00
|
|
|
<input type="number" class="form-control" name="jarak" required value="{{ old('jarak') }}">
|
2024-12-12 18:18:26 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label class="form-label">Allowance</label>
|
2024-12-16 17:01:55 +07:00
|
|
|
<input type="number" class="form-control" name="allowance" id="allowance" required value="{{ old('allowance') }}">
|
2024-12-12 18:18:26 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label class="form-label">Transport Dalam Kota</label>
|
2024-12-16 17:01:55 +07:00
|
|
|
<input type="number" class="form-control" name="transport_dalkot" id="transport_dalkot" required value="{{ old('transport_dalkot') }}">
|
2024-12-12 18:18:26 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-lg-6">
|
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label class="form-label">Transport Antar Kota</label>
|
2024-12-16 17:01:55 +07:00
|
|
|
<input type="number" class="form-control" name="transport_ankot" id="transport_ankot" required value="{{ old('transport_ankot') }}">
|
2024-12-12 18:18:26 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label class="form-label">Hotel</label>
|
2024-12-16 17:01:55 +07:00
|
|
|
<input type="number" class="form-control" name="hotel" id="hotel" required value="{{ old('hotel') }}">
|
2024-12-12 18:18:26 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label class="form-label">Total</label>
|
2024-12-16 17:01:55 +07:00
|
|
|
<input type="number" class="form-control" name="total" id="total" required value="{{ old('total') }}" readonly>
|
2024-12-12 18:18:26 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label class="form-label">Bukti 1</label>
|
2024-12-16 17:01:55 +07:00
|
|
|
<input type="file" class="form-control" name="bukti1" value="{{ old('bukti1') }}">
|
2024-12-12 18:18:26 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label class="form-label">Bukti 2</label>
|
2024-12-16 17:01:55 +07:00
|
|
|
<input type="file" class="form-control" name="bukti2" value="{{ old('bukti2') }}">
|
2024-12-12 18:18:26 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label class="form-label">Bukti 3</label>
|
2024-12-16 17:01:55 +07:00
|
|
|
<input type="file" class="form-control" name="bukti3" value="{{ old('bukti3') }}">
|
2024-12-12 18:18:26 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<button type="submit" class="btn btn-primary ml-2">Submit</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
2024-12-16 17:01:55 +07:00
|
|
|
|
|
|
|
|
<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>
|
2024-12-12 18:18:26 +07:00
|
|
|
@endsection
|