{% extends app['twig_theme'] ~ '/' ~ 'layout.twig' %}
{% import  app['twig_theme'] ~ '/macro/iptw_macro.twig' as main_macro %}

{% set title = ('Statistics'|trans ~ ': ' ~ 'Subscribers statistic'|trans) %}


{% block footer_js %}
    
        {{ parent() }}
        {% include app.twig_theme ~ "/basic_templates/scripts-datatables.twig" %}

        <script src="{{app.request_context.baseUrl}}/plugins/datatables/extensions/FixedHeader/js/dataTables.fixedHeader.js"></script>
        <link  href="{{app.request_context.baseUrl}}/plugins/datatables/extensions/FixedHeader/css/fixedHeader.dataTables.css" rel="stylesheet">

{% endblock %}
{% block footer %}

        {{ parent() }}
        <script type="text/javascript" defer>
            {% include (app.twig_theme ~ "/Statistics/stat_abonents/stat_abonents.js.twig") %}
        </script>
        
{% endblock %}


{% block content %}
    <div id="iptv_list">
        <div class="row  filters-actions-pannel">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                {{ main_macro.get_filter_button_bar('abon_to', 'id', 'title', app['allAbonentStat']) }}
                {{ main_macro.get_datepicker_double_input() }}
            </div>
        </div>

        <div class="row">
            {% if attribute(app, 'filters') is defined  and attribute(app['filters'], 'abon_to') is defined %}
                <div class="col-xs-10 col-sm-8 col-sm-offset-2 box-name text-center bg-warning">
                    <span class="text_black">
                        {% if app['filters']['abon_to'] == 'anec' %}
                            {{ 'View is a review of at least one joke'|trans }}
                        {% elseif app['filters']['abon_to'] == 'video' %}
                            {{ 'View is a playback of more than 70%% of movie length'|trans }}
                        {% else %}
                            {{ 'View is an uninterrupted playback of channel for more than 30 minutes'|trans }}
                        {% endif %}
                    </span>
                </div>
            {% endif %}
        </div>

        <div class="row">
            <div class="box">
                {% if attribute(app, 'dropdownAttribute') is defined %}
                    {{ main_macro.get_dropdown_attribute(app['dropdownAttribute']) }}
                {% endif %}
                <div class="box-content">
                    <div class="box-content no-padding">
                        <table class="table  table-hover table-datatable" id="datatable-1">
                            {% if attribute(app, 'dropdownAttribute') is defined %}
                                {{ main_macro.get_datatable_head(app['dropdownAttribute']) }}
                            {% endif %}
                            <tbody>

                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

{% endblock %}