{% extends '@RxConnexion/Admin/content.html.twig' %}
{% block content %}
    <form method="POST" action="{{ path('schedule_form', {action: action, id: id}) }}">
        <div class="row max-width-initial">
            <div class="large-6 columns">
                <h5>Appointment information</h5>
                <p class="form-hint-text">Enter schedule information below</p>
                <div class="row">
                    <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">
                    <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">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.marketingStaff_fullName) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.marketingStaff_fullName) }}
                        {{ form_widget(form.marketingStaff) }}
                    </div>
                </div>
                <div class="row">
                    <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 class="large-6 columns" style="margin-top: 70px;">
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_widget(form.schedule_status) }}
                        {{ form_label(form.scheduleStatus_desc) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.scheduleStatus_desc) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.chart_type) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.chart_type) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns" style="padding: 0px;">
                        {{ form_label(form.schedule_date) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.schedule_date) }}
                    </div>
                </div>
                <div class="row">
                    <div class="xxlarge-6 xlarge-6 large-6 medium-6 small-12 columns">
                        <label class="required">Start Time</label>
                        <div class="row collapse">
                            <div class="xxlarge-3 xlarge-3 large-3 medium-3 small-3 columns">
                                {{ form_widget(form.start_time_hour) }}
                            </div>
                            <div class="xxlarge-1 xlarge-1 large-1 medium-1 small-1 columns text-center">:</div>
                            <div class="xxlarge-3 xlarge-3 large-3 medium-3 small-3 columns">
                                {{ form_widget(form.start_time_minute) }}
                            </div>
                            <div class="xxlarge-1 xlarge-1 large-1 medium-1 small-1 columns text-center">&nbsp;</div>
                            <div class="xxlarge-3 xlarge-3 large-3 medium-3 small-3 columns end">
                                {{ form_widget(form.start_time_period) }}
                            </div>
                        </div>
                    </div>
                    <div class="xxlarge-6 xlarge-6 large-6 medium-6 small-12 columns">
                        <label class="required">End Time</label>
                        <div class="row collapse">
                            <div class="xxlarge-3 xlarge-3 large-3 medium-3 small-3 columns">
                                {{ form_widget(form.end_time_hour) }}
                            </div>
                            <div class="xxlarge-1 xlarge-1 large-1 medium-1 small-1 columns text-center">:</div>
                            <div class="xxlarge-3 xlarge-3 large-3 medium-3 small-3 columns">
                                {{ form_widget(form.end_time_minute) }}
                            </div>
                            <div class="xxlarge-1 xlarge-1 large-1 medium-1 small-1 columns text-center">&nbsp;</div>
                            <div class="xxlarge-3 xlarge-3 large-3 medium-3 small-3 columns end">
                                {{ form_widget(form.end_time_period) }}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="small-12 columns">
                <hr class="max-width-initial">
                <div class="button-container">
                    <button type="submit" class="button just-continue" name="action" value="{{ action }}"
                            data-message="Are you sure you want to save this information?"
                    >Save</button>
                    {% if action == 'u' and (userData.type == 'Super Admin' or 'Admin Appointment Delete' in userData.accesses) %}
                        <button type="submit" class="ask-continue button alert" name="action" value="d"
                                data-message="Are you sure you want to delete this record?"
                        >Delete</button>
                    {% endif %}
                    <a href="{{ path('schedule') }}" class="button secondary">Back</a>
                </div>
            </div>
        </div>
        {{ form_widget(form.action) }}
        {{ form_widget(form.id) }}
        {{ form_widget(form._token) }}
    </form>
    {% include '@RxConnexion/Admin/js.html.twig' %}
    <script>
        //<![CDATA[
        schedule_form.settings.medical_facility_autocomplete_url = '{{ path('health_facility_autocomplete_for_schedule') }}';
        schedule_form.settings.patient_autocomplete_url = '{{ path('patient_autocomplete') }}';
        schedule_form.settings.provider_autocomplete_url = '{{ path('provider_autocomplete_for_schedule') }}';
        jQ(document).ready(function(){
            schedule_form.init();
        });
        //]]>
    </script>
{% endblock %}