<?php 
/**
 *
 * @package theme-eye-Premium
 */
if(get_theme_mod('lz_fitness_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
       $lz_fitness_testimonials_title = get_theme_mod('lz_fitness_testimonials_title', 'What Clients Say About US'); 
       $lz_fitness_testimonials_sub_title = get_theme_mod('lz_fitness_testimonials_sub_title', 'Testimonials');
       ?>
       <div class="col-md-12">
        <div class="ht-section-title-tagline">
          <div class="test-subttl">
           <?php if(!empty($lz_fitness_testimonials_sub_title)) { echo ($lz_fitness_testimonials_sub_title);}?>
         </div>
         <div class="clearfix"></div>
         <h2 class="ht-section-title lz-testimonials-heading">
          <?php if(!empty($lz_fitness_testimonials_title)) { echo ($lz_fitness_testimonials_title);}?>
        </h2>
        <div class="clearfix"></div>
        

      </div>
    </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++ ){
                      $lz_fitness_testimonials_page_id = get_theme_mod('lz_fitness_testimonials_page'.$i); 
                      $lz_fitness_testimonials_page_icon = get_theme_mod('lz_fitness_testimonials_page_icon'.$i);
                      if(get_post_status($lz_fitness_testimonials_page_id) != 'publish'){
                        continue;
                      }else{
                        ++$counter;
                      }
                      if($lz_fitness_testimonials_page_id){
                        $showStatic = false;
                        $testimonialTxt .= testimonialShortCode($lz_fitness_testimonials_page_id, $isCustomizer=false, $counter);
                      }
                      $lz_fitness_image = wp_get_attachment_image_src(get_post_meta( $lz_fitness_testimonials_page_id, '_thumbnail_id', true ),'total-team-thumb');
                      if($showStatic == false && !empty($lz_fitness_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($lz_fitness_image[0]) && !empty($lz_fitness_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="col-md-4 col-sm-4 padding25 wow fadeInUp">
                       <div class="testimonial-content-box">
                         
                        <div class="col-md-12 col-sm-12 testimonial-content">   
                          <p>Nullam id dolor id nibih ultricie  vehicula uti elit Aenean eule quam Pelltesque is ornare ornare sem lacina quapam venenatis vestibulum.</p> 
                          
                        </div> 
                        <div class="col-md-3 col-sm-4 col-xs-3 team-thumb padding0">
                          <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-9 padding0 detailsbx">
                          <h6 class="secondry-text">Marian Dupre</h6>
                          <div class="designation-text">Patriots Company</div>
                        </div>
                        <div class="clearfix"></div>
                      </div>
                    </div>

                    <div class="col-md-4 col-sm-4 padding25 wow fadeInUp">
                     <div class="testimonial-content-box">
                       
                      <div class="col-md-12 col-sm-12 testimonial-content">   
                        <p>Nullam id dolor id nibih ultricie  vehicula uti elit Aenean eule quam Pelltesque is ornare ornare sem lacina quapam venenatis vestibulum.</p> 
                        
                      </div> 
                      <div class="col-md-3 col-sm-4 col-xs-3 team-thumb padding0">
                        <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-9 padding0 detailsbx">
                        <h6 class="secondry-text">Marian Dupre</h6>
                        <div class="designation-text">Patriots Company</div>
                      </div>
                      <div class="clearfix"></div>
                    </div>
                  </div>
                  <div class="col-md-4 col-sm-4 padding25 wow fadeInUp">
                   <div class="testimonial-content-box">
                     
                    <div class="col-md-12 col-sm-12 testimonial-content">   
                      <p>Nullam id dolor id nibih ultricie  vehicula uti elit Aenean eule quam Pelltesque is ornare ornare sem lacina quapam venenatis vestibulum.</p> 
                      
                    </div> 
                    <div class="col-md-3 col-sm-4 col-xs-3 team-thumb padding0">
                      <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-9 padding0 detailsbx">
                      <h6 class="secondry-text">Marian Dupre</h6>
                      <div class="designation-text">Patriots Company</div>
                    </div>
                    <div class="clearfix"></div>
                  </div>
                </div>

              </div>
            </div>

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

               </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 }

