fix redirect

This commit is contained in:
Jagad R R
2024-12-26 13:28:06 +07:00
parent c8c37f8d10
commit 1bd9ffecba
8 changed files with 13 additions and 33 deletions
@@ -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