{% extends 'admin/layout.html.twig' %}
{% set panel = 'dashboard' %}
{% set nav = 'system' %}
{% set menu = 'admin_operation_analysis' %}

{% block main %}
  <link href="{{ asset('assets/libs/gallery/morris/0.5.0/morris.css') }}" rel="stylesheet"/>
  <div class="row">

    <div class="col-md-12">
      {% block analysisHead %}
        <div class="col-md-12">
          {{ web_macro.flash_messages() }}

          <form class="well well-sm form-inline" action="{{ url("admin_operation_analysis_rount",{tab:tab}) }}" method="get" id="operation-form"
            role="form">
            <div class="form-group">
              <select class="form-control" name="analysisDateType">
                {{ select_options(dict('analysisDateType'), dataInfo.analysisDateType, '--选择数据类型--'|trans) }}
              </select>
            </div>
            <div class="form-group">
              <a type="button" class="btn btn-default" id="btn-month" currentMonthStart="{{ dataInfo.currentMonthStart }}"
                currentMonthEnd="{{ dataInfo.currentMonthEnd }}">{{ '本月'|trans }}</a>
            </div>
            <div class="form-group">
              <a type="button" class="btn btn-default " id="btn-lastMonth" lastMonthStart="{{ dataInfo.lastMonthStart }}"
                lastMonthEnd="{{ dataInfo.lastMonthEnd }}">{{ '上月'|trans }}</a>
            </div>

            <div class="form-group">
              <a type="button" class="btn btn-default " id="btn-lastThreeMonths" lastThreeMonthsStart="{{ dataInfo.lastThreeMonthsStart }}"
                lastThreeMonthsEnd="{{ dataInfo.lastThreeMonthsEnd }}">{{ '近三月'|trans }}</a>
            </div>

            <div class="form-group mll">
              <label class="ptm">{{ '起始日期'|trans }}</label>
              <input type="text" class="form-control analysis-input mls" name="startTime" value="{{ dataInfo.startTime }}">
            </div>

            <div class="form-group mls">
              <label class="ptm">{{ '截止日期'|trans }}</label>
              <input type="text" class="form-control analysis-input mls" name="endTime" value="{{ dataInfo.endTime }}">
            </div>

            <button class="btn btn-primary pull-right" id="btn-search">{{ '查询'|trans }}</button>
          </form>

          {% if showHelpMessage|default(null ) == 1 %}
            <div class="help-block">{{ '视频观看数，将从数据统计功能更新启用之日起开始记录'|trans }}</div>
          {% endif %}
        </div>
        <div class="col-md-12">
          {% if tab == "trend" and dataInfo.analysisDateType not in ['courseSetSum', 'userSum', 'courseSum'] %}
            <p class="text-muted">
              <span class="mrl">{{ '总数：'|trans }}<strong class="inflow-num">{{ count|default(0) }}</strong></span>
            </p>
          {% endif %}
        </div>
        <div class="col-md-12">
          <ul class="nav nav-tabs" role="tablist">
            <li role="presentation"{% if tab=="trend" %} class="active"{% endif %} ><a
                href="{{ path(href,{tab:"trend",startTime:dataInfo.startTime,endTime:dataInfo.endTime,analysisDateType:dataInfo.analysisDateType}) }}">{{ '趋势'|trans }}</a>
            </li>
            <li role="presentation" {% if tab=="detail" %} class="active"{% endif %}><a
                href="{{ path(href,{tab:"detail",startTime:dataInfo.startTime,endTime:dataInfo.endTime,analysisDateType:dataInfo.analysisDateType}) }}">{{ '明细'|trans }}</a>
            </li>
          </ul>
        </div>
      {% endblock %}
      {% block analysisBody %}
      {% endblock %}
    </div>
  </div>

{% endblock %}
