{% extends '@RxConnexion/Admin/content.html.twig' %}
{% block content %}
    <form method="POST" action="{{ path('insurance_form', {action: action, id: id}) }}">
        <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_desc) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.account_desc) }}
                        {{ form_widget(form.account) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.insurance_type_desc) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.insurance_type_desc) }}
                        {{ form_widget(form.insurance_type) }}
                    </div>
                </div>
                <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.fax_no) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.fax_no) }}
                        {{ form_widget(form.fax_no_two) }}
                    </div>
                </div>
            </div>
            <div class="large-6 columns">
            </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 Insurance 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('insurance') }}" 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[
        insurance_form.settings.insurance_type_autocomplete_url = '{{ path('insurance_type_autocomplete') }}';
        insurance_form.settings.account_autocomplete_url = '{{ path('account_autocomplete') }}';
        jQ(document).ready(function(){
            insurance_form.init();
        });
        //]]>
    </script>
{% endblock %}