Преглед изворни кода

Updated appointments refactor views

Samson Mutunga пре 1 година
родитељ
комит
7dc1f10abb

+ 2 - 1
app/Http/Controllers/McpController.php

@@ -30,6 +30,7 @@ use Illuminate\Support\Facades\File;
 use App\Models\Bill;
 use App\Models\ClientSMS;
 use App\Models\AccountInvite;
+use App\Models\AppointmentView;
 use App\Models\ClientMemo;
 use App\Models\ClientProAccess;
 use Illuminate\Support\Facades\Http;
@@ -175,7 +176,7 @@ class McpController extends Controller
     public function appointments(Request $request)
     {
         $filters = $request->all();
-        $appointments = Appointment::where('pro_id', $this->performer->pro->id);
+        $appointments = AppointmentView::where('pro_id', $this->performer->pro->id);
         $this->filterMultiQuery($request, $appointments, 'raw_date', 'date_category', 'date_value_1', 'date_value_2');
         $this->filterSimpleQuery($request, $appointments, 'status', 'status');
         $appointments = $appointments->orderBy('end_time', 'DESC')->paginate(20);

+ 3 - 3
resources/views/app/mcp/appointments.blade.php

@@ -30,11 +30,11 @@
                     @foreach($appointments as $appointment)
                     <tr>
                         <td>
-                            <a href="/patients/view/{{$appointment->client->uid}}/calendar/{{$appointment->uid}}">
+                            <a href="/patients/view/{{$appointment->client_uid}}/calendar/{{$appointment->uid}}">
                                 {{friendly_date($appointment->raw_date) . ' ' . friendly_time($appointment->raw_start_time)}}                            
                             </a>
                         </td>
-                        <td>{{ $appointment->client->displayName() }}</pre>
+                        <td>{{ $appointment->client_display_name }}</pre>
                         </td>
                         <td>{{ $appointment->title }}</td>
                         <td>{{ $appointment->description }}</td>
@@ -46,7 +46,7 @@
                             @endif
                         </td>
                         <td>
-                            @include('app.patient.partials.appointment-confirmation',['patient' => $appointment->client])
+                            @include('app.patient.partials.appointment-confirmation-light')
                         </td>
                     </tr>
                     @endforeach

+ 2 - 2
resources/views/app/patient/partials/appointment-confirmation-light.blade.php

@@ -3,7 +3,7 @@
         @if($appointment->status === 'PENDING' && !$appointment->latest_confirmation_request_at && !$appointment->latest_confirmation_decision_at)
             <b class="text-warning-mellow">Not requested yet</b>
             <div>
-                @include('app.patient.partials.appointment-request-confirmation', ['label' => 'Request Confirmation'])
+                @include('app.patient.partials.appointment-request-confirmation-light', ['label' => 'Request Confirmation'])
             </div>
         @endif
         @if($appointment->latest_confirmation_decision_at)
@@ -48,7 +48,7 @@
             @endif
             @if($appointment->status !== 'COMPLETED' && $appointment->status !== 'CONFIRMED' && $appointment->status !== 'CANCELLED')
             <div>
-              @include('app.patient.partials.appointment-request-confirmation', ['label' => 'Re-request Confirmation'])
+              @include('app.patient.partials.appointment-request-confirmation-light', ['label' => 'Re-request Confirmation'])
             </div>
             @endif
         @endif

+ 18 - 0
resources/views/app/patient/partials/appointment-request-confirmation-light.blade.php

@@ -0,0 +1,18 @@
+<div moe relative class="">
+    <a href="#" start show class="text-sm font-weight-normal">{{ $label }}</a>
+    <form url="/api/appointment/sendConfirmationRequestViaEmailAndSms" right>
+        <input type="hidden" name="uid" value="{{ $appointment->uid }}">
+        <div class="mb-2">
+            <label for="" class="text-sm text-secondary mb-1">Cell Number</label>
+            <input type="text" class="form-control form-control-sm" name="toSmsNumber" value="{{$appointment->client_cell_number}}">
+        </div>
+        <div class="mb-2">
+            <label for="" class="text-sm text-secondary mb-1">Email Address</label>
+            <input type="text" class="form-control form-control-sm" name="emailAddress" value="{{$appointment->client_email_address}}">
+        </div>
+        <div>
+            <button submit class="btn btn-sm btn-primary mr-1">Send</button>
+            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+        </div>
+    </form>
+</div>