<?php 
/**
 *
 * @package Luzuk
 */
if(get_theme_mod('testimonials_area_disable') != 'on' ){ ?> 


    <?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="testimonials-area" id="testimonials" 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
       $testimonials_title = get_theme_mod('testimonials_title', 'Our Happy Customers'); 
       $testimonials_sub_title = get_theme_mod('testimonials_sub_title', 'Testimonials');
        $testimonials_sub_text = get_theme_mod('testimonials_sub_text', 'The first draft is written and reviewed to create the first draft is written and reviewed');
       ?>
       <div class="col-md-5 ts-pd">
        <div class="ht-section-title-tagline">
          <h4 class="test-area-subttle inner-area-title wow fadeInLeft">
           <?php if(!empty($testimonials_sub_title)) { echo ($testimonials_sub_title);}?>
         </h4>
         <div class="clearfix"></div>
         <div class="section-title wow fadeInRight">
          <h2><?php if(!empty($testimonials_title)) { echo ($testimonials_title);}?></h2>
        </div>
        <div class="clearfix"></div>
        <div class="test-area-text section-area-text wow fadeInDown animated">
           <?php if(!empty($testimonials_sub_text)) { echo ($testimonials_sub_text);}?>
         </div>

      </div>
    </div>

    <div class="col-md-7">
    <div class="testimonials-single-area">
      <!-- Carousel slider -->
      <div class="carousel slide" data-ride="carousel" id="quote-carousel"> 
        <div class="clearfix"></div>
                   
                   <?php
                   $showStatic = true;
                   $testimonialTxt = '';
                   $counter = -1 ;
                   $testcount = 0;
                   ?>
                   <!-- Bottom Carousel Indicators -->
                   <ol class="carousel-indicators">
                    <?php
                    for( $i = 1; $i < 10; $i++ ){
                      $testimonials_page_id = get_theme_mod('testimonials_page'.$i); 
                      $testimonials_page_icon = get_theme_mod('testimonials_page_icon'.$i);
                      if(get_post_status($testimonials_page_id) != 'publish'){
                        continue;
                      }else{
                        ++$counter;
                      }
                      if($testimonials_page_id){
                        $showStatic = false;
                        $testimonialTxt .= testimonialShortCode($testimonials_page_id, $isCustomizer=false, $counter);
                      }
                      $lz_fitness_image = wp_get_attachment_image_src(get_post_meta( $testimonials_page_id, '_thumbnail_id', true ),'total-team-thumb');
                      if($showStatic == false && !empty($lz_fitness_image[0]) && ( $counter%1 == 0 ) ){
                        ?>
                        <li data-target="#quote-carousel" data-slide-to="<?php echo $testcount;?>" <?php if($i==1){?>class="active"<?php }?>></li>
                        <?php
                        $testcount ++; } 
               ?>
                  <?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="ts-shape-area">
                        <i class="fa fa-quote-left wow fadeInDown" aria-hidden="true"></i>
                      </div>
              <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 testimonials-match-height="groupName" class="ts-area-single text-center wow zoomIn col-md-12 col-sm-12 col-xs-12">
                         
                        <div class="ts-area-c section-area-text wow fadeInUp">   
                          <p>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle.</p> 
                          
                        </div> 
                        <div class="pd-0 ts-area-bx">
                          <h6 class="ts-area-title wow fadeInRight">John Smith</h6>
                        </div>
                        
                        <div class="clearfix"></div>
                      </div>
                       <div class="clearfix"></div>
                       <div class="ts-area-thumb wow zoomIn">
                          <img class="img-responsive" src="<?php echo get_template_directory_uri(); ?>/images/team1.jpg" alt="">
                        </div>

            </div>

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

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

             </div>

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



           </div>
       </div>
<!--  <script>
        jQuery.noConflict();
        $(function(){
          function tsareasingleHeight(){
            var ht = 0;
            $('.testimonials-area .ts-area-single').each(function(i){
              var tHt = $(this).height();
              if(ht<tHt){
                ht=tHt;
              }
            });
            $('.testimonials-area .ts-area-single').height(ht+'px');
          }
          tsareasingleHeight();
        });
        $( window ).resize(function(){
          tsareasingleHeight();
        });
      </script> 
 -->
      <script>
  var matchHeight = function () {
  
  function init() {
    eventListeners();
    matchHeight();
  }
  
  function eventListeners(){
    $(window).on('resize', function() {
      matchHeight();
    });
  }
  
  function matchHeight(){
    var groupName = $('[testimonials-match-height]');
    var groupHeights = [];
    
    groupName.css('min-height', 'auto');
    
    groupName.each(function() {
      groupHeights.push($(this).outerHeight());
    });
    
    var maxHeight = Math.max.apply(null, groupHeights);
    groupName.css('min-height', maxHeight);
  };
  
  return {
    init: init
  };
  
} ();

$(document).ready(function() {
  matchHeight.init();
});
</script>

   
    <?php }

