@if (Auth::user()->hasRole('Patient'))
@else
{{ Form::label('patient_name', __('messages.case.patient') . ':', ['class' => 'form-label']) }}
{{ Form::select('patient_id', $patients, null, ['class' => 'form-select', 'required', 'id' => 'appointmentPatientId', 'placeholder' => __('messages.document.select_patient'), 'data-control' => 'select2']) }}
@endif
{{ Form::label('department_name', __('messages.appointment.doctor_department') . ':', ['class' => 'form-label']) }}
{{ Form::select('department_id', $departments, null, ['class' => 'form-select', 'required', 'id' => 'appointmentDepartmentId', 'placeholder' => __('messages.web_appointment.select_department'), 'data-control' => 'select2']) }}
{{ Form::label('doctor_name', __('messages.case.doctor') . ':', ['class' => 'form-label']) }}
{{ Form::select('doctor_id', isset($doctors) ? $doctors : [], null, ['class' => 'form-select', 'required', 'id' => 'appointmentDoctorId', 'placeholder' => __('messages.web_home.select_doctor'), 'data-control' => 'select2']) }}
@if (!Auth::user()->hasRole('Patient'))
{{ Form::label('opd_date', __('messages.appointment.date') . ':', ['class' => 'form-label']) }}
{{ Form::text('opd_date', isset($appointment) ? $appointment->opd_date->format('Y-m-d') : null, ['id'=>'appointmentOpdDate', 'class' => (getLoggedInUser()->thememode ? 'bg-light opdDate form-control' : 'bg-white opdDate form-control'), 'required', 'autocomplete'=>'off','placeholder'=>__('messages.appointment.date')]) }}
{{ Form::label('problem', __('messages.appointment.description').':', ['class' => 'form-label']) }}
{{ Form::textarea('problem', null, ['class' => 'form-control', 'rows'=>'4','placeholder'=>__('messages.appointment.description')]) }}
@if (count($customField) >= 0)
@foreach ($customField as $field)
@php
$field_values = explode(',',$field['values']);
$dateType = ($field['field_type'] == 6) ? 'customFieldDate' : 'customFieldDateTime';
$field_type = \App\Models\AddCustomFields::FIELD_TYPE_ARR[$field['field_type']];
$fieldName = 'field'.$field['id'];
$fieldData = isset($appointment->custom_field[$fieldName]) ? $appointment->custom_field[$fieldName] : null;
@endphp
{{ Form::label($field['field_name'], $field['field_name'] . ':', ['class' => $field['is_required'] == 1 ? 'form-label dynamic-field' : 'form-label']) }}
@if ($field['is_required'] == 1)
@endif
@if ($field_type == 'date' || $field_type == 'date & Time')
{{ Form::text($fieldName, ($fieldData == 'y-m-d' ? $fieldData : null), ['id'=>$dateType,'class' => (getLoggedInUser()->thememode || $field['is_required'] == 1) ? 'bg-light form-control dynamic-field' : 'bg-white form-control', 'autocomplete' => 'off','placeholder'=> $field['field_name'],$field['is_required'] == 1 ? 'required' : '']) }}
@elseif ($field_type == 'toggle')
@elseif ($field_type == 'select')
{{ Form::select($fieldName,$field_values, isset($fieldData) ? $fieldData : null, ['class' => $field['is_required'] == 1 ? 'form-select dynamic-field' : 'form-select', 'placeholder' => $field['field_name'], 'data-control' => 'select2',$field['is_required'] == 1 ? 'required' : '']) }}
@elseif ($field_type == 'multiSelect')
{{ Form::select($fieldName.'[]',$field_values, isset($fieldData) ? $fieldData : 0, ['class' => $field['is_required'] == 1 ? 'form-select appointment-multi-select dynamic-field' : 'form-select appointment-multi-select', 'placeholder' => $field['field_name'], 'data-control' => 'select2','multiple' => true,$field['is_required'] == 1 ? 'required' : '']) }}
@else
{{ Form::$field_type($fieldName, $fieldData, ['class' => $field['is_required'] == 1 ? 'form-control dynamic-field' : 'form-control', 'placeholder' => $field['field_name'],$field['is_required'] == 1 ? 'required' : '','rows' => $field_type == 'textarea' ? 4 : '']) }}
@endif
@endforeach
@endif
@endif
@if (Auth::user()->hasRole('Patient'))
{{ Form::label('opd_date', __('messages.appointment.date') . ':', ['class' => 'form-label']) }}
{{ Form::text('opd_date', null, ['id' => 'patientAppointmentOpdDate', 'class' => getLoggedInUser()->thememode ? 'bg-light opdDate form-control' : 'bg-white opdDate form-control', 'required', 'autocomplete' => 'off', 'placeholder' => __('messages.appointment.date')]) }}
{{ Form::label('problem', __('messages.appointment.description') . ':', ['class' => 'form-label']) }}
{{ Form::textarea('problem', null, ['class' => 'form-control', 'rows' => '4', 'placeholder' => __('messages.appointment.description')]) }}
@if (count($customField) >= 0)
@foreach ($customField as $field)
@php
$field_values = explode(',',$field['values']);
$dateType = ($field['field_type'] == 6) ? 'customFieldDate' : 'customFieldDateTime';
$field_type = \App\Models\AddCustomFields::FIELD_TYPE_ARR[$field['field_type']];
$fieldName = 'field'.$field['id'];
$fieldData = isset($appointment->custom_field[$fieldName]) ? $appointment->custom_field[$fieldName] : null;
@endphp
{{ Form::label($field['field_name'], $field['field_name'] . ':', ['class' => $field['is_required'] == 1 ? 'form-label dynamic-field' : 'form-label']) }}
@if ($field['is_required'] == 1)
@endif
@if ($field_type == 'date' || $field_type == 'date & Time')
{{ Form::text($fieldName, $fieldData, ['id' => $dateType, 'class' => (getLoggedInUser()->thememode || $field['is_required'] == 1) ? 'bg-light form-control dynamic-field' : 'bg-white form-control', 'autocomplete' => 'off', 'placeholder' => $field['field_name'], $field['is_required'] == 1 ? 'required' : '']) }}
@elseif ($field_type == 'toggle')
@elseif ($field_type == 'select')
{{ Form::select($fieldName,$field_values, isset($fieldData) ? $fieldData : null, ['class' => $field['is_required'] == 1 ? 'form-select dynamic-field' : 'form-select', 'placeholder' => $field['field_name'], 'data-control' => 'select2',$field['is_required'] == 1 ? 'required' : '']) }}
@elseif ($field_type == 'multiSelect')
{{ Form::select($fieldName.'[]',$field_values, isset($fieldData) ? $fieldData : 0, ['class' => $field['is_required'] == 1 ? 'form-select appointment-multi-select dynamic-field' : 'form-select appointment-multi-select', 'placeholder' => $field['field_name'], 'data-control' => 'select2','multiple' => true,$field['is_required'] == 1 ? 'required' : '']) }}
@else
{{ Form::$field_type($fieldName, $fieldData, ['class' => $field['is_required'] == 1 ? 'form-control dynamic-field' : 'form-control', 'placeholder' => $field['field_name'],$field['is_required'] == 1 ? 'required' : '','rows' => $field_type == 'textarea' ? 4 : '']) }}
@endif
@endforeach
@endif
@endif