@if(isset($filters) && !empty($filters)) @php ($floatOff = ['select', 'multiselect', 'file', 'radio', 'checkbox', 'editor', 'date', 'custom', 'switch']) @php ($dateTimePicker = 0)
@if(isset($sortableColumn)) {{----}} @endif @foreach($filters['fields'] as $key => $value) @php ($attributes = (isset($value['attributes']) ? $value['attributes'] : [])) @php ($attributes['id'] = (isset($attributes['id']) ? $attributes['id'] : $key)) @php ($attributes['class'] = (isset($attributes['class']) ? $attributes['class'] : 'form-control mr-sm-2')) @php ($inputValue = (\Request::input($key) != "" ? \Request::input($key) : null)) @php ($inputValue = $inputValue != '' ? $inputValue : (isset($value['value']) ? $value['value'] : null)) @php ($dateTimePicker = (!$dateTimePicker && in_array($value['type'], ['date', 'time', 'datetime'])) ? 1 : $dateTimePicker) @if(!in_array($value['type'], ['html', 'include', 'hidden'])) @if($value['type'] == 'head_search')
{!! html()->text($key, $inputValue)->attributes($attributes) !!}
@elseif($value['type'] == 'text') {!! html()->text($key, $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'email') {!! html()->email($key, $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'number') {!! html()->number($key, $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'date') {!! html()->date($key, $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'month') @php($attributes['data-date-format'] = $attributes['placeholder'] ?? 'mm-yyyy') @php($attributes['data-provide'] = 'datepicker') @php($attributes['data-date-autoclose'] = 'true') @php($attributes['data-date-min-view-mode'] = '1') @php($attributes['autocomplete'] = 'off') {!! html()->month($key, $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'time') @php($attributes['class'] .= ' timepicker') {!! html()->text($key, $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'mobile') @php ($attributes['data-inputmask'] = "'mask': '(999) 999-9999'") @php ($attributes['class'] .= " input-mask") {!! html()->text($key, $inputValue)->attributes($attributes) !!} @once @push('page_script') @endpush @endonce @elseif($value['type'] == 'datetime') @php($attributes['class'] .= ' datetimepicker') {!! html()->text($key, $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'password') {!! html()->password($key)->attributes($attributes) !!} @elseif($value['type'] == 'select') @php($attributes['data-live-search'] = "true") @php($attributes['data-size'] = 5) @php($attributes['class'] = (isset($attributes['class']) ? $attributes['class'] . ' ' : '') . 'custom-select mr-2') @if(is_array($value['options']) && !empty($value['options'])) @php($value['options'] = ['' => ($value['label'] ?? 'Option')] + $value['options']) @endif {!! html()->select($key, $value['options'], $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'multiselect') @php ($attributes['multiple'] = 'true') {!! html()->select($key, $value['options'], $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'radio')
@foreach($value['options'] as $k => $option)
{!! html()->radio($key)->value($k)->checked($inputValue == $k)->attributes(['class' => $key, 'id' => $key . '-' . $k]) !!}
@endforeach
@elseif($value['type'] == 'checkbox')
@foreach($value['options'] as $k => $option)
{!! html()->checkbox($key . '[]')->value($k)->checked(is_array($inputValue) && in_array($k, $inputValue))->attributes(['class' => $key, 'id' => $key . '-' . $k]) !!}
@endforeach
@elseif($value['type'] == 'switch') @foreach($value['options'] as $k => $option)
@endforeach @elseif($value['type'] == 'custom') {!! $inputValue !!} @elseif($value['type'] == 'button') {!! html()->button($value['label'], $value['attributes']) !!} @endif @elseif($value['type'] == 'html') {!! $value['value'] !!} @elseif($value['type'] == 'hidden') {!! html()->hidden($key, $inputValue) !!} @endif @endforeach {{-- @if(isset($filters['reset']) && $filters['reset']) Reset @endif --}}
@if($dateTimePicker) @include('admin.components.date-time-picker') @endif @endif