{% extends '@admin/index.twig' %}

{% block content %}
  <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 mb-3 border-bottom">
    <h1 class="h2">
      <i aria-hidden="true" class="bi bi-clock-history"></i>
      {{ ad_sess_session }} #{{ sessionId }}
    </h1>
  </div>
  <table class="table table-striped align-middle border shadow">
    <tbody>
    {% set num = 0 %}
    {% for line in trackingData %}
      {% set data = line|split(';') %}
      {% if data.0 == sessionId %}
        {% set num = num + 1 %}
        <tr>
          <td>{{ data.7|date('Y-m-d H:i:s') }}</td>
          <td>{{ data.1 }} ({{ data.2 }})</td>
        </tr>
        {% if num == 1 %}
          <tr>
            <td>{{ ad_sess_referer }}:</td>
            <td>
              {% set temp = data.5|replace({'?': '? '}) %}
              {{ temp|escape }}
            </td>
          </tr>
          <tr>
            <td>{{ ad_sess_browser }}:</td>
            <td>{{ data.6|escape }}</td>
          </tr>
          <tr>
            <td>{{ ad_sess_ip }}:</td>
            <td>{{ data.3|escape }}</td>
          </tr>
        {% endif %}
      {% endif %}
    {% endfor %}
    </tbody>
    <tfoot>
      <tr>
        <td colspan="2"><a href="./statistics/sessions/{{ thisDay }}">{{ ad_sess_back }}</a></td>
      </tr>
    </tfoot>
  </table>
{% endblock %}
