48 lines
2.0 KiB
PHP
Executable File
48 lines
2.0 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['fields'] as $key => $field)
|
|
@if($field['type']=='area')
|
|
<div class="col-md-12">
|
|
@else
|
|
<div class="col-md-6">
|
|
@endif
|
|
<div class="position-relative form-group">
|
|
<label for="{{ $key }}">{{ $field['label'] }}</label>
|
|
@switch($field['type'])
|
|
@case('area')
|
|
<textarea name="{{ $key }}" id="{{ $key }}" class="form-control" >{{$data->$key ?? ''}}</textarea>
|
|
@break
|
|
@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">
|
|
@foreach ($field['fetch']() as $key1 => $value1)
|
|
<option value="{{ $key1 }}" @if($data->$key == $key1) selected @endif>{{ $value1 }}</option>
|
|
@endforeach
|
|
</select>
|
|
@break
|
|
@case('true_false')
|
|
<div class="col-12">
|
|
<input class="bsToggle" id="{{ $key }}" name="{{ $key }}" type="checkbox" data-toggle="toggle" data-on="Da" data-off="Ne" data-onstyle="success" value="1" data-offstyle="danger" data-width="75" @if ($data->$key==1) checked @endif>
|
|
</div>
|
|
@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>
|