|
@@ -74,7 +74,13 @@
|
|
placeholder="(optional)">
|
|
placeholder="(optional)">
|
|
</div>
|
|
</div>
|
|
<div class="mb-3">
|
|
<div class="mb-3">
|
|
- <button class="btn btn-sm btn-primary d-block w-100 font-weight-bold">Set Appointment</button>
|
|
|
|
|
|
+ <button class="btn btn-sm btn-primary d-block w-100 font-weight-bold">
|
|
|
|
+ @if($appointment && $appointment->uid)
|
|
|
|
+ Update Appointment
|
|
|
|
+ @else
|
|
|
|
+ Book Appointment
|
|
|
|
+ @endif
|
|
|
|
+ </button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</form>
|
|
<div class="appt-calendar-col pl-2 border-left border-light">
|
|
<div class="appt-calendar-col pl-2 border-left border-light">
|
|
@@ -131,7 +137,7 @@
|
|
$('.appt-form [name="date"]').val(info.dateStr.substr(0, 10));
|
|
$('.appt-form [name="date"]').val(info.dateStr.substr(0, 10));
|
|
},
|
|
},
|
|
eventClassNames: function(arg) {
|
|
eventClassNames: function(arg) {
|
|
- @if($appointment)
|
|
|
|
|
|
+ @if($appointment && $appointment->uid)
|
|
if(arg.event.extendedProps.appointmentUid === '{{ $appointment->uid }}') {
|
|
if(arg.event.extendedProps.appointmentUid === '{{ $appointment->uid }}') {
|
|
return ['stag-current-appt'];
|
|
return ['stag-current-appt'];
|
|
}
|
|
}
|
|
@@ -163,7 +169,7 @@
|
|
$('.appt-form [name="endTime"]').val($('.appt-form [name="endTime"]').val().substr(0, 5));
|
|
$('.appt-form [name="endTime"]').val($('.appt-form [name="endTime"]').val().substr(0, 5));
|
|
$.post(form.attr('action'), form.serialize(), function(_data) {
|
|
$.post(form.attr('action'), form.serialize(), function(_data) {
|
|
if(_data && _data.success) {
|
|
if(_data && _data.success) {
|
|
- @if($appointment)
|
|
|
|
|
|
+ @if($appointment && $appointment->uid)
|
|
toastr.success('Appointment updated successfully');
|
|
toastr.success('Appointment updated successfully');
|
|
@else
|
|
@else
|
|
toastr.success('Appointment booked successfully');
|
|
toastr.success('Appointment booked successfully');
|
|
@@ -175,7 +181,11 @@
|
|
toastr.error(_data.message);
|
|
toastr.error(_data.message);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- toastr.error('Unable to book appointment!');
|
|
|
|
|
|
+ @if($appointment && $appointment->uid)
|
|
|
|
+ toastr.error('Unable to update appointment!');
|
|
|
|
+ @else
|
|
|
|
+ toastr.error('Unable to book appointment!');
|
|
|
|
+ @endif
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}, 'json');
|
|
}, 'json');
|