|
|
|
@ -10,19 +10,18 @@
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="card-body"> |
|
|
|
|
<form action="{{ route('dashboard.peminjaman.store') }}" method="POST" enctype="multipart/form-data"> |
|
|
|
|
<form action="{{ route('dashboard.peminjaman.store') }}" method="POST" enctype="multipart/form-data" |
|
|
|
|
id="peminjamanForm"> |
|
|
|
|
@csrf |
|
|
|
|
<div class="form-group"> |
|
|
|
|
<label for="peti_id" class="col-form-label">Pilih Detail Peti: <span |
|
|
|
|
class="text-danger">*</span></label> |
|
|
|
|
<select class="form-control" name="peti_id" type="text" id="peti_id" required> |
|
|
|
|
<option disabled selected>Pilih Detail Peti</option> |
|
|
|
|
@foreach ($peti as $data_peti) |
|
|
|
|
@if (!in_array($data_peti->id, $existingPeti)) |
|
|
|
|
@foreach ($peti_block as $data_peti) |
|
|
|
|
<option value="{{ $data_peti->id }}" data-warehouse-id="{{ $data_peti->warehouse_id }}"> |
|
|
|
|
{{ $data_peti->fix_lot }} |
|
|
|
|
</option> |
|
|
|
|
@endif |
|
|
|
|
@endforeach |
|
|
|
|
</select> |
|
|
|
|
<label for="exit_at" class="col-form-label">Tanggal Peminjaman: <span |
|
|
|
@ -46,24 +45,15 @@
|
|
|
|
|
</div> |
|
|
|
|
<div class="modal-footer d-flex justify-content-center"> |
|
|
|
|
<a href="{{ route('dashboard.peminjaman.index') }}" class="btn btn-secondary">Kembali</a> |
|
|
|
|
<button type="submit" class="btn btn-primary">Simpan</button> |
|
|
|
|
<button type="submit" class="btn btn-primary" id="submitButton">Simpan</button> |
|
|
|
|
</div> |
|
|
|
|
</form> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<script> |
|
|
|
|
document.addEventListener('DOMContentLoaded', function() { |
|
|
|
|
const petiSelect = document.getElementById('peti_id'); |
|
|
|
|
const exitWarehouseSelect = document.getElementById('exit_warehouse'); |
|
|
|
|
|
|
|
|
|
// Saat pilihan Detail Peti berubah |
|
|
|
|
petiSelect.addEventListener('change', function() { |
|
|
|
|
const selectedOption = petiSelect.options[petiSelect.selectedIndex]; |
|
|
|
|
const warehouseId = selectedOption.getAttribute('data-warehouse-id'); |
|
|
|
|
|
|
|
|
|
// Atur nilai pilihan Asal Gudang sesuai dengan data peti yang dipilih |
|
|
|
|
exitWarehouseSelect.value = warehouseId; |
|
|
|
|
}); |
|
|
|
|
<script> |
|
|
|
|
document.getElementById('peminjamanForm').addEventListener('submit', function() { |
|
|
|
|
document.getElementById('submitButton').setAttribute('disabled', 'true'); |
|
|
|
|
}); |
|
|
|
|
</script> |
|
|
|
|
@endsection |
|
|
|
|