|
@@ -23,7 +23,7 @@
|
|
|
}
|
|
|
?>
|
|
|
|
|
|
- <div class="p-3 mcp-theme-1">
|
|
|
+ <div class="p-3 mcp-theme-1" id="patients-list">
|
|
|
<div class="card">
|
|
|
|
|
|
<div class="card-header px-3 py-2 d-flex align-items-center">
|
|
@@ -31,11 +31,18 @@
|
|
|
<i class="fas fa-user-injured"></i>
|
|
|
Patients
|
|
|
</strong>
|
|
|
- <select class="ml-auto max-width-300px form-control form-control-sm" onchange="fastLoad('/patients/' + this.value, true, false, false)">
|
|
|
- <option value="" {{ $filter === '' ? 'selected' : '' }}>All patients</option>
|
|
|
- <option value="not-yet-seen" {{ $filter === 'not-yet-seen' ? 'selected' : '' }}>Patients I have not seen yet</option>
|
|
|
- <option value="having-birthday-today" {{ $filter === 'having-birthday-today' ? 'selected' : '' }}>Patients having birthday today</option>
|
|
|
- </select>
|
|
|
+ <div class="ml-auto d-flex align-items-center search-form">
|
|
|
+ <form action="" method="get" class="mr-2" id="patients-search">
|
|
|
+ <input type="text" name="q" value="{{request()->input('q')}}" class="form-control form-control-sm"
|
|
|
+ placeholder="Name / Email / Tags">
|
|
|
+ </form>
|
|
|
+ <select class="ml-auto max-width-300px form-control form-control-sm"
|
|
|
+ id="patients-filter">
|
|
|
+ <option value="" {{ $filter === '' ? 'selected' : '' }}>All patients</option>
|
|
|
+ <option value="not-yet-seen" {{ $filter === 'not-yet-seen' ? 'selected' : '' }}>Patients I have not seen yet</option>
|
|
|
+ <option value="having-birthday-today" {{ $filter === 'having-birthday-today' ? 'selected' : '' }}>Patients having birthday today</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="card-body p-0">
|
|
|
<table class="table table-condensed p-0 m-0">
|
|
@@ -213,4 +220,20 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+ <script>
|
|
|
+ (function() {
|
|
|
+ function init() {
|
|
|
+ function submit() {
|
|
|
+ let url = '/patients' +
|
|
|
+ ($('#patients-filter').val() ? '/' + $('#patients-filter').val() : '') +
|
|
|
+ ($('#patients-search input').val() ? '?q=' + encodeURIComponent($('#patients-search input').val()) : '');
|
|
|
+ fastLoad(url);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $('#patients-search').off('submit').on('submit', submit);
|
|
|
+ $('#patients-filter').off('change').on('change', submit);
|
|
|
+ }
|
|
|
+ addMCInitializer('patients-list', init, '#patients-list');
|
|
|
+ }).call(window);
|
|
|
+ </script>
|
|
|
@endsection
|