{% 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('marketing_staff') }}">Marketing Staff List</a></li>
                    <li>
                        <span class="show-for-sr">Current: </span> Marketing Staff Details
                    </li>
                </ul>
            </nav>
            {% include '@RxConnexion/MarketingStaff/overview.html.twig' with {marketingStaff: marketingStaff} %}
            <br/>
            <div class="content-container has-loading">
                <div class="content-container-content hide">
                    <ul class="tabs custom-tabs" data-tabs id="provider-tabs">
                        {% if userData.type == 'Super Admin' or 'Admin Marketing Staff Health Facility' in userData.accesses %}
                            <li class="tabs-title {{ tab is null or tab is empty or tab == 'm' ? 'is-active' : '' }}" data-dt-id="medicalFacilities-datalist"><a href="#panel-medical-facilities" aria-selected="true">Branch</a></li>
                        {% endif %}
                        {% if userData.type == 'Super Admin' or 'Admin Marketing Staff Work Schedule' in userData.accesses %}
                            <li class="tabs-title {{ tab == 'ps' ? 'is-active' : '' }}" data-dt-id="workSchedule-datalist"><a href="#panel-work-schedule" aria-selected="false">Work Schedule</a></li>
                        {% endif %}
                    </ul>
                    <div class="tabs-content custom-tabs-content" data-tabs-content="provider-tabs">
                        <div class="tabs-panel {{ tab is null or tab is empty or tab == 'm' ? 'is-active' : '' }}" id="panel-medical-facilities">

                            <div class="text-right">
                                {% if userData.type == 'Super Admin' or 'Admin Marketing Staff Health Facility New' in userData.accesses %}
                                    <a href="javascript:void(0)" class="href-medical-facility-form href-new-action" data-action="n" data-id="0">Add Branch</a>
                                {% endif %}
                            </div>
                            <table class="display responsive" id="medicalFacilities-datalist" width="100%">
                                <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>Company</th>
                                    <th>Branch</th>
                                    <th>Description</th>
                                    <th>Mobile No.</th>
                                    <th>Phone No.</th>
                                    <th>Email</th>
                                    <th>Start Date</th>
                                    <th>End Date</th>
                                    <th>Action</th>
                                </tr>
                                </thead>
                                <tbody></tbody>
                            </table>
                        </div>
                        <div class="tabs-panel {{ tab == 'ps' ? 'is-active' : '' }}" id="panel-work-schedule">
                            <div class="row">
                                <div class="large-4 columns">
                                    <div class="input-group">
                                        <label class="input-group-label">Type</label>
                                        <select class="input-group-field" id="work-schedule-filter-type">
                                            <option value="" selected>All</option>
                                            <option value="Regular" >Regular</option>
                                            <option value="Irregular">Irregular</option>
                                            <option value="Out">Out</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="text-right">
                                {% if userData.type == 'Super Admin' or 'Admin Marketing Staff Work Schedule New' in userData.accesses %}
                                    <a href="javascript:void(0)" class="href-work-schedule-form href-new-action" data-action="n" data-id="0">New Work Schedule</a>
                                {% endif %}
                            </div>
                            <table class="display responsive" id="workSchedule-datalist" width="100%">
                                <thead>
                                <tr>
                                    <th>Type</th>
                                    <th>Branch</th>
                                    <th>From Date</th>
                                    <th>From Time</th>
                                    <th>To Date</th>
                                    <th>To Time</th>
                                    <th>Day</th>
                                    <th>Note</th>
                                    <th>Action</th>
                                </tr>
                                </thead>
                                <tbody></tbody>
                            </table>

                            {% if userData.type == 'Super Admin' or 'Admin Marketing Staff Work Schedule History' in userData.accesses %}
                                <br>
                                <hr>
                                <h5>History</h5>
                                <table class="display responsive" id="workScheduleHistory-datalist" width="100%">
                                    <thead>
                                    <tr>
                                        <th>Action</th>
                                        <th>Date</th>
                                        <th>User</th>
                                        {#<th>Label</th>#}
                                        <th>Detail</th>
                                    </tr>
                                    </thead>
                                    <tbody></tbody>
                                </table>
                            {% endif %}
                        </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>
    <div class="reveal large" id="large-modal" data-reveal>
        <div id="large-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[
        marketingStaff_detail.settings.marketingStaff_id = '{{ marketingStaff_id }}';
        marketingStaff_detail.settings.medicalFacilities_ajaxUrl = '{{ path('marketing_staff_health_facilities_ajax_list') }}';
        marketingStaff_detail.settings.workSchedule_ajaxUrl = '{{ path('marketing_staff_work_schedule_ajax_list') }}';
        marketingStaff_detail.settings.medicalFacilities_formUrl = '{{ path('marketing_staff_health_facilities_form', {marketingStaff_id:marketingStaff_id}) }}';
        marketingStaff_detail.settings.medicalFacilities_formActionUrl = '{{ path('marketing_staff_health_facilities_save') }}';
        marketingStaff_detail.settings.workSchedule_formUrl = '{{ path('marketing_staff_work_schedule_form', {marketing_staff_id:marketingStaff_id}) }}';
        marketingStaff_detail.settings.workSchedule_formActionUrl = '{{ path('marketing_staff_work_schedule_save') }}';
        marketingStaff_detail.settings.medicalFacility_autocompleteUrl = '{{ path('health_facility_autocomplete') }}';
        marketingStaff_detail.settings.workScheduleHistory_ajaxUrl = '{{ path('marketing_staff_work_schedule_history_ajax_list') }}';
        jQ(document).ready(marketingStaff_detail.init);
        //]]>
    </script>
{% endblock %}