@extends('layouts.'.env('THEME')) @section('content')
@if(!empty($time_slot->getSubjectLead())) @endif
@if($time_slot->isCancelled())

Cancelled

@endif @if(!empty($time_slot->getCreator()))
Booked by: {!! $time_slot->getCreator()->name !!} @if(!empty($time_slot->getLastEditor()) && $time_slot->getLastEditor()->id != $time_slot->getCreator()->id) , last edited by: {!! $time_slot->getLastEditor()->name !!} @endif
@endif {!! Form::model($time_slot, ['route' => ['update_appointment', $time_slot->id]]) !!} @method('PATCH') {!! Form::token() !!}
Type {!! Form::select('type', $timeslot_types, $time_slot->type, ['id' => 'type-select']) !!}
isCancelled()) style="text-decoration: line-through;" @endif>
{!! $time_slot->start->diffForHumans() !!}
{!! $time_slot->getAdminInfoLine() !!}
Users
@if(sizeof($time_slot->leads) == 0)

No leads attached to this time slot

@endif @foreach($time_slot->leads as $lead) {!! $lead->user->name !!}
@endforeach
Staff
@if(sizeof($time_slot->staff) == 0)

No staff attached to this time slot

@endif
@foreach($staff as $sta)
@php $checked = false; if(!empty($preSelectedStaff[$sta->id])) $checked = true; @endphp {!! Form::checkbox('attach_staff['.$sta->id.']', $sta->id, $checked, ['id' => 'attach_staff_'.$sta->id, 'class' => 'staff_attachment p-0', 'data-id' => $sta->id]) !!} {!! Form::label('attach_staff_'.$sta->id, $sta->user->name) !!}
@endforeach
{!! Form::submit('Save changes', ['class' => 'btn btn-primary']) !!}
{!! Form::close() !!} @foreach($time_slot->notes as $note) @endforeach @if($time_slot->isCancelled()) {!! Form::open(['route' => 'reinstate_booking', 'method' => 'post']) !!} {!! Form::token() !!} {{ Form::hidden('id', $time_slot->id) }}
Reinstate booking
@foreach($time_slot->leads as $lead)
{!! Form::checkbox('notify_email[]', $lead->getEmail(), null, ['id' => 'notify_lead_email'.$lead->id, 'class' => 'p-0']) !!} {!! Form::label('notify_lead_email'.$lead->id, 'Notify user by email ('.$lead->getEmail().')') !!}
@endforeach @foreach($time_slot->staff as $staff)
{!! Form::checkbox('notify_email[]', $staff->getEmail(), null, ['id' => 'notify_staff_email'.$staff->id, 'class' => 'p-0']) !!} {!! Form::label('notify_staff_email'.$staff->id, 'Notify staff by email ('.$staff->getEmail().')') !!}
@endforeach
{!! Form::textarea('reason', '', [ 'class' => 'form-control', 'placeholder' => 'Reinstate reason (included in email)', 'rows' => 4, 'name' => 'reason', 'max' => 10000 ]) !!}
{!! Form::close() !!} @else @include('admin.timeslot.appointment_closing') @endif
@endsection @section('script') @include('staff.schedule.script') @endsection