added form others

This commit is contained in:
Jagad R R
2024-12-20 11:07:07 +07:00
parent cd28280fb6
commit 53b60c42d6
18 changed files with 671 additions and 102 deletions
@@ -43,10 +43,6 @@
<label class="form-label">Hotel</label>
<input type="text" class="form-control" name="hotel" id="hotel" required value="{{ old('hotel') }}">
</div>
<div class="mb-3">
<label class="form-label">Total</label>
<input type="text" class="form-control" name="total" id="total" required value="{{ old('total') }}">
</div>
</div>
<div class="col-lg-6">
@@ -97,28 +93,4 @@
unformatOnSubmit: true // Nilai asli tanpa format saat dikirimkan
});
</script>
<script>
const allowance = document.getElementById('allowance');
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 transportAnkotValue = parseInt(transportAnkot.value) || 0;
const hotelValue = parseInt(hotel.value) || 0;
total.value = allowanceValue + transportAnkotValue + hotelValue;
}
// Attach event listeners
[allowance, transportAnkot, hotel].forEach(input => {
input.addEventListener('input', calculateTotal);
});
// Initial calculation on page load
calculateTotal();
</script>
@endsection