{% extends '@RxConnexion/Admin/content.html.twig' %}
{% block content %}
    <div id="flash-messages-container">
    </div>
    <div class="row max-width-initial">
        <div class="small-12 columns">
            <nav aria-label="You are here:" role="navigation">
                <ul class="breadcrumbs">
                    <li><a href="{{ path('sales_agent') }}">Sales Agent List</a></li>
                    <li>
                        <span class="show-for-sr">Current: </span> Sales Agent Details
                    </li>
                </ul>
            </nav>
            {% include '@RxConnexion/SalesAgent/overview.html.twig' with {salesAgent: salesAgent} %}
            <br/>
            <div class="content-container has-loading">
                <div class="content-container-content hide">
                    <ul class="tabs custom-tabs" data-tabs id="sales-agent-tabs">
                        {% if userData.type == 'Super Admin' or 'Admin Sales Agent Detail Referring Health Facility' in userData.accesses %}
                            <li class="tabs-title {{ tab is null or tab is empty or tab == 'm' ? 'is-active' : '' }}"><a href="#panel-referring-health-facility" aria-selected="true">Affiliate</a></li>
                        {% endif %}
                    </ul>
                    <div class="tabs-content custom-tabs-content" data-tabs-content="sales-agent-tabs">
                        <div class="tabs-panel {{ tab is null or tab is empty or tab == 'm' ? 'is-active' : '' }}" id="panel-referring-health-facility">
                            <div class="text-right">
                                {% if userData.type == 'Super Admin' or 'Admin Sales Agent Detail Referring Health Facility New' in userData.accesses %}
                                    <a href="javascript:void(0)" class="href-referring-health-facility-form href-new-action" data-action="n" data-id="0">Add Affiliate</a>
                                {% endif %}
                            </div>
                            <table class="display responsive" id="referringHealthFacility-datalist" width="100%">
                                <thead>
                                <tr>
                                    <th>Description</th>
                                    <th>Address</th>
                                    <th>Phone No(s).</th>
                                    <th>Mobile No(s).</th>
                                    <th>Email(s)</th>
                                    <th>Start Date</th>
                                    <th>End Date</th>
                                    <th>Action</th>
                                </tr>
                                </thead>
                                <tbody></tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="reveal small" id="modal" data-reveal>
        <div id="modal-content"></div>
        <button class="close-button" data-close aria-label="Close modal" type="button">
            <span aria-hidden="true">&times;</span>
        </button>
    </div>
    {% include '@RxConnexion/Admin/js.html.twig' %}
    <script language="javascript">
        //<![CDATA[
        salesAgent_detail.settings.salesAgent_id = '{{ salesAgent_id }}';
        salesAgent_detail.settings.referringMedicalFacilities_ajaxUrl = '{{ path('sales_agent_referring_health_facility_ajax_list') }}';
        salesAgent_detail.settings.referringMedicalFacilities_formUrl = '{{ path('sales_agent_health_referring_facility_form', {salesAgent_id:salesAgent_id}) }}';
        salesAgent_detail.settings.referringMedicalFacilities_formActionUrl = '{{ path('sales_agent_referring_affiliate_save') }}';
        jQ(document).ready(salesAgent_detail.init);
        //]]>
    </script>
{% endblock %}