et#23
Mahesh Sharma 2 years ago
parent 6023ac6817
commit 0c5354f9ce
  1. 8
      app/Http/Controllers/Admin/AppointmentController.php
  2. 35
      app/Http/Controllers/AppointmentController.php
  3. 5
      resources/views/admin/appointment/index.blade.php
  4. 61
      resources/views/admin/appointment/show.blade.php
  5. 24
      resources/views/appointment_confirmed.blade.php

@ -49,7 +49,6 @@ class AppointmentController extends Controller
'location' => $request->get('location'), 'location' => $request->get('location'),
'description' => $request->get('description'), 'description' => $request->get('description'),
'service_type' => $request->get('service_type'), 'service_type' => $request->get('service_type'),
]); ]);
$appointment->save(); $appointment->save();
@ -86,6 +85,13 @@ 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){
$appointment = Appointment::with('appointment_booking_detail')->findorfail($id);
return view($this->view.'show', compact('appointment'));
}
public function destroy($id) public function destroy($id)
{ {
$appointment = Appointment::find($id); $appointment = Appointment::find($id);

@ -51,22 +51,49 @@ class AppointmentController extends Controller
'email' => 'required|email', 'email' => 'required|email',
'phone' => 'required', 'phone' => 'required',
]); ]);
$appointment_id = $request->get('appointment_id');
$appointment = Appointment::findorfail($appointment_id);
$appointment_detail = new AppointmentBookingDetail(); $appointment_detail = new AppointmentBookingDetail();
$appointment_detail->name = $request->get('name'); $appointment_detail->name = $request->get('name');
$appointment_detail->email = $request->get('email'); $appointment_detail->email = $request->get('email');
$appointment_detail->phone = $request->get('phone'); $appointment_detail->phone = $request->get('phone');
$appointment_detail->notes = $request->get('notes'); $appointment_detail->notes = $request->get('notes');
$appointment_id = $request->get('appointment_id');
$appointment_detail->appointment_id = $appointment_id; $appointment_detail->appointment_id = $appointment_id;
$email = $request['email'];
$name = $request['name'];
if($appointment_detail->save()){ if($appointment_detail->save()){
$appointment = Appointment::findorfail($appointment_id);
$date = Carbon::createFromFormat('Y-m-d', $appointment->date); $date = Carbon::createFromFormat('Y-m-d', $appointment->date);
$formated_date = $date->format('M d, Y'); $formated_date = $date->format('M d, Y');
// $isAm = ($appointment['start_time'] < '12:00:00') ? 'AM' :'PM';
$appointment->is_booked = true; $appointment->is_booked = true;
$appointment->save(); $appointment->save();
$subject = 'Appointment Confirmed';
\Mail::send('appointment_confirmed', array(
'full_name' =>$name,
'email' =>$email,
'date' => $formated_date,
'start_time' => $appointment['start_time'],
'end_time' => $appointment['end_time'],
'phone' =>$request['phone'],
'subject' =>$subject
), function($message) use ($subject,$email,$name){
// $subject=($service!= '') ? 'Enquiry for '.$service : 'Contact/Feedback';
$message->subject($subject);
$message->to($email, $name)->subject($subject);
// $message->cc('extratechweb@gmail.com', 'Extratech')->subject($subject);
// $message->cc('suman@extratechs.com.au', 'Extratech')->subject($subject);
});
} }
return response()->json(['appointment_detail' => $appointment_detail,'appointment' => $appointment,'formated_date' => $formated_date],200); return response()->json(['appointment_detail' => $appointment_detail,'appointment' => $appointment,'formated_date' => $formated_date],200);

@ -55,6 +55,7 @@
<thead> <thead>
<tr> <tr>
<th style="width: 10px">S.N.</th> <th style="width: 10px">S.N.</th>
<th style="width: 10px">Service Type</th>
<th class="text-center">Date</th> <th class="text-center">Date</th>
<th class="text-center">Start Time</th> <th class="text-center">Start Time</th>
<th class="text-center">End Time</th> <th class="text-center">End Time</th>
@ -66,12 +67,16 @@
@foreach($appointments as $setting) @foreach($appointments as $setting)
<tr> <tr>
<th scope="row">{{$loop->iteration}}</th> <th scope="row">{{$loop->iteration}}</th>
<td class="text-center">{{config('custom.service_type')[$setting->service_type]}}</td>
<td class="text-center">{{$setting->date}}</td> <td class="text-center">{{$setting->date}}</td>
<td class="text-center">{{$setting->start_time}}</td> <td class="text-center">{{$setting->start_time}}</td>
<td class="text-center">{{$setting->end_time}}</td> <td class="text-center">{{$setting->end_time}}</td>
<td class="text-center">{{$setting->is_booked ? 'Booked' : 'Not Booked'}}</td> <td class="text-center">{{$setting->is_booked ? 'Booked' : 'Not Booked'}}</td>
<td class="d-flex justify-content-center action-icons"> <td class="d-flex justify-content-center action-icons">
<a href="{{url('admin/appointments/'.$setting->id.'/view')}}" class="btn btn-sm" data-bs-toggle="tooltip" data-bs-placement="top" title="view">
<i class="fa-solid fa-eye"></i>
</a>
<a href="{{url('admin/appointments/'.$setting->id.'/edit')}}" class="btn btn-sm" data-bs-toggle="tooltip" data-bs-placement="top" title="edit"> <a href="{{url('admin/appointments/'.$setting->id.'/edit')}}" class="btn btn-sm" data-bs-toggle="tooltip" data-bs-placement="top" title="edit">
<i class="fas fa-pencil-alt"></i> <i class="fas fa-pencil-alt"></i>
</a> </a>

