{% extends 'base_backend_admin.html.twig' %}

{% block title %} Paramètre Rendez-Vous{% endblock %}

{% block content %}
<!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4">
    <h1 class="h3 mb-0 text-gray-800">Paramètre Rendez-Vous</h1>
    <ol class="breadcrumb float-sm-right">
        <li class="breadcrumb-item">Service</li>
        <li class="breadcrumb-item">Rendez-Vous</li>
        <li class="breadcrumb-item">Paramètre</li>
    </ol>
</div>

<!-- Begin Page Content -->
<div class="container-fluid">
    
    {% include 'backend_admin/basic/notice.html.twig' %}
    
    <div class="card shadow mb-4">
       
        <div class="card-header py-3">
            <h6 class="m-0 font-weight-bold text-info">Paramètre Rendez-vous</h6>
        </div>
        <div class="card-body">
            
            <div class="row my-3">
                <div class="col-3">Date début: <b>{{ startDate }}</b></div>
                <div class="col-3">Date Fin: <b>{{ endDate }}</b></div>
                <div class="col-3">Durée du service: <b>{{ duree }}minute</b></div>
            </div>

            <div class="row my-3">
                <div class="col-3">Heur début: <b>{{ startTime }}</b></div>
                <div class="col-3">Heur Fin: <b>{{ endTime }}</b></div>
                <div class="col-3">Durée Entre les Rendez-Vous: <b>{{ between }}minute</b></div>
            </div>

            <div class="row">
                <div class="col-9">
                    Exclure les jours:
                    {% for exclude in excludeDay %}
                        {% if exclude == 'Sun'%} <b>dimanche,</b> {% endif %}
                        {% if exclude == 'Mon'%} <b>lundi,</b> {% endif %}
                        {% if exclude == 'Tue'%} <b>mardi,</b> {% endif %}
                        {% if exclude == 'Wed'%} <b>mercredi,</b> {% endif %}
                        {% if exclude == 'Thu'%} <b>jeudi,</b> {% endif %}
                        {% if exclude == 'Fri'%} <b>verdredi,</b> {% endif %}
                        {% if exclude == 'Sat'%} <b>samedi,</b> {% endif %}
                    {% endfor %}
                </div>
            </div>

        </div>
    </div>


    <div class="card shadow mb-4">
        <div class="card-header py-3">
            <h6 class="m-0 font-weight-bold text-info">Liste des  Rendez-vous</h6>
        </div>
        <div class="card-body">
            
            <table class="table">
                {% for key,rendezVous in arrRendezVous %}
                    <tr>
                        <td> <b>{{ key }}</b> </td>
                        <td>
                            <div class="row">
                                {% for val in rendezVous %}
                                    <div class="col-2">{{ val['debut'] }} - {{ val['fin'] }}</div>
                                {% endfor %}
                            </div>
                        </td>
                    </tr>
                {% endfor %}
            </table>
        </div>
    </div>

    {% if save == 'true' %}
        <div align="center">
            <a href="{{ path('backend_admin_service_rdv_save', {'id':id,
                                                        'startDate':startDate, 
                                                        'endDate':endDate, 
                                                        'startTime':startTime,
                                                        'endTime':endTime,
                                                        'between':between,
                                                        'excludeDay':excludeDay} ) }}" class="d-none d-sm-inline-block btn btn-primary btn-lg">
                <i class="fa-solid fa-floppy-disk"></i>
                Enregister
            </a>
        </div>
    {% endif %}
</div>
{% endblock %}

{% block javascripts %}
    {{ parent() }}
    {{ encore_entry_script_tags('app_backend_article_service') }}
{% endblock %}