{% extends "@EasyAdmin/page/content.html.twig" %} {% set titre ='Planning des voyages' %} {% block content_title %} {{ titre }} {% endblock %} {% block main %}
{{ form_start(form, {'attr': {'id': 'search_form'}}) }} {{ form_row(form.depart)}} {{ form_row(form.arrivee)}} {{ form_row(form.date)}} {{ form_end(form) }}
{{ app.session.get('nbVisite') }}.
{%do schedules.setPageRange(3)%}{{knp_pagination_render(schedules, 'pagination.html.twig')}}
{% for schedule in schedules %} {% endfor %}
{% set maxMontant = 0 %} {% set tabTarifs=[] %} {% set tabTarifName=[] %} {% for tarif in tarifs %} {% if ((tarif.depart.id == schedule.depart.id) and (tarif.arrivee.id == schedule.arrivee.id) and (tarif.company == schedule.company) and (tarif.typeTarif == schedule.typeTarif)) %} {% set tabTarifs = tabTarifs|merge([{ 'name' : tarif.name, 'amount' : tarif.amount }]) %} {% set tabTarifName=tabTarifName|merge([tarif.name]) %} {% set maxMontant = max(tarif.amount, maxMontant) %} {% endif %} {% endfor %} {% set buttonDisabled = '' %} {% set buttonClass = 'btn btn-warning' %} {% if ((maxMontant == 0) or (schedule.seats<=0)) %} {% set buttonDisabled = 'disabled' %} {% set buttonClass = 'btn btn-primary' %} {% endif %}
{{ schedule.scheduleDate ? schedule.scheduleDate|format_datetime('full', 'none', locale='fr') }}
{% if (schedule.seats <= 8) and (schedule.seats > 1) %} {% elseif (schedule.seats <= 1) %} {% endif %}
{{ schedule.departureTime ? schedule.departureTime|date('H:i') : '' }} {# #} {{ schedule.depart }} {{ maxMontant }} CFA
( {% for tarif in tabTarifs %} {{tarif.name}}:{{tarif.amount}} {% endfor %})
{{ schedule.estimatedArrivalTime ? schedule.estimatedArrivalTime|date('H:i') : '' }} {# #} {{ schedule.arrivee }}
{{ schedule.company }}
{% if schedule.company.image is null %} {% else %} {% endif %}
{% for conf in schedule.bus.conforts %} {{conf.description}} {% endfor %}
{%do schedules.setPageRange(3)%}{{knp_pagination_render(schedules, 'pagination.html.twig')}}
{% endblock %} {% block body_javascript %} {{ parent()}} {% endblock %}