fix redirect
This commit is contained in:
@@ -70,10 +70,6 @@
|
||||
<label class="form-label">Hotel</label>
|
||||
<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" 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" name="bukti1" value="{{ old('bukti1') }}">
|
||||
@@ -95,30 +91,4 @@
|
||||
</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
|
||||
|
||||
Reference in New Issue
Block a user