Jelajahi Sumber

Link from patient-detail to patient-call-page (opens in RHS)

Vijayakrishnan 5 tahun lalu
induk
melakukan
21729a951d
2 mengubah file dengan 38 tambahan dan 1 penghapusan
  1. 5 1
      app/Models/Client.php
  2. 33 0
      resources/views/layouts/patient.blade.php

+ 5 - 1
app/Models/Client.php

@@ -8,8 +8,12 @@ class Client extends Model
 {
     protected $table = 'client';
 
-    public function displayName(){
+    public function displayName() {
         return $this->name_last . ', '. $this->name_first;
     }
 
+    public function prosInMeetingWith() {
+        return Pro::where('in_meeting_with_client_id', $this->id)->get();
+    }
+
 }

+ 33 - 0
resources/views/layouts/patient.blade.php

@@ -174,6 +174,39 @@
                                 </button>
                             </div>
                         </div>
+                        {{-- go to patient's call page --}}
+                        <div class="p-3 border small mt-3 bg-white">
+                            <div class="mr-3 my-1">Online:
+                                <span class="font-weight-bold">
+                                        <?= $patient->is_online ? '<span class="text-success">YES</span>' : '<span class="text-secondary">NO</span>' ?>
+                                    </span>
+                            </div>
+                            <div class="mr-3 my-1">Video:
+                                <span class="font-weight-bold">
+                                        <?= $patient->is_client_video_turned_on ? '<span class="text-success">ON</span>' : '<span class="text-secondary">OFF</span>' ?>
+                                    </span>
+                                @if($patient->is_online && $patient->is_client_video_turned_on && count($patient->prosInMeetingWith()))
+                                    <div class="my-1 font-weight-bold">Currently talking to:</div>
+                                    @foreach($patient->prosInMeetingWith() as $inCallPro)
+                                        <div class="d-block my-1">
+                                            <i class="fa fa-chevron-right mr-1"></i>
+                                            <a href="/pros/view/{{ $inCallPro->uid }}/SUB_dashboard"
+                                               class="text-primary">
+                                                {{ $inCallPro->name_display }}
+                                            </a>
+                                        </div>
+                                    @endforeach
+                                @endif
+                            </div>
+                            <div>
+                                <a href="#"
+                                   class="btn btn-sm btn-primary mt-2 font-weight-bold px-3"
+                                   onclick="return window.top.openInRHS('/pro/meet/{{ $patient->uid }}')">
+                                    <i class="fa fa-phone mr-1"></i>
+                                    Go to the client's meeting page
+                                </a>
+                            </div>
+                        </div>
                     </div>
                     <div class="card-body">
                         <h1 class="h3">@yield('section-title')</h1>