templates/editer_session/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Editer session{% endblock %}
  3. {% block body %}
  4. <body id="kt_app_body" data-kt-app-layout="dark-sidebar" data-kt-app-header-fixed="true" data-kt-app-sidebar-enabled="true" data-kt-app-sidebar-fixed="true" data-kt-app-sidebar-hoverable="true" data-kt-app-sidebar-push-header="true" data-kt-app-sidebar-push-toolbar="true" data-kt-app-sidebar-push-footer="true" data-kt-app-toolbar-enabled="true" class="app-default">
  5. <div class="d-flex flex-column flex-root app-root" id="kt_app_root">
  6.             <!--begin::Page-->
  7.     <div class="app-page flex-column flex-column-fluid" id="kt_app_page">
  8.             <div class="app-wrapper flex-column flex-row-fluid" id="kt_app_wrapper">
  9.                 <div class="app-main flex-column flex-row-fluid" id="kt_app_main">
  10.                 
  11.                         <div class="d-flex flex-column flex-column-fluid">
  12.                             <!--begin::Toolbar-->
  13.                             <div id="kt_app_toolbar" class="app-toolbar py-3 py-lg-6">
  14.                                 <!--begin::Toolbar container-->
  15.                                 <div id="kt_app_toolbar_container" class="app-container container-xxl d-flex flex-stack">
  16.                                     <!--begin::Page title-->
  17.                                     <div class="page-title d-flex flex-column justify-content-center flex-wrap me-3">
  18.                                         <!--begin::Title-->
  19.                                         <h1 class="page-heading d-flex text-dark fw-bold fs-3 flex-column justify-content-center my-0">Interface de gestion d'une session</h1>
  20.                                         
  21.                                             </br>
  22.                                         <div class="card mb-5 mb-xxl-8">
  23.                                             <div class="card-body pt-9 pb-0">
  24.                                                 <div class="d-flex flex-wrap flex-sm-nowrap "style="min-width: 980px;">
  25.                                                     
  26.                                                     <div class="flex-grow-1">
  27.                                                         <div class="d-flex justify-content-between align-items-start flex-wrap mb-2">
  28.                                                             <div class="d-flex flex-column">
  29.                                                                 <div class="d-flex align-items-center mb-2">
  30.                                                                     <a href="#" class="text-gray-900 text-hover-primary fs-2 fw-bold me-1">{{session.nom}}</a>
  31.                                                                     
  32.                                                                 </div>
  33.                                                                 <div class="d-flex flex-wrap fw-semibold fs-6 mb-4 pe-2">
  34.                                                                     <a href="#" class="d-flex align-items-center text-gray-600 text-hover-primary me-5 mb-2">
  35.                                                                     <span class="svg-icon svg-icon-4 me-1">
  36.                                                                         <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
  37.                                                                             <path d="M9 1.5C4.875 1.5 1.5 4.875 1.5 9C1.5 13.125 4.875 16.5 9 16.5C13.125 16.5 16.5 13.125 16.5 9C16.5 4.875 13.125 1.5 9 1.5ZM9 14.625C5.625 14.625 3 11.925 3 9C3 6.075 5.625 3.375 9 3.375C12.375 3.375 15 6.075 15 9C15 11.925 12.375 14.625 9 14.625Z" fill="currentColor"/>
  38.                                                                             <rect x="6" y="5.25" width="6" height="1.5" fill="currentColor"/>
  39.                                                                             <rect x="6" y="8.25" width="6" height="1.5" fill="currentColor"/>
  40.                                                                             <rect x="6" y="11.25" width="6" height="1.5" fill="currentColor"/>
  41.                                                                         </svg>
  42.                                                                     </span>
  43.                                                                     Session</a>
  44.                                                                 </div>
  45.                                                                 
  46.             
  47.                                                                 
  48.                                                                 <div class="d-flex flex-wrap fw-semibold fs-6 mb-4 pe-2">
  49.                                                                     <a href="#" class="d-flex align-items-center text-gray-600 text-hover-primary me-5  mb-2">
  50.                                                                     <span class="svg-icon svg-icon-4 me-1">
  51.                                                                         <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
  52.                                                                             <rect x="3" y="4" width="18" height="16" rx="2" stroke="currentColor" stroke-width="2" fill="none" />
  53.                                                                             <circle cx="8" cy="12" r="2" stroke="currentColor" stroke-width="2" fill="none" />
  54.                                                                             <circle cx="12" cy="12" r="2" stroke="currentColor" stroke-width="2" fill="none" />
  55.                                                                             <circle cx="16" cy="12" r="2" stroke="currentColor" stroke-width="2" fill="none" />
  56.                                                                         </svg>
  57.                                                                     </span> <span class="text-gray-900"> Nom du programme : </span> {{session.programme.nom}}</a>
  58.                                                                 </div>
  59.                                                                 <div class="d-flex flex-wrap fw-semibold fs-6 mb-4 pe-2">
  60.                                                                     <a href="#" class="d-flex align-items-center text-gray-600 text-hover-primary me-5  mb-2">
  61.                                                                     <span class="svg-icon svg-icon-4 me-1">
  62.                                                                         <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
  63.                                                                         <rect x="3" y="4" width="18" height="16" rx="2" stroke="currentColor" stroke-width="2" fill="none" />
  64.                                                                         <circle cx="8" cy="12" r="2" stroke="currentColor" stroke-width="2" fill="none" />
  65.                                                                         <circle cx="12" cy="12" r="2" stroke="currentColor" stroke-width="2" fill="none" />
  66.                                                                         <circle cx="16" cy="12" r="2" stroke="currentColor" stroke-width="2" fill="none" />
  67.                                                                         </svg>
  68.                                                                     </span> <span class="text-gray-900"> Description : </span>{{session.description}}</a>
  69.                                                                 </div>
  70.                                                                 
  71.                                                             </div>
  72.                                                             {% if is_granted('ROLE_ADMIN') %}                                        
  73.                                                             <div class="d-flex my-4">
  74.                                                                 <a href="#" class="btn btn-sm btn-light btn-danger me-2" data-bs-toggle="modal" data-bs-target="#kt_modal_1">
  75.                                                                         Supprimer
  76.                                                                 </a>
  77.                                                                 {# Code du modal pour le bouton supprimer #}
  78.                                                                 <div class="modal fade" tabindex="-1" id="kt_modal_1">
  79.                                                                     <div class="modal-dialog">
  80.                                                                         <div class="modal-content">
  81.                                                                             <div class="modal-header">
  82.                                                                                 <h3 class="modal-title">Supprimer une session</h3>
  83.                                                                                 <!--begin::Close-->
  84.                                                                                 <div class="btn btn-icon btn-sm btn-active-light-primary ms-2" data-bs-dismiss="modal" aria-label="Close">
  85.                                                                                     <i class="ki-duotone ki-cross fs-1"><span class="path1"></span><span class="path2"></span></i>
  86.                                                                                 </div>
  87.                                                                                 <!--end::Close-->
  88.                                                                             </div>
  89.                                                                             <div class="modal-body">
  90.                                                                                 <p>Êtes-vous sûr(e) de vouloir supprimer la session: <strong> {{session.nom}} </strong></p>
  91.                                                                             </div>
  92.                                                                             <div class="modal-footer">
  93.                                                                                 <button type="button" class="btn btn-light" data-bs-dismiss="modal">Annuler</button>
  94.                                                                                 <a href="{{ path('delete-session', {id:session.id}) }}" class="btn btn-primary">Valider</a>
  95.                                                                             </div>
  96.                                                                         </div>
  97.                                                                     </div>
  98.                                                                 </div>
  99.                                                                 
  100.                                                             </div>
  101.                                                             {% endif %}
  102.                                                         </div>
  103.                                                         
  104.                                                     </div>
  105.                                                     <!--end::Info-->
  106.                                                 </div>
  107.                                                 </br>
  108.                                                 <ul class="nav nav-custom nav-tabs nav-line-tabs nav-line-tabs-2x border-0 fs-4 fw-semibold mb-8">
  109.                                                     <!--begin:::Tab item-->
  110.                                                     <li class="nav-item">
  111.                                                         <a class="nav-link text-active-primary pb-4 active" data-bs-toggle="tab" href="#session">Informations de la session</a>
  112.                                                     </li>
  113.                                                     <li class="nav-item">
  114.                                                         <a class="nav-link text-active-primary pb-4 " data-kt-countup-tabs="true" data-bs-toggle="tab" href="#participants">Liste des participants</a>
  115.                                                     </li>
  116.                                                     <li class="nav-item">
  117.                                                         <a class="nav-link text-active-primary pb-4" data-bs-toggle="tab" href="#seances">Liste des séances</a>
  118.                                                     </li>
  119.                                                     
  120.                                                 </ul>
  121.                                             </div>
  122.                                         </div>
  123.                                 
  124.                                     </div>    
  125.                                     </div>
  126.                                     
  127.                                 </div>
  128.                             </div>
  129.                             <div id="kt_app_content" class="app-content flex-column-fluid">
  130.                                 <!--begin::Content container-->
  131.                                 <div id="kt_app_content_container" class="app-container container-xxl">
  132.                                     <!--begin::Layout-->
  133.                                     <div class="d-flex flex-column flex-lg-row">
  134.                                         <div class="flex-lg-row-fluid ms-lg-15">
  135.                                             <div class="tab-content" id="myTabContent">
  136.                                                 <div class="tab-pane fade show active" id="session" role="tabpanel">
  137.                                                 {{ form_start(form) }}
  138.                                                     <div class="card card-flush mb-6 mb-xl-9">
  139.                                                         <div class="card-header border-0">
  140.                                                             <div class="modal-body py-10 px-lg-17">
  141.                                                                 <h3 class="fw-bold">Informations de la session</h3></br></br>
  142.                                         
  143.                                                                     <div class="d-flex flex-column flex-md-row gap-5">
  144.                                                                         <div class="flex-row-fluid">
  145.                                                                         {{ form_row(form.nom) }}
  146.                                                                         </div>
  147.                                                                         <div class="flex-row-fluid">
  148.                                                                         {{ form_row(form.programme) }}
  149.                                                                         </div>
  150.                                                                     </div>
  151.                                                                     </br>
  152.                                                                     </br>
  153.                                                                     <div class="d-flex flex-column flex-md-row gap-5">
  154.     
  155.                                                                         <div class="flex-row-fluid">
  156.                                                                             {{ form_row(form.datedebut) }}
  157.                                                                         </div>
  158.                                                                         <div class="flex-row-fluid">
  159.                                                                             {{ form_row(form.datefin) }}
  160.                                                                         </div>
  161.                                                                         <div class="flex-row-fluid">
  162.                                                                             {{ form_row(form.nbrmaxparticipants) }}
  163.                                                                         </div>
  164.                                                                     </div>
  165.                                             
  166.                                             
  167.                                                                     </br>
  168.                                                                      </br>
  169.                                                                     <div class="d-flex flex-column flex-md-row gap-5">
  170.                                                                         <div class="flex-row-fluid">
  171.                                                
  172.                                                                              {{ form_row(form.description) }}
  173.                                                                         </div>
  174.                                                                     </div>
  175.                                                                     </br>
  176.                                                                     </br>
  177.                                         
  178.                                                             </div>
  179.                                                         </div>
  180.                                                         
  181.                                                 </br>
  182.                                                 <div class="modal-footer flex-center">
  183.                                                     {{ form_row(form.Enregistrer) }}
  184.                                                 </div>
  185.                                                 </br>
  186.                                             
  187.                                                     
  188.     
  189.                                             </form>    
  190.                                             {{ form_end(form) }}
  191.                                         
  192.                                         </div>    
  193.                             </div>
  194.                         </div>
  195.                     
  196.                     
  197.                                                 <div class="tab-content" id="myTabContent">
  198.                                                     <div class="tab-pane fade" id="participants" role="tabpanel">
  199.                                                     
  200.                                                         <div class="card pt-4 mb-6 mb-xl-9">
  201.                                                             <div class="card-header border-0">
  202.                                                                 <div class="card-title">
  203.                                                                     <h2>Liste des participants</h2>
  204.                                                                 </div>
  205.                                                                 
  206.                                                             </div>
  207.                                                             <div class="card-body pt-0 pb-5">
  208.                                                                 <div class="table-responsive">
  209.                                                                     <table class="table align-middle table-row-dashed gy-5" id="kt_table_users_login_session">
  210.                                                                         <!--begin::Table head-->
  211.                                                                         <thead class="border-bottom border-gray-200 fs-7 fw-bold">
  212.                                                                             <!--begin::Table row-->
  213.                                                                             <tr class="text-start text-muted text-uppercase gs-0">
  214.                                                                                 <th class="min-w-100px">Nom et prénom</th>
  215.                                                                                 <th>Sexe</th>
  216.                                                                                 <th>Date de naissance</th>
  217.                                                                                 <th>Type</th>
  218.                                                                             </tr>
  219.                                                                         </thead>
  220.                                                                         <tbody class="fs-6 fw-semibold text-gray-600">
  221.                                                                         {% for particpant in particpants %}
  222.                                                                             <tr>
  223.                                                                                 <!--begin::Invoice=-->
  224.                                                                                 <td>{{particpant.membre.nom}} {{particpant.membre.prenom}}</td>
  225.                                                                                 
  226.                                                                                 <td>{{particpant.membre.sexe}}</td>
  227.                                                                             
  228.                                                                                 <td>{{particpant.membre.datenaissance.format('Y-m-d')}}</td>
  229.                                                                                 <td>{{particpant.membre.type}}</td>
  230.                                                                             </tr>
  231.                                                                         {% endfor %}
  232.                                                                     
  233.                                                                             
  234.                                                                             
  235.                                                                         </tbody>
  236.                                                                         <!--end::Table body-->
  237.                                                                     </table>
  238.                                                                     <!--end::Table-->
  239.                                                                 </div>
  240.                                                                 <!--end::Table wrapper-->
  241.                                                             </div>
  242.                                                         
  243.                                                         </div>
  244.                                                     
  245.                                                     </div>
  246.                                                     
  247.                                                 </div>
  248.                                                
  249.                                                 <div class="tab-content" id="myTabContent">
  250.                                                      <div class="tab-pane fade" id="seances" role="tabpanel">
  251.                                                     
  252.                                                         <div class="card pt-4 mb-6 mb-xl-9">
  253.                                                             <div class="card-header border-0">
  254.                                                             
  255.                                                                 <div class="card-title">
  256.                                                                     <h2>Liste des séances</h2>
  257.                                                                 </div>
  258.                                                             
  259.                                                                 <div class="card-toolbar">
  260.                                                                 
  261.                                                                     <a href="{{ path ('app_ajouter_seance')}}">
  262.                                                                         <button type="button" class="btn btn-primary" data-bs-toggle="modal">
  263.                                                                             <span class="svg-icon svg-icon-2">
  264.                                                                             <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
  265.                                                                             <rect opacity="0.5" x="11.364" y="20.364" width="16" height="2" rx="1" transform="rotate(-90 11.364 20.364)" fill="currentColor" />
  266.                                                                             <rect x="4.36396" y="11.364" width="16" height="2" rx="1" fill="currentColor" />
  267.                                                                             </svg>
  268.                                                                             </span>
  269.                                                                         Ajouter une séance</button></a>
  270.                                                                     <!--end::Filter-->
  271.                                                                 </div>
  272.                                                             
  273.                                                             </div>
  274.                                                         
  275.                                                             <div class="card-body pt-0 pb-5">
  276.                                                                 <!--begin::Table wrapper-->
  277.                                                                 <div class="table-responsive">
  278.                                                                     <!--begin::Table-->
  279.                                                                     <table class="table align-middle table-row-dashed gy-5" id="kt_table_users_login_session">
  280.                                                                         <!--begin::Table head-->
  281.                                                                         <thead class="border-bottom border-gray-200 fs-7 fw-bold">
  282.                                                                             <!--begin::Table row-->
  283.                                                                             <tr class="text-start text-muted text-uppercase gs-0">
  284.                                                                                 <th class="min-w-100px">Nom de la séance</th>
  285.                                                                                 {% if session.programme.nom is same as('NDPS') %}
  286.                                                                                     <th>Jours</th>
  287.                                                                                 {% else %}
  288.                                                                                     <th>Jour</th>
  289.                                                                                 {% endif %}
  290.                                                                                 <th>Heure de début</th>
  291.                                                                                 <th>Heure de fin</th>
  292.                                                                                 <th>Type</th>
  293.                                                                                 <th>Actions</th>
  294.                                                                                 
  295.                                                                 
  296.                                                                             </tr>
  297.                                                                             <!--end::Table row-->
  298.                                                                         </thead>
  299.                                                                         <!--end::Table head-->
  300.                                                                         <!--begin::Table body-->
  301.                                                                         <tbody class="fs-6 fw-semibold text-gray-600">
  302.                                                                         {% for seance in seances %}
  303.                                                                             <tr>
  304.                                                                                 <td>{{seance.nom}}</td>
  305.                                                                                 {% if session.programme.nom is same as('NDPS')  %}
  306.                                                                                     {% set jours = seance.semainendps %}
  307.                                                                                         <td>{{ jours|join(', ') }}</td>
  308.                                                                                 {% else %}
  309.                                                                                     <td>{{seance.jour}}</td>
  310.                                                                                 {% endif %}
  311.                                                                                 
  312.                                                                                 <td>{{seance.heuredebut.format('H:i:s')}}</td>
  313.                                                                                 <td>{{seance.heurefin.format('H:i:s')}}</td>
  314.                                                                                 <td>{{seance.typeseance}}</td>
  315.                                                                                 <td>
  316.                                                                                     <a href="{{path('app_editer_seance',{id:seance.id})}}" class="bi bi-pencil-fill fs-5" data-kt-menu-trigger="click" data-kt-menu-placement="bottom-end">
  317.                                                                                     </a>
  318.                                                                                 </td>
  319.                                                                                 
  320.                                                                             </tr>
  321.                                                                             {% endfor %}
  322.                                                                             
  323.                                                                             
  324.                                                                         </tbody>
  325.                                                                         <!--end::Table body-->
  326.                                                                     </table>
  327.                                                                     <!--end::Table-->
  328.                                                                 </div>
  329.                                                                 <!--end::Table wrapper-->
  330.                                                             </div>
  331.                                                         <!--end::Card body-->
  332.                                                         </div>
  333.                                                     
  334.                                                     </div>
  335.                                             
  336.                                           
  337.                                                 </div>
  338.                                     </div>
  339.                                 </div>
  340.                             </div>
  341.                             </div>
  342.                         
  343.                         <div id="kt_app_footer" class="app-footer">
  344.                             <!--begin::Footer container-->
  345.                             <div class="app-container container-fluid d-flex flex-column flex-md-row flex-center flex-md-stack py-3">
  346.                                 <!--begin::Copyright-->
  347.                                 <div class="text-dark order-2 order-md-1">
  348.                                     <span class="text-muted fw-semibold me-1">2023&copy;</span>
  349.                                     <a href="https://smartegy.ca/" target="_blank" class="text-gray-800 text-hover-primary">Made with <3 by smartegy</a>
  350.                                 </div>
  351.                                 
  352.                             </div>
  353.                         </div>
  354.                     </div>
  355.                 </div>
  356.             </div>
  357.         </div>
  358. <script>
  359. document.addEventListener('DOMContentLoaded', function() {
  360.     // Sélectionne le formulaire par son nom ou autre méthode
  361.     const form = document.querySelector('form[name="session"]'); // Changez "programme" selon le nom de votre formulaire
  362.     const saveButton = document.getElementById('session_Enregistrer'); // Assurez-vous que l'ID correspond à votre bouton
  363.     // Vérifie si le bouton existe
  364.     if (!saveButton) {
  365.         console.error('Button with id "session_Enregistrer" not found.');
  366.         return;
  367.     }
  368.     // Sélectionne les champs requis
  369.     const requiredFields = form.querySelectorAll('input[required], select[required], textarea[required]');
  370.     // Fonction pour vérifier si tous les champs requis sont remplis
  371.     function validateForm() {
  372.         let allFilled = true;
  373.         requiredFields.forEach(field => {
  374.             if (!field.value.trim()) {
  375.                 allFilled = false;
  376.             }
  377.         });
  378.         // Activer/désactiver le bouton en fonction des champs requis
  379.         saveButton.disabled = !allFilled;
  380.     }
  381.     // Ajouter des écouteurs d'événements pour chaque champ requis
  382.     requiredFields.forEach(field => {
  383.         field.addEventListener('input', validateForm);
  384.     });
  385.     // Initialiser l'état du bouton lors du chargement de la page
  386.     validateForm();
  387. });
  388. </script>
  389. {% endblock %}
  390.