fix redirect
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
@if (Session::has('success'))
|
||||
<script>
|
||||
@@ -22,6 +21,9 @@
|
||||
}).then(() => {
|
||||
if ("{{ Session::get('redirect_url') }}") {
|
||||
window.location.href = "{{ Session::get('redirect_url') }}";
|
||||
@php
|
||||
Session::forget('redirect_url');
|
||||
@endphp
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -37,6 +39,9 @@
|
||||
}).then(() => {
|
||||
if ("{{ Session::get('redirect_url') }}") {
|
||||
window.location.href = "{{ Session::get('redirect_url') }}";
|
||||
@php
|
||||
Session::forget('redirect_url');
|
||||
@endphp
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -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