perbaikan ekosisitem
This commit is contained in:
@@ -32,13 +32,21 @@
|
||||
<input type="date" class="form-control @error($k->kolom) is-invalid @enderror" id="add-data-{{ $k->kolom }}"
|
||||
name="{{ $k->kolom }}" placeholder="Cth: {{ $k->label }}" value="{{ old($k->kolom) }}" />
|
||||
@elseif($k->tipe == 'datetime')
|
||||
<input type="datetime" class="form-control @error($k->kolom) is-invalid @enderror" id="add-data-{{ $k->kolom }}"
|
||||
<input type="datetime-local" class="form-control @error($k->kolom) is-invalid @enderror" id="add-data-{{ $k->kolom }}"
|
||||
name="{{ $k->kolom }}" placeholder="Cth: {{ $k->label }}" value="{{ old($k->kolom) }}" />
|
||||
@elseif($k->tipe == 'boolean')
|
||||
<select class="form-select tipe-boolean @error($k->kolom) is-invalid @enderror" id="add-data-{{ $k->kolom }}" name="{{ $k->kolom }}">
|
||||
<option value="1" {{ old($k->kolom) == 1 ? 'selected' : '' }}>Ya</option>
|
||||
<option value="0" {{ old($k->kolom) == 0 ? 'selected' : '' }}>Tidak</option>
|
||||
</select>
|
||||
@elseif($k->tipe == 'foreign_key')
|
||||
<select class="form-select tipe-fk @error($k->kolom) is-invalid @enderror" id="add-data-{{ $k->kolom }}" name="{{ $k->kolom }}">
|
||||
@if ($list_relasi->where('kolom_id', $k->id)->first() != null)
|
||||
@foreach($list_relasi->where('kolom_id', $k->id)->first()['options'] as $opsi_relasi)
|
||||
<option value="{{ $opsi_relasi->value }}" {{ old($k->kolom) == $opsi_relasi->value ? 'selected' : '' }}>{{ $opsi_relasi->label }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@else
|
||||
<input type="text" class="form-control @error($k->kolom) is-invalid @enderror" id="add-data-{{ $k->kolom }}"
|
||||
name="{{ $k->kolom }}" placeholder="Cth: {{ $k->label }}" value="{{ old($k->kolom) }}" />
|
||||
@@ -63,7 +71,7 @@
|
||||
<script>
|
||||
'use strict';
|
||||
$(document).ready(function () {
|
||||
$('#add-data-program,.tipe-boolean').select2();
|
||||
$('#add-data-program,.tipe-boolean, .tipe-fk').select2();
|
||||
|
||||
$('#addNewDataForm').validate({
|
||||
rules: {
|
||||
|
||||
Reference in New Issue
Block a user