|  |  | @ -13,19 +13,53 @@ class AppointmentController extends Controller | 
			
		
	
		
		
			
				
					
					|  |  |  | { |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  |     protected $view = 'admin.appointment.'; |  |  |  |     protected $view = 'admin.appointment.'; | 
			
		
	
		
		
			
				
					
					|  |  |  |     protected $redirect = 'admin/appointments'; |  |  |  |     protected $redirect = 'admin/appointments'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     // protected $service; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     public function index(){ |  |  |  |     public function education_appointments() | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         $appointments = Appointment::orderBy('id','DESC'); |  |  |  |     { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $appointments = Appointment::where('service_type', '1')->orderBy('id', 'DESC'); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (\request('date')) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             $date = \request('date'); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             $appointments = $appointments->whereDate('date', $date); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (\request('status')) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             $status = \request('status'); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             $appointments = $appointments->where('status', $status); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (\request('is_booked')) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             $is_booked = (\request('is_booked')) == '1' ? true : false; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             $appointments = $appointments->where('is_booked', $is_booked); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $appointments = $appointments->paginate(20); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $service = 'Education'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $is_booked = $is_booked ?? null; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $date = $date ?? null; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $status = $status ?? null; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         return view($this->view . 'index', compact('appointments', 'service', 'is_booked', 'date', 'status')); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public function visa_appointments() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $appointments = Appointment::where('service_type', '2')->orderBy('id', 'DESC'); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (\request('date')) { |  |  |  |         if (\request('date')) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             $key = \request('date'); |  |  |  |             $date = \request('date'); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             $appointments = $appointments->whereDate('date',$key); |  |  |  |             $appointments = $appointments->whereDate('date', $date); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (\request('status')) { |  |  |  |         if (\request('status')) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             $key = \request('status'); |  |  |  |             $status = \request('status'); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             $appointments = $appointments->where('status',$key); |  |  |  |             $appointments = $appointments->where('status', $status); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (\request('is_booked')) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             $is_booked = (\request('is_booked')) == '1' ? true : false; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             $appointments = $appointments->where('is_booked', $is_booked); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         $appointments = $appointments->paginate(30); |  |  |  |         $appointments = $appointments->paginate(20); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         return view($this->view.'index',compact('appointments')); |  |  |  |         $is_booked = $is_booked ?? null; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $date = $date ?? null; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $status = $status ?? null; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $service = 'Migration|Visa'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         return view($this->view . 'index', compact('appointments', 'service', 'is_booked', 'date', 'status')); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     public function create() |  |  |  |     public function create() | 
			
		
	
	
		
		
			
				
					|  |  | @ -96,11 +130,11 @@ class AppointmentController extends Controller | 
			
		
	
		
		
			
				
					
					|  |  |  |         return redirect($this->redirect)->with('success', 'Appointment has been updated'); |  |  |  |         return redirect($this->redirect)->with('success', 'Appointment has been updated'); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     public function show($id){ |  |  |  |     public function show($id) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     { | 
			
		
	
		
		
			
				
					
					|  |  |  |         $appointment = Appointment::with('appointment_booking_detail')->findorfail($id); |  |  |  |         $appointment = Appointment::with('appointment_booking_detail')->findorfail($id); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         return view($this->view . 'show', compact('appointment')); |  |  |  |         return view($this->view . 'show', compact('appointment')); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     public function destroy($id) |  |  |  |     public function destroy($id) | 
			
		
	
	
		
		
			
				
					|  |  | @ -111,4 +145,3 @@ class AppointmentController extends Controller | 
			
		
	
		
		
			
				
					
					|  |  |  |         return redirect($this->redirect)->with('success', 'Appointment has been deleted'); |  |  |  |         return redirect($this->redirect)->with('success', 'Appointment has been deleted'); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
	
		
		
			
				
					|  |  | 
 |