|
@@ -149,12 +149,14 @@ class PracticeManagementController extends Controller
|
|
if($proUid){
|
|
if($proUid){
|
|
$pro = Pro::where('uid', $proUid)->first();
|
|
$pro = Pro::where('uid', $proUid)->first();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if($request->get('pro_uid')){
|
|
if($request->get('pro_uid')){
|
|
$proUid = $request->get('pro_uid');
|
|
$proUid = $request->get('pro_uid');
|
|
$pro = Pro::where('uid', $proUid)->first();
|
|
$pro = Pro::where('uid', $proUid)->first();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ $selectedProUid = $pro->uid;
|
|
|
|
+
|
|
$pros = Pro::all();
|
|
$pros = Pro::all();
|
|
|
|
|
|
$generalAvailabilitiesList = ProGeneralAvailability::where('pro_id', $pro->id)->where('is_cancelled', false)->orderBy('created_at', 'asc')->get();
|
|
$generalAvailabilitiesList = ProGeneralAvailability::where('pro_id', $pro->id)->where('is_cancelled', false)->orderBy('created_at', 'asc')->get();
|
|
@@ -190,37 +192,33 @@ class PracticeManagementController extends Controller
|
|
$generalAvailabilities['SUNDAY'][] = $ga;
|
|
$generalAvailabilities['SUNDAY'][] = $ga;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
$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();
|
|
|
|
|
|
//events for the calendar
|
|
//events for the calendar
|
|
- $startDate = date('Y-m-d', strtotime("sunday -1 week"));
|
|
|
|
- $endDateTime = new DateTime($startDate);
|
|
|
|
|
|
+ $startDate = date('Y-m-d', strtotime("sunday -1 week"));
|
|
|
|
+ $endDateTime = new DateTime($startDate);
|
|
$endDateTime->modify('+6 day');
|
|
$endDateTime->modify('+6 day');
|
|
$endDate = $endDateTime->format("Y-m-d");
|
|
$endDate = $endDateTime->format("Y-m-d");
|
|
|
|
|
|
$eventsData = $pro->getAvailabilityEvents($startDate, $endDate);
|
|
$eventsData = $pro->getAvailabilityEvents($startDate, $endDate);
|
|
$events = json_encode($eventsData);
|
|
$events = json_encode($eventsData);
|
|
|
|
|
|
- return view('app.practice-management.pro-availability', compact('pros','generalAvailabilities', 'specificAvailabilities', 'specificUnavailabilities','events'));
|
|
|
|
|
|
+ return view('app.practice-management.pro-availability',
|
|
|
|
+ compact('pros','generalAvailabilities', 'specificAvailabilities',
|
|
|
|
+ 'specificUnavailabilities', 'events', 'selectedProUid'));
|
|
}
|
|
}
|
|
|
|
|
|
- public function loadAvailability(Request $request){
|
|
|
|
|
|
+ public function loadAvailability(Request $request, $proUid){
|
|
$performer = $this->performer();
|
|
$performer = $this->performer();
|
|
$pro = $performer->pro;
|
|
$pro = $performer->pro;
|
|
$startDate = $request->get('start');
|
|
$startDate = $request->get('start');
|
|
$endDate = $request->get('end');
|
|
$endDate = $request->get('end');
|
|
-
|
|
|
|
- if($request->get('pro_uid')){
|
|
|
|
- $proUid = $request->get('pro_uid');
|
|
|
|
- $pro = Pro::where('uid', $proUid)->first();
|
|
|
|
- }
|
|
|
|
|
|
|
|
- $eventsData = $pro->getAvailabilityEvents($startDate, $endDate);
|
|
|
|
- //$events = json_encode($eventsData);
|
|
|
|
-
|
|
|
|
- return $eventsData;
|
|
|
|
|
|
+ $selectedPro = Pro::where('uid', $proUid)->first();
|
|
|
|
+
|
|
|
|
+ return $selectedPro->getAvailabilityEvents($startDate, $endDate);
|
|
}
|
|
}
|
|
|
|
|
|
public function proAvailabilityFilter(Request $request){
|
|
public function proAvailabilityFilter(Request $request){
|