Make name and e-mail based searches with like for easier administration. (#1397)
* Update UserRepository.php Make `name` and `e-mail` based searches with `like` for easier administration and search. * Update search.blade.php Remove old dashed out code * Update index.blade.php Add proper state selections
This commit is contained in:
parent
94735103aa
commit
08624042f2
@ -90,11 +90,11 @@ class UserRepository extends Repository
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($request->filled('name')) {
|
if ($request->filled('name')) {
|
||||||
$where['name'] = $request->name;
|
$where[] = ['name', 'LIKE', '%'.$request->name.'%'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request->filled('email')) {
|
if ($request->filled('email')) {
|
||||||
$where['email'] = $request->email;
|
$where[] = ['email', 'LIKE', '%'.$request->email.'%'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request->filled('state')) {
|
if ($request->filled('state')) {
|
||||||
|
@ -2,12 +2,26 @@
|
|||||||
|
|
||||||
@section('title', 'Users')
|
@section('title', 'Users')
|
||||||
@section('actions')
|
@section('actions')
|
||||||
<li><a href="{{ route('admin.userfields.index') }}">
|
<li>
|
||||||
<i class="ti-user"></i>Profile Fields</a>
|
<a href="{{ route('admin.userfields.index') }}"></i>Profile Fields</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
<li><a href="{{ route('admin.users.index') }}?search=state:0">
|
<a href="{{ route('admin.users.index') }}?state=0">@lang(UserState::label(UserState::PENDING))</a>
|
||||||
<i class="ti-user"></i>@lang(UserState::label(UserState::PENDING))</a>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="{{ route('admin.users.index') }}?state=1">@lang(UserState::label(UserState::ACTIVE))</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="{{ route('admin.users.index') }}?state=2">@lang(UserState::label(UserState::REJECTED))</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="{{ route('admin.users.index') }}?state=3">@lang(UserState::label(UserState::ON_LEAVE))</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="{{ route('admin.users.index') }}?state=4">@lang(UserState::label(UserState::SUSPENDED))</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="{{ route('admin.users.index') }}?state=5">@lang(UserState::label(UserState::DELETED))</a>
|
||||||
</li>
|
</li>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
@ -10,12 +10,6 @@
|
|||||||
{{ Form::label('email', 'Email:') }}
|
{{ Form::label('email', 'Email:') }}
|
||||||
{{ Form::text('email', null, ['class' => 'form-control']) }}
|
{{ Form::text('email', null, ['class' => 'form-control']) }}
|
||||||
|
|
||||||
{{--{{ Form::label('dep_icao', 'Departure:') }}
|
|
||||||
{{ Form::select('dep_icao', $airports, null , ['class' => 'form-control']) }}
|
|
||||||
|
|
||||||
{{ Form::label('arr_icao', 'Arrival:') }}
|
|
||||||
{{ Form::select('arr_icao', $airports, null , ['class' => 'form-control']) }}
|
|
||||||
--}}
|
|
||||||
{{ Form::submit('find', ['class' => 'btn btn-primary']) }}
|
{{ Form::submit('find', ['class' => 'btn btn-primary']) }}
|
||||||
|
|
||||||
<a href="{{ route('admin.users.index') }}">clear</a>
|
<a href="{{ route('admin.users.index') }}">clear</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user