ldc-agis/resources/views/bo/modules/search-bar.blade.php
2023-12-19 15:09:12 +00:00

48 lines
2.2 KiB
PHP

@php
$iArgs = [];
if (request()->sort_col) {
$iArgs['sort_col'] = request()->sort_col;
}
if (request()->search) {
$iArgs['search'] = request()->sort_way;
}
@endphp
<div class="row mb-3">
<div class="col-12">
<form id="searchForm" action="/{{ request()->path() }}">
<div class="input-group pt-3">
<label class="input-group-text" for="searchField">{{ $searchFields }}</label>
@if (request()->sort_col)
<input class="d-none" name="sort_col" type="text" value="{{ request()->sort_col }}">
@endif
@if (request()->sort_way)
<input class="d-none" name="sort_way" type="text" value="{{ request()->sort_way }}">
@endif
@if (request()->rangefilter)
<input class="d-none" name="rangefilter" type="text" value="{{ request()->rangefilter }}">
@endif
@if (request()->group)
<input class="d-none" name="group" type="text" value="{{ request()->group }}">
@endif
<input class="form-control" id="searchField" name="search" type="search" value="{{ request()->search }}"
placeholder="{{ __('crud.other.search_placeholder') }}" />
<button class="btn btn-primary" data-bs-toggle="tooltip" type="submit" title="{{ __('crud.other.search_start') }}">
<i class="fas fa-search"></i>
</button>
<button class="btn btn-danger" id="searchDelete" data-bs-toggle="tooltip" type="button"
title="{{ __('crud.other.search_delete') }}">
<i class="fas fa-backspace"></i>
</button>
@push('scripts')
<script nonce="{{ $nonce }}">
document.getElementById('searchDelete').addEventListener('click', function(e) {
document.getElementById('searchField').value = '';
document.getElementById('searchForm').submit();
});
</script>
@endpush
</div>
</form>
</div>
</div>