|
@@ -54,11 +54,31 @@
|
|
|
</form>
|
|
|
</div>
|
|
|
@endif
|
|
|
+ <select class="ml-auto max-width-300px form-control form-control-sm"
|
|
|
+ onchange="fastLoad('/patients/view/{{$patient->uid}}/supply-orders{{@$supplyOrder ? '/' . $supplyOrder->uid : '' }}?filter=' + this.value, true, false, false)">
|
|
|
+ <option value="active" {{ !request()->input('filter') || request()->input('filter') === 'active' ? 'selected' : '' }}>Active Supply Orders</option>
|
|
|
+ <option value="cancelled" {{ request()->input('filter') === 'cancelled' ? 'selected' : '' }}>Cancelled Supply Orders</option>
|
|
|
+ <option value="all" {{ request()->input('filter') === 'all' ? 'selected' : '' }}>All Supply Orders</option>
|
|
|
+ </select>
|
|
|
</div>
|
|
|
<div class="d-flex align-items-start h-100">
|
|
|
<div class="flex-grow-1">
|
|
|
<table class="table table-sm table-bordered mb-0" style="table-layout: fixed">
|
|
|
- @if($patient->supplyOrders && count($patient->supplyOrders))
|
|
|
+ <?php
|
|
|
+ $supplyOrdersList = $patient->activeSupplyOrders;
|
|
|
+ if(request()->input('filter')) {
|
|
|
+ switch(request()->input('filter')) {
|
|
|
+ case 'cancelled':
|
|
|
+ $supplyOrdersList = $patient->cancelledSupplyOrders;
|
|
|
+ break;
|
|
|
+ case 'all':
|
|
|
+ $supplyOrdersList = $patient->supplyOrders;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+
|
|
|
+ @if($supplyOrdersList && count($supplyOrdersList))
|
|
|
<thead>
|
|
|
<tr class="bg-light">
|
|
|
<th class="px-2 text-nowrap text-secondary border-bottom-0"><div class="text-ellipsis">Title</div></th>
|
|
@@ -70,10 +90,10 @@
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
- @foreach($patient->supplyOrders as $iSupplyOrder)
|
|
|
+ @foreach($supplyOrdersList as $iSupplyOrder)
|
|
|
<tr class="{{@$supplyOrder && @$supplyOrder->uid === $iSupplyOrder->uid ? 'bg-aliceblue' : ''}} {{$iSupplyOrder->is_cancelled ? 'on-hover-opaque' : ''}}">
|
|
|
<td class="px-2">
|
|
|
- <a href="{{route('patients.view.supply-orders', ['patient' => $patient, 'supplyOrder' => $iSupplyOrder])}}">
|
|
|
+ <a href="{{route('patients.view.supply-orders', ['patient' => $patient, 'supplyOrder' => $iSupplyOrder])}}{{request()->input('filter') ? '?filter=' . request()->input('filter') : ''}}">
|
|
|
{{ $iSupplyOrder->product->title }}
|
|
|
</a>
|
|
|
@if($iSupplyOrder->is_cancelled)
|
|
@@ -106,7 +126,7 @@
|
|
|
@else
|
|
|
<tbody>
|
|
|
<tr>
|
|
|
- <td class="text-secondary p-3">No supply orders have been created for this patient</td>
|
|
|
+ <td class="text-secondary p-3">No supply orders matching the criteria</td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
@endif
|
|
@@ -116,7 +136,7 @@
|
|
|
<div class="min-width-500px ml-2 border align-self-stretch p-3">
|
|
|
<div class="d-flex align-items-center">
|
|
|
<h3 class="font-size-16 m-0">{{$supplyOrder->product->title}}</h3>
|
|
|
- <a class="ml-auto" href="{{route('patients.view.supply-orders', ['patient' => $patient])}}">
|
|
|
+ <a class="ml-auto" href="/patients/view/{{$patient->uid}}/supply-orders{{request()->input('filter') ? '?filter=' . request()->input('filter') : ''}}">
|
|
|
<i class="fa fa-times-circle on-hover-opaque"></i>
|
|
|
</a>
|
|
|
</div>
|