{% extends '@RxConnexion/Admin/content.html.twig' %}
{% block content %}
    <form method="POST" action="{{ path('sales_agent_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.first_name) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.first_name) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.middle_name) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.middle_name) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.last_name) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.last_name) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.gender) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.gender) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.birth_date) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.birth_date) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.address) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.address) }}
                    </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>Other information</h5>
                <p class="form-hint-text">Enter other information below</p>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.rate) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.rate) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.mobile_no) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.mobile_no) }}
                        {{ form_widget(form.mobile_no_two) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.phone_no) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.phone_no) }}
                        {{ form_widget(form.phone_no_two) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.email) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.email) }}
                    </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 Sales Agent 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('sales_agent') }}" 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[
        salesAgent_form.settings.accountUser_autocomplete_url = '{{ path('account_user_autocomplete') }}';
        jQ(document).ready(function(){
            salesAgent_form.init();
        });
        //]]>
    </script>
{% endblock %}