36 lines
1.5 KiB
PHP
Executable File
36 lines
1.5 KiB
PHP
Executable File
<form data-id="{{$data->id ?? '0'}}" id="form2">
|
|
<div class="form-row">
|
|
<div class="col">
|
|
<div class="form-row">
|
|
@foreach ($obj as $key => $field)
|
|
<div class="col-md-6">
|
|
<div class="position-relative form-group">
|
|
<label for="{{ $key }}">{{ $field['label'] }}</label>
|
|
@switch($field['type'])
|
|
@case('text')
|
|
<input name="{{ $key }}" id="{{ $key }}" type="text" class="form-control" value="{{$data->$key ?? ''}}">
|
|
@break
|
|
@case('select')
|
|
<select name="{{ $key }}" id="{{ $key }}" class="form-control ui search fluid normal dropdown">
|
|
@foreach ($field['fetch']($data) as $key1 => $value1)
|
|
<option value="{{ $key1 }}" @if($data->$key == $key1) selected @endif>{{ $value1 }}</option>
|
|
@endforeach
|
|
</select>
|
|
@break
|
|
@endswitch
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="form-row">
|
|
<div class="col-12">
|
|
<input type="hidden" name="id" value="{{$data->id ?? '0'}}">
|
|
@csrf
|
|
<button type="button" class="btn-sm btn-danger cancel" rel="{{ $data->id ?? "" }}">Cancel</button>
|
|
<button type="button" class="btn-sm btn-primary submit float-right">Snimi</button>
|
|
</div>
|
|
</div>
|
|
</form>
|