@php $a = $appointment ?? null; @endphp
<div class="row">
    <div class="col-md-6"><div class="form-group">
        {!! Form::label('erp_customer_id', __('vrc::lang.customer') . ':') !!}
        {!! Form::select('erp_customer_id', $customers, $a->erp_customer_id ?? null, ['class' => 'form-control vrc-select2 vrc-appt-customer', 'placeholder' => __('messages.please_select'), 'data-vehicles-url' => url('vrc/customers/__ID__/vehicles')]) !!}
    </div></div>
    <div class="col-md-6"><div class="form-group">
        {!! Form::label('vehicle_id', __('vrc::lang.vehicle') . ':') !!}
        {!! Form::select('vehicle_id', $vehicles ?? [], $a->vehicle_id ?? null, ['class' => 'form-control vrc-select2 vrc-appt-vehicle', 'placeholder' => __('messages.please_select')]) !!}
    </div></div>
</div>
<div class="row">
    <div class="col-md-6"><div class="form-group">
        {!! Form::label('scheduled_start', __('vrc::lang.scheduled_start') . ':*') !!}
        {!! Form::input('datetime-local', 'scheduled_start', isset($a) ? optional($a->scheduled_start)->format('Y-m-d\TH:i') : null, ['class' => 'form-control', 'required']) !!}
    </div></div>
    <div class="col-md-6"><div class="form-group">
        {!! Form::label('scheduled_end', __('vrc::lang.scheduled_end') . ':') !!}
        {!! Form::input('datetime-local', 'scheduled_end', isset($a) ? optional($a->scheduled_end)->format('Y-m-d\TH:i') : null, ['class' => 'form-control']) !!}
    </div></div>
</div>
<div class="row">
    <div class="col-md-4"><div class="form-group">
        {!! Form::label('bay_id', __('vrc::lang.bay') . ':') !!}
        {!! Form::select('bay_id', $bays, $a->bay_id ?? null, ['class' => 'form-control', 'placeholder' => __('messages.please_select')]) !!}
    </div></div>
    <div class="col-md-4"><div class="form-group">
        {!! Form::label('source', __('vrc::lang.source') . ':') !!}
        {!! Form::select('source', ['walk_in' => __('vrc::lang.src_walk_in'), 'phone' => __('vrc::lang.src_phone'), 'portal' => __('vrc::lang.src_portal'), 'web' => __('vrc::lang.src_web')], $a->source ?? 'phone', ['class' => 'form-control']) !!}
    </div></div>
    <div class="col-md-4"><div class="form-group">
        {!! Form::label('estimated_duration_min', __('vrc::lang.est_duration_min') . ':') !!}
        {!! Form::number('estimated_duration_min', $a->estimated_duration_min ?? null, ['class' => 'form-control', 'min' => 0]) !!}
    </div></div>
</div>
<div class="form-group">
    {!! Form::label('concern', __('vrc::lang.concern') . ':') !!}
    {!! Form::textarea('concern', $a->concern ?? null, ['class' => 'form-control', 'rows' => 2]) !!}
</div>
<label><input type="checkbox" name="override_conflict" value="1" class="vrc-appt-override"> @lang('vrc::lang.override_double_booking')</label>
