<?php 

/**
 *
 * @package Luzuk
 */
if(get_theme_mod('luzuk_them_testimonials_section_disable') != 'on' ){ ?> 
  <section id="testimonials-section" class="ht-section lz-testimonials-section"> 

    <?php 
    if( get_theme_mod('sec_testimonialsectionTpadding',true) ) {
      $sec_testimonialsectionTpadding = 'padding-top:'.esc_attr(get_theme_mod('sec_testimonialsectionTpadding')).';';
    }
    if( get_theme_mod('sec_testimonialsectionBpadding',true) ) {
      $sec_testimonialsectionBpadding = 'padding-bottom:'.esc_attr(get_theme_mod('sec_testimonialsectionBpadding')).';';
    }
    if( get_theme_mod('sec_testimonialsectionLpadding',true) ) {
      $sec_testimonialsectionLpadding = 'padding-left:'.esc_attr(get_theme_mod('sec_testimonialsectionLpadding')).';';
    }
    if( get_theme_mod('sec_testimonialsectionRpadding',true) ) {
      $sec_testimonialsectionRpadding = 'padding-right:'.esc_attr(get_theme_mod('sec_testimonialsectionRpadding')).';';
    }
    ?>  

    <div class="lightbox" style="<?php echo esc_attr($sec_testimonialsectionTpadding); ?>" "<?php echo esc_attr($sec_testimonialsectionBpadding); ?>" "<?php echo esc_attr($sec_testimonialsectionLpadding); ?>" "<?php echo esc_attr($sec_testimonialsectionRpadding); ?>">
      <div class="container">
       <?php
       $luzuk_them_testimonials_title = get_theme_mod('luzuk_them_testimonials_title', 'Testimonials'); 
      
       ?>
       <div class="col-md-12">
        <?php if($luzuk_them_testimonials_title){ ?>
        <div class="ht-section-title-tagline">       
         
         <h2 class="ht-section-title lz-testimonials-heading">
          <?php if(!empty($luzuk_them_testimonials_title)) { echo ($luzuk_them_testimonials_title);}?>
        </h2>
        <div class="clearfix"></div>
        <div class="titlebor"></div>

      </div>
      <?php }?>
    </div>

    <div class="testimonials-member-wrap">
      <!-- Carousel slider -->
      <div class="carousel slide" data-ride="carousel" id="quote-carousel"> 
        <div class="clearfix"></div>
                    <!-- <div class="">
                     <a data-slide="prev" href="#quote-carousel" class="left carousel-control"><i class="fa fa-long-arrow-left" aria-hidden="true"></i></a>
                     <a data-slide="next" href="#quote-carousel" class="right carousel-control"><i class="fa fa-long-arrow-right" aria-hidden="true"></i></a>
                   </div> -->
                   <?php
                   $showStatic = true;
                   $testimonialTxt = '';
                   $counter = -1 ;
                   $testcount = 0;
                   ?>
                   <!-- Bottom Carousel Indicators -->
                   <ol class="carousel-indicators">
                    <?php
                    for( $i = 1; $i < 10; $i++ ){
                      $luzuk_them_testimonials_page_id = get_theme_mod('luzuk_them_testimonials_page'.$i); 
                      $luzuk_them_testimonials_page_icon = get_theme_mod('luzuk_them_testimonials_page_icon'.$i);
                      if(get_post_status($luzuk_them_testimonials_page_id) != 'publish'){
                        continue;
                      }else{
                        ++$counter;
                      }
                      if($luzuk_them_testimonials_page_id){
                        $showStatic = false;
                        $testimonialTxt .= testimonialShortCode($luzuk_them_testimonials_page_id, $isCustomizer=false, $counter);
                      }
                      $luzuk_them_image = wp_get_attachment_image_src(get_post_meta( $luzuk_them_testimonials_page_id, '_thumbnail_id', true ),'total-team-thumb');
                      if($showStatic == false && !empty($luzuk_them_image[0]) && ( $counter%3 == 0 ) ){
                        ?>
                        <li data-target="#quote-carousel" data-slide-to="<?php echo $testcount;?>" <?php if($i==1){?>class="active"<?php }?>></li>
                        <?php
                        $testcount ++; } 
                  // if(empty($luzuk_them_image[0]) && !empty($luzuk_them_testimonials_page_id)){//?>
                 <!-- <li data-target="#quote-carousel" data-slide-to="<?php// echo $counter;?>" <?php //if($i==0){//?>class="active"<?php//}?>><img class="img-responsive " src="<?php //echo get_template_directory_uri(); ?>/images/team-thumb.png" alt="">
                 </li> -->
                  <?php //}
                }

                if($showStatic === true){
                  for($i=0;$i<=2;$i++){?>
                    <li data-target="#quote-carousel" data-slide-to="<?php echo $i;?>" <?php if($i==0){?>class="active"<?php }?>><img class="img-responsive " src="<?php //echo get_template_directory_uri(); ?>/images/nothumb-related.png" alt="">
                    </li>
                  <?php }
                }
                ?>
              </ol>
              <!-- Carousel items -->
              <!-- Carousel Slides / Quotes -->
              <div class="carousel-inner">
                <?php 
                echo $testimonialTxt;
                if($showStatic == true){
                  for($i=0;$i<=2;$i++){?>
                    <div class="item <?php if($i==0){?>active<?php }?>"> 
                     <div class="row">

                 

                  <div class=" padding25">
                 <div class=" testimonial-content">   
                          <p>Nullam id dolor id nibih ultricie  vehicula uti elit Aenean eule quam Pelltesque is ornare ornare sem lacina quapam venenatis vestibulum. Nullam id dolor id nibih ultricie vehicula uti elit Aenean eule quam Pelltesque is ornare ornare sem lacina quapam venenatis vestibulum.</p> 
                          <div class="col-md-5 col-sm-5 col-md-offset-4 col-sm-offset-4 col-xs-12">
                          <div class="col-md-3 col-sm-4 team-thumb padding0 text-center">
                          <img class="img-responsive" src="<?php echo get_template_directory_uri(); ?>/images/testiminial.jpg" alt="">
                        </div>
                        <div class="col-md-9 col-sm-8 col-xs-12 padding0 detailsbx">
                          <h6 class="secondry-text">Marian Dupre</h6>
                          <div class="designation-text">Position</div>
                        </div>
                      </div>
                       <div class="clearfix"></div>
                      </div>
                </div>

              </div>
            </div>

          <?php }
        }
        ?>
        <a data-slide="prev" href="#quote-carousel" class="left carousel-control"><i class="fa fa-angle-left"></i></a>
                 <a data-slide="next" href="#quote-carousel" class="right carousel-control"><i class="fa fa-angle-right"></i></a>
      </div>
               

               </div>

               <div class="clearfix"></div>
               <!-- Carousel items -->

             </div>
             <div class="clearfix"></div>
           </div>

           <div class="clearfix"></div>
         </div>
       </section>
       <script>
        jQuery.noConflict();
        $(function(){
          function testimonialcontentHeight(){
            var ht = 0;
            $('section#testimonials-section .testimonial-content').each(function(i){
              var tHt = $(this).height();
              if(ht<tHt){
                ht=tHt;
              }
            });
            $('section#testimonials-section .testimonial-content').height(ht+'px');
          }
          testimonialcontentHeight();
        });
        $( window ).resize(function(){
          testimonialcontentHeight();
        });
      </script> 

       <script>
        jQuery.noConflict();
        $(function(){
          function detailsbxHeight(){
            var ht = 0;
            $('section#testimonials-section .detailsbx').each(function(i){
              var tHt = $(this).height();
              if(ht<tHt){
                ht=tHt;
              }
            });
            $('section#testimonials-section .detailsbx').height(ht+'px');
          }
          detailsbxHeight();
        });
        $( window ).resize(function(){
          detailsbxHeight();
        });
      </script> 
    <?php }

