{% set userData = app.session.get('userData') %}
<form method="POST" action="{{ path('schedule_dashboard_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">View 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, {attr: {'disabled':'true'}}) }}
                    {{ 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, {attr: {'disabled':'true'}}) }}
                    {{ form_widget(form.patient) }}
                </div>
            </div>
            <div class="row">
                <div class="large-3 large-text-right columns">
                    {{ form_label(form.provider_fullName) }}
                </div>
                <div class="large-9 columns">
                    {{ form_widget(form.provider_fullName, {attr: {'disabled':'true'}}) }}
                    {{ form_widget(form.provider) }}
                </div>
            </div>
            <div class="row">
                <div class="large-3 large-text-right columns">
                    {{ form_label(form.chart_type) }}
                </div>
                <div class="large-9 columns">
                    <input type="text" value="{{ schedule.chartType.description }}" disabled>
                    {{ form_widget(form.chart_type, {value: schedule.chartType.id ,attr: {'hidden':'true'}}) }}
                </div>
            </div>
            <div class="row">
                <div class="large-3 large-text-right columns">
                    {{ form_label(form.schedule_date) }}
                </div>
                <div class="large-9 columns">
                    {{ form_widget(form.schedule_date, {attr: {'readonly':'true', 'class':'a'}}) }}
                </div>
            </div>
        </div>
        <div class="large-6 columns" >
            <h5>Update information</h5>
            <p class="form-hint-text">Enter update information for this schedule below</p>
            <div class="row">
                <div class="large-3 large-text-right columns">
                    {{ form_label(form.schedule_status) }}
                </div>
                <div class="large-9 columns">
                    {{ form_widget(form.schedule_status, {value: schedule.scheduleStatus.id|default(''),}) }}
                </div>
            </div>
            <div class="row">
                <div class="large-3 large-text-right columns">
                    <label class="middle required" for="schedule_note">Notes</label>
                </div>
                <div class="large-9 columns">
                    {{ form_widget(form.note, {value: '', attr: {'required':'true'}}) }}
                </div>
            </div>
            <div class="row hide">
                <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="javascript:void(0)" data-close aria-label="Close modal" class="button secondary">Close</a>
            </div>
        </div>
    </div>
    {{ form_widget(form.action) }}
    {{ form_widget(form.id) }}
    {{ form_widget(form._token) }}
</form>