You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
4.7 KiB
88 lines
4.7 KiB
@extends('layouts.main') |
|
@section('content') |
|
@include('layouts.components.alert-prompt') |
|
|
|
<div class="card shadow mb-4"> |
|
<div class="card-header py-3"> |
|
<div class="row"> |
|
<div class="col-6"> |
|
<h5 class="m-0 font-weight-bold text-primary mt-2">Edit Peti</h5> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="card-body"> |
|
<form action="{{ route('dashboard.peti.update', [$peti->id]) }}" method="POST" enctype="multipart/form-data" |
|
id="editForm"> |
|
@csrf |
|
@method('PUT') |
|
<div class="form-group"> |
|
<label for="tipe_peti_id" class="col-form-label">Tipe Peti: <span class="text-danger">*</span></label> |
|
<select class="form-control" name="tipe_peti_id" id="tipe_peti_id" required> |
|
<option disabled selected>Pilih Warehouse</option> |
|
@foreach ($typepeti as $data_type) |
|
<option value="{{ $data_type->id }}" |
|
@if ($data_type->id == $peti->tipe_peti_id) selected |
|
@else @endif> |
|
{{ $data_type->type }} |
|
</option> |
|
@endforeach |
|
</select> |
|
|
|
<label for="warna" class="col-form-label">Warna Peti: <span class="text-danger">*</span></label> |
|
<input class="form-control" name="warna" type="text" id="warna" value="{{ $peti->warna }}" |
|
placeholder="Masukkan Warna Peti (contoh: merah)" pattern="[^0-9]+" |
|
oninput="this.value=this.value.replace(/[0-9]/g,'');" title="Hanya huruf diperbolehkan" required> |
|
|
|
<label for="customer_id" class="col-form-label">Customer: <span class="text-danger">*</span></label> |
|
<select class="form-control" name="customer_id" id="customer_id"> |
|
<option disabled selected>Pilih Warehouse</option> |
|
@foreach ($customer as $data_customer) |
|
<option value="{{ $data_customer->id }}" |
|
@if ($data_customer->id == $peti->customer_id) selected |
|
@else @endif> |
|
{{ $data_customer->name }}</option> |
|
@endforeach |
|
</select> |
|
|
|
<label for="warehouse_id" class="col-form-label">Gudang: <span class="text-danger">*</span></label> |
|
<select class="form-control" name="warehouse_id" id="warehouse_id"> |
|
<option disabled selected>Pilih Warehouse</option> |
|
@foreach ($warehouse as $data_warehouse) |
|
<option value="{{ $data_warehouse->id }}" |
|
@if ($data_warehouse->id == $peti->warehouse_id) selected |
|
@else @endif> |
|
{{ $data_warehouse->name }}</option> |
|
@endforeach |
|
</select> |
|
|
|
<label for="kondisipeti_id" class="col-form-label">Kondisi Peti:</label> |
|
<select class="form-control" name="kondisipeti_id" id="kondisipeti_id"> |
|
<option disabled>Pilih Kondisi Peti</option> |
|
@foreach ($kondisiPeti as $data_kondisiPeti) |
|
<option value="{{ $data_kondisiPeti->id }}" |
|
@if ($data_kondisiPeti->id == $peti->kondisipeti_id) selected |
|
@else @endif> |
|
{{ $data_kondisiPeti->nama_kondisi }}</option> |
|
@endforeach |
|
</select> |
|
|
|
<label for="date_pembuatan" class="col-form-label">Tanggal Pembuatan Peti: <span |
|
class="text-danger">*</span></label> |
|
<input class="form-control" name="date_pembuatan" type="date" id="date_pembuatan" |
|
value="{{ $peti->date_pembuatan }}" required> |
|
|
|
</div> |
|
<div class="modal-footer d-flex justify-content-center"> |
|
<a href="{{ route('dashboard.peti.index') }}" class="btn btn-secondary">Kembali</a> |
|
<button type="submit" class="btn btn-primary" id="submitButton">Simpan</button> |
|
</div> |
|
</form> |
|
</div> |
|
</div> |
|
|
|
<script> |
|
document.getElementById('editForm').addEventListener('submit', function() { |
|
document.getElementById('submitButton').setAttribute('disabled', 'true'); |
|
}); |
|
</script> |
|
@endsection
|
|
|