<?php
/**
 *
 * @package Luzuk Premium
 */
if(get_theme_mod('lz_fitness_testimonials_section_disable') != 'on' ){ ?>
<section id="testimonials-section" class="ht-section lz-testimonials-section">
    
    <div class="overlay">
    <div class="container">
        <?php
        $lz_fitness_testimonials_title = get_theme_mod('lz_fitness_testimonials_title', 'Testimonials');
       
        ?>        

        <div class="testimonials-member-wrap">
            <!-- Carousel slider -->
            <div class="col-md-12 padding0" data-wow-delay="0.2s">
                <div class="carousel slide" data-ride="carousel" id="quote-carousel">
                     <div class="ht-section-title-tagline">
                        <h2 class="ht-section-title lz-testimonials-heading"><?php if(!empty($lz_fitness_testimonials_title)) { echo ($lz_fitness_testimonials_title);}?></h2>
                        <div class="dlab-separator-outer m-b0">
                            <div class="dlab-separator text-primary style-icon"><i class="fa fa-birthday-cake"></i></div>
                        </div>
                    </div>
                     <div class="clearfix"></div>
                    <div class="">
                     <a data-slide="prev" href="#quote-carousel" class="left carousel-control"><i class="fa fa-chevron-left"></i></a>
                     <a data-slide="next" href="#quote-carousel" class="right carousel-control"><i class="fa fa-chevron-right"></i></a>
                    </div>
                    <?php
                    $showStatic = true;
                    $testimonialTxt = '';
                    $counter = -1 ;
                    ?>
                    <!-- Bottom Carousel Indicators -->
                   <ol class="carousel-indicators">
                        <?php
                        $tCount = 0;
                        for( $i = 1; $i < 13; $i++ ){
                            $lz_fitness_testimonials_page_id = get_theme_mod('lz_fitness_testimonials_page'.$i); 
                            if(!empty($lz_fitness_testimonials_page_id)){
                                ++$tCount;
                            }
                        }

                        for( $i = 1; $i < 13; $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, false, $tCount);
                            }
                            $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])){
                            ?>
                            
                            <?php }
                            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-6 padding0">
                                             <div class="testimonial-contentbox">
                                                <div class="team-thumb padding0">
                                                    <img class="img-responsive" src="<?php echo get_template_directory_uri(); ?>/images/test.jpg" alt="">
                                                </div>
                                                <div class="col-md-12 col-sm-12 padding0 test-box">
                                                        <h3 class="secondry-text">Peter Wood</h3>
                                                        <div class="text-designation">Servant</div>                                   
                                                        <p>Embarrassing hidden in the middle of text all the Lorem Ipsum generators the Internet tend to repeat predefined chunks as necessary.</p>
                                                </div>
                                                <div class="clearfix"></div>
                                            </div>
                                        </div>
                                        <div class="col-md-6 padding0">
                                             <div class="testimonial-contentbox">
                                                <div class="team-thumb padding0">
                                                    <img class="img-responsive" src="<?php echo get_template_directory_uri(); ?>/images/test.jpg" alt="">
                                                </div>
                                                <div class="col-md-12 col-sm-12 padding0 test-box">
                                                        <h3 class="secondry-text">Peter Wood</h3>
                                                        <div class="text-designation">Servant</div>                                   
                                                        <p>Embarrassing hidden in the middle of text all the Lorem Ipsum generators the Internet tend to repeat predefined chunks as necessary.</p>
                                                </div>
                                                <div class="clearfix"></div>
                                            </div>
                                        </div>

                                    </div>
                                </div>
                                
                            <?php }
                        }
                        ?>
                    </div>
                   
                </div>
            </div>
            <div class="clearfix"></div>
            <!-- Carousel items -->
        </div>
        <div class="clearFix"></div>
    </div>
</div>
    <div class="clearfix"></div>
</section>
<script>
  jQuery.noConflict();
  $(function(){
    function testimonialcontentboxHeight(){
      var ht = 0;
      $('#testimonials-section .testimonial-contentbox').each(function(i){
        var tHt = $(this).height();
        if(ht<tHt){
          ht=tHt;
        }
      });
      $('#testimonials-section .testimonial-contentbox').height(ht+'px');
    }
    testimonialcontentboxHeight();
  });
  $( window ).resize(function(){
    testimonialcontentboxHeight();
  });
</script>
<?php }

