{% set userData = app.session.get('userData') %}

<h5>Appointment Form</h5>
{% include '@RxConnexion/Patient/overview.v2.html.twig' %}
<div id="city-warning" class="callout alert" style="display: none;"><i class="fa fa-warning"></i> WARNING: Patient is located at a different city.</div>
<div id="patient-chart-warning" class="callout warning" style="display: none;"><i class="fa fa-warning"></i> WARNING: Last encounter branch is different.</div>
<div class="row max-width-initial">
    <div class="large-12 columns">
        <form method="POST" id="scheduleForm" action="{{ path('calendar_form_save') }}" method="POST">
            <div class="row">
                <div class="large-6 columns">
                    <div class="row large-text-center">
                        <div class="large-3 large-text-right columns">
                            {{ form_label(form.patient_fullName) }}
                        </div>
                        <div class="large-9 columns">
                            {{ form_widget(form.patient_fullName) }}
                            {{ form_widget(form.patient) }}
                        </div>
                    </div>
                    <div class="row large-text-center">
                        <div class="large-3 large-text-right columns">
                            {{ form_label(form.health_facility_desc) }}
                        </div>
                        <div class="large-9 columns">
                            {{ form_widget(form.health_facility_desc) }}
                            {{ form_widget(form.health_facility) }}
                        </div>
                    </div>
                    <div class="row large-text-center">
                        <div class="large-3 large-text-right columns">
                            {{ form_label(form.provider_fullName) }}
                        </div>
                        <div class="large-9 columns">
                            {{ form_widget(form.provider_fullName) }}
                            {{ form_widget(form.provider) }}
                        </div>
                    </div>
                    <div class="row large-text-center">
                        <div class="large-3 large-text-right columns">
                            {{ form_label(form.chartType_desc) }}
                        </div>
                        <div class="large-9 columns">
                            {{ form_widget(form.chartType_desc) }}
                            {{ form_widget(form.chartType) }}
                        </div>
                    </div>
                    <div class="row large-text-center">
                        <div class="large-3 large-text-right columns">
                            {{ form_label(form.scheduleStatus) }}
                        </div>
                        <div class="large-9 columns">
                            {{ form_widget(form.scheduleStatus) }}
                        </div>
                    </div>
                </div>
                <div class="large-6 columns" style="padding: 0;">
                    <div class="row large-text-center">
                        <div class="large-3 large-text-right columns">
                            {{ form_label(form.schedule_date) }}
                        </div>
                        <div class="large-9 columns">
                            {{ form_widget(form.schedule_date) }}
                        </div>
                    </div>
                    <div class="row large-text-center">
                        <div class="large-3 large-text-right columns">
                            <label class="required">Start Time</label>
                        </div>
                        <div class="large-3 columns">
                            {{ form_widget(form.start_time_hour) }}
                        </div>
                        <div class="large-3 columns">
                            {{ form_widget(form.start_time_minute) }}
                        </div>
                        <div class="large-3 columns">
                            {{ form_widget(form.start_time_period) }}
                        </div>
                    </div>
                    <div class="row large-text-center">
                        <div class="large-3 large-text-right columns">
                            <label class="required">End Time</label>
                        </div>
                        <div class="large-3 columns">
                            {{ form_widget(form.end_time_hour) }}
                        </div>
                        <div class="large-3 columns">
                            {{ form_widget(form.end_time_minute) }}
                        </div>
                        <div class="large-3 columns">
                            {{ form_widget(form.end_time_period) }}
                        </div>
                    </div>
                    <div class="row">
                        <div class="large-3 large-text-right columns">
                            {{ form_label(form.note_type) }}
                        </div>
                        <div class="large-9 columns">
                            {{ form_widget(form.note_type) }}
                            {{ form_widget(form.note_template_description) }}
                            {{ form_widget(form.noteTemplate) }}
                        </div>
                    </div>
                    <div class="row large-text-center">
                        <div class="large-3 large-text-right columns">
                            {{ form_label(form.note) }}
                        </div>
                        <div class="large-9 columns">
                            {{ form_widget(form.note) }}
                        </div>
                    </div>
                </div>
            </div>
            <hr>
            <div class="row-max-width-initial">
                <div class="small-12 columns no-padding-right">
                    <div class="button-container clearfix text-right">
                        <button type="submit"
                                class="just-continue button"
                                value="{{ action }}"
                        >Save</button>
                        {% if userData.type == 'Super Admin' or 'Admin Schedule Delete' in userData.accesses %}
                            <button type="submit" class="ask-continue button alert hide" value="d"
                                    data-message="Are you sure you want to delete this record?"
                                    style="margin-left: 10px; margin-right: 0;"
                            >Delete</button>
                        {% endif %}
                        <a href="javascript:void(0)" class="button secondary" data-close style="margin-left: 10px; margin-right: 0;">Close</a>
                    </div>
                </div>
            </div>
            {{ form_widget(form.patient_city_id) }}
            {{ form_widget(form.health_facility_city_id) }}
            {{ form_widget(form.health_facility_geoLat) }}
            {{ form_widget(form.health_facility_geoLong) }}
            {{ form_widget(form.patient_geoLat) }}
            {{ form_widget(form.patient_geoLong) }}
            {{ form_widget(form.action) }}
            {{ form_widget(form.id) }}
            {{ form_widget(form.health_facility) }}
            {{ form_widget(form.start_time) }}
            {{ form_widget(form._token) }}
        </form>
    </div>
    <div class="large-4 columns hide">
        <div id="map-canvas"></div>
    </div>
</div>
<hr>
