|
@@ -13,6 +13,8 @@ use App\Models\ProSpecificAvailability;
|
|
use App\Models\ProSpecificUnavailability;
|
|
use App\Models\ProSpecificUnavailability;
|
|
use App\Models\ProTextShortcut;
|
|
use App\Models\ProTextShortcut;
|
|
use App\Models\ProTransaction;
|
|
use App\Models\ProTransaction;
|
|
|
|
+use DateTime;
|
|
|
|
+use DateTimeZone;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Request;
|
|
|
|
|
|
class PracticeManagementController extends Controller
|
|
class PracticeManagementController extends Controller
|
|
@@ -171,9 +173,67 @@ class PracticeManagementController extends Controller
|
|
$specificAvailabilities = ProSpecificAvailability::where('pro_id', $pro->id)->where('is_cancelled', false)->orderBy('start_time')->get();
|
|
$specificAvailabilities = ProSpecificAvailability::where('pro_id', $pro->id)->where('is_cancelled', false)->orderBy('start_time')->get();
|
|
$specificUnavailabilities = ProSpecificUnavailability::where('pro_id', $pro->id)->where('is_cancelled', false)->orderBy('start_time', 'asc')->get();
|
|
$specificUnavailabilities = ProSpecificUnavailability::where('pro_id', $pro->id)->where('is_cancelled', false)->orderBy('start_time', 'asc')->get();
|
|
|
|
|
|
- return view('app.practice-management.my-availability', compact('generalAvailabilities', 'specificAvailabilities', 'specificUnavailabilities'));
|
|
|
|
- }
|
|
|
|
|
|
+ //events for the calendar
|
|
|
|
+ $eventsData = [];
|
|
|
|
+ $dayInts = [
|
|
|
|
+ 'SUNDAY'=> 1,
|
|
|
|
+ 'MONDAY'=> 2,
|
|
|
|
+ 'TUESDAY'=> 3,
|
|
|
|
+ 'WEDNESDAY'=> 4,
|
|
|
|
+ 'THURSDAY'=> 5,
|
|
|
|
+ 'FRIDAY'=> 6,
|
|
|
|
+ 'SATURDAY'=> 7,
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ foreach($specificUnavailabilities as $sa){
|
|
|
|
+ $realTimezone = resolve_timezone($sa->timezone);
|
|
|
|
+
|
|
|
|
+ $startTime = new DateTime($sa->start_time);
|
|
|
|
+ $startTime->setTimezone(new DateTimeZone($realTimezone));
|
|
|
|
+
|
|
|
|
+ $endTime = new DateTime($sa->end_time);
|
|
|
|
+ $endTime->setTimezone(new DateTimeZone($realTimezone));
|
|
|
|
+
|
|
|
|
+ $eventsData[] = [
|
|
|
|
+ 'title' => $sa->title,
|
|
|
|
+ 'start' => $startTime->format(DateTime::ISO8601),
|
|
|
|
+ 'end' => $endTime->format(DateTime::ISO8601),
|
|
|
|
+ 'backgroundColor' => 'red'
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ foreach($specificAvailabilities as $su){
|
|
|
|
+
|
|
|
|
+ $realTimezone = resolve_timezone($su->timezone);
|
|
|
|
+
|
|
|
|
+ $startTime = new DateTime($su->start_time);
|
|
|
|
+ $startTime->setTimezone(new DateTimeZone($realTimezone));
|
|
|
|
|
|
|
|
+ $endTime = new DateTime($su->end_time);
|
|
|
|
+ $endTime->setTimezone(new DateTimeZone($realTimezone));
|
|
|
|
+
|
|
|
|
+ $eventsData[] = [
|
|
|
|
+ 'title' => $su->title,
|
|
|
|
+ 'start' => $startTime->format(DateTime::ISO8601),
|
|
|
|
+ 'end' => $endTime->format(DateTime::ISO8601),
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ foreach($generalAvailabilities as $day => $ga){
|
|
|
|
+ $eventsData[] = [
|
|
|
|
+ 'title' => 'General Availability',
|
|
|
|
+ 'daysOfWeek' => [$dayInts[$day]],
|
|
|
|
+ 'startTime' => $ga->start_time,
|
|
|
|
+ 'endTime' => $ga->end_time,
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $events = json_encode($eventsData);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return view('app.practice-management.my-availability', compact('generalAvailabilities', 'specificAvailabilities', 'specificUnavailabilities','events'));
|
|
|
|
+ }
|
|
|
|
|
|
// video call page (RHS)
|
|
// video call page (RHS)
|
|
// generic call handle (no uid)
|
|
// generic call handle (no uid)
|