Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
tribikram | b442ed8aab | 2 years ago |
tribikram | fb66e173a5 | 2 years ago |
tribikram | 5ba8f799c6 | 2 years ago |
tribikram | c5d44d9533 | 2 years ago |
tribikram | cbe0928929 | 2 years ago |
@ -1,36 +0,0 @@ |
||||
<?php |
||||
|
||||
namespace App\Console\Commands; |
||||
|
||||
use Illuminate\Console\Command; |
||||
use Illuminate\Support\Facades\Queue; |
||||
|
||||
class CheckQueue extends Command |
||||
{ |
||||
/** |
||||
* The name and signature of the console command. |
||||
* |
||||
* @var string |
||||
*/ |
||||
protected $signature = 'queue:check'; |
||||
|
||||
/** |
||||
* The console command description. |
||||
* |
||||
* @var string |
||||
*/ |
||||
protected $description = 'Check if there is a job in the queue'; |
||||
|
||||
/** |
||||
* Execute the console command. |
||||
* |
||||
* @return int |
||||
*/ |
||||
public function handle() |
||||
{ |
||||
$count = Queue::size(); // Get the number of jobs in the queue |
||||
if ($count > 0) { |
||||
$this->call('queue:process'); // Call the ProcessQueue command if there is a job in the queue |
||||
} |
||||
} |
||||
} |
@ -1,33 +0,0 @@ |
||||
<?php |
||||
|
||||
namespace App\Console\Commands; |
||||
|
||||
use Illuminate\Console\Command; |
||||
use Illuminate\Support\Facades\Queue; |
||||
|
||||
class ProcessQueue extends Command |
||||
{ |
||||
/** |
||||
* The name and signature of the console command. |
||||
* |
||||
* @var string |
||||
*/ |
||||
protected $signature = 'queue:process'; |
||||
|
||||
/** |
||||
* The console command description. |
||||
* |
||||
* @var string |
||||
*/ |
||||
protected $description = 'Process the tasks in the queue'; |
||||
|
||||
/** |
||||
* Execute the console command. |
||||
* |
||||
* @return int |
||||
*/ |
||||
public function handle() |
||||
{ |
||||
Queue::daemon(); // Process the tasks in the queue |
||||
} |
||||
} |
@ -0,0 +1,278 @@ |
||||
<?php |
||||
|
||||
namespace App\Http\Controllers\Admin; |
||||
|
||||
use App\Http\Controllers\Controller; |
||||
use App\Models\Accomodation; |
||||
use App\Models\BlogPoint; |
||||
use App\Models\NewsAndUpdatePoint; |
||||
use App\Models\Setting; |
||||
use App\Models\User; |
||||
use App\Models\AccomodationFeature; |
||||
use App\Models\AccomodationInformation; |
||||
use App\Models\AccomodationSliderTitle; |
||||
use App\Models\AccomodationImage; |
||||
use Illuminate\Http\Request; |
||||
use Illuminate\Support\Facades\Auth; |
||||
use Illuminate\Support\Facades\Session; |
||||
// use function GuzzleHttp\Promise\all; |
||||
|
||||
class AccomodationController extends Controller |
||||
{ |
||||
protected $view = 'admin.accomodation.'; |
||||
protected $redirect = 'admin/accomodations'; |
||||
|
||||
public function index() |
||||
{ |
||||
$settings = Accomodation::orderBy('id','DESC'); |
||||
|
||||
if(\request('name')){ |
||||
$key = \request('name'); |
||||
$settings = $settings->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]); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
@ -1,155 +0,0 @@ |
||||
<?php |
||||
|
||||
namespace App\Http\Controllers\Admin; |
||||
|
||||
use App\Http\Controllers\Controller; |
||||
|
||||
|
||||
use App\Models\Appointment; |
||||
use Illuminate\Http\Request; |
||||
use Carbon\Carbon; |
||||
|
||||
class AppointmentController extends Controller |
||||
{ |
||||
protected $view = 'admin.appointment.'; |
||||
protected $redirect = 'admin/appointments'; |
||||
// protected $service; |
||||
|
||||
public function education_appointments() |
||||
{ |
||||
$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')) { |
||||
$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); |
||||
$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() |
||||
{ |
||||
return view($this->view . 'create'); |
||||
} |
||||
|
||||
public function store(Request $request) |
||||
{ |
||||
$request->validate([ |
||||
'date' => 'required|date', |
||||
'start_time' => 'required|date_format:H:i', |
||||
'end_time' => 'required|date_format:H:i', |
||||
]); |
||||
$start_time = Carbon::createFromFormat('H:i', $request->get('start_time'))->format('H:i A'); |
||||
$end_time = Carbon::createFromFormat('H:i', $request->get('end_time'))->format('H:i A'); |
||||
|
||||
$appointment = new Appointment([ |
||||
'date' => $request->get('date'), |
||||
'start_time' => $start_time, |
||||
'end_time' => $end_time, |
||||
'location' => $request->get('location'), |
||||
'description' => $request->get('description'), |
||||
'service_type' => $request->get('service_type'), |
||||
]); |
||||
|
||||
$appointment->save(); |
||||
if($request->get('service_type') == "1"){ |
||||
$service = 'education'; |
||||
}else{ |
||||
$service = 'visa'; |
||||
} |
||||
|
||||
return redirect($this->redirect.'/'.$service)->with('success', 'Appointment has been added'); |
||||
} |
||||
|
||||
public function edit($id) |
||||
{ |
||||
$appointment = Appointment::findorfail($id); |
||||
$start_time = explode(" ", $appointment->start_time); |
||||
$start_time = $start_time[0]; |
||||
|
||||
$end_time = explode(" ", $appointment->end_time); |
||||
$end_time = $end_time[0]; |
||||
$appointment['start_time'] = $start_time; |
||||
$appointment['end_time'] = $end_time; |
||||
return view($this->view . 'edit', compact('appointment')); |
||||
} |
||||
|
||||
public function update(Request $request, $id) |
||||
{ |
||||
|
||||
$request->validate([ |
||||
'date' => 'required|date', |
||||
'start_time' => 'required|date_format:H:i', |
||||
'end_time' => 'required|date_format:H:i', |
||||
]); |
||||
$start_time = Carbon::createFromFormat('H:i', $request->get('start_time'))->format('H:i A'); |
||||
$end_time = Carbon::createFromFormat('H:i', $request->get('end_time'))->format('H:i A'); |
||||
|
||||
$appointment = Appointment::find($id); |
||||
$appointment->date = $request->get('date'); |
||||
$appointment->start_time = $start_time; |
||||
$appointment->end_time = $end_time; |
||||
$appointment->location = $request->get('location'); |
||||
$appointment->description = $request->get('description'); |
||||
$appointment->service_type = $request->get('service_type'); |
||||
$appointment->status = $request->get('status'); |
||||
$appointment->save(); |
||||
if($request->get('service_type') == "1"){ |
||||
$service = 'education'; |
||||
}else{ |
||||
$service = 'visa'; |
||||
} |
||||
|
||||
return redirect($this->redirect.'/'.$service)->with('success', 'Appointment has been updated'); |
||||
} |
||||
|
||||
public function show($id) |
||||
{ |
||||
$appointment = Appointment::with('appointment_booking_detail')->findorfail($id); |
||||
|
||||
return view($this->view . 'show', compact('appointment')); |
||||
} |
||||
|
||||
public function destroy($id) |
||||
{ |
||||
$appointment = Appointment::find($id); |
||||
$appointment->delete(); |
||||
|
||||
return redirect($this->redirect)->with('success', 'Appointment has been deleted'); |
||||
} |
||||
} |
@ -1,145 +0,0 @@ |
||||
<?php |
||||
|
||||
namespace App\Http\Controllers; |
||||
|
||||
use Illuminate\Http\Request; |
||||
use App\Models\Appointment; |
||||
use Carbon\Carbon; |
||||
use App\Models\AppointmentBookingDetail; |
||||
|
||||
class AppointmentController extends Controller |
||||
{ |
||||
public function index(){ |
||||
|
||||
$educationAppointments = Appointment::where('date', '>=', Carbon::today())->where('service_type', '1')->get(); |
||||
$visaAppointments = Appointment::where('date', '>=', Carbon::today())->where('service_type', '2')->get(); |
||||
// foreach($educationAppointments as $appointment){ |
||||
// $startTime = Carbon::createFromFormat('H:i', $appointment->start_time); |
||||
// $date = Carbon::createFromFormat('H:i', $appointment->start_time); |
||||
// dd($date); |
||||
// } |
||||
return view('appointment', compact('educationAppointments', 'visaAppointments')); |
||||
|
||||
} |
||||
|
||||
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'); |
||||
|
||||
$type_id = $request->id; |
||||
$appointments_all = 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'); |
||||
$currentTime = Carbon::now(); |
||||
$appointments = []; |
||||
foreach ($appointments_all as $appointment) { |
||||
$start_time = explode(" ", $appointment->start_time); |
||||
$start_time = $start_time[0]; |
||||
$appointmentDate = Carbon::createFromFormat('Y-m-d H:i', $appointment->date.' '.$start_time); |
||||
if ($appointmentDate->gt($currentTime)) { |
||||
array_push($appointments, $appointment); |
||||
} |
||||
} |
||||
|
||||
return response()->json(['appointment' => $appointments,'formated_date' => $formated_date]); |
||||
} |
||||
|
||||
public function form_submit(Request $request){ |
||||
|
||||
$request->validate([ |
||||
'name' => 'required', |
||||
'email' => 'required|email', |
||||
'phone' => 'required', |
||||
]); |
||||
$appointment_id = $request->get('appointment_id'); |
||||
|
||||
$appointment = Appointment::findorfail($appointment_id); |
||||
$appointment_detail = new AppointmentBookingDetail(); |
||||
$appointment_detail->name = $request->get('name'); |
||||
$appointment_detail->email = $request->get('email'); |
||||
$appointment_detail->phone = $request->get('phone'); |
||||
$appointment_detail->notes = $request->get('notes'); |
||||
$appointment_detail->appointment_id = $appointment_id; |
||||
$email = $request['email']; |
||||
$name = $request['name']; |
||||
$phone = $request['phone']; |
||||
|
||||
if($appointment_detail->save()){ |
||||
|
||||
$date = Carbon::createFromFormat('Y-m-d', $appointment->date); |
||||
$formated_date = $date->format('M d, Y'); |
||||
$appointment->is_booked = true; |
||||
$appointment->save(); |
||||
$subject = 'Appointment Booked Successfully.'; |
||||
dispatch(function() use ($name,$email,$phone,$subject,$formated_date,$appointment) { |
||||
|
||||
\Mail::send('appointment_confirmed', array( |
||||
|
||||
'full_name' =>$name, |
||||
|
||||
'email' =>$email, |
||||
|
||||
'date' => $formated_date, |
||||
|
||||
'start_time' => $appointment['start_time'], |
||||
|
||||
'end_time' => $appointment['end_time'], |
||||
|
||||
'phone' =>$phone, |
||||
|
||||
'subject' =>$subject |
||||
|
||||
|
||||
), function($message) use ($subject,$email,$name){ |
||||
// $subject=($service!= '') ? 'Enquiry for '.$service : 'Contact/Feedback'; |
||||
$message->subject($subject); |
||||
// $message->from('admin@eteducation.com.au', 'Admin'); |
||||
$message->to($email, $name)->subject($subject); |
||||
// $message->cc('extratechweb@gmail.com', 'Extratech')->subject($subject); |
||||
// $message->cc('admin@eteducation.com.au', 'Extratech')->subject($subject); |
||||
|
||||
}); |
||||
|
||||
|
||||
}); |
||||
|
||||
dispatch(function() use ($name,$email,$phone,$subject,$formated_date,$appointment) { |
||||
|
||||
\Mail::send('appointment_confirmed_for_admin', array( |
||||
|
||||
'full_name' =>$name, |
||||
|
||||
'email' =>$email, |
||||
|
||||
'date' => $formated_date, |
||||
|
||||
'start_time' => $appointment['start_time'], |
||||
|
||||
'end_time' => $appointment['end_time'], |
||||
|
||||
'phone' =>$phone, |
||||
|
||||
'subject' =>$subject |
||||
|
||||
), function($message) use ($subject){ |
||||
// $subject=($service!= '') ? 'Enquiry for '.$service : 'Contact/Feedback'; |
||||
$message->subject($subject); |
||||
// $message->to($email, $name)->subject($subject); |
||||
$message->to('mahesh@extratechs.com.au', 'Extratech')->subject($subject); |
||||
// $message->cc('admin@eteducation.com.au', 'Extratech')->subject($subject); |
||||
|
||||
}); |
||||
|
||||
|
||||
}); |
||||
} |
||||
|
||||
return response()->json(['appointment_detail' => $appointment_detail,'appointment' => $appointment,'formated_date' => $formated_date],200); |
||||
|
||||
} |
||||
} |
@ -1,76 +0,0 @@ |
||||
<?php |
||||
|
||||
namespace App\Http\Controllers; |
||||
|
||||
use App\Jobs\SendEnquiryMailJob; |
||||
use App\Models\Country; |
||||
use App\Models\Enquiry; |
||||
use Illuminate\Http\Request; |
||||
use Illuminate\Support\Facades\DB; |
||||
use Illuminate\Support\Facades\Session; |
||||
|
||||
|
||||
|
||||
class EnquiryController extends Controller |
||||
{ |
||||
public function form() |
||||
{ |
||||
$countries = Country::all(); |
||||
return view('enquiry-form', compact('countries')); |
||||
} |
||||
|
||||
public function submit(Request $request) |
||||
{ |
||||
$work_experience = $request->get('work_experience'); |
||||
if ($work_experience == 'no') { |
||||
$request['work_experience_details'] = null; |
||||
$request['salary_mode'] = null; |
||||
} |
||||
$marital_status = $request->get('marital_status'); |
||||
if ($marital_status == 'Widow' || $marital_status == 'Single') { |
||||
$request['married_date'] = null; |
||||
$request['spouse_academics'] = null; |
||||
$request['spouse_work_experience'] = null; |
||||
$request['spouse_salary_mode'] = null; |
||||
} |
||||
DB::beginTransaction(); |
||||
try { |
||||
$enquiry = Enquiry::create($request->all()); |
||||
} catch (\Exception $e) { |
||||
DB::rollback(); |
||||
return redirect()->back()->with(['msg' => 'Something went wrong. Please try again!', 'status' => false], 400); |
||||
} |
||||
DB::commit(); |
||||
dispatch(new SendEnquiryMailJob($enquiry)); |
||||
return redirect()->back()->with(['msg' => 'We have recieved your enquiry. You will be contacted soon!', 'status' => true], 200); |
||||
} |
||||
|
||||
public function index() |
||||
{ |
||||
|
||||
$enquiries = Enquiry::orderBy('id', 'DESC'); |
||||
if (\request('name')) { |
||||
$key = \request('name'); |
||||
$enquiries = $enquiries->where('first_name', 'like', $key . '%'); |
||||
} |
||||
if (\request('email')) { |
||||
$key = \request('email'); |
||||
$enquiries = $enquiries->where('email', 'like', $key . '%'); |
||||
} |
||||
$enquiries = $enquiries->paginate(30); |
||||
return view('admin.enquiry.index', compact('enquiries')); |
||||
} |
||||
|
||||
public function show($id) |
||||
{ |
||||
$enquiry = Enquiry::findorfail($id); |
||||
return view('admin.enquiry.show', compact('enquiry')); |
||||
} |
||||
public function delete($id) |
||||
{ |
||||
$enquiry = Enquiry::findorfail($id); |
||||
$enquiry->delete(); |
||||
Session::flash('success', 'Enquiry has been successfully deleted!'); |
||||
return redirect('admin/enquiries'); |
||||
} |
||||
} |
@ -1,41 +0,0 @@ |
||||
<?php |
||||
|
||||
namespace App\Jobs; |
||||
|
||||
use App\Mail\EnquiryMail; |
||||
use App\Models\Setting; |
||||
use Illuminate\Bus\Queueable; |
||||
use Illuminate\Contracts\Queue\ShouldBeUnique; |
||||
use Illuminate\Contracts\Queue\ShouldQueue; |
||||
use Illuminate\Foundation\Bus\Dispatchable; |
||||
use Illuminate\Queue\InteractsWithQueue; |
||||
use Illuminate\Queue\SerializesModels; |
||||
use Illuminate\Support\Facades\Mail; |
||||
|
||||
class SendEnquiryMailJob implements ShouldQueue |
||||
{ |
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; |
||||
|
||||
/** |
||||
* Create a new job instance. |
||||
* |
||||
* @return void |
||||
*/ |
||||
protected $enquiry; |
||||
public function __construct($enquiry) |
||||
{ |
||||
$this->enquiry = $enquiry; |
||||
} |
||||
|
||||
/** |
||||
* Execute the job. |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function handle() |
||||
{ |
||||
$email = Setting::where('key', 'email')->get('value')->first()->value; |
||||
|
||||
Mail::to($email)->send(new EnquiryMail($this->enquiry)); |
||||
} |
||||
} |
@ -1,65 +0,0 @@ |
||||
<?php |
||||
|
||||
namespace App\Mail; |
||||
|
||||
use Illuminate\Bus\Queueable; |
||||
use Illuminate\Contracts\Queue\ShouldQueue; |
||||
use Illuminate\Mail\Mailable; |
||||
use Illuminate\Mail\Mailables\Content; |
||||
use Illuminate\Mail\Mailables\Envelope; |
||||
use Illuminate\Queue\SerializesModels; |
||||
|
||||
class EnquiryMail extends Mailable |
||||
{ |
||||
use Queueable, SerializesModels; |
||||
|
||||
/** |
||||
* Create a new message instance. |
||||
* |
||||
* @return void |
||||
* |
||||
*/ |
||||
protected $enquiry; |
||||
|
||||
public function __construct($enquiry) |
||||
{ |
||||
$this->enquiry = $enquiry; |
||||
} |
||||
|
||||
/** |
||||
* Get the message envelope. |
||||
* |
||||
* @return \Illuminate\Mail\Mailables\Envelope |
||||
*/ |
||||
public function envelope() |
||||
{ |
||||
return new Envelope( |
||||
subject: 'Enquiry Mail', |
||||
); |
||||
} |
||||
|
||||
/** |
||||
* Get the message content definition. |
||||
* |
||||
* @return \Illuminate\Mail\Mailables\Content |
||||
*/ |
||||
public function content() |
||||
{ |
||||
return new Content( |
||||
view: 'enquiry_mail', |
||||
with: [ |
||||
'enquiry' => $this->enquiry, |
||||
], |
||||
); |
||||
} |
||||
|
||||
/** |
||||
* Get the attachments for the message. |
||||
* |
||||
* @return array |
||||
*/ |
||||
public function attachments() |
||||
{ |
||||
return []; |
||||
} |
||||
} |
@ -1,17 +0,0 @@ |
||||
<?php |
||||
|
||||
namespace App\Models; |
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory; |
||||
use Illuminate\Database\Eloquent\Model; |
||||
|
||||
class Appointment extends Model |
||||
{ |
||||
use HasFactory; |
||||
|
||||
protected $guarded = ['id']; |
||||
|
||||
public function appointment_booking_detail(){ |
||||
return $this->hasOne(AppointmentBookingDetail::class); |
||||
} |
||||
} |
@ -1,15 +0,0 @@ |
||||
<?php |
||||
|
||||
namespace App\Models; |
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory; |
||||
use Illuminate\Database\Eloquent\Model; |
||||
|
||||
class AppointmentBookingDetail extends Model |
||||
{ |
||||
use HasFactory; |
||||
|
||||
public function appointment(){ |
||||
return $this->belongsTo(Appointment::class); |
||||
} |
||||
} |
@ -1,11 +0,0 @@ |
||||
<?php |
||||
|
||||
namespace App\Models; |
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory; |
||||
use Illuminate\Database\Eloquent\Model; |
||||
|
||||
class Country extends Model |
||||
{ |
||||
use HasFactory; |
||||
} |
@ -1,13 +0,0 @@ |
||||
<?php |
||||
|
||||
namespace App\Models; |
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory; |
||||
use Illuminate\Database\Eloquent\Model; |
||||
|
||||
class Enquiry extends Model |
||||
{ |
||||
use HasFactory; |
||||
|
||||
protected $guarded = ['id']; |
||||
} |
@ -1,37 +0,0 @@ |
||||
<?php |
||||
|
||||
use Illuminate\Database\Migrations\Migration; |
||||
use Illuminate\Database\Schema\Blueprint; |
||||
use Illuminate\Support\Facades\Schema; |
||||
|
||||
return new class extends Migration |
||||
{ |
||||
/** |
||||
* Run the migrations. |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function up() |
||||
{ |
||||
Schema::create('appointments', function (Blueprint $table) { |
||||
$table->id(); |
||||
$table->date('date'); |
||||
$table->string('start_time'); |
||||
$table->string('end_time'); |
||||
$table->string('location')->nullable(); |
||||
$table->string('description')->nullable(); |
||||
$table->enum('status',[1,2]); |
||||
$table->timestamps(); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* Reverse the migrations. |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function down() |
||||
{ |
||||
Schema::dropIfExists('appointments'); |
||||
} |
||||
}; |
@ -1,32 +0,0 @@ |
||||
<?php |
||||
|
||||
use Illuminate\Database\Migrations\Migration; |
||||
use Illuminate\Database\Schema\Blueprint; |
||||
use Illuminate\Support\Facades\Schema; |
||||
|
||||
return new class extends Migration |
||||
{ |
||||
/** |
||||
* Run the migrations. |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function up() |
||||
{ |
||||
Schema::table('appointments', function (Blueprint $table) { |
||||
$table->enum('service_type',[1,2]); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* Reverse the migrations. |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function down() |
||||
{ |
||||
Schema::table('appointments', function (Blueprint $table) { |
||||
// |
||||
}); |
||||
} |
||||
}; |
@ -1,32 +0,0 @@ |
||||
<?php |
||||
|
||||
use Illuminate\Database\Migrations\Migration; |
||||
use Illuminate\Database\Schema\Blueprint; |
||||
use Illuminate\Support\Facades\Schema; |
||||
|
||||
return new class extends Migration |
||||
{ |
||||
/** |
||||
* Run the migrations. |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function up() |
||||
{ |
||||
Schema::table('appointments', function (Blueprint $table) { |
||||
$table->boolean('is_booked')->default(false); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* Reverse the migrations. |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function down() |
||||
{ |
||||
Schema::table('appointments', function (Blueprint $table) { |
||||
// |
||||
}); |
||||
} |
||||
}; |
@ -1,37 +0,0 @@ |
||||
<?php |
||||
|
||||
use Illuminate\Database\Migrations\Migration; |
||||
use Illuminate\Database\Schema\Blueprint; |
||||
use Illuminate\Support\Facades\Schema; |
||||
|
||||
return new class extends Migration |
||||
{ |
||||
/** |
||||
* Run the migrations. |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function up() |
||||
{ |
||||
Schema::create('appointment_booking_details', function (Blueprint $table) { |
||||
$table->id(); |
||||
$table->bigInteger('appointment_id')->unsigned(); |
||||
$table->foreign('appointment_id')->references('id')->on('appointments')->onDelete('cascade'); |
||||
$table->string('name'); |
||||
$table->string('email')->nullable(); |
||||
$table->string('phone'); |
||||
$table->string('notes')->nullable(); |
||||
$table->timestamps(); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* Reverse the migrations. |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function down() |
||||
{ |
||||
Schema::dropIfExists('appointment_booking_details'); |
||||
} |
||||
}; |
@ -1,59 +0,0 @@ |
||||
<?php |
||||
|
||||
use Illuminate\Database\Migrations\Migration; |
||||
use Illuminate\Database\Schema\Blueprint; |
||||
use Illuminate\Support\Facades\Schema; |
||||
|
||||
return new class extends Migration |
||||
{ |
||||
/** |
||||
* Run the migrations. |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function up() |
||||
{ |
||||
Schema::create('enquiries', function (Blueprint $table) { |
||||
$table->id(); |
||||
$table->string('first_name'); |
||||
$table->string('middle_name')->nullable(); |
||||
$table->string('last_name'); |
||||
$table->date('dob'); |
||||
$table->string('cob'); |
||||
$table->string('gender'); |
||||
$table->string('email'); |
||||
$table->string('phone'); |
||||
$table->string('address'); |
||||
$table->string('highest_qualification'); |
||||
$table->string('stream')->nullable(); |
||||
$table->string('gpa'); |
||||
$table->string('graduate_year'); |
||||
$table->string('gap')->nullable(); |
||||
$table->string('current_status')->nullable(); |
||||
$table->string('work_experience'); |
||||
$table->text('work_experience_details')->nullable(); |
||||
$table->string('salary_mode')->nullable(); |
||||
$table->string('test_score')->nullable(); |
||||
$table->string('marital_status'); |
||||
$table->string('married_date')->nullable(); |
||||
$table->string('spouse_academics')->nullable(); |
||||
$table->string('spouse_work_experience')->nullable(); |
||||
$table->string('spouse_salary_mode')->nullable(); |
||||
$table->string('immigration_history')->nullable(); |
||||
$table->string('desired_study_field')->nullable(); |
||||
$table->string('desired_location')->nullable(); |
||||
$table->boolean('status')->default(true); |
||||
$table->timestamps(); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* Reverse the migrations. |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function down() |
||||
{ |
||||
Schema::dropIfExists('enquiries'); |
||||
} |
||||
}; |
@ -1,49 +0,0 @@ |
||||
<?php |
||||
|
||||
namespace Database\Seeders; |
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents; |
||||
use Illuminate\Database\Seeder; |
||||
use App\Models\Appointment; |
||||
use Carbon\Carbon; |
||||
use Carbon\CarbonInterval; |
||||
use Illuminate\Support\Facades\DB; |
||||
|
||||
|
||||
class AppointmentTableSeeder extends Seeder |
||||
{ |
||||
/** |
||||
* Run the database seeds. |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function run() |
||||
{ |
||||
|
||||
$latestAppointment = DB::table('appointments')->latest('date')->first(); |
||||
$startDate = $latestAppointment ? Carbon::parse($latestAppointment->date)->addDay() : Carbon::now(); |
||||
|
||||
$startTime = Carbon::parse("9:00 AM"); |
||||
$endTime = Carbon::parse("5:00 PM"); |
||||
|
||||
foreach(config('custom.service_type') as $key => $value){ |
||||
|
||||
for ($i = 0; $i < 7; $i++) { |
||||
$date = $startDate->copy()->addDays($i); |
||||
for ($j = 0; $j <= ((($endTime->diffInMinutes($startTime)) / 30)-1); $j++) { |
||||
|
||||
$currentTime = $startTime->copy()->addMinutes(30 * $j); |
||||
$currentEndTime = $startTime->copy()->addMinutes(30 * $j + 30); |
||||
|
||||
DB::table('appointments')->insert([ |
||||
'date' => $date, |
||||
'start_time' => $currentTime->format("H:i A"), |
||||
'end_time' => $currentEndTime->format("H:i A"), |
||||
'service_type' => $key |
||||
]); |
||||
} |
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 389 KiB After Width: | Height: | Size: 389 KiB |
Before Width: | Height: | Size: 389 KiB After Width: | Height: | Size: 389 KiB |
Before Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 455 KiB |
Before Width: | Height: | Size: 348 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 259 KiB |
Before Width: | Height: | Size: 377 KiB |
@ -1,82 +0,0 @@ |
||||
/*! Zabuto Calendar - v2.1.0 - 2022-12-29 |
||||
* https://github.com/zabuto/calendar |
||||
* Copyright (c) 2022 Anke Heijnen; Licensed MIT */ |
||||
.zabuto-calendar { |
||||
width: 100%; |
||||
margin: 0; |
||||
padding: 0 |
||||
} |
||||
|
||||
.zabuto-calendar__navigation__item--next, |
||||
.zabuto-calendar__navigation__item--prev { |
||||
text-align: center; |
||||
cursor: pointer |
||||
} |
||||
|
||||
.zabuto-calendar__navigation__item--header { |
||||
text-align: center |
||||
} |
||||
|
||||
.zabuto-calendar__navigation__item--header__title { |
||||
cursor: pointer; |
||||
font-weight: bolder |
||||
} |
||||
|
||||
.zabuto-calendar__days-of-week__item { |
||||
text-align: center |
||||
} |
||||
|
||||
.zabuto-calendar__day { |
||||
text-align: center |
||||
} |
||||
|
||||
.zabuto-calendar__day--today { |
||||
text-align: center |
||||
} |
||||
|
||||
.zabuto-calendar.table td, |
||||
.zabuto-calendar.table th { |
||||
vertical-align: middle |
||||
} |
||||
|
||||
.zabuto-calendar.table thead td { |
||||
padding-top: 14px; |
||||
padding-bottom: 14px; |
||||
background-color: #fafafa |
||||
} |
||||
|
||||
.zabuto-calendar.table-bordered thead td { |
||||
border: 0 |
||||
} |
||||
|
||||
.zabuto-calendar.table thead th { |
||||
background-color: #f0f0f0 |
||||
} |
||||
|
||||
.zabuto-calendar.table>thead:first-child>tr:first-child>td { |
||||
border-top: 1px solid #ddd |
||||
} |
||||
|
||||
.zabuto-calendar.table>thead>tr>th { |
||||
border-bottom: 2px solid #ddd |
||||
} |
||||
|
||||
.zabuto-calendar.table>tbody td { |
||||
width: calc(100% / 7) |
||||
} |
||||
|
||||
.zabuto-calendar.table>tbody>tr:last-child>td { |
||||
border-bottom: 1px solid #ddd |
||||
} |
||||
|
||||
.zabuto-calendar.table>tbody td .badge { |
||||
font-size: 100% |
||||
} |
||||
|
||||
.zabuto-calendar.clickable>tbody td { |
||||
cursor: pointer |
||||
} |
||||
|
||||
.zabuto-calendar.table.clickable>tbody td:hover { |
||||
background-color: #f0f0f0 |
||||
} |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 394 KiB |
After Width: | Height: | Size: 394 KiB |
After Width: | Height: | Size: 2.4 MiB |
After Width: | Height: | Size: 460 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 389 KiB |
After Width: | Height: | Size: 389 KiB |
Before Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 441 KiB After Width: | Height: | Size: 441 KiB |
Before Width: | Height: | Size: 441 KiB After Width: | Height: | Size: 441 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 441 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 441 KiB |
Before Width: | Height: | Size: 441 KiB |
Before Width: | Height: | Size: 441 KiB |
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 431 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 572 KiB |
Before Width: | Height: | Size: 610 KiB |
Before Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 572 KiB |