{% extends '@RxConnexion/Admin/content.html.twig' %}
{% block content %}
    <form method="POST" action="{{ path('financing_company_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.code) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.code) }}
                    </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_label(form.is_active) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.is_active) }}
                    </div>
                </div>
            </div>
            <div class="large-6 columns">
                <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>Invoice information</h5>
                <p class="form-hint-text">Enter invoice information below</p>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.last_or_number) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.last_or_number) }}
                    </div>
                </div>
            </div>
            <div class="large-6 columns">
            </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-3 xlarge-3 large-3 medium-3 small-12 columns">
                        {{ form_label(form.mobile_no) }}
                        {{ form_widget(form.mobile_no) }}
                        {{ form_widget(form.mobile_no_two) }}
                    </div>
                    <div class="xxlarge-3 xlarge-3 large-3 medium-3 small-12 columns">
                        {{ form_label(form.phone_no) }}
                        {{ form_widget(form.phone_no) }}
                        {{ form_widget(form.phone_no_two) }}
                    </div>
                    <div class="xxlarge-3 xlarge-3 large-3 medium-3 small-12 columns">
                        {{ form_label(form.fax_no) }}
                        {{ form_widget(form.fax_no) }}
                        {{ form_widget(form.fax_no_two) }}
                    </div>
                    <div class="xxlarge-3 xlarge-3 large-3 medium-3 small-12 columns">
                        {{ form_label(form.email) }}
                        {{ form_widget(form.email) }}
                        {{ form_widget(form.email_two) }}
                    </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]" accept="image/*">
                    </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 Financing Company 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('financing_company') }}" 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[
        financingCompany_form.settings.city_autocomplete_url = '{{ path('city_autocomplete') }}';
        financingCompany_form.settings.postalCode_autocomplete_url = '{{ path('postal_code_autocomplete') }}';
        jQ(document).ready(function(){
            financingCompany_form.init();
        });
        //]]>
    </script>
{% endblock %}