From 6023ac6817fd1b0bcfcf800b2eefcd6482612dd3 Mon Sep 17 00:00:00 2001 From: Mahesh Sharma Date: Mon, 13 Feb 2023 09:59:33 +0545 Subject: [PATCH] appointment-initial-confirmed --- .../Admin/AccomodationController.php | 278 ------------------ .../Controllers/AppointmentController.php | 11 +- public/frontend/css/style.css | 33 ++- resources/views/appointment.blade.php | 223 ++++++-------- resources/views/study-abroad-detail.blade.php | 2 +- 5 files changed, 134 insertions(+), 413 deletions(-) delete mode 100644 app/Http/Controllers/Admin/AccomodationController.php diff --git a/app/Http/Controllers/Admin/AccomodationController.php b/app/Http/Controllers/Admin/AccomodationController.php deleted file mode 100644 index a686beb..0000000 --- a/app/Http/Controllers/Admin/AccomodationController.php +++ /dev/null @@ -1,278 +0,0 @@ -where('title','like','%'.$key.'%'); - } - if(\request('status')){ - $key = \request('status'); - $settings = $settings->where('status',$key); - } - $settings = $settings->paginate(config('custom.per_page')); - return view($this->view.'index',compact('settings')); - } - - public function create() - { - return view($this->view . 'create'); - } - - public function store(Request $request) - { - - $this->validate(\request(), [ - 'title' => 'required', - 'phone' => 'required', - 'address' => 'required', - 'status' => 'required', - 'images' => 'required', - 'slider_image' => 'required|file|mimes:jpeg,png,jpg' - ]); - - if($request->has('slider_image')){ - - $extension = \request()->file('slider_image')->getClientOriginalExtension(); - $image_folder_type = array_search('accomodation',config('custom.image_folders')); //for image saved in folder - $count = rand(100,999); - $out_put_path = User::save_image(\request()->file('slider_image'),$extension,$count,$image_folder_type); - $image_path1 = $out_put_path[0]; - } - - $requestData = $request->all(); - if(isset($image_path1)){ - $requestData['slider_image'] = $image_path1; - } - - - // $requestData['slug'] = Setting::create_slug($requestData['keyword']); - $accomodation = Accomodation::create($requestData); - - if($request->hasFile('images')){ - foreach($request->file('images') as $imagefile) { - $extension = $imagefile->getClientOriginalExtension(); - $image_folder_type = array_search('accomodation',config('custom.image_folders')); //for image saved in folder - $count = rand(100,999); - $out_put_path = User::save_image($imagefile,$extension,$count,$image_folder_type); - $image_path1 = $out_put_path[0]; - $accomodation_image = new AccomodationImage(); - $accomodation_image->accomodation_id = $accomodation->id; - $accomodation_image->image = $image_path1; - $accomodation_image->save(); - - } - - } - if(\request('feature_name')){ - foreach (\request('feature_name') as $index => $value){ - $setting_point = new AccomodationFeature(); - $setting_point->accomodation_id = $accomodation->id; - $setting_point->feature_name = $value; - $setting_point->save(); - } - } - if(\request('information_name')){ - foreach (\request('information_name') as $index => $value){ - $setting_point = new AccomodationInformation(); - $setting_point->accomodation_id = $accomodation->id; - $setting_point->information_name = $value; - $setting_point->save(); - } - } - if(\request('title_name')){ - foreach (\request('title_name') as $index => $value){ - $setting_point = new AccomodationSliderTitle(); - $setting_point->accomodation_id = $accomodation->id; - $setting_point->title_name = $value; - $setting_point->save(); - } - } - Session::flash('success','Accomodation successfully created'); - return redirect($this->redirect); - } - - public function show($id) - { - $setting =Accomodation::findorfail($id); - return view($this->view.'show',compact('setting')); - } - - public function edit($id){ - $setting =Accomodation::findorfail($id); - return view($this->view.'edit',compact('setting')); - } - - public function update(Request $request, $id){ - -// dd(\request()->all()); - $setting =Accomodation::findorfail($id); - $this->validate(\request(), [ - 'title' => 'required', - 'phone' => 'required', - 'address' => 'required', - 'status' => 'required' - // 'images' => 'required', - // 'slider_image' => 'required|file|mimes:jpeg,png,jpg' - ]); - - if(\request('slider_image')){ - $this->validate(\request(),[ - 'image' => 'file|mimes:jpeg,png,jpg' - ]); - if($request->hasFile('slider_image')){ - $extension = $request->file('slider_image')->getClientOriginalExtension(); - $image_folder_type = array_search('accomodation',config('custom.image_folders')); //for image saved in folder - $count = rand(100,999); - $out_put_path = User::save_image($request->file('slider_image'),$extension,$count,$image_folder_type); - $image_path1 = $out_put_path[0]; - if (is_file(public_path().'/'.$setting->slider_image) && file_exists(public_path().'/'.$setting->slider_image)){ - unlink(public_path().'/'.$setting->slider_image); - } - } - } - - - $requestData = $request->all(); - // $requestData['slug'] = Setting::create_slug($requestData['keyword']); - if(isset($image_path1)){ - $requestData['slider_image'] = $image_path1; - } - $setting->fill($requestData); - if($setting->save()){ - - if($request->hasFile('images')){ - - $accommodation_image = $setting->accommodation_images(); - $accommodation_image->delete(); - foreach($request->file('images') as $imagefile) { - $extension = $imagefile->getClientOriginalExtension(); - $image_folder_type = array_search('accomodation',config('custom.image_folders')); //for image saved in folder - $count = rand(100,999); - $out_put_path = User::save_image($imagefile,$extension,$count,$image_folder_type); - $image_path1 = $out_put_path[0]; - // if (is_file(public_path().'/'.$setting->slider_image) && file_exists(public_path().'/'.$setting->slider_image)){ - // unlink(public_path().'/'.$setting->slider_image); - // } - $accomodation_image = new AccomodationImage(); - $accomodation_image->accomodation_id = $id; - $accomodation_image->image = $image_path1; - $accomodation_image->save(); - - } - - } - - if(\request('feature_name') ){ - $accommodation_feature = $setting->accommodation_features(); - $accommodation_feature->delete(); - foreach (\request('feature_name') as $index => $value){ - $setting_point = new AccomodationFeature(); - $setting_point->accomodation_id = $id; - $setting_point->feature_name = $value; - $setting_point->save(); - } - } - - if(\request('information_name') ){ - $accommodation_information = $setting->accommodation_informations(); - $accommodation_information->delete(); - foreach (\request('information_name') as $index => $value){ - $setting_point = new AccomodationInformation(); - $setting_point->accomodation_id = $id; - $setting_point->information_name = $value; - $setting_point->save(); - } - } - - if(\request('title_name') ){ - $accommodation_title = $setting->accommodation_slider_titles(); - $accommodation_title->delete(); - foreach (\request('title_name') as $index => $value){ - $setting_point = new AccomodationSlidertitle(); - $setting_point->accomodation_id = $id; - $setting_point->title_name = $value; - $setting_point->save(); - } - } - - } - - Session::flash('success','Accomodation succesffuly edited.'); - return redirect($this->redirect); - - } - - public function delete($id){ - $setting=Accomodation::findorfail($id); - // if($setting->accommodation_features->count() > 0){ - // $setting->accommodation_features()->delete(); - // } - // if($setting->accommodation_informations->count() > 0){ - // $setting->accommodation_informations()->delete(); - // } - // if($setting->accommodation_slider_titles->count() > 0){ - // $setting->accommodation_informations()->delete(); - // } - if($setting->delete()){ - if (is_file(public_path().'/'.$setting->slider_image) && file_exists(public_path().'/'.$setting->slider_image)){ - unlink(public_path().'/'.$setting->slider_image); - } - } - Session::flash('success','Accomodation successfully is deleted !'); - return redirect($this->redirect); - } - - public function points_remove($id) - { - if(Auth::user()){ - $setting = AccomodationFeature::findorfail($id); - $setting->delete(); - return response()->json(['point_id' => $id]); - } - - } - public function information_points_remove($id) - { - if(Auth::user()){ - $setting = AccomodationInformation::findorfail($id); - $setting->delete(); - return response()->json(['point_id' => $id]); - } - - } - public function slider_points_remove($id) - { - if(Auth::user()){ - $setting = AccomodationSliderTitle::findorfail($id); - $setting->delete(); - return response()->json(['point_id' => $id]); - } - - } - -} diff --git a/app/Http/Controllers/AppointmentController.php b/app/Http/Controllers/AppointmentController.php index b71da32..98a4185 100644 --- a/app/Http/Controllers/AppointmentController.php +++ b/app/Http/Controllers/AppointmentController.php @@ -23,21 +23,26 @@ class AppointmentController extends Controller } public function get_appointment_by_date(Request $request){ + $dateTime = $request->date; + $date_parts = explode(" ", $dateTime); $month_number = date_parse($date_parts[1])['month']; $carbon = Carbon::createFromDate($date_parts[3], $month_number, $date_parts[2]); $date = $carbon->format('Y-m-d'); - - $appointments = Appointment::whereDate('date',$date)->where(['status' => 1, 'is_booked' => false])->get(); + $type_id = $request->id; + $appointments = Appointment::whereDate('date',$date)->where(['service_type' => $type_id,'is_booked' => false,'status' => 1])->get(); + + $old_date = Carbon::createFromFormat('Y-m-d', $date); + $formated_date = $old_date->format('M d, Y'); // $users = DB::table('appointments')->whereDate('created_at', '2022-12-01')->get(); // $time = []; // foreach($appointments as $appointment){ // array_push($time, [$appointment->start_time, $appointment->id]); // } // dd($time); - return response()->json(['appointment' => $appointments]); + return response()->json(['appointment' => $appointments,'formated_date' => $formated_date]); } public function form_submit(Request $request){ diff --git a/public/frontend/css/style.css b/public/frontend/css/style.css index 1b9d6e5..c8f0b0f 100644 --- a/public/frontend/css/style.css +++ b/public/frontend/css/style.css @@ -1513,7 +1513,7 @@ Responsive Codes flex-direction: column; gap: 20px; } -.appointment-card{ +/* .appointment-card{ background-color: #E5F0FF; display: flex; align-items: center; @@ -1523,10 +1523,34 @@ Responsive Codes padding: 10px 15px; border-radius: 12px; width: 360px; +} */ +.appointment-section .btn-appointment{ + background-color: #E5F0FF; + text-decoration: none; + color: #000000; + padding: 10px 15px; + border-radius: 8px; + margin-bottom: 15px; + text-align: left; + font-size:20px; + font-weight:bold; +} +.appointment-section .appointment-pills .active{ + background-color: #326cbf!important; + color: #fff!important;; } .appointment-card-img{ width: 40px; padding:5px; + display: inline-block; + margin-right:8px; +} +.book-modal-info p{ + color: #808080; +} +.appointment-section .nav-pills{ + width:82%; + } .appointment-card h3{ font-weight: bold; @@ -1578,7 +1602,6 @@ table.lightgrey-weekends tbody td:nth-child(n+6) { } .appointment-section h1{ color: #296AC7; - margin-bottom: 2rem; } .calender-section h3{ font-size: 18px; @@ -2074,6 +2097,12 @@ table.lightgrey-weekends tbody td:nth-child(n+6) { .faq-section .accordion-button, .accordion-body{ line-height: 27px; } + .appointment-section{ + padding:2rem; + } + .appointment-section .nav-pills { + width: 96%; + } } /* mobile view css end */ /* ipad, tablets screen css */ diff --git a/resources/views/appointment.blade.php b/resources/views/appointment.blade.php index 3e670b2..cb9b89f 100644 --- a/resources/views/appointment.blade.php +++ b/resources/views/appointment.blade.php @@ -11,42 +11,54 @@ @section('content')
-
+

Book an Appointment

-
- -
- -
-
-

Education Services

-
-
- -
- -
-
-

Visa Services

-
-
+

Please select the service and available date to book

+
+ +
+
+
-
-
-
-
Time Zone:
-
Australia | Sydney
+ +
+
+
+
+
+
Time Zone:
+
Australia | Sydney
+
+

Select Available Date

+

Education services | 30 mins

+
+
+
-

Select available date

-

Education services | 30 mins

-
-
- + + +
+
+
+
Time Zone:
+
Australia | Sydney
+
+

Select Available Date

+

Visa services | 30 mins

+
+
+
+
+ @@ -91,61 +103,38 @@
- - - - - - - @endsection @section('script') + @endsection \ No newline at end of file diff --git a/resources/views/study-abroad-detail.blade.php b/resources/views/study-abroad-detail.blade.php index 73e2e6b..d2fa5c5 100644 --- a/resources/views/study-abroad-detail.blade.php +++ b/resources/views/study-abroad-detail.blade.php @@ -58,7 +58,7 @@
    - @foreach($universities->skip(3)->take(3) as $point) + @foreach($universities->skip(6)->take(3) as $point)
  • {{$point->point}}
  • @endforeach