Browse Source

Show appts in notes list page

Vijayakrishnan 3 năm trước cách đây
mục cha
commit
fb0a79c43b
1 tập tin đã thay đổi với 60 bổ sung0 xóa
  1. 60 0
      resources/views/app/patient/notes.blade.php

+ 60 - 0
resources/views/app/patient/notes.blade.php

@@ -4,6 +4,66 @@
 
     <?php $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_create($patient->created_at))->invert === 1); ?>
 
+    <?php
+    $dateLastWeek = date_sub(date_create(), date_interval_create_from_date_string("14 days"));
+    $dateLastWeek = date_format($dateLastWeek, "Y-m-d");
+    $appointments = \App\Models\Appointment::where('client_id', $patient->id)
+        ->orderBy('raw_date', 'desc')->orderBy('raw_start_time', 'desc')
+        ->where('raw_date', '>=', $dateLastWeek)
+        ->get();
+    ?>
+    <div class="">
+        <div class="d-flex align-items-end pb-3">
+            <h4 class="font-weight-bold m-0 font-size-16">Appointments</h4>
+        </div>
+        <table class="table table-striped table-sm table-bordered mb-4">
+            @if($appointments && count($appointments))
+                <thead class="bg-light">
+                <tr>
+                    <th class="text-secondary border-bottom-0">Date & Time</th>
+                    <th class="text-secondary border-bottom-0">Pro</th>
+                    <th class="text-secondary border-bottom-0">Title</th>
+                    <th class="text-secondary border-bottom-0">Description</th>
+                    <th class="text-secondary border-bottom-0">Status</th>
+                    <th class="text-secondary border-bottom-0">Confirmation</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach($appointments as $appointment)
+                    <tr>
+                        <td>
+                            <a href="/patients/view/{{$patient->uid}}/calendar/{{$appointment->uid}}" class="text-nowrap">
+                                {{friendly_date($appointment->raw_date) . ' ' . friendly_time($appointment->raw_start_time)}}
+                            </a>
+                        </td>
+                        <td>{{ $appointment->pro->displayName() }}</pre></td>
+                        <td>{{ $appointment->title }}</td>
+                        <td>{{ $appointment->description }}</td>
+                        <td>
+                            {{ $appointment->status }}
+                            @if($appointment->status_memo)
+                                <hr>
+                                {{$appointment->status_memo}}
+                            @endif
+                        </td>
+                        <td>
+                            @if($appointment->status !== 'CANCELLED' && $appointment->status !== 'COMPLETED')
+                                @include('app.patient.partials.appointment-confirmation')
+                            @endif
+                        </td>
+                    </tr>
+                @endforeach
+                </tbody>
+            @else
+                <tbody>
+                <tr>
+                    <td class="text-secondary p-3">No recent or upcoming appointments</td>
+                </tr>
+                </tbody>
+            @endif
+        </table>
+    </div>
+
     <div id="notes-list-{{$patient->id}}">
     <div class="pt-2 d-flex align-items-start">
         <h6 class="my-0 d-flex align-items-baseline w-100">