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


  if( get_theme_mod('testimonials_areaOpacity',true) ) {
    $testimonials_areaOpacity = 'opacity:'.esc_attr(get_theme_mod('testimonials_areaOpacity')).';';
  }

  ?>
  <section id="testimonials-post-section" class="ht-section">
    <div class="shape"></div>

   <div class="lightbox">
    <div class="overlay"></div>
    <?php
    // echo "post id: ". 
    $lz_fitness_testimonials_page_id = get_theme_mod('lz_fitness_testimonials_page'); 
      // echo '<br>title '.   
    ?>
    <div class="treatment-main-box">
        <?php 
        $lz_fitness_testimonials_title = get_theme_mod('lz_fitness_testimonials_title', 'Client Testimonials');
        $lz_fitness_testimonials_text = get_theme_mod('lz_fitness_testimonials_text', 'consectetur adipiscing elit. Vivamus eu pharetra ex. Etiam eget diam ligula. Sed at blandit ante. Vivamus feugiat.');
        ?>
        <div class="row">
          <div class="ht-section-title-tagline">

            <h2 class="ht-section-title">
              <?php echo ($lz_fitness_testimonials_title);  ?>
            </h2>             
            <div class="testimonials-text">
              <?php echo ($lz_fitness_testimonials_text); ?>
            </div>
            
          </div>
        </div>

        <div class="clearfix"></div>
        
      </div>
    <div class="container"> 
      
      <div class="main-timeline">
        <div class="owl-carousel owl-theme">


        <!-- <div class="col-md-offset-3 testimonials-boxs">  -->
          <?php 
          $showStatic = true;
          $cols = get_theme_mod('lz_fitness_testimonials_npp_count', 2);
          $cols++;
          switch($cols){
            case 1:
            $colCls = 'col-md-12 col-sm-12 col-xs-12';
            break;
            case 2:
            case 3:
            case 4:
            case 5:
            case 6: 
            $colCls = 'col-md-12 col-sm-12 col-xs-12';
            break;
            default: 
            $colCls = 'col-md-12 col-sm-12 col-xs-12';
            break;
          }
          for( $i = 1; $i <= $cols; $i++ ){
            $url = get_theme_mod('lz_fitness_testimonials_page_url_'.$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($lz_fitness_testimonials_page_id){
              $showStatic = false;
              echo TestimonialShortCode($lz_fitness_testimonials_page_id, $isCustomizer=true, $i);
            }
          }
    // adding the static content
          if($showStatic === true){
            for( $i = 1; $i <= $cols; $i++ ){ ?>
              <div class="item"> 
              <div class="<?php echo $colCls;?> timeline">
              <div class="testimonialsbox">
                  <div class="test-icon">
                   <img src="<?php echo esc_url(get_template_directory_uri().'/images/teamsec1.jpg');?>" alt="testimonials" />
                  </div>

                <div class="timeline-content">                  
                 <div class="testimonial-box-content">
                  <h5 class="title">Elisha Smith</h5>
                  <div class="post">(Manager)</div>
                  <p class="description">
                    Lorem ipsum dolor sit amet, consectetur adipiscing is adisp elit. Vivamus eu pharetra ex. Etiam is eget diam ligula. Sed at blandit ante. Vivamus feugiat. 
                  </p>                  
                  
                </div>
              </div>

              </div>
              <div class="clearfix"></div>   
            </div>
            <div class="clearfix"></div> 
          </div><!--item -->
            <?php 
          }
        } ?>
         
        </div>
      </div>  
      
      </div>
    </div>
  </section>

 <script>
        $(document).ready(function() {
          $('.ht-section .owl-carousel').owlCarousel({
           slideSpeed : 1000,
            autoplay: true,
              loop: true,
              margin: 30,
              responsiveClass: true,
              responsive: {
                0: {
                  items: 1,
                  nav: true
                },
                600: {
                  items:1,
                  nav: true
                },
                1000: {
                  items:1,
                  nav: true,
                  loop: true,
                  margin: 0
              }
            }
          })
        })
      </script>
      <script>
    jQuery.noConflict();
    $(function(){
      function tsareasingleHeight(){
        var ht = 0;
        $('#testimonials-post-section .testimonialsbox').each(function(i){
          var tHt = $(this).height();
          if(ht<tHt){
            ht=tHt;
          }
        });
        $('#testimonials-post-section .testimonialsbox').height(ht+'px');
      }
      tsareasingleHeight();
    });
    $( window ).resize(function(){
      tsareasingleHeight();
    });
  </script>

<?php }

