templates/home/fiche_vehicule.html.twig line 1

Open in your IDE?
  1. {% extends 'layout_website.html.twig' %}
  2. {% block title %} {{ vehicule.getMetaTitle }} - Fiche vehicule - {{parent()}}{% endblock %}
  3. {% block stylesheets %}
  4.     {{parent()}}
  5.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.min.css">
  6.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css"/>
  7.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.min.css"/>
  8.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/photoswipe.min.css"/>
  9.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/default-skin/default-skin.min.css"/>
  10.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css"/>
  11.     <style type="text/css">
  12.         #titleproduct{
  13.             display:none;
  14.         }
  15. .nav-top{
  16.             padding:18px 7px;
  17.         }
  18.         .wrapper-list{
  19.             padding-bottom: 20px;
  20.         }
  21.         .wrapper-gallery{
  22.             background: #fff
  23.         }
  24.         .wrapper-item{
  25.             padding: 0 0;
  26.         }
  27.         .preview-image .img-item:not(:first-child){
  28.             margin-top: 6rem;
  29.         }
  30.         .preview-image{
  31.         /*    height: 75vh; */
  32.             height: auto;
  33.             max-height: 65vh;
  34.         }
  35.         .preview-image .slick-list{
  36.             height: 100%
  37.         }
  38.         .preview-image .slick-track{
  39.             height: 100%
  40.         }
  41.         .preview-image .slick-track img{
  42.             width: auto;
  43.             height: auto;
  44.             max-width: 100%;
  45.         /*    max-height: 100%; */
  46.             max-height: 50vh;
  47.             margin: auto;
  48.         }
  49.         .blockimgslid{
  50.             height: 100%;
  51.             display: block;
  52.             text-align: center;
  53.         }
  54.         .wrap-infos{
  55.             text-align: center;
  56.             color: #000;
  57.             background: #fff;
  58.             padding: 30px;
  59.             padding-bottom: 9rem;
  60.         }
  61.         .wrap-infos .title-product{
  62.             text-align: center;
  63.             color: #000;
  64.             font-weight: 700;
  65.             font-size: 1.8rem;
  66.         }
  67.         .btn.action{
  68.             border: 1px solid transparent;
  69.             border-radius: 30px;
  70.             background-color: #51c5a1;
  71.             font-weight: normal;
  72.             font-style: normal;
  73.             color: #fff;
  74.             cursor: pointer;
  75.             padding: 12px 27px;
  76.             font-size: 1.6rem;
  77.         /*    box-shadow: -250px 0px 100px -180px #687FED inset; */
  78.             transition: all 0.2s ease-in;
  79.         }
  80.         .btn.action:hover{
  81.             background : #fff;
  82.             color: #51c5a1;
  83.             border: 1px solid #51c5a1;
  84.             box-shadow: none;
  85.         }
  86.         .btn.action.voir-detail{
  87.             margin-top:2rem;
  88.         }
  89.         .ref {
  90.             font-size:1.5rem;
  91.         }
  92.         .ref .iconify{
  93.             vertical-align: middle;
  94.             font-size:1.5rem;
  95.         }
  96.         .box-cart >.content{display: none;text-align:left;}
  97.         .box-cart {
  98.                 box-shadow: 1px 5px 19px 0px #51c5a1 ;
  99.                 border-radius: 10px;
  100.                 padding: 1rem;
  101.                 font-size: .9rem;
  102.                 line-height: 1.6em;
  103.                 margin: auto;
  104.                 margin-top: 2rem;
  105.                 background: #fff;
  106.                 max-width: 60rem;
  107.         }
  108.         .box-cart:not(.open){
  109.             background: #fff;
  110.             box-shadow: 0px 0px 5px 3px #51c5a1;
  111.         }
  112.         .box-cart > .title{cursor: pointer;margin:0;text-align: center;}
  113.         .details-wrapper{display:none;}
  114.         .details-wrapper .box-cart {
  115.             background: #fff!important;
  116.             padding: 0;
  117.         }
  118.         .details-wrapper .box-cart > .title {
  119.             font-size: 1.4rem;
  120.             font-weight: 600;
  121.             padding: 1.5rem 0;
  122.             margin: 0;
  123.         }
  124.         .details-wrapper .box-cart > .title {
  125.             font-size: 1.4rem;
  126.             font-weight: 600;
  127.             padding: 1.5rem 0;
  128.             margin: 0;
  129.         }
  130.         .details-wrapper .box-cart.open > .title {
  131.             box-shadow: 0px 3px 7px 0px rgba(0, 0, 255, .2);
  132.         }
  133.         .details-wrapper .box-cart >.content {
  134.             padding: 1.4rem;
  135.         }
  136.         .blockprice{
  137.             display: flex;
  138. flex-direction: column;
  139.         }
  140.         .blockprice .prx{
  141.             text-align:center;
  142.             color: #51c5a1;
  143.             font-size: 2.2rem;
  144.         }
  145.         .blockprice .prxttc{
  146.             text-align:right;
  147.             font-size: 1.2rem;
  148.         }
  149.          
  150.         @media (min-width: 1400px){
  151.             .container {
  152.                 width: 1400px;
  153.             }
  154.         }
  155.         .nav-stape {
  156.             display: none;
  157.             background: #51c5a1;
  158.             padding: 21px 18px;
  159.             text-align: center;
  160.             color: #fff;
  161.         }
  162.         .nav-stape .content{
  163.             max-width: 600px;
  164.             margin: auto;
  165.             display: flex;
  166.             align-items: center;
  167.             justify-content: space-around;
  168.         }
  169.         .nav-stape .btn-nav{
  170.             border: 1px solid #fff;
  171.             padding: 8px 30px;
  172.             border-radius: 24px;
  173.             color: #fff;
  174.             transition: all 0.2s ease;
  175.         }
  176.         .nav-stape .btn-nav:hover{
  177.             background: #fff;
  178.             color: #000;
  179.         }
  180.         .btn-nav.next{
  181.             background: #fff;
  182.             color: #000;
  183.         }
  184.         .btn-nav.next:hover{
  185.             color: #fff;
  186.             background: #000;
  187.             border: 1px solid #fff;
  188.         }
  189.         .faq {
  190.             background: #FFFFFF;
  191.             box-shadow: 0 2px 48px 0 rgba(0, 0, 0, 0.1);
  192.             border-radius: 4px;
  193.             margin:2rem 0;
  194.         }
  195.         .faq .card {
  196.             border: none;
  197.             background: none;
  198.             border-bottom: 1px dashed #CEE1F8;
  199.         }
  200.         .faq .card .card-header {
  201.             padding: 0px;
  202.             border: none;
  203.             background: none;
  204.             -webkit-transition: all 0.3s ease 0s;
  205.             -moz-transition: all 0.3s ease 0s;
  206.             -o-transition: all 0.3s ease 0s;
  207.             transition: all 0.3s ease 0s;
  208.         }
  209.         .faq .card .card-header:hover {
  210.             background: rgba(42, 30, 233, 0.1);
  211.             padding-left: 10px;
  212.         }
  213.         .faq .card .card-header .faq-title {
  214.             width: 100%;
  215.             text-align: left;
  216.             padding: 0px;
  217.             padding-left: 30px;
  218.             padding-right: 30px;
  219.             font-weight: 400;
  220.             font-size: 1.2rem;
  221.             letter-spacing: 1px;
  222.             color: #3B566E;
  223.             text-decoration: none !important;
  224.             -webkit-transition: all 0.3s ease 0s;
  225.             -moz-transition: all 0.3s ease 0s;
  226.             -o-transition: all 0.3s ease 0s;
  227.             transition: all 0.3s ease 0s;
  228.             cursor: pointer;
  229.             padding-top: 20px;
  230.             padding-bottom: 20px;
  231.             display: flex;
  232.             align-content: center;
  233.             align-items: center;
  234.         }
  235.         .faq .card .card-header .faq-title .badge {
  236.             display: inline-block;
  237.             width: 20px;
  238.             height: 20px;
  239.             line-height: 14px;
  240.             float: left;
  241.             -webkit-border-radius: 100px;
  242.             -moz-border-radius: 100px;
  243.             border-radius: 100px;
  244.             text-align: center;
  245.             background: #337ab7;
  246.             color: #fff;
  247.             font-size: 12px;
  248.             margin-right: 20px;
  249.         }
  250.         .faq .card .card-body {
  251.             padding: 2rem;
  252.             font-weight: 400;
  253.             font-size: 16px;
  254.             color: #6F8BA4;
  255.             line-height: 28px;
  256.             letter-spacing: 1px;
  257.             border-top: 1px solid #F3F8FF;
  258.             text-align: left;
  259.         }
  260.         .faq .card .card-body p {
  261.             margin-bottom: 14px;
  262.         }
  263.         @media (max-width: 991px) {
  264.             .faq {
  265.                 margin-bottom: 30px;
  266.             }
  267.             .faq .card .card-header .faq-title {
  268.                 line-height: 26px;
  269.                 margin-top: 10px;
  270.             }
  271.         }
  272.         .wrap-infos .title.tarif {
  273.             font-size: 1.6rem;
  274.             font-weight: 300;
  275.         }
  276.         .table{
  277.             border-collapse: separate;
  278.             border-spacing: 0 0.5em;
  279.         }
  280.         .descr{    
  281.             text-align: justify;
  282.         }
  283.         .caract ul {
  284.     list-style-type: none;
  285.     padding: 0 !important;
  286. }
  287.         .caract ul li{
  288.             text-align: left;
  289.         }
  290. /*
  291.         .details-wrapper strong.title {
  292.             padding: 0 11rem;
  293.             text-align: center;
  294.             display: block;
  295.             font-size: 1rem;
  296.             font-weight: 400;
  297.             font-style: italic;
  298.         }
  299.         .details-wrapper #calendar {
  300.             padding: 0 11rem;
  301.             margin-top: 2rem;
  302.         }
  303.         .details-wrapper #calendar .table-header {
  304.             display: flex;
  305.             align-items: center;
  306.             justify-content: space-between;
  307.             width: 100%;
  308.         }
  309.         .details-wrapper #calendar #left-arrow, .details-wrapper #calendar #right-arrow {
  310.             display: flex;
  311.             align-items: center;
  312.         }
  313.         .details-wrapper #calendar #left-arrow:hover,.details-wrapper #calendar #right-arrow:hover{
  314.             font-weight: 800;
  315.             cursor: pointer;
  316.         }
  317.         .details-wrapper #calendar #month-year {
  318.             text-transform: uppercase;
  319.             font-style: italic;
  320.             font-weight: 400;
  321.         }
  322.         
  323.         .details-wrapper #calendar .iconify.arrow {
  324.             font-size: 2.5rem;
  325.         }
  326.         .details-wrapper #calendar .table>thead>tr>th,
  327.         .details-wrapper #calendar .table>thead>tr>td,
  328.         .details-wrapper #calendar .table>tbody>tr>th,
  329.         .details-wrapper #calendar .table>tbody>tr>td{
  330.             border:none; 
  331.             text-align: center;
  332.             margin-top: 1rem;
  333.         }
  334.         
  335.         .details-wrapper #calendar .table>tbody>tr>th.select-date.active.start,
  336.         .details-wrapper #calendar .table>tbody>tr>td.select-date.active.start{
  337.             border-top-left-radius: 2rem;
  338.             border-bottom-left-radius: 2rem;
  339.         }
  340.         .details-wrapper #calendar .table>tbody>tr>th.select-date.active.end,
  341.         .details-wrapper #calendar .table>tbody>tr>td.select-date.active.end{
  342.             border-top-right-radius: 2rem;
  343.             border-bottom-right-radius: 2rem;
  344.         }
  345.         .details-wrapper #calendar .table>tbody>tr>th.empty:hover,
  346.         .details-wrapper #calendar .table>tbody>tr>td.empty:hover{
  347.             cursor:not-allowed;
  348.             background:initial;
  349.             color:initial;
  350.         }
  351.         .details-wrapper #calendar .table>tbody>tr>th.active,
  352.         .details-wrapper #calendar .table>tbody>tr>td.active{
  353.             background: #000;
  354.             color: rgb(255, 255, 255);
  355.         }
  356.         .details-wrapper #calendar .table>tbody>tr>th:hover,
  357.         .details-wrapper #calendar .table>tbody>tr>td:hover{
  358.             background: #000;
  359.             color: rgb(255, 255, 255);
  360.             cursor: pointer;
  361.         }
  362.         .details-wrapper #calendar tr td{
  363.             font-size: 1rem;
  364.         }
  365.         .details-wrapper #calendar sup {
  366.             font-size: .8rem;
  367.             color: #c1c1c1;
  368.             font-style: italic;
  369.         }
  370.         .details-wrapper .range{
  371.             margin-top:2rem;
  372.             text-align:center;
  373.         }
  374.         .details-wrapper div.title{
  375.             margin-bottom:1rem;
  376.             text-align:center;
  377.         }
  378.         .details-wrapper .total{
  379.             text-align:center;
  380.             font-size:1.4rem;
  381.             font-weight:500;
  382.             position: relative;
  383.         }
  384.         .details-wrapper .total .prix{
  385.             font-weight:300;
  386.         }
  387.         .details-wrapper .nb_vehicules{
  388.             text-align:center;
  389.             margin:2rem 0;
  390.         }
  391.         .details-wrapper .box-cart > .title.location,
  392.         .details-wrapper .box-cart > .title.equipement,
  393.         .details-wrapper .box-cart > .title.covering {
  394.             display: flex;
  395.             align-items: center;
  396.             align-content: center;
  397.             justify-content: center;
  398.             position: relative;
  399.         }
  400.         .details-wrapper .box-cart > .title svg.iconify{
  401.             position: absolute;
  402.             left: 2rem;
  403.         }
  404.         .details-wrapper .box-cart > .title.location svg.iconify {
  405.             font-size: 5rem;
  406.             height: 100%;
  407.             top: -0.5rem;
  408.         }
  409.         .details-wrapper .box-cart > .title.equipement svg.iconify {
  410.             font-size: 2rem;
  411.             height: 100%;
  412.             top: 0;
  413.         }
  414.         .details-wrapper .box-cart > .title.covering svg.iconify {
  415.             font-size: 2rem;
  416.             height: 100%;
  417.             top: 0;
  418.         }
  419.         .details-wrapper .box-cart.open > .title svg.iconify{
  420.             color: #59b18c;
  421.         }*/
  422.         .modal_bloc {
  423.             height: 100%;
  424.             left: 0;
  425.             top: 0;
  426.         }
  427.         .modal_bloc img {
  428.             max-height: 550px;
  429.         }
  430. /*
  431.         .slick-next {
  432.             top: 49% !important;
  433.             right: 10px !important;
  434.             z-index: 1800;
  435.             background-image: url("{{asset('img/arrow.png')}}") !important;
  436.             background-size: contain !important;
  437.             background-repeat: no-repeat !important;
  438.             background-position: center !important;
  439.             transform: rotate(180deg) !important;
  440.         }
  441.         .slick-next::before {
  442.             content: '' !important;
  443.         }
  444.         .slick-prev {
  445.             left: 10px !important;
  446.             z-index: 1800;
  447.             background-image: url("{{asset('img/arrow.png')}}") !important;
  448.             background-size: contain !important;
  449.             background-repeat: no-repeat !important;
  450.             background-position: center !important;
  451.         }
  452.         .slick-prev::before {
  453.             content: '' !important;
  454.         }*/
  455.         .modal {
  456.             z-index: 1800;
  457.         }
  458.         .img-modal-content {
  459.             background: transparent;
  460.             padding: 0;
  461.             margin: 0;
  462.             box-shadow: none;
  463.             border: none;
  464.         }
  465.         .img-modal-body {
  466.             padding: 0;
  467.             width: 100%;
  468.         }
  469.         .close {
  470.             font-size: 4rem;
  471.             font-weight: 500;
  472.         }
  473.         .img-zoom:hover {
  474.             cursor: zoom-in;
  475.         }
  476.         .content label {
  477.             color: #556d89;
  478.             font-weight: normal;
  479.             font-style: normal;
  480.         }
  481.         .selelem {
  482.             width: 30px;
  483.             margin-left: 10px;
  484.             border: none;
  485.             background-color: #ffffff;
  486.             color: #556d89;
  487.             font-weight: 600;
  488.             font-style: normal;
  489.             -webkit-appearance: none;
  490.             -moz-appearance: none;
  491.             appearance: none;
  492.         }
  493.         .details-wrapper #calendar .table>thead>tr>th.disable, .details-wrapper #calendar .table>thead>tr>td.disable, .details-wrapper #calendar .table>tbody>tr>th.disable, .details-wrapper #calendar .table>tbody>tr>td.disable{
  494.             color:#e0e0e0;
  495.         }
  496.         .details-wrapper #calendar .table>tbody>tr>th.disable:hover, .details-wrapper #calendar .table>tbody>tr>td.disable:hover {
  497.             background: transparent;
  498.             color:#e0e0e0;
  499.             cursor: not-allowed;
  500.         }
  501.         .pswp {
  502.             z-index: 9999;
  503.         }
  504.         #openPreview{
  505.             cursor:pointer;
  506.         }
  507.         @media screen and (max-width: 570px) {
  508.             .details-wrapper .box-cart > .content {
  509.                 padding: 1rem;
  510.             }
  511.             .details-wrapper strong.title {
  512.                 padding: 0 4rem;
  513.             }
  514.             .details-wrapper #calendar {
  515.                 padding: 0 4rem;
  516.             }
  517.         }
  518.         @media screen and (max-width: 470px) {
  519.             .details-wrapper #calendar {
  520.                 padding: 0 2rem;
  521.             }
  522.         }
  523.         @media screen and (max-width: 767px) {
  524.             .detailequip .prix {
  525.                 top: -4rem;
  526.             }
  527.         }
  528.         @media screen and (max-width: 396px) {
  529.             .detailequip .prix {
  530.                 top: -6rem;
  531.             }
  532.         }
  533.         
  534.         html,
  535.         body {
  536.         }
  537.         .material-icons {
  538.             font-size:inherit;
  539.         }
  540.     /*    header {
  541.             box-shadow: 1px 5px 19px 0 rgba(0, 0, 255, 0.2);
  542.             padding-bottom: 2rem;
  543.         }
  544.         header .logo-container {
  545.             text-align: center;
  546.             font-size: 37px;
  547.             font-weight: 900;
  548.             font-style: italic;
  549.             padding: 16px 10px 5px;
  550.             background: linear-gradient(to right, #e02608 100%, #545252 0%);
  551.             -webkit-background-clip: text;
  552.             -webkit-text-fill-color: transparent;
  553.         }
  554.         header .nav.list-item {
  555.             margin: auto;
  556.             display: flex;
  557.             align-items: center;
  558.             justify-content: space-around;
  559.             font-size: 18px;
  560.             max-width: 1100px;
  561.             color: #576f8a;
  562.             flex-wrap: wrap;
  563.         }
  564.         header .nav.list-item {
  565.             margin-top: 2rem;
  566.             padding: 0 2rem;
  567.         }*/
  568.         .nav.list-item .item-menu.active {
  569.             font-weight: 700
  570.         }
  571.         .item-menu .img-drap {
  572.             border-radius: 50%;
  573.             width: 23px;
  574.             height: 23px;
  575.         }
  576. #photocov{
  577.     display:none;
  578. }
  579. .minitexthover{
  580.     font-size: .8em;
  581. }
  582. .pagenextform{
  583.     position: inherit;
  584. }
  585. .blockpriceprx {
  586.     text-align: center;
  587.     color: #51c5a1;
  588.     font-size: 1.8rem;
  589.     margin-top: 0;
  590. }
  591. .caracdeon h5{
  592.     text-align: left;
  593.     cursor: pointer;
  594. }
  595. .caracdeon .caract{
  596.     overflow: hidden;
  597.     height : 0;
  598. }
  599. .caracdeon .caract ul{
  600.     margin: 5px 0 0;
  601. }
  602. .prxnbvehic{
  603.     line-height: 1rem;
  604. }
  605.     </style>
  606. {% endblock %}
  607.     
  608. {% block body_container %}  
  609. <div id="pages"></div>
  610.     <div   class="body-container container">
  611.         <div class="wrapper-list">
  612.             <div class="wrapper-item row">
  613.                 <div class="wrapper-gallery col-md-6">
  614.                     <div id="devisvalid" class="{{devisvalid}}"><h3>Votre devis a Ã©té transmis, après validation<br />Vous le recevrez directement dans votre boite email</h3></div>
  615.                     <div class="nav-top">
  616.                         <div></div>
  617.                         <img src="{{asset('img/icons/zoom-visionbox.png')}}" style="float: right;" id="openPreview">
  618.                     </div>
  619.                     <div class="preview-image">
  620.                     {% set idximages = 0 %}
  621.                         {% for img in Imagesjson %}
  622.                         <div class="blockimgslid">
  623.                         <img src="{{asset('uploads/images/optimise/'~img.Name)}}" data-index="{{idximages}}" alt="{{ img.Alt }}" class="img-responsive img-zoom">
  624.                         </div>
  625.                     {% set idximages = idximages + 1 %}
  626.                         {% endfor %}
  627.                     </div>
  628.                     <div style="display: flex; justify-content:space-around;">
  629.                         {% if 'Location' in vehicule.cat %}
  630.                         <div class="blockprice">
  631.                         <a href="{{ path('home') }}?location&filtre_nom={{ vehicule.getNom }}&catsel" id="showblock" class="btn action voir-detail">Location</a>
  632.                     {% set prxtbl = vehicule.PrixTable|json_decode %}
  633.                         <span class="prx">1 jour {{vehicule.prixLoc}} â‚¬<span class="prxttc"> HT</span></span>
  634.                         <span class="prx">7 jours {{prxtbl[7]}} â‚¬<span class="prxttc"> HT</span></span>
  635.                         <span class="prx">30 jours {{prxtbl[30]}} â‚¬<span class="prxttc"> HT</span></span>
  636.                         <span class="prx prxnbvehic"><span class="prxttc">{{VersionVehicules|length}} véhicule(s) en stock</span></span>
  637.                         
  638.                         </div>
  639.                         {% endif %}
  640.                         {% if 'Occasion' in vehicule.cat or 'Achat' in vehicule.cat %}
  641.                         {% set prxmin = 0 %}
  642.                         
  643.                         <div class="blockprice">
  644.                         <a href="{{ path('home') }}?achat&filtre_nom={{ vehicule.getNom }}&catsel" id="showblock2" class="btn action voir-detail" style="margin-top: 2rem;">Achat</a>
  645.                         {% if vehicule.prix > 0 %}
  646.                         {% set prxmin = vehicule.prix %}
  647.                         {% if 'Achat' in vehicule.cat %}
  648.                         <span class="prx">Neuf {{vehicule.prix}} â‚¬<span class="prxttc"> HT</span></span>
  649.                         {% endif %}
  650.                         {% endif %}
  651.                         
  652.                         {% if vehicule.prixoccas > 0 %}
  653.                         {% set prxmin = vehicule.prixoccas %}
  654.                         {% if 'Occasion' in vehicule.cat %}
  655.                         <span class="prx">Occasion {{vehicule.prixoccas}} â‚¬<span class="prxttc"> HT</span></span>
  656.                         <span class="prx prxnbvehic"><span class="prxttc">{{vehicule.NbOccasion}} véhicule(s) en stock</span></span>
  657.                         {% endif %} 
  658.                         {% endif %} 
  659.                         
  660.                         </div>
  661.                         {% endif %}
  662.                     </div> 
  663.                     <p class="blockpriceprx">Hors Ã©ventuelles remises</p>
  664.                     <div class="box-cart lienimg">
  665.                         <h4 class="title">Photos en situation</h4>
  666.                         <div class="listim content">
  667.                         {% set dexphot = 0 %}
  668.                             {% for Photos in vehicule.getPhotos|json_decode %}
  669.                             <div class="">
  670.                             <div class="image-wrapper">
  671.                             <img src="/uploads/images/optimise/{{Photos.Name}}" onclick="openPhotoSwipes({{dexphot}}, photocov)" alt="" class="" > 
  672.                             </div>
  673.                             </div>
  674.                             {% set dexphot = dexphot + 1 %}
  675.                             {% endfor %}
  676.                         </div>  
  677.                         <div id="photocov">
  678.                             {% for Photos in vehicule.getPhotos|json_decode %} 
  679.                             <img src="/uploads/images/optimise/{{Photos.Name}}" alt="" class="" >  
  680.                             {% endfor %}
  681.                         </div>  
  682.                     </div>
  683.                     <div class="box-cart">
  684.                         <h4 class="title">Dossier technique</h4>
  685.                         <div class="content"> 
  686.                             <ul>
  687.                                 {% for media in vehicule.getMedias|json_decode %}
  688.                                 <li>
  689.                                     <a href="{{asset('uploads/images/'~media.ImgFile)}}">{{ media.Name }}</a>
  690.                                 </li>
  691.                                 {% endfor %}
  692.                             </ul>
  693.                         </div>
  694.                     </div>
  695.                     <div class="box-cart">
  696.                         <h4 class="title">FAQ et conseils</h4>
  697.                         <div class="content faq" id="accordion"> 
  698.                             {% for faq in Faqs %}
  699.                             <div class="card">
  700.                                 <div class="card-header" id="faqHeading-{{ loop.index }}">
  701.                                     <div class="mb-0">
  702.                                         <h5 class="faq-title" data-toggle="collapse" data-target="#faqCollapse-{{ loop.index }}" data-aria-expanded="{% if loop.index == 1 %}true{% else %}false{% endif %}" data-aria-controls="faqCollapse-{{ loop.index }}">
  703.                                             <span class="badge">{{ loop.index }}</span>{{ faq.Titre | raw }}
  704.                                         </h5>
  705.                                     </div>
  706.                                 </div>
  707.                                 <div id="faqCollapse-{{ loop.index }}" class="collapse" aria-labelledby="faqHeading-{{ loop.index }}" data-parent="#accordion">
  708.                                     <div class="card-body">
  709.                                         {{ faq.Detail | raw }}
  710.                                     </div>
  711.                                 </div>
  712.                             </div>
  713.                             {% endfor %}
  714.                         </div>
  715.                     </div>
  716.                 </div>
  717.                 <div class="wrap-infos col-md-6">
  718.                     <h1 class="title-product">
  719.                         {{ vehicule.getNom }}
  720.                     </h1> 
  721.                     <div class="descr">
  722.                             {{ vehicule.getBlocText | raw }}
  723.                         </div> 
  724.                         {% for caractli in caractlistesArray %}
  725.                         {% if caractli.caractvehicule.getType == "Accordeon" %}
  726.                         {% set nameaccord = caractli.caractvehicule.getName %}
  727.                         {% set isused = false %}
  728.                                     {% for caractliste in caractlistesArray %}
  729.                                     {% if caractliste.caractvehicule.getType == nameaccord %}
  730.                                         {% set isused = true %}
  731.                                         {% endif %}
  732.                                     {% endfor %}
  733.                                     {% if isused == true %}
  734.                                     
  735.                           <div class="caracdeon">
  736.                               <h5 onclick="caracdeon(this)">{{caractli.caractvehicule.getName}}</h5>
  737.                               
  738.                             <div class="caract">
  739.                                 <ul>
  740.                                     {% for caractliste in caractlistesArray %}
  741.                                     {% if caractliste.caractvehicule.getType == nameaccord %}
  742.                                     
  743.                                         <li>
  744.                                             <b>{{ caractliste.caractvehicule.getName }} :</b> {{ caractliste.value }}
  745.                                         </li>
  746.                                         {% endif %}
  747.                                     {% endfor %}
  748.                                 </ul>
  749.                             </div> 
  750.                           </div>
  751.                           
  752.                                     {% endif %}
  753.                                     
  754. {% endif %}
  755.                         {% endfor %}
  756.                 
  757.                             <div class="caract">
  758.                                 <ul>
  759.                                     {% for caractliste in caractlistesArray %}
  760.                                     {% if caractliste.caractvehicule.getType == '' %}
  761.                                     
  762.                                         <li>
  763.                                             <b>{{ caractliste.caractvehicule.getName }} :</b> {{ caractliste.value }}
  764.                                         </li>
  765.                                         {% endif %}
  766.                                     {% endfor %}
  767.                                 </ul>
  768.                             </div> 
  769. <br />    
  770. <br />
  771.     <div class="shareblock">
  772.     <span>Partagez :</span>
  773.     {% set currentPath = absolute_url( path(app.request.attributes.get('_route'),
  774.                        app.request.attributes.get('_route_params')) )  %}
  775.     
  776. <!-- Facebook -->
  777.        <a target="_blank" title="Facebook" href="https://www.facebook.com/sharer.php?u={{currentPath}}" rel="nofollow" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=500,width=700');return false;"><img class="iconshare" src="{{asset('/img/logo-fb-black.svg')}}" alt="Facebook" /></a>
  778. <!-- //Facebook -->
  779. <!-- Twitter -->
  780.         <a target="_blank" title="Twitter" href="https://twitter.com/share?url={{currentPath}}" rel="nofollow" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=400,width=700');return false;"><img class="iconshare" src="{{asset('/img/logo-twitter-black.svg')}}" alt="Twitter" /></a>
  781. <!-- //Twitter -->
  782. <!-- Linkedin -->
  783.         <a target="_blank" title="Linkedin" href="https://www.linkedin.com/shareArticle?mini=true&amp;url={{currentPath}}" rel="nofollow" onclick="javascript:window.open(this.href, '','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=450,width=650');return false;"><img class="iconshare" src="{{asset('/img/linkedin-icon.svg')}}" alt="Linkedin" /></a>
  784. <!-- //Linkedin -->
  785.         <a target="_blank" title="Pinterest" href="http://pinterest.com/pin/create/button/?url={{currentPath}}&media=http%3A%2F%2Fwww.aliasdmc.com%2Fimages%2Fthumbnail.jpg" rel="nofollow" onclick="javascript:window.open(this.href, '','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=450,width=650');return false;"><img class="iconshare" src="{{asset('/img/pinterest-1.svg')}}" alt="Pinterest" /></a> 
  786. </div>
  787.                 </div>
  788.             </div>
  789.         </div>
  790.     </div>
  791.     <div class="details-wrapper">
  792.         
  793.         
  794.     <div id="findevis" style="text-align: center;width: 100% !important;margin-left: 0 !important;"></div>
  795.         <!-- style="background: #f7f8f9;padding-top: 9rem;" -->
  796.         <!-- <div>
  797.             <div class="nav-stape">
  798.                 <div class="content">
  799.                     <a href="javascript:void(0)" id="prev" class="prev btn-nav btn">Précédent</a>
  800.                     <span class="value" id="etapenb"> 
  801.                         Etape 1/4
  802.                     </span>
  803.                     <span class="value" id="prixTotal"> 
  804.                         HT : {{ vehicule.getPrixLoc|default(0) }} â‚¬  
  805.                     </span>
  806.                     <span class="value" id="prixTotalTTC">
  807.                     {% set prxttc = vehicule.getPrixLoc|default(0) + ((vehicule.getPrixLoc|default(0) * 20) / 100) %}
  808.                         TTC : {{ prxttc|number_format(2) }} â‚¬
  809.                     </span>
  810.                     <a href="javascript:void(0)" id="next" class="next btn-nav btn">Suivant</a>
  811.                 </div>
  812.             </div>
  813.         </div> -->
  814.         <input type="hidden" name="prixVehicule" id="prixVehicule" value="{{ vehicule.getPrixLoc|default(0) }}">
  815.         <input type="hidden" name="prixTable" id="prixTable" value="{{ vehicule.getPrixTable }}">
  816.         <input type="hidden" name="prixmoisplus" id="prixmoisplus" value="{{ vehicule.getPrixmoisplus|default(0) }}">
  817.         {% set carac = vehicule.Caractliste %}
  818.         <input type="hidden" name="caractliste" id="caractliste" value="{{ carac }}"> 
  819.     </div>
  820.     <!-- Root element of PhotoSwipe. Must have class pswp. -->
  821.     <div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
  822.         <!-- Background of PhotoSwipe. 
  823.             It's a separate element as animating opacity is faster than rgba(). -->
  824.         <div class="pswp__bg"></div>
  825.         <!-- Slides wrapper with overflow:hidden. -->
  826.         <div class="pswp__scroll-wrap">
  827.             <!-- Container that holds slides. 
  828.                 PhotoSwipe keeps only 3 of them in the DOM to save memory.
  829.                 Don't modify these 3 pswp__item elements, data is added later on. -->
  830.             <div class="pswp__container">
  831.                 <div class="pswp__item"></div>
  832.                 <div class="pswp__item"></div>
  833.                 <div class="pswp__item"></div>
  834.             </div>
  835.             <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
  836.             <div class="pswp__ui pswp__ui--hidden">
  837.                 <div class="pswp__top-bar">
  838.                     <!--  Controls are self-explanatory. Order can be changed. -->
  839.                     <div class="pswp__counter"></div>
  840.                     <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
  841.                     {# <button class="pswp__button pswp__button--share" title="Share"></button> #}
  842.                     <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
  843.                     <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
  844.                     <!-- Preloader demo https://codepen.io/dimsemenov/pen/yyBWoR -->
  845.                     <!-- element will get class pswp__preloader--active when preloader is running -->
  846.                     <div class="pswp__preloader">
  847.                         <div class="pswp__preloader__icn">
  848.                         <div class="pswp__preloader__cut">
  849.                             <div class="pswp__preloader__donut"></div>
  850.                         </div>
  851.                         </div>
  852.                     </div>
  853.                 </div>
  854.                 <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
  855.                     <div class="pswp__share-tooltip"></div> 
  856.                 </div>
  857.                 <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
  858.                 </button>
  859.                 <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
  860.                 </button>
  861.                 <div class="pswp__caption">
  862.                     <div class="pswp__caption__center"></div>
  863.                 </div>
  864.             </div>
  865.         </div>
  866.     </div> 
  867.     {% set firstimg = '' %}
  868.     {% set isfirstimg = 0 %}
  869.     {% for img in vehicule.getImg %} 
  870.         {% if isfirstimg == 0 %}
  871.         {% set firstimg = img.getImgFile %}    
  872.     {% set isfirstimg = 1 %}    
  873.         {% endif %}         
  874.                         {% endfor %}  
  875.     <input type="hidden" id="jsondata" value='[{"id":{{ vehicule.getId }},"nb":0,"name":"{{ vehicule.getNom }}","ImgFile":"{{ firstimg }}","datedeb":"","datefin":"","nbjours":0,"service":"Location","soustot":0,"equip":[],"cover":[],"origine":"{{ vehicule.origine }}"}]'>
  876.     <div class="modal fade" id="imagemodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  877.         <div class="modal-dialog modal-lg" data-dismiss="modal">
  878.             <div class="modal-content img-modal-content" >              
  879.             <div class="modal-body img-modal-body">
  880.                 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Fermer</span></button>
  881.                 <img src="" id="imagePreview" class="imagepreview" style="width: 100%;" >
  882.             </div>
  883.         </div>
  884.     </div>
  885.     <div id="titleproduct">{{vehicule.getNom}}</div>
  886.     <div id="localock">{{ LocationLockjson }}</div>
  887. {% endblock %}
  888. {% block javascripts %}
  889.     {{parent()}}
  890.     <script src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js"></script>
  891.     <script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/photoswipe.min.js"></script>
  892.     <script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/photoswipe-ui-default.min.js"></script>
  893.     <script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
  894.     <script type="text/javascript">
  895.     /*
  896.     <scr ipt type="text/javascript" src="https://momentjs.com/downloads/moment.min.js"></scr ipt>
  897.     <scr ipt type="text/javascript" src="https://momentjs.com/downloads/moment-with-locales.min.js"></scr ipt>*/
  898. function caracdeon(el){
  899.       if( $(el).parent().find('.caract').height() == 0 ){
  900.     $(el).parent().find('.caract').height('auto')
  901.     }else{
  902.     $(el).parent().find('.caract').height(0)
  903.     }
  904. }
  905.     function formatDate(date) {
  906.     //var d = new Date(date),
  907.     //ou si envoyé au format date: 
  908.         var d = date
  909.          
  910.          let month = '' + (d.getMonth() + 1)
  911.          let day = '' + d.getDate()
  912.          let year = d.getFullYear()
  913.     
  914.       if (month.length < 2) 
  915.           month = '0' + month;
  916.       if (day.length < 2) 
  917.           day = '0' + day;
  918.     
  919.       return [year, month, day].join('-');
  920.     }
  921.     /*
  922. let jsondata = $('#jsondata').val()
  923.     jsondata = JSON.parse(jsondata);
  924.     
  925.   
  926. let jsondatastring = JSON.stringify( jsondata )
  927. $('#jsondata').val(jsondatastring) 
  928. */
  929.     /* 'equip':[{'name':'','nbmax':'0','TypePrix':'','PrixTable':'[]','Prixmoisplus':null,'prix':'0','id':0,'texte':null,'img':[],'modal':{'display':'none'},'nbchoisi':0}] */
  930.     /*'cover':[{'name':'','nbmax':null,'TypePrix':'','PrixTable':'[]','Prixmoisplus':null,'prix':'0','id':0,'texte':null,'img':[],'modal':{'display':'none'},'nbchoisi':'0'}]*/
  931.     function openopt(trg){ 
  932.         if( $( '#'+ trg+ ' > .accordbot').height() == 0){
  933.             $( '#'+ trg+ ' > .accordbot').height('auto')
  934.             $( '#'+ trg+ ' > .accordbot').css('overflow',  'initial')
  935.             $( '#'+ trg+ ' > .accordtop > img').css('transform',  'rotate(0deg)')
  936.             
  937.         }else{
  938.             $( '#'+ trg+ ' > .accordbot').height(0)
  939.             $( '#'+ trg+ ' > .accordbot').css('overflow',  'hidden')
  940.             $( '#'+ trg+ ' > .accordtop img').css('transform',  'rotate(180deg)')
  941.         }
  942.         
  943.     }
  944.         
  945.         $(document).on('click','.box-cart .title',function(){
  946.             $(this).parent().toggleClass('open');
  947.             $(this).parent().find('.content').slideToggle();
  948.         });
  949.         var start_date = 0;
  950.         var end_date = 0;
  951.         var prixVehicule = parseFloat($('#prixVehicule').val()) || 0;
  952.         
  953.         $(document).ready(function(){
  954.             let queryString = window.location.search;  
  955.         if( queryString == '?location' ){
  956.             $('.body-container').hide()
  957.             $('.details-wrapper').show()
  958.             $('.nav-stape').show()
  959.         }
  960.             /*$('.img-zoom').on('click', function() {
  961.                 $('#imagePreview').attr('src', $(this).attr('src'));
  962.                 $('#imagemodal').modal('show');   
  963.             });*/
  964.             $(document).on('click','#openPreview',function(){ 
  965.                 $('.slick-slide.slick-current.slick-active').children().click();
  966.             })
  967.             
  968.             $("table tr td.disabled").click(function(event) {
  969.                 this.onclick = null;
  970.                 event.preventDefault();
  971.                 event.returnValue = false;
  972.                 return false;
  973.             });
  974.             /*$('.preview-image').slick({
  975.                 dots: true,
  976.                 infinite: true,
  977.                 speed: 500,
  978.                 fade: true,
  979.                 cssEase: 'linear'
  980.             });*/
  981.             SlickZoom({selector:'.preview-image',item:'.img-zoom'});
  982.             $(document).on("click",".minus",function(){
  983.                 $val = parseInt($(this).next().val()) || 0;
  984.                 nbmax = parseInt($(this).parents('.detailequip').data('nbmax'));
  985.                 nbmax = nbmax - parseInt($(this).parents('.detailequip').find('.nbsel').val());
  986.                 if($val<1){
  987.                     $val = 0;
  988.                 }
  989.                 else{
  990.                     $val--;
  991.                 }
  992.                 let Maxpv = parseInt($(this).parents('.detailequip').data('maxpv')); 
  993.                 let nbve = Maxpv * parseInt($(this).parents('.detailequip').find('.nbvehicsel').val());
  994.  
  995.             if($('#nbJours').val() == 0){
  996.                 $val = 0;
  997.                 toastr.error("Attention ! Vous devez d'abord sélectionner vos dates ou une durée de location");
  998.             }else if ($val>nbve) {
  999.                 $(this).val(nbve);
  1000.                 $val = nbve;
  1001.                 //nb max : nbve
  1002.                 toastr.error("Attention ! Vous avez déjà atteint le nombre maximum pour ce type d'option");
  1003.             }else if ($val>nbmax) {
  1004.                     $(this).next().val(nbmax);
  1005.                     $val = nbmax;
  1006.                     toastr.error("Attention ! Vous avez déjà atteint le nombre maximum pour ce type d'option");
  1007.                 } else {
  1008.                     $(this).next().val($val);
  1009.                 }
  1010.                 
  1011.                 if($val==0){
  1012.                     $(this).parents('.detailequip').find('.prix').addClass('opaclair');
  1013.                 }
  1014.                 else{
  1015.                     $(this).parents('.detailequip').find('.prix').removeClass('opaclair');
  1016.                 }
  1017.             });
  1018.             $(document).on("click",".plus",function(){
  1019.                 $val = parseInt($(this).prev().val()) || 0; 
  1020.                 Maxpv = parseInt($(this).parents('.detailequip').data('maxpv')); 
  1021.                 nbmax = parseInt($(this).parents('.detailequip').data('nbmax'));
  1022.                 nbmax = nbmax -  parseInt($(this).parents('.detailequip').find('.nbsel').val());
  1023.                 
  1024.                 $val++;
  1025.                 if($val<1){
  1026.                     $val = 0;
  1027.                 }
  1028.                 let nbve 
  1029.                 if( Maxpv > 0){
  1030.                  nbve = Maxpv * parseInt($(this).parents('.detailequip').find('.nbvehicsel').val());
  1031.                 }else{
  1032.                  nbve = parseInt($(this).parents('.detailequip').find('.nbvehicsel').val());
  1033.                 }
  1034.                 
  1035.  
  1036.             if($('#nbJours').val() == 0){
  1037.                  
  1038.                 $val = 0;
  1039.                 toastr.error("Attention ! Vous devez d'abord sélectionner vos dates ou une durée de location");
  1040.             }else if ($val>nbve) {
  1041.                 $(this).val(nbve);
  1042.                 $val = nbve;
  1043.                 toastr.error("Attention ! Vous avez déjà atteint le nombre maximum pour ce type d'option");
  1044.             }else if ($val>nbmax) {
  1045.                     $(this).prev().val(nbmax);
  1046.                     $val = nbmax;
  1047.                     toastr.error("Attention ! Vous avez déjà atteint le nombre maximum pour ce type d'option");
  1048.                 } else {
  1049.                     $(this).prev().val($val);
  1050.                 }
  1051.                 if($val==0){
  1052.                     $(this).parents('.detailequip').find('.prix').addClass('opaclair');
  1053.                 }
  1054.                 else{
  1055.                     $(this).parents('.detailequip').find('.prix').removeClass('opaclair');
  1056.                 }
  1057.             });
  1058.             $(document).on('change','.chkbx',function(){
  1059.                 if($(this).is(':checked')){
  1060.                     $(this).parents('.detailequip').find('.prix').removeClass('opaclair');
  1061.                 }
  1062.                 else{
  1063.                     $(this).parents('.detailequip').find('.prix').addClass('opaclair');
  1064.                 }
  1065.             });
  1066. /*
  1067.             $(document).on('click','.select-date',function(){
  1068.                 var temp_date = new Date();
  1069.                 var temp_day = parseInt(temp_date.getDate());
  1070.                 var temp_month = parseInt(temp_date.getMonth());
  1071.                 var temp_year = parseInt(temp_date.getFullYear());
  1072.                 if(parseInt($(this).data('timestamp')) < (+new Date(temp_year, temp_month,temp_day))){
  1073.                     return false;
  1074.                 }
  1075.                 if(start_date==0){
  1076.                     start_date = $(this).attr('id');
  1077.                 }
  1078.                 else if(end_date==0){
  1079.                     end_date = $(this).attr('id');
  1080.                 }
  1081.                 else{
  1082.                     end_date = 0;
  1083.                     start_date = $(this).attr('id');
  1084.                 }
  1085.                 
  1086.                 if(end_date != 0 && $("#"+start_date).data('timestamp') > $("#"+end_date).data('timestamp') ){
  1087.                     let temp = start_date;
  1088.                     start_date = end_date;
  1089.                     end_date = temp;
  1090.                 }
  1091.                 $('.select-date').removeClass('active');
  1092.                 $('.select-date').removeClass('start');
  1093.                 $('.select-date').removeClass('end');
  1094.                 if(start_date!=0){
  1095.                     let day = $("#"+start_date).data('day');
  1096.                     if(day<10)
  1097.                         day = "0"+day;
  1098.                     let month = parseInt($("#"+start_date).data('month'))+1;
  1099.                     if(month<10)
  1100.                         month = "0"+month;
  1101.                     let year = $("#"+start_date).data('year');
  1102.                     $('#start_date').text(day+"/"+month+"/"+year);
  1103.                     $("#"+start_date).addClass('active');
  1104.                     $("#"+start_date).addClass('start');
  1105.                 }
  1106.                 else{
  1107.                     $('#start_date').text("--/--/---");
  1108.                 }
  1109.                 if(end_date!=0){
  1110.                     let day = $("#"+end_date).data('day');
  1111.                     if(day<10)
  1112.                         day = "0"+day;
  1113.                     let month = parseInt($("#"+end_date).data('month'))+1;
  1114.                     if(month<10)
  1115.                         month = "0"+month;
  1116.                     let year = $("#"+end_date).data('year');
  1117.                     $('#end_date').text(day+"/"+month+"/"+year);
  1118.                     $("#"+end_date).addClass('active');
  1119.                     $("#"+end_date).addClass('end');
  1120.                     $('#nbJours').val(datediff($('#start_date').text(), $('#end_date').text()));
  1121.                 }
  1122.                 else{
  1123.                     $('#nbJours').val(0);
  1124.                     $('#end_date').text("--/--/---");
  1125.                 }
  1126.                 
  1127. let jsondatas = $('#jsondata').val()
  1128.     jsondata = JSON.parse(jsondatas);
  1129.                 
  1130.                 if(start_date!=0 && end_date!=0){
  1131.                     start_date_day = parseInt($("#"+start_date).data('day'));
  1132.                     if(start_date_day<10)
  1133.                         start_date_day = "0"+start_date_day;
  1134.                     start_date_month = parseInt($("#"+start_date).data('month'))+1;
  1135.                     if(start_date_month<10)
  1136.                         start_date_month = "0"+start_date_month;
  1137.                     start_date_string = $("#"+start_date).data('year')+"-"+start_date_month+"-"+start_date_day;
  1138.                     end_date_day = parseInt($("#"+end_date).data('day'));
  1139.                     if(end_date_day<10)
  1140.                         end_date_day = "0"+end_date_day;
  1141.                     end_date_month = parseInt($("#"+end_date).data('month'))+1;
  1142.                     if(end_date_month<10)
  1143.                         end_date_month = "0"+end_date_month;
  1144.                     end_date_string = $("#"+end_date).data('year')+"-"+end_date_month+"-"+end_date_day;
  1145.                     start_date_string = $("#"+start_date).data('year')+"-"+start_date_month+"-"+start_date_day;
  1146.                     end_date_string = $("#"+end_date).data('year')+"-"+end_date_month+"-"+end_date_day;
  1147.                     dates = enumerateDaysBetweenDates(start_date_string,end_date_string);
  1148.                     for (let i = 0; i < dates.length; i++) {
  1149.                         $('#'+dates[i].getFullYear()+"-"+(dates[i].getMonth())+"-"+dates[i].getDate()).addClass('active');
  1150.                     }
  1151.                      
  1152.                 jsondata[0].datedeb = start_date_string
  1153.                 jsondata[0].datefin = end_date_string
  1154.                 jsondata[0].nbjours = datediff( $('#start_date').text(), $('#end_date').text() )
  1155.                 jsondata[0].soustot = $('#nb_vehicules').val() 
  1156.                 //add dimentions véhicule
  1157.                 jsondata[0].dimentions = $('#caractliste').val() 
  1158.                 }
  1159.                  
  1160.   
  1161. let jsondatastring = JSON.stringify( jsondata )
  1162.   $('#jsondata').val(jsondatastring) 
  1163.                 let id_vehicule = {{ vehicule.getId }} 
  1164.             let Nb_max = {{ vehicule.nbVehicules }} 
  1165.             let locationlock = $('#localock').text() 
  1166.             locationlock = JSON.parse(locationlock)
  1167.             for (let index = ( locationlock.length -1 ); index >= 0 ; index--) { 
  1168.                 const element = locationlock[index]; 
  1169.                 if( element.VehicId != id_vehicule ){ 
  1170.                     locationlock.splice(index, 1) 
  1171.                 }
  1172.             }  
  1173.         let disp_max = Nb_max
  1174.         dates = []
  1175.              
  1176.              if( typeof(start_date_string) !== 'undefined' && typeof(end_date_string) !== 'undefined' ){ 
  1177.                  dates = getDates(start_date_string,end_date_string);
  1178.              }
  1179.                     
  1180.                 dates.forEach(element => {
  1181.                     
  1182.                      let nb_dispo = Nb_max
  1183.                     
  1184.                     for (let index = 0; index < locationlock.length; index++) {  
  1185.                         let deb_date = new Date( locationlock[index].DateDeb.timestamp * 1000 )
  1186.                         let fin_date = new Date( locationlock[index].DateFin.timestamp * 1000 )
  1187.                         if( new Date( deb_date ) <= new Date(element) && new Date( fin_date ) >= new Date(element) ){ 
  1188.                             nb_dispo = nb_dispo - locationlock[index].Nbsel
  1189.                         }                         
  1190.                     } 
  1191.                     if( disp_max >= nb_dispo){
  1192.                         disp_max = nb_dispo
  1193.                     }
  1194.                     
  1195.                 });
  1196.             $('#nb_vehicules').empty();
  1197.             
  1198.             if( disp_max > 0){
  1199.                 for (let index = 1; index <= disp_max; index++) {
  1200.                  var option = document.createElement('option');
  1201.                     option.text = option.value = index;
  1202.                     document.getElementById("nb_vehicules").add(option, 0);
  1203.             } 
  1204.             } 
  1205.             
  1206.           
  1207.              
  1208.                 MiseAJourPrix();
  1209.             });*/
  1210.             function getDates(startDate, stopDate) {
  1211.     var dateArray = [];
  1212.     var currentDate = moment(startDate);
  1213.     var stopDate = moment(stopDate);
  1214.     while (currentDate <= stopDate) {
  1215.         dateArray.push( moment(currentDate).format('YYYY-MM-DD') )
  1216.         currentDate = moment(currentDate).add(1, 'days');
  1217.     }
  1218.     return dateArray;
  1219. }
  1220.             $(document).on('change','#nbJours', function() {
  1221.                 if(start_date!=0){
  1222.                     $('.select-date').removeClass('active');
  1223.                     $('.select-date').removeClass('start');
  1224.                     $('.select-date').removeClass('end');
  1225.                     start_date_day = parseInt($("#"+start_date).data('day'));
  1226.                     if(start_date_day<10)
  1227.                         start_date_day = "0"+start_date_day;
  1228.                     start_date_month = parseInt($("#"+start_date).data('month'))+1;
  1229.                     if(start_date_month<10)
  1230.                         start_date_month = "0"+start_date_month;
  1231.                     start_date_string = $("#"+start_date).data('year')+"-"+start_date_month+"-"+start_date_day;
  1232.                     $('#start_date').text(start_date_day+"/"+start_date_month+"/"+$("#"+start_date).data('year'));
  1233.                     $("#"+start_date).addClass('active');
  1234.                     $("#"+start_date).addClass('start'); 
  1235.                     nbJours = parseInt($('#nbJours').val())||0;
  1236.                     if(nbJours<0){
  1237.                         nbJours = 0;
  1238.                     }
  1239.                     if(nbJours>0){
  1240.                         nbJours--;
  1241.                     }
  1242.                     end_date = moment(start_date_string).add(nbJours,'days');
  1243.                     end_date_day = parseInt(end_date.format('D'));
  1244.                     end_date_month = (parseInt(end_date.format('M'))||0)-1;
  1245.                      end_date_year = end_date.format('YYYY')
  1246.                     end_date = end_date.format('YYYY')+'-'+end_date_month+'-'+end_date.format('D');
  1247.                      
  1248.                     end_date_day = end_date_day;
  1249.                     if(end_date_day<10)
  1250.                         end_date_day = "0"+end_date_day; 
  1251.                     if(end_date_month<10)
  1252.                         end_date_month = "0"+end_date_month;
  1253.                     end_date_string = end_date_year+"-"+(end_date_month +1 )+"-"+end_date_day;
  1254.                 /*    end_date_day = parseInt($("#"+end_date).data('day'));
  1255.                     if(end_date_day<10)
  1256.                         end_date_day = "0"+end_date_day;
  1257.                     end_date_month = parseInt($("#"+end_date).data('month'))+1;
  1258.                     if(end_date_month<10)
  1259.                         end_date_month = "0"+end_date_month;
  1260.                     end_date_string = $("#"+end_date).data('year')+"-"+end_date_month+"-"+end_date_day;*/
  1261.                     
  1262.                     $('#end_date').text(end_date_day+"/"+(end_date_month +1 )+"/"+end_date_year);
  1263.                     $("#"+end_date).addClass('active');
  1264.                     $("#"+end_date).addClass('end');
  1265.                     dates = enumerateDaysBetweenDates(start_date_string,end_date_string); 
  1266.                     for (let i = 0; i < dates.length; i++) {
  1267.                         $('#'+dates[i].getFullYear()+"-"+(dates[i].getMonth())+"-"+dates[i].getDate()).addClass('active');
  1268.                     }
  1269.                 }
  1270.                 else{
  1271.                     let jsondatas = $('#jsondata').val()
  1272.     jsondata = JSON.parse(jsondatas);
  1273.                   jsondata[0].datedeb = ''
  1274.                 jsondata[0].datefin = ''
  1275.                 jsondata[0].nbjours = $('#nbJours').val()  
  1276.   
  1277. let jsondatastring = JSON.stringify( jsondata )
  1278.   $('#jsondata').val(jsondatastring) 
  1279.                 //    console.log( $(this).val() );
  1280.                 }
  1281.  
  1282.                 MiseAJourPrix();
  1283.             });
  1284.         if($('.devisvalid').length > 0){
  1285.             setTimeout(() => {
  1286.                 $('#devisvalid').removeClass('devisvalid');
  1287.                 $('#devisvalid').addClass('devisvalid_hide'); 
  1288.                 document.cookie = "devis_page_{{ vehicule.getId }}=-1 ; path=/";
  1289.                 document.cookie = "validevis_page_{{ vehicule.getId }}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
  1290.             }, 5000);
  1291.         }
  1292.         });
  1293.         $('.voir-detail').click(function(){
  1294.             //    $('html, body').animate({scrollTop:($(".details-wrapper").offset().top)}, 800);
  1295.             $('.body-container').hide()
  1296.             $('.details-wrapper').show()
  1297.             $('.nav-stape').show()
  1298.             
  1299.         });
  1300.     /*    $('.prev').click(function(){
  1301.             //    $('html, body').animate({scrollTop:($(".details-wrapper").offset().top)}, 800);
  1302.             $('.body-container').show()
  1303.             $('.nav-stape').hide()
  1304.             $('.details-wrapper').hide()
  1305.         });*/
  1306.         function getAllEvents(element) {
  1307.             var result = [];
  1308.             for (var key in element) {
  1309.                 if (key.indexOf('on') === 0) {
  1310.                     result.push(key.slice(2));
  1311.                 }
  1312.             }
  1313.             return result.join(' ');
  1314.         }
  1315. /*
  1316.         var el = $('input').bind(getAllEvents($('input')[0]), function(e) {
  1317.             MiseAJourPrix();
  1318.         });
  1319.         var el = $('select').bind(getAllEvents($('select')[0]), function(e) {
  1320.             MiseAJourPrix();
  1321.         });
  1322.         var el = $('.minus').bind(getAllEvents($('.minus')[0]), function(e) {
  1323.             MiseAJourPrix();
  1324.         });
  1325.         var el = $('.plus').bind(getAllEvents($('.plus')[0]), function(e) {
  1326.             MiseAJourPrix();
  1327.         });
  1328.         var el = $('.select-date').bind(getAllEvents($('.select-date')[0]), function(e) {
  1329.             MiseAJourPrix();
  1330.         });
  1331.         var el = $('.nbequ').bind(getAllEvents($('.nbequ')[0]), function(e) {
  1332.             $val = parseInt($(this).val()) || 0;
  1333.             nbmax = parseInt($(this).parents('.detailequip').data('nbmax'));
  1334.                 nbmax = nbmax - parseInt($(this).parents('.detailequip').find('.nbsel').val());
  1335.  
  1336.                 let Maxpv = parseInt($(this).parents('.detailequip').data('maxpv')); 
  1337.             let nbve = Maxpv * parseInt($(this).parents('.detailequip').find('.nbvehicsel').val());
  1338.             if($val<0){
  1339.                 $val = 0;
  1340.                 $(this).val($val);
  1341.             }
  1342.             if( $('#nbJours').val() == 0){
  1343.                 $val = 0;
  1344.                 toastr.error("Attention ! Vous devez d'abord sélectionner vos dates ou une durée de location");
  1345.             }else if ($val>nbve) {
  1346.                 $(this).val(nbve);
  1347.                 $val = nbve;
  1348.                 toastr.error("Attention ! Vous avez déjà atteint le nombre maximum pour ce type d'option");
  1349.             }else if ($val>nbmax) {
  1350.                 $(this).val(nbmax);
  1351.                 $val = nbmax;
  1352.                 toastr.error("Attention ! Vous avez déjà atteint le nombre maximum pour ce type d'option");
  1353.             } else {
  1354.                 $(this).val($val);
  1355.             }
  1356.             if($val==0){
  1357.                 $(this).parents('.detailequip').find('.prix').addClass('opaclair');
  1358.             }
  1359.             else{
  1360.                 $(this).parents('.detailequip').find('.prix').removeClass('opaclair');
  1361.             }
  1362.             MiseAJourPrix();
  1363.         });*/
  1364.     /*    function MiseAJourPrix(){
  1365.             let nbvehicule = parseInt($('#nb_vehicules').val()) || 0;
  1366.         //    let nbjours = datediff($('#start_date').text(), $('#end_date').text())
  1367.             let nbjours = $('#nbJours').val()
  1368.             let prixObject = calculPrixTotal();
  1369.             try {
  1370.                 var PrixTable =  JSON.parse( $("#prixTable").val() )
  1371.             } catch (error) {
  1372.                 var PrixTable =  $("#prixTable").val()
  1373.             }
  1374.             let prixmoisplus = parseFloat($('#prixmoisplus').val()) || 0;
  1375.             let prixLocation = 0; 
  1376.             if(PrixTable !== null){
  1377.                 if( nbjours >= 31 ){
  1378.                     let nbrestant = nbjours - 30
  1379.                     let prixunitsupp = prixmoisplus
  1380.                     prixLocation = ( (parseInt( PrixTable[30] , 10)|| 0) + ( prixunitsupp * nbrestant ) ) * nbvehicule ; 
  1381.             
  1382.                 }
  1383.                 else{
  1384.                     prixLocation = (parseFloat(PrixTable[nbjours])||0)  * nbvehicule
  1385.                     
  1386.                 }
  1387.             }
  1388.                 
  1389. let jsondatas = $('#jsondata').val()
  1390.     jsondata = JSON.parse(jsondatas);
  1391.                  
  1392.                       
  1393.                  
  1394.                 jsondata[0].nbjours = $('#nbJours').val() 
  1395.                 //add dimentions véhicule
  1396.                 jsondata[0].dimentions = $('#caractliste').val() 
  1397.                 jsondata[0].soustot = prixLocation
  1398.                 jsondata[0].nb = parseInt($('#nb_vehicules').val()) || 0;
  1399.           
  1400.   
  1401. let jsondatastring = JSON.stringify( jsondata )
  1402.   $('#jsondata').val(jsondatastring) 
  1403.   let prxttc =  (prixObject.prix + prixLocation) + (((prixObject.prix + prixLocation) * 20) / 100) 
  1404.             $('#prixTotal').html('HT : '+(prixObject.prix + prixLocation)+' â‚¬');
  1405.             $('#prixTotalTTC').html('TTC : ' + prxttc.toFixed(2) +' â‚¬');
  1406.             $('#prixLocationttc').html( calcttc(prixLocation) + ' â‚¬ TTC');
  1407.             $('#prixLocation').html(prixLocation+' â‚¬ HT');
  1408.             $('#prixCovering').html(prixObject.prixCovering+' â‚¬ HT');
  1409.             $('#prixCoveringttc').html( calcttc(prixObject.prixCovering )+' â‚¬ TTC');
  1410.             $('#prixEquipement').html(prixObject.prixEquipement+' â‚¬ HT');
  1411.             $('#prixEquipementttc').html( calcttc(prixObject.prixEquipement )+' â‚¬ TTC');
  1412.         }
  1413.         function calculPrixTotal(){
  1414.             let nbvehicule = parseInt($('#nb_vehicules').val()) || 0;
  1415.             $('.nbvehicsel').val(nbvehicule)
  1416.             let nbjours = parseInt($('#nbJours').val())||0;
  1417.             let start_date = $('#start_date').text()
  1418.             start_date = start_date.split('/');
  1419.             start_date = start_date[2] +'-'+ start_date[1] +'-'+start_date[0]
  1420.             start_date = new Date(  start_date )
  1421.             let end_date = $('#end_date').text()
  1422.             end_date = end_date.split('/');
  1423.             end_date = end_date[2] +'-'+ end_date[1] +'-'+end_date[0]
  1424.             end_date = new Date(  end_date )
  1425.             prixObject = { prix:0, prix0:0, prixCovering:0, prixEquipement:0 }
  1426.             
  1427. let jsondata = $('#jsondata').val()
  1428.     jsondata = JSON.parse(jsondata);     
  1429.             for (var i = 0 ; i < $('.detailequip').length ; i++) {
  1430.                 value = $('.detailequip')[i];
  1431.                 
  1432.                 let prix = 0
  1433.                 let prix0 = 0
  1434.                 let prixmoisplus = parseFloat($(value).data('prixmoisplus')) || 0;
  1435.                 let prixmois = parseFloat($(value).data('prixmois')) || 0;
  1436.                 let prixUn;
  1437.                 let localock = JSON.parse( $('#localock').text())
  1438.                 let nbsel = 0
  1439.                 localock.forEach(element => {
  1440.                     if( element.vehictrue == false){
  1441.                         if(  element.OptionId == $(value).data('idoption')){
  1442.                             let DateDeb = new Date( element.DateDeb.timestamp * 1000 ) 
  1443.                             let DateFin = new Date( element.DateFin.timestamp * 1000 )
  1444.                             if( start_date <= DateFin && end_date >= DateDeb){ 
  1445.                             nbsel = nbsel + parseInt( element.Nbsel )
  1446.                             } 
  1447.                         
  1448.                         }
  1449.                     }
  1450.                     
  1451.                     
  1452.                 }); 
  1453.                 $(value).find('.nbsel').val(nbsel)
  1454.                 //$(value).attr( "data-nbsel", nbsel)
  1455.                                 
  1456.                 if ($(value).data('typeprix') == 'Variable') {
  1457.                     let nbchoisi = parseInt($(value).find('.nbequ').val()) || 0;
  1458.                     if(nbchoisi<0){
  1459.                         nbchoisi = 0;
  1460.                     }
  1461.                     
  1462.                     try {
  1463.                         var PrixTable =  JSON.parse( $(value).data('prixtable') )
  1464.                     } catch (error) {
  1465.                         var PrixTable =  $(value).data('prixtable')
  1466.                     }
  1467.                     if(PrixTable !== null){
  1468.                         if( nbjours >= 31 ){
  1469.                             let nbrestant = nbjours - 30
  1470.                             let prixunitsupp = prixmoisplus
  1471.                             prix = ( (parseInt( PrixTable[30] , 10)|| 0) + ( prixunitsupp * nbrestant ) ) * nbchoisi ; 
  1472.                             prix0 = ( (parseInt( PrixTable[30] , 10)|| 0) + ( prixunitsupp * nbrestant ) ) * nbchoisi ; 
  1473.                             prixUn = ( (parseInt( PrixTable[30] , 10)|| 0) + ( prixunitsupp * nbrestant ) );
  1474.                 
  1475.                         }
  1476.                         else{
  1477.                             prix = (parseFloat(PrixTable[nbjours])||0)  * nbchoisi
  1478.                             prix0 =  (parseFloat(PrixTable[nbjours])||0) * nbchoisi 
  1479.                             prixUn = (parseFloat(PrixTable[nbjours])||0) ;
  1480.                         }
  1481.                     }
  1482.                     if(nbchoisi>0){
  1483.                         $(value).find('.prix').html(prix+" â‚¬");
  1484.                     }
  1485.                     else{
  1486.                         $(value).find('.prix').html(prixUn+" â‚¬");
  1487.                     }
  1488.                 }
  1489.                 else if ($(value).data('typeprix') == 'Fixe par véhicule') {
  1490.                     
  1491.                     let nbchoisi = parseInt($(value).find('.nbequ').val()) || 0;
  1492.                     if(nbchoisi<0){
  1493.                         nbchoisi = 0;
  1494.                     }
  1495.                     let prixunit = parseFloat($(value).data('prix')) || 0;
  1496.                     prix = parseInt( nbchoisi, 10) *  prixunit  ;
  1497.                     prix0 = prixunit ;
  1498.                     if(nbchoisi>0){
  1499.                         $(value).find('.prix').html(prix+" â‚¬");
  1500.                     }
  1501.                     else{
  1502.                         $(value).find('.prix').html(prix0+" â‚¬");
  1503.                     }
  1504.                 }
  1505.                 else if ($(value).data('typeprix') == 'base + fixe par vehicule') {
  1506.                     
  1507.                     let nbchoisi = parseInt($(value).find('.nbequ').val()) || 0;
  1508.                     if(nbchoisi<0){
  1509.                         nbchoisi = 0;
  1510.                     }
  1511.                     let prixunit = parseFloat($(value).data('prix')) || 0;
  1512.                     let prxbase = parseFloat($(value).data('prixmoisplus')) || 0;
  1513.                     prix = parseInt( nbchoisi, 10) *  prixunit  ;
  1514.                     prix = prix + prxbase
  1515.                     prix0 = prixunit + prxbase;
  1516.                     if(nbchoisi>0){
  1517.                         $(value).find('.prix').html(prix+" â‚¬");
  1518.                     }
  1519.                     else{
  1520.                         $(value).find('.prix').html(prix0+" â‚¬");
  1521.                     }
  1522.                 }
  1523.                 else {
  1524.                     let nbchoisi = 0;
  1525.                     if($(value).find('.chkbx').is(':checked')){
  1526.                         nbchoisi = 1;
  1527.                     }
  1528.                     let prixunit = parseFloat($(value).data('prix')) || 0;
  1529.                     prix =  nbchoisi * prixunit  ;
  1530.                     prix0 =  prixunit  ;
  1531.                     if($(value).find('.chkbx').is(':checked')){
  1532.                         $(value).find('.prix').html(prix+" â‚¬");
  1533.                     }
  1534.                     else{
  1535.                         $(value).find('.prix').html(prix0+" â‚¬");
  1536.                     }
  1537.                 }
  1538.  
  1539.         
  1540.                 //type
  1541.                 //nbchois
  1542.                 prixObject.prix = prixObject.prix + prix
  1543.                 prixObject.prix0 = prixObject.prix0 + prix0
  1544.                 let nbch = 0
  1545.                 if($(value).find('.chkbx').is(':checked') ){
  1546.                     nbch = 1
  1547.                 }
  1548.                 if( parseInt($(value).find('.nbequ').val()) > 0){
  1549.                     nbch = parseInt($(value).find('.nbequ').val())
  1550.                 }
  1551.                 let detequ = {
  1552.                     name: $(value).data('name'),
  1553.                     nbmax:null,
  1554.                     TypePrix: $(value).data('typeprix'),
  1555.                     PrixTable:  $(value).data('prixtable'),
  1556.                     Prixmoisplus: parseFloat($(value).data('prixmois')),
  1557.                     prix: $(value).data('prix'),
  1558.                     id: $(value).data('idoption'),
  1559.                     texte:null,
  1560.                     img:[],
  1561.                     modal:{'display':'none'},
  1562.                     nbchoisi: nbch
  1563.                     }
  1564.                     
  1565.                 
  1566.                 if($(value).data('option')=="covering"){
  1567.                     prixObject.prixCovering = prixObject.prixCovering + prix
  1568.                     let coverex = -1
  1569.                         for (let index = 0; index < jsondata[0].cover.length; index++) {
  1570.                             if( jsondata[0].cover[index].id == $(value).data('idoption') ){
  1571.                                 jsondata[0].cover[index] = detequ
  1572.                                 coverex = index
  1573.                             } 
  1574.                         }
  1575.                     if(nbch > 0){
  1576.                         
  1577.                         if( coverex == -1 ){
  1578.                             jsondata[0].cover.push(detequ)
  1579.                         }else{
  1580.                             jsondata[0].cover[coverex] = detequ
  1581.                         }
  1582.                     }else{
  1583.                         if( coverex >= 0){
  1584.                         jsondata[0].cover.splice( coverex , 1)
  1585.                         }
  1586.                     } 
  1587.                 }
  1588.                 else{
  1589.                     prixObject.prixEquipement = prixObject.prixEquipement + prix
  1590.                     let equipex = -1
  1591.                         for (let index = 0; index < jsondata[0].equip.length; index++) {
  1592.                             if( jsondata[0].equip[index].id == $(value).data('idoption') ){
  1593.                                 jsondata[0].equip[index] = detequ
  1594.                                 equipex = index
  1595.                             } 
  1596.                         }
  1597.                     if(nbch > 0){
  1598.                         
  1599.                         if( equipex == -1 ){
  1600.                             jsondata[0].equip.push(detequ)
  1601.                         }else{
  1602.                             jsondata[0].equip[equipex] = detequ
  1603.                         }
  1604.                     }else{
  1605.                         if( equipex >= 0){
  1606.                         jsondata[0].equip.splice( equipex , 1)
  1607.                         }
  1608.                     }
  1609.                 }
  1610.                 
  1611.             }
  1612.  
  1613.             
  1614. let jsondatastring = JSON.stringify( jsondata )
  1615. $('#jsondata').val(jsondatastring) 
  1616.             return prixObject;
  1617.             
  1618.         }
  1619.         function datediff(first, second) {
  1620.             first = moment(first, "DD/MM/YYYY");
  1621.             second = moment(second, "DD/MM/YYYY");
  1622.             days = parseInt(second.diff(first, 'days')) || 0;
  1623.             return days+1;
  1624.         }
  1625.         function enumerateDaysBetweenDates(startDate, endDate) {
  1626.             var dates = [];
  1627.             var currDate = moment(startDate).startOf('day');
  1628.             var lastDate = moment(endDate).startOf('day');
  1629.             while(currDate.add(1, 'days').diff(lastDate) < 0) {
  1630.                 dates.push(currDate.clone().toDate());
  1631.             }
  1632.             return dates;
  1633.         }*/
  1634.             //        openPhotoSwipes(0, photocov);
  1635.             let photocov = $('#photocov').slick({
  1636.                     dots: true,
  1637.                     infinite: true,
  1638.                     speed: 500,
  1639.                     fade: true,
  1640.                     cssEase: 'linear'
  1641.                 }); 
  1642.         
  1643.         function parseThumbnailElementss(el) {
  1644.                     var data = [];
  1645.                     el.find(  'img:not(.slick-cloned)').each(function() {
  1646.                         
  1647.                         var img = this;
  1648.                         data.push({
  1649.                             el: img,
  1650.                             src: img.src,
  1651.                             msrc: img.src,
  1652.                             w: img.naturalWidth,
  1653.                             h: img.naturalHeight
  1654.                         });
  1655.                     });
  1656.                     return data;
  1657.                 };
  1658.         function openPhotoSwipes(index, $gallery) {
  1659.                     if (isNaN(parseInt(index, 10))) { return; }
  1660.  
  1661.                  slickInstance = $('#photocov')
  1662.                     var pswpElement = $('.pswp')[0];
  1663.                     var gallery;
  1664.                     var items = parseThumbnailElementss($gallery);
  1665.                     // define options (if needed)
  1666.                     var options = {
  1667.                         galleryUID: $gallery.attr('data-pswp-uid'),
  1668.                         getThumbBoundsFn: function(index) {
  1669.                             // See Options->getThumbBoundsFn section of docs for more info
  1670.                             var thumbnail = items[index].el,
  1671.                                 pageYScroll = window.pageYOffset || document.documentElement.scrollTop,
  1672.                                 rect = thumbnail.getBoundingClientRect();
  1673.                             return {
  1674.                                 x: rect.left,
  1675.                                 y: rect.top + pageYScroll,
  1676.                                 w: rect.width
  1677.                             };
  1678.                         }
  1679.                     };
  1680.                     options.index = parseInt(index, 10);
  1681.                     options.fullscreenEl = false;
  1682.                     // Pass data to PhotoSwipe and initialize it
  1683.                     gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options);
  1684.                     gallery.listen('beforeChange', function() {
  1685.                         var slideItem = $(gallery.currItem.el);
  1686.                         var currentIndex = slideItem.index() - (slideItem.siblings('.slick-slide.slick-cloned').length / 2);
  1687.                         if (slickInstance) {
  1688.                             slickInstance.slick('slickGoTo', currentIndex);
  1689.                         }
  1690.                     });
  1691.                     gallery.init();
  1692.                 };
  1693.         function SlickZoom(options) {
  1694.             options = options || {};
  1695.             if (!(options.selector && options.item)) {
  1696.                 return console.error('selector and item required');
  1697.             }
  1698.             $(options.selector).each(function(i) {
  1699.                 var container = $(this);
  1700.                 var items = container.find(options.item);
  1701.                 var slickInstance = null;
  1702.                 var slickOption = options.slickOption || {
  1703.                     dots: true,
  1704.                     infinite: true,
  1705.                     speed: 500,
  1706.                     fade: true,
  1707.                     cssEase: 'linear'
  1708.                 };
  1709.                 // init slick carousel if more than 2 items
  1710.                 if (items.length >= 2) {
  1711.                     slickInstance = container.slick(slickOption);
  1712.                 }
  1713.                 // init photoswipe
  1714.                 container
  1715.                 .attr('data-pswp-uid', i+1)
  1716.                 .on('click', options.item, function (e) {
  1717.                     e.preventDefault();
  1718.                     var slideItem = $(this); 
  1719.                     // var index = slideItem.index() - (slideItem.siblings('.slick-slide.slick-cloned').length / 2);
  1720.                     var index = slideItem[0].dataset.index
  1721.                     openPhotoSwipe(index, container);
  1722.                 });
  1723.                 function parseThumbnailElements(el) {
  1724.                     var data = [];
  1725.                     el.find(options.item + ':not(.slick-cloned)').each(function() {
  1726.                         var img = this;
  1727.                         data.push({
  1728.                             el: img,
  1729.                             src: img.src,
  1730.                             msrc: img.src,
  1731.                             w: img.naturalWidth,
  1732.                             h: img.naturalHeight
  1733.                         });
  1734.                     });
  1735.                     return data;
  1736.                 };
  1737.                 function openPhotoSwipe(index, $gallery) {
  1738.                     if (isNaN(parseInt(index, 10))) { return; }
  1739.                     var pswpElement = $('.pswp')[0];
  1740.                     var gallery;
  1741.                     var items = parseThumbnailElements($gallery);
  1742.                     // define options (if needed)
  1743.                     var options = {
  1744.                         galleryUID: $gallery.attr('data-pswp-uid'),
  1745.                         getThumbBoundsFn: function(index) {
  1746.                             // See Options->getThumbBoundsFn section of docs for more info
  1747.                             var thumbnail = items[index].el,
  1748.                                 pageYScroll = window.pageYOffset || document.documentElement.scrollTop,
  1749.                                 rect = thumbnail.getBoundingClientRect();
  1750.                             return {
  1751.                                 x: rect.left,
  1752.                                 y: rect.top + pageYScroll,
  1753.                                 w: rect.width
  1754.                             };
  1755.                         }
  1756.                     };
  1757.                     options.index = parseInt(index, 10);
  1758.                     options.fullscreenEl = false;
  1759.                     // Pass data to PhotoSwipe and initialize it
  1760.                     gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options);
  1761.                     gallery.listen('beforeChange', function() {
  1762.                         var slideItem = $(gallery.currItem.el);
  1763.                         var currentIndex = slideItem.index() - (slideItem.siblings('.slick-slide.slick-cloned').length / 2);
  1764.                         if (slickInstance) {
  1765.                             slickInstance.slick('slickGoTo', currentIndex);
  1766.                         }
  1767.                     });
  1768.                     gallery.init();
  1769.                 };
  1770.             });
  1771.         }
  1772. $('.koikes').hover(function() {
  1773.     
  1774.     const image = $( this ).parent().find( ".onover" )[0]
  1775. const config = {
  1776.   rootMargin: '0px 0px 0px 0px',
  1777.   threshold: [0, 0.25, 0.75, 1]
  1778. };
  1779. observer = new IntersectionObserver((entries) => {
  1780.   entries.forEach(entry => {
  1781.       console.log( entry.intersectionRatio )
  1782.     if (entry.intersectionRatio < 1) {
  1783.         let classlist = entry.target.classList
  1784.         if( classlist.contains('changehover') ){
  1785.        entry.target.classList.remove('changehover');
  1786.         }else{
  1787.        entry.target.classList.add('changehover');
  1788.         }
  1789.     } else {
  1790.         observer.unobserve(image);
  1791.     }
  1792.   });
  1793. }, config);
  1794.  
  1795.   observer.observe(image); 
  1796. });
  1797. function parseThumbnailinfoimg(el) {
  1798.                     var data = []; 
  1799.                         
  1800.                         var img = el;
  1801.                         data.push({
  1802.                             el: img,
  1803.                             src: img.src,
  1804.                             msrc: img.src,
  1805.                             w: img.naturalWidth,
  1806.                             h: img.naturalHeight
  1807.                         }); 
  1808.                     return data;
  1809.                 };
  1810. function openinfoimgSwipes(item) {
  1811.     console.log(item)
  1812.     var gallery;
  1813.                     var items = parseThumbnailinfoimg(item);
  1814.     var options = {
  1815.                         galleryUID: $(item).attr('data-pswp-uid'),
  1816.                         getThumbBoundsFn: function(index) {
  1817.                             // See Options->getThumbBoundsFn section of docs for more info
  1818.                             var thumbnail = item,
  1819.                                 pageYScroll = window.pageYOffset || document.documentElement.scrollTop,
  1820.                                 rect = thumbnail.getBoundingClientRect();
  1821.                             return {
  1822.                                 x: rect.left,
  1823.                                 y: rect.top + pageYScroll,
  1824.                                 w: rect.width
  1825.                             };
  1826.                         }
  1827.                     };
  1828.     options.fullscreenEl = false;
  1829.                     var pswpElement = $('.pswp')[0];
  1830. gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options);
  1831.     gallery.init()
  1832. }
  1833. $(document).ready(function () {
  1834. //    MiseAJourPrix();
  1835. });
  1836. function calcttc(prix){
  1837. let prxttc = prix + (( prix * 20) / 100) 
  1838.     return prxttc
  1839. }
  1840. $('.faq-title').on('click', function () {
  1841.     let trg = $(this).attr('data-target')
  1842.     if( $( trg ).hasClass( "collapse" ) ){
  1843.         $( trg ).removeClass('collapse') 
  1844.     }else{
  1845.         $( trg ).addClass('collapse') 
  1846.     }
  1847. })
  1848.     </script>
  1849.          {{ encore_entry_script_tags('app') }}
  1850.          {{ encore_entry_script_tags('formulaire') }}
  1851.          
  1852. {% endblock %}