@ -19,7 +19,7 @@
<!-- SELECT2 EXAMPLE --> <!-- SELECT2 EXAMPLE -->
<div class="card card-default"> <div class="card card-default">
<div class="card-header"> <div class="card-header">
<h3 class="card-title">Applicant</h3> <h3 class="card-title">Appointment Details</h3>
<a href="{{url('admin/applicants')}}" class="btn btn-green back-button active" role="button" aria-pressed="true">List</a> <a href="{{url('admin/applicants')}}" class="btn btn-green back-button active" role="button" aria-pressed="true">List</a>
</div> </div>
<div class="card-body"> <div class="card-body">
@ -27,60 +27,55 @@
@include('errors.error') @include('errors.error')
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="col-md-12 mt-4">
<label for="service_name" style="font-weight: bold; font-size: 20px; color: #DD6227">Booking Details</label></br>
<ul class="contact-info">
<li class="d-flex">
<span>Appointment Date: </span>
<span>{{$appointment->date}}</span>
</li>
<li class="d-flex">
<span>Appointment Start Time: </span>
<span>{{$appointment->start_time}}</span>
</li>
<li class="d-flex">
<span>Appointment End Time: </span>
<span>{{$appointment->end_time}}</span>
</li>
</ul>
</div>
<div class="col-md-12"> <div class="col-md-12">
<label for="service_name" style="font-weight: bold; font-size: 20px; color: #DD6227">Applicant Details</label></br> <label for="service_name" style="font-weight: bold; font-size: 20px; color: #DD6227">Applicant Details</label></br>
<ul class="contact-info"> <ul class="contact-info">
@php $appointment_detail = $appointment->appointment_booking_detail; @endphp
<li class="d-flex"> <li class="d-flex">
<span>Full Name:</span> <span>Full Name:</span>
<span>{{$applicants->name}}</span> <span>{{$appointment_detail->name}}</span>
</li> </li>
<li class="d-flex"> <li class="d-flex">
<span>Email:</span> <span>Email:</span>
<span>{{$applicants->email}}</span> <span>{{$appointment_detail->email}}</span>
</li> </li>
<li class="d-flex"> <li class="d-flex">
<span>Phone:</span> <span>Phone:</span>
<span>{{$applicants->phone}}</span> <span>{{$appointment_detail->phone}}</span>
</li> </li>
<li class="d-flex">
<span>State:</span>
<span>{{config('custom.states')[$applicants->state]}}</span>
</li>
</ul>
</div>
<div class="col-md-12 mt-4">
<label for="service_name" style="font-weight: bold; font-size: 20px; color: #DD6227">Interested Areas</label></br>
<ul class="contact-info">
<li class="d-flex"> <li class="d-flex">
<span>Sevices:</span> <span>Notes:</span>
<span> <span>{{$appointment_detail->notes}}</span>
@foreach($applicants->applicant_service as $service)
{{App\Models\Service::find($service->service_id)->name}}<br />
@endforeach
</span>
</li>
<li class="d-flex">
<span>Message: </span>
<span>{{$applicants->message}}</span>
</li> </li>
<li class="d-flex">
<span>Resume: </span>
<a target = "_blank" href="{{url($applicants->resume)}}" class="d-flex">
<!-- <div class="profile-icon mr-2">
<img src="{{url('admin/images/view-icon.png')}}" alt="">
</div> -->
<p>View Resume</p>
</a>
<!-- <span>{{url($applicants->resume)}}</span> -->
</li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>

@ -0,0 +1,24 @@
<style>
.main-column{
display:flex;
width:100%;
}
.column-one{
width:50%;
}
</style>
<h1>Appointment Booked Successfully</h1>
<br />
<div class="main-column" style = "display:block; width:100%;">
<div class="column-one" style = "display:block; width:100%;">
<h3>Please, find out the booking details below</h3>
<b>Appointment Date:</b>{{$date}}<br /><br />
<b>Appointment Start Time:</b>{{$start_time}}<br /><br />
<b>Appointment End Time:</b>{{$end_time}}<br /><br />
<b>Your Full Name:</b> {{ $full_name }}<br /><br />
<b>Phone:</b> {{$phone}}<br /><br />
</div>
</div>
Loading…
Cancel
Save