{% extends '@RxConnexion/Admin/content.html.twig' %}
{% block content %}
    <form method="POST" action="{{ path('health_facility_form', {action: action, id: id}) }}" enctype="multipart/form-data">
        <div class="row max-width-initial">
            <div class="large-6 columns">
                <h5>Basic information</h5>
                <p class="form-hint-text">Enter basic information below</p>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.account) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.account) }}
                    </div>
                </div>
                {#<div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.healthFacility_type_desc) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.healthFacility_type_desc) }}
                        {{ form_widget(form.healthFacility_type) }}
                    </div>
                </div>#}
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.company_desc) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.company_desc) }}
                        {{ form_widget(form.company) }}
                    </div>
                </div>
                {#<div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.branch_description) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.branch_description) }}
                    </div>
                </div>#}
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.description) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.description) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_widget(form.is_active) }}
                        {{ form_label(form.is_active) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.isMarketing) }}
                        {{ form_label(form.isMarketing) }}
                    </div>
                </div>
                <h5>Address information</h5>
                <p class="form-hint-text">Enter address information below</p>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.street) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.street) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.city_desc) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.city_desc) }}
                        {{ form_widget(form.city) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.postalCode_desc) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.postalCode_desc) }}
                        {{ form_widget(form.postalCode) }}
                    </div>
                </div>
            </div>
            <div class="large-6 columns">
                <h5>Operations information</h5>
                <p class="form-hint-text">Enter operations information below</p>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.schedule_type) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.schedule_type) }}
                    </div>
                </div>
                <div class="row hide" id="rxgrab-healthFacility-form-queueuing-time-container">
                    <div class="xxlarge-6 xlarge-6 large-6 medium-12 small-12 columns">
                        <label>Queueing Start Time</label>
                        <div class="row collapse">
                            <div class="xxlarge-3 xlarge-3 large-3 medium-3 small-3 columns">
                                {{ form_widget(form.queueing_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.queueing_start_time_minute) }}
                            </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 end">
                                {{ form_widget(form.queueing_start_time_period) }}
                            </div>
                        </div>
                    </div>
                    <div class="xxlarge-6 xlarge-6 large-6 medium-12 small-12 columns">
                        <label>Queueing End Time</label>
                        <div class="row collapse">
                            <div class="xxlarge-3 xlarge-3 large-3 medium-3 small-3 columns">
                                {{ form_widget(form.queueing_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.queueing_end_time_minute) }}
                            </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 end">
                                {{ form_widget(form.queueing_end_time_period) }}
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="xxlarge-6 xlarge-6 large-6 medium-12 small-12 columns">
                        <label>Opening Time</label>
                        <div class="row collapse">
                            <div class="xxlarge-3 xlarge-3 large-3 medium-3 small-3 columns">
                                {{ form_widget(form.opening_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.opening_time_minute) }}
                            </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 end">
                                {{ form_widget(form.opening_time_period) }}
                            </div>
                        </div>
                    </div>
                    <div class="xxlarge-6 xlarge-6 large-6 medium-12 small-12 columns">
                        <label>Closing Time</label>
                        <div class="row collapse">
                            <div class="xxlarge-3 xlarge-3 large-3 medium-3 small-3 columns">
                                {{ form_widget(form.closing_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.closing_time_minute) }}
                            </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 end">
                                {{ form_widget(form.closing_time_period) }}
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="large-3 large-text-right columns">
                            {{ form_label(form.no_of_clinician) }}
                        </div>
                        <div class="large-9 columns">
                            {{ form_widget(form.no_of_clinician,{'type' : 'number'}) }}
                        </div>
                    </div>
                </div>
            </div>
            <div class="large-12 columns">
                <h5>Contact information</h5>
                <p class="form-hint-text">Enter contact information below</p>
                <div class="row">
                    <div class="xxlarge-4 xlarge-4 large-4 medium-4 small-12 columns">
                        {{ form_label(form.mobile_no) }}
                        {{ form_widget(form.mobile_no) }}
                        {{ form_widget(form.mobile_no_two) }}
                        {{ form_widget(form.mobile_no_three) }}
                    </div>
                    <div class="xxlarge-4 xlarge-4 large-4 medium-4 small-12 columns">
                        {{ form_label(form.phone_no) }}
                        {{ form_widget(form.phone_no) }}
                        {{ form_widget(form.phone_no_two) }}
                        {{ form_widget(form.phone_no_three) }}
                    </div>
                    <div class="xxlarge-4 xlarge-4 large-4 medium-4 small-12 columns">
                        {{ form_label(form.email) }}
                        {{ form_widget(form.email) }}
                        {{ form_widget(form.email_two) }}
                        {{ form_widget(form.email_three) }}
                    </div>
                </div>
                <div class="row">
                    <div class="xxlarge-12 xlarge-12 large-12 medium-12 small-12 columns">
                        {{ form_label(form.services) }}
                        {{ form_widget(form.services) }}
                    </div>
                </div>
                <div class="row">
                    <div class="xxlarge-12 xlarge-12 large-12 medium-12 small-12 columns">
                        <label style="margin:10px;">Upload Photo</label>
                        <input style="margin:10px;" type="file" name="form[photo]">
                    </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 Provider 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('health_facility') }}" 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[
        healthFacility_form.settings.healthFacilityType_autocomplete_url = '{{ path('health_facility_type_autocomplete') }}';
        healthFacility_form.settings.company_autocomplete_url = '{{ path('company_autocomplete') }}';
        healthFacility_form.settings.city_autocomplete_url = '{{ path('city_autocomplete') }}';
        healthFacility_form.settings.account_autocomplete_url = '{{ path('account_autocomplete') }}';
        healthFacility_form.settings.postalCode_autocomplete_url = '{{ path('postal_code_autocomplete') }}';
        jQ(document).ready(function(){
            healthFacility_form.init();
            CKEDITOR.replace('healthFacility_services');
        });
        //]]>
    </script>
{% endblock %}