templates/formation_elearning/detailsFront.html.twig line 1

Open in your IDE?
  1. {% extends 'backfront.html.twig' %}
  2. {% block title %}Formations SIP Academy - Java, Python, DevOps, Agile et Plus{% endblock %}
  3. {% block body %}
  4.         <!--End of Header Area-->
  5.         <!--Breadcrumb Banner Area Start-->
  6.     <style>
  7.         /* Style global */
  8.         .certificates-wrapper {
  9.             position: relative;
  10.             display: flex;
  11.             align-items: center;
  12.             justify-content: center;
  13.         }
  14.         /* Conteneur avec scroll masqué */
  15.         .certificates-container {
  16.             overflow-x: hidden; /* Masque le scroll */
  17.             white-space: nowrap;
  18.             width: 80%; /* Ajuste la largeur selon ton design */
  19.             padding-bottom: 10px;
  20.             scroll-behavior: smooth;
  21.         }
  22.         .certificates-scroll {
  23.             display: flex;
  24.             gap: 15px;
  25.         }
  26.         /* Style des cartes */
  27.         .certificate-card {
  28.             flex: 0 0 auto;
  29.             width: 220px;
  30.             background: white;
  31.             border-radius: 10px;
  32.             box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  33.             overflow: hidden;
  34.             text-align: center;
  35.         }
  36.         .certificate-card img {
  37.             width: 100%;
  38.             height: 140px;
  39.             object-fit: cover;
  40.             border-bottom: 3px solid #1c3263;
  41.         }
  42.         .certificate-info {
  43.             padding: 10px;
  44.         }
  45.         /* Boutons de navigation */
  46.         .scroll-btn {
  47.             background-color: #1c3263;
  48.             color: white;
  49.             border: none;
  50.             padding: 10px 15px;
  51.             font-size: 15px;
  52.             cursor: pointer;
  53.             position: absolute;
  54.             top: 50%;
  55.             transform: translateY(-50%);
  56.             border-radius: 50%;
  57.             box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  58.         }
  59.         .scroll-btn.left {
  60.             left: 0;
  61.         }
  62.         .scroll-btn.right {
  63.             right: 0;
  64.         }
  65.         /* Effet au survol */
  66.         .scroll-btn:hover {
  67.             background-color: #0e2149;
  68.         }
  69.     </style>
  70.         <!--End of Breadcrumb Banner Area-->
  71.         <!--Course Area Start-->
  72.         <div class="course-details-area section-padding">
  73.             <div class="container">
  74.                 <div class="row">
  75.                     <div class="col-lg-8 col--12">
  76.                         <div class="course-details-right-sidebar">
  77.                             <div class="events-details-img1 img-full">
  78.                                 <h3>{{formation.titre }}</h3>
  79.                                 <img alt="" src="{{asset('uploads/formation/'~ formation.affiche  )}}">
  80.                             </div>
  81.                             <div class="single-item-content">
  82.                                 <div class="single-item-comment-view">
  83.                                     <span><svg xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" viewBox="0 0 24 24"><path fill="#000" d="M3 19V5h18v14zm5.5-2.5h1v-1h1.23q.328 0 .549-.221t.221-.548v-2.462q0-.327-.221-.548t-.548-.221H7.5v-2h4v-1h-2v-1h-1v1H7.27q-.328 0-.549.221T6.5 9.27v2.462q0 .327.221.548t.548.221H10.5v2h-4v1h2zm7.5-.52l1.539-1.538H14.46zm-1.538-6.172h3.077L16 8.269z"/></svg>{{formation.prix }}DT</span>
  84. {#                                    <span><i class="zmdi zmdi-favorite"></i>{{formation.nblike }}</span>#}
  85.                                 </div>
  86.                                 <div class="single-item-rating">
  87.                                     <i class="zmdi zmdi-star"></i>
  88.                                     <i class="zmdi zmdi-star"></i>
  89.                                     <i class="zmdi zmdi-star"></i>
  90.                                     <i class="zmdi zmdi-star"></i>
  91.                                     <i class="zmdi zmdi-star"></i>
  92.                                 </div>
  93.                             </div>
  94.                             <div class="about-lectures">
  95.                                 <h3>Description</h3>
  96.                                 {{ formation.description|raw }}
  97.                             </div>
  98.                             <div class="about-lectures">
  99.                                 <h3>Programme</h3>
  100.                                 {{ formation.programme|raw }}
  101.                             </div>
  102.                             {% if sections  != null %}
  103.                                 <div class="course-duration mb-30">
  104.                                     <div class="duration-title">
  105.                                         <div class="text"><span>Sections</span> <span class="text-right"> Durée</span></div>
  106.                                     </div>
  107.                                     <div class="duration-text">
  108.                                         {%  for section  in sections %}
  109.                                             <div class="text"><span style="width: 300px">{{ section.titre }}</span> <span class="text-right">{{ section.duree }}</span></div>
  110.                                         {% endfor %}
  111.                                     </div>
  112.                                 </div>
  113.                             {% endif %}
  114.                         </div>
  115.                         {% if certifs %}
  116.                             <div class="certificates-area section-padding" style="margin-top: -50px">
  117.                                 <div class="container">
  118.                                     <h3 class="mb-4 ">🏆 Certificates</h3>
  119.                                     <div class="certificates-wrapper">
  120.                                         <!-- Bouton gauche -->
  121.                                         {% if certifs|length > 2 %}
  122.                                             <button class="scroll-btn left" onclick="scrollCertificates(-1)">◀</button>
  123.                                         {% endif %}
  124.                                         <!-- Conteneur scrollable -->
  125.                                         <div class="certificates-container">
  126.                                             <div class="certificates-scroll">
  127.                                                 {% for certif in certifs %}
  128.                                                     <div class="certificate-card">
  129.                                                         <img src="{{ asset('uploads/elearning/' ~ certif.image) }}" alt="Certificat de {{ certif.prenom }} {{ certif.nom }}">
  130.                                                         <div class="certificate-info">
  131.                                                             <h5>{{ certif.prenom }} {{ certif.nom }}</h5>
  132.                                                             <p class="text-muted">{{ certif.date|date('d M Y') }}</p>
  133.                                                         </div>
  134.                                                     </div>
  135.                                                 {% else %}
  136.                                                     <p class="text-center w-100">Aucun certificat disponible pour cette formation.</p>
  137.                                                 {% endfor %}
  138.                                             </div>
  139.                                         </div>
  140.                                         <!-- Bouton droit -->
  141.                                         {% if certifs|length > 2 %}
  142.                                             <button class="scroll-btn right" onclick="scrollCertificates(1)">▶</button>
  143.                                         {% endif %}
  144.                                     </div>
  145.                                 </div>
  146.                             </div>
  147.                             <script>
  148.                                 function scrollCertificates(direction) {
  149.                                     const container = document.querySelector(".certificates-container");
  150.                                     const scrollAmount = 250; // Distance de défilement
  151.                                     container.scrollLeft += direction * scrollAmount;
  152.                                 }
  153.                             </script>
  154.                         {% endif %}
  155. {% if temoignages %}
  156.                         <div class="testimonial-area" style="margin-top: -50px">
  157.                             <div class="container">
  158.                                 <div class="row">
  159.                                     <div class="testimonial-slider-2 owl-carousel">
  160.                                         {% for temoii in temoignages %}
  161.                                             <div class="col-12">
  162.                                                 <div class="single-testimonial testimonial-style-2">
  163.                                                     <div class="des-testimonial">
  164.                                                         {{ temoii.description }}                                </div>
  165.                                                     <div class="testimonial-author">
  166.                                                         <div class="author-img">
  167.                                                             <img src="{{ asset('uploads/temoignage/' ~ temoii.image ) }}" alt="" style="width: 100%;height: 100%" >
  168.                                                         </div>
  169.                                                         <div class="author-content">
  170.                                                             <h5>{{ temoii.prenom }} {{ temoii.nom }} &nbsp; </h5>
  171.                                                             <p>{{ temoii.poste }}</p>
  172.                                                         </div>
  173.                                                     </div>
  174.                                                 </div>
  175.                                             </div>
  176.                                         {% endfor %}
  177.                                     </div>
  178.                                 </div>
  179.                             </div>
  180.                         </div>
  181. {% endif %}
  182.                         <!-- Section des certificats -->
  183.                         <!-- Section des certificats -->
  184.                         <!-- Section des certificats -->
  185.                     </div>
  186.                     <!-- Partie droite : Vidéo + Ajouter au panier -->
  187.                     <div class="col-lg-4">
  188.                         <div class="sidebar-widget">
  189.                             <div style="margin-bottom: 25px" class="course-sidebar p-3 bg-white rounded shadow">
  190.                                 {% if  formation.video  %}
  191.                                 <h5 class=" font-weight-bold mb-3">🎥 Aperçu du cours</h5>
  192.                                 <div class="course-video mb-3">
  193.                                     <video width="100%" controls class="rounded shadow">
  194.                                         <source src="{{ asset('uploads/elearning/' ~ formation.video) }}" type="video/mp4">
  195.                                         Votre navigateur ne supporte pas la lecture des vidéos.
  196.                                     </video>
  197.                                 </div>
  198.                                 {% endif  %}
  199.                                 <!-- Prix et bouton Ajouter au panier -->
  200.                                 <div class="text-center">
  201.                                     <h4 class=" text-danger font-weight-bold mb-3">{{ formation.prix }} DT</h4>
  202.                                     <button style="font-size: 15px; background-color: #1c3263;color: white" data-id="{{ formation.id }}" class="btn-ajout-panier btn btn-lg  w-100 rounded-pill shadow-sm">
  203.                                         🛒 Ajouter au panier
  204.                                     </button>
  205.                                 </div>
  206.                             </div>
  207.                             {% if  evenements  %}
  208.                             <div class="single-sidebar-widget">
  209.                                 <h4 class="title">Prochaines Sessions</h4>
  210.                                 <div class="recent-content">
  211.                                     {% for evenement in evenements|sort|reverse %}
  212.                                         <div class="recent-content-item">
  213.                                             <a href="{{ path('app_details_session',{'slug':evenement.slug}) }}">
  214.                                                 {% if evenement.image %}
  215.                                                     <img  alt="" style="width: 70px;height: 65px"  src="{{asset('uploads/evenement/'~ evenement.image  )}}">
  216.                                                 {% else %}
  217.                                                     <img  alt="" style="width: 70px;height: 65px"  src="{{asset('uploads/formation/'~ evenement.formation.affiche  )}}">
  218.                                                 {% endif %}
  219.                                             </a>
  220.                                             <div class="recent-text">
  221.                                                 <h4><a href="{{ path('app_details_session',{'slug':evenement.slug}) }}">{{ evenement.titre }}</a></h4>
  222.                                                 <div class="single-item-comment-view">
  223.                                                     <span><i class="zmdi zmdi-time"></i>{{ evenement.starttime |date('d M H:i') }}</span>
  224.                                                     <span><i class="zmdi zmdi-time"></i>{{ evenement.endtime |date('d M H:i') }}</span>
  225.                                                 </div>
  226.                                             </div>
  227.                                         </div>
  228.                                     {% endfor %}
  229.                                 </div>
  230.                             </div>
  231.                             {% endif  %}
  232.                             <div class="single-sidebar-widget">
  233.                                 <h4 class="title">Anciennes Sessions</h4>
  234.                                 <div class="recent-content">
  235.                                     {% for evenement in ancienevents|sort|reverse %}
  236.                                         <div class="recent-content-item">
  237.                                             <a href="{{ path('app_details_session',{'slug':evenement.slug}) }}">
  238.                                                 {% if evenement.image %}
  239.                                                     <img  alt="" style="width: 70px;height: 65px"  src="{{asset('uploads/evenement/'~ evenement.image  )}}">
  240.                                                 {% else %}
  241.                                                     <img  alt="" style="width: 70px;height: 65px"  src="{{asset('uploads/formation/'~ evenement.formation.affiche  )}}">
  242.                                                 {% endif %}
  243.                                             </a>
  244.                                             <div class="recent-text">
  245.                                                 <h4><a href="{{ path('app_details_session',{'slug':evenement.slug}) }}">{{ evenement.titre }}</a></h4>
  246.                                                 <div class="single-item-comment-view">
  247.                                                     <span><i class="zmdi zmdi-time"></i>{{ evenement.starttime |date('d M H:i') }}</span>
  248.                                                     <span><i class="zmdi zmdi-time"></i>{{ evenement.endtime |date('d M H:i') }}</span>
  249.                                                 </div>
  250.                                             </div>
  251.                                         </div>
  252.                                     {% endfor %}
  253.                                 </div>
  254.                             </div>
  255.                             <div class="single-sidebar-widget">
  256.                                 <h4 class="title">Dernières Actualités</h4>
  257.                                 <div class="recent-content">
  258.                                     {% for actualite in actualites %}
  259.                                         <div class="recent-content-item">
  260.                                             <a href="{{ path('app_details_actualite',{'slug':actualite.slug}) }}"><img src="{{asset('uploads/actualite/'~ actualite.image  )}}" style="width: 70px;height: 65px" alt=""></a>
  261.                                             <div class="recent-text">
  262.                                                 <h4><a href="{{ path('app_details_actualite',{'slug':actualite.slug}) }}">{{ actualite.titre }}</a></h4>
  263.                                                 <a class="single-item-comment-view" style="height: 20px;margin-bottom: 0px;color: darkblue;font-size: 13px"
  264.                                                    href="{{ path('app_details_actualite',{'slug':actualite.slug}) }}"
  265.                                                 >Lire la suite</a>
  266.                                                 <div class="single-item-comment-view">
  267.                                                     <span><i class="zmdi zmdi-eye"></i>{{ actualite.nbvue }}</span>
  268.                                                     <span><i class="zmdi zmdi-comments"></i>{{ actualite.nbcommentaire }}</span>
  269.                                                 </div>
  270.                                             </div>
  271.                                         </div>
  272.                                     {% endfor %}
  273.                                 </div>
  274.                             </div>
  275. {#                            <div class="single-sidebar-widget">#}
  276. {#                                <h4 class="title">Recent Course</h4>#}
  277. {#                                <div class="recent-content">#}
  278. {#                                    <div class="recent-content-item">#}
  279. {#                                        <a href="#"><img src="img/event/7.jpg" alt=""></a>#}
  280. {#                                        <div class="recent-text">#}
  281. {#                                            <h4><a href="#">Learn English in</a></h4>#}
  282. {#                                            <div class="single-item-comment-view">#}
  283. {#                                                <span><i class="zmdi zmdi-eye"></i>59</span>#}
  284. {#                                                <span><i class="zmdi zmdi-comments"></i>19</span>#}
  285. {#                                            </div>#}
  286. {#                                            <p>There are many varf passages of Lorem Ipsuable,amar</p>#}
  287. {#                                        </div>#}
  288. {#                                    </div>#}
  289. {#                                    <div class="recent-content-item">#}
  290. {#                                        <a href="#"><img src="img/event/8.jpg" alt=""></a>#}
  291. {#                                        <div class="recent-text">#}
  292. {#                                            <h4><a href="#">Team Works</a></h4>#}
  293. {#                                            <div class="single-item-comment-view">#}
  294. {#                                                <span><i class="zmdi zmdi-eye"></i>59</span>#}
  295. {#                                                <span><i class="zmdi zmdi-comments"></i>19</span>#}
  296. {#                                            </div>#}
  297. {#                                            <p>There are many varf passages of Lorem Ipsuable,amar</p>#}
  298. {#                                        </div>#}
  299. {#                                    </div>#}
  300. {#                                    <div class="recent-content-item">#}
  301. {#                                        <a href="#"><img src="img/event/9.jpg" alt=""></a>#}
  302. {#                                        <div class="recent-text">#}
  303. {#                                            <h4><a href="#">Learn With Fun</a></h4>#}
  304. {#                                            <div class="single-item-comment-view">#}
  305. {#                                                <span><i class="zmdi zmdi-eye"></i>59</span>#}
  306. {#                                                <span><i class="zmdi zmdi-comments"></i>19</span>#}
  307. {#                                            </div>#}
  308. {#                                            <p>There are many varf passages of Lorem Ipsuable,amar</p>#}
  309. {#                                        </div>#}
  310. {#                                    </div>#}
  311. {#                                    <div class="recent-content-item">#}
  312. {#                                        <a href="#"><img src="img/event/10.jpg" alt=""></a>#}
  313. {#                                        <div class="recent-text">#}
  314. {#                                            <h4><a href="#">Writing Skill</a></h4>#}
  315. {#                                            <div class="single-item-comment-view">#}
  316. {#                                                <span><i class="zmdi zmdi-eye"></i>59</span>#}
  317. {#                                                <span><i class="zmdi zmdi-comments"></i>19</span>#}
  318. {#                                            </div>#}
  319. {#                                            <p>There are many varf passages of Lorem Ipsuable,amar</p>#}
  320. {#                                        </div>#}
  321. {#                                    </div>#}
  322. {#                                </div>#}
  323. {#                            </div>#}
  324. {#                            <div class="single-sidebar-widget">#}
  325. {#                                <h4 class="title">Search by Tags</h4>#}
  326. {#                                <ul class="tags">#}
  327. {#                                    <li><a href="#">Photoshop</a></li>#}
  328. {#                                    <li><a href="#">Design</a></li>#}
  329. {#                                    <li><a href="#">Tutorial</a></li>#}
  330. {#                                    <li><a href="#">Courses</a></li>#}
  331. {#                                    <li><a href="#">Premium</a></li>#}
  332. {#                                    <li><a href="#">Designtuto</a></li>#}
  333. {#                                </ul>#}
  334. {#                            </div>#}
  335. {#                      #}
  336.                         </div>
  337.                     </div>
  338.                 </div>
  339.             </div>
  340.         </div>
  341.         <!--Course Area End-->
  342.     <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
  343.     <script>
  344.         document.addEventListener('DOMContentLoaded', () => {
  345.             const cartCount = document.getElementById('cart-count');
  346.             document.querySelectorAll('.btn-ajout-panier').forEach(button => {
  347.                 button.addEventListener('click', () => {
  348.                     const formationId = button.dataset.id;
  349.                     fetch(`/panier/ajouter/${formationId}`, {
  350.                         method: 'POST',
  351.                         headers: { 'X-Requested-With': 'XMLHttpRequest' }
  352.                     })
  353.                         .then(response => response.json())
  354.                         .then(data => {
  355.                             if (data.status === 'ok') {
  356.                                 // 1) Mettre à jour le compteur
  357.                                 cartCount.textContent = data.total_items;
  358.                                 // 2) Afficher SweetAlert de succès
  359.                                 Swal.fire({
  360.                                     icon: 'success',
  361.                                     title: 'Ajouté !',
  362.                                     text: data.message,
  363.                                     timer: 1500,
  364.                                     showConfirmButton: false
  365.                                 });
  366.                                 // 3) Désactiver le bouton pour ne plus pouvoir cliquer
  367.                                 button.disabled = true;
  368.                             } else if (data.status === 'already_in_cart') {
  369.                                 // Formation déjà dans le panier
  370.                                 Swal.fire({
  371.                                     icon: 'info',
  372.                                     title: 'Déjà au panier',
  373.                                     text: data.message
  374.                                 });
  375.                                 // Optionnel : vous pouvez désactiver le bouton aussi
  376.                                 button.disabled = true;
  377.                             } else {
  378.                                 // Erreur générale
  379.                                 Swal.fire({
  380.                                     icon: 'error',
  381.                                     title: 'Erreur',
  382.                                     text: data.message ?? 'Erreur lors de l’ajout au panier.'
  383.                                 });
  384.                             }
  385.                         })
  386.                         .catch(() => {
  387.                             Swal.fire({
  388.                                 icon: 'error',
  389.                                 title: 'Erreur réseau',
  390.                                 text: 'Impossible d’ajouter la formation.'
  391.                             });
  392.                         });
  393.                 });
  394.             });
  395.         });
  396.     </script>
  397. {% endblock %}