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

  <?php 
      if( get_theme_mod('testimonisection_toppadding',true) ) {
                $testimonisection_toppadding = 'padding-top:'.esc_attr(get_theme_mod('testimonisection_toppadding')).';';
            }
            if( get_theme_mod('testimonisection_bottompadding',true) ) {
                $testimonisection_bottompadding = 'padding-bottom:'.esc_attr(get_theme_mod('testimonisection_bottompadding')).';';
            }
            if( get_theme_mod('testimonisection_leftpadding',true) ) {
                $testimonisection_leftpadding = 'padding-left:'.esc_attr(get_theme_mod('testimonisection_leftpadding')).';';
            }
            if( get_theme_mod('testimonisection_rightpadding',true) ) {
                $testimonisection_rightpadding = 'padding-right:'.esc_attr(get_theme_mod('testimonisection_rightpadding')).';';
            }
  ?>
  
  <section id="testimonials-section" class="ht-section" style="<?php echo esc_attr($testimonisection_toppadding); ?>" "<?php echo esc_attr($testimonisection_bottompadding); ?>" "<?php echo esc_attr($testimonisection_leftpadding); ?>" "<?php echo esc_attr($testimonisection_rightpadding); ?>"> 
    <div class="overlay"></div>

   <div class="testimonialbox">
      <div class="testimoni-wrapper ">
        <!-- <div class="container"> -->
        <?php
            $luzuk_testimonials_title = get_theme_mod('luzuk_testimonials_title', 'USER TESTIMONIALS');        
        ?>
       
            <div class="row">
              <div class="ht-section-title-tagline">
                <?php if($luzuk_testimonials_title){ ?>
                   <div class="heading-icon-l">
                     <i class="fa fa-cog"></i>
                  </div> 
                  <div class="section-title lz-testimonials-heading ht-border">
                    <h2><?php echo ($luzuk_testimonials_title);  ?></h2>
                    <div class="title-icon">
                        <img src="<?php echo esc_html(get_template_directory_uri()); ?>/images/heading-tap.png" />
                    </div>
                  </div>
                  <div class="clearfix"></div>
                <?php }?>
              </div> 
            </div>


        <div class="testimonials-member-wrap">
          <!-- Carousel slider -->
          <div class="owl-carousel owl-theme">    
            <?php 
            $showStatic = true;
            $cols = get_theme_mod('luzuk_test_npp_count', 10);
            $cols++;
            switch($cols){
              case 1:
                $colCls = 'col-md-12 col-sm-12 col-xs-12';
                break;
              case 2:
                $colCls = 'col-md-6 col-sm-6 col-xs-12';
                break;
              case 3:
              case 5:
              case 6:
              case 7:
              case 8:
              case 9:
              case 10:
              case 11:
              case 12:
              case 13:
              case 14:
              case 15:
              case 16:

                $colCls = 'col-md-4 col-sm-6 col-xs-12';
                break;
              default:
                $colCls = 'col-md-3 col-sm-6 col-xs-12';
                break;
            }
            $icons = array(1=>'heart', 2=>'star', 3=>'flash', 4=>'bell',5=>'heart', 6=>'star', 7=>'flash', 8=>'bell'); 

            for( $i = 1; $i <= $cols; $i++ ){
              $luzuk_testimonials_page_id = get_theme_mod('luzuk_testimonials_page'.$i); 
              $luzuk_testimonials_page_icon = get_theme_mod('luzuk_testimonials_page_icon'.$i);
              if($luzuk_testimonials_page_id){
                $showStatic = false;
                echo testimonialShortCode($luzuk_testimonials_page_id, $isCustomizer=true, $i);
              }
            }
            // adding the static content
            if($showStatic === true){
              for( $i = 1; $i <= $cols; $i++ ){ ?>
              <div class="item"> 
                  <div class="row">
                      <div class="testimonial-content-box">    
                        <div class="team-thumb">
                          <img class="img-responsive" src="<?php echo get_template_directory_uri(); ?>/images/testimonials.jpg" alt="">
                        </div>                  
                        <div class="testimonial-content">                             
                          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae ante a nibh ornare tristique laoreet ac odio. Donec ac eleifend lacus. Etiam bibendum nec mi non consequat. </p>
                          <i class="fa fa-quote-left"></i> 
                          <div class="clearfix"></div>
                          <h6 class="secondry-text">Lalin Smith</h6>
                          <div class="text-designation">Position</div>
                        </div> 
                        <div class="clearfix"></div>
                      </div>
                  </div>
                </div>
              
              <?php 
              }
            } ?>
          </div>
            <!-- </div>   -->      
         </div>
        <div class="clearfix"></div>
      </div>
        
      <!-- </div> -->
    </div>
  </div>
    <div class="clearfix"></div>
</section>
<script>
    $(document).ready(function() {
      $('.owl-carousel').owlCarousel({
        loop: true,
        autoplay: true,
        margin: 30,
        responsiveClass: true,
        responsive: {
          0: {
            items: 1,
            nav: true
          },
          600: {
            items:2,
            nav: false
          },
          1000: {
            items:3,
            nav: true,
            loop: true,
            margin: 45
          }
        }
      })
    })
</script>

<script type="text/javascript">
    var title = 0;
    jQuery("#testimonials-section .testimonial-content-box").each(function(){
    if ($(this).height() > title) { title = $(this).height(); }
    });
    jQuery("#testimonials-section .testimonial-content-box").height(title);


    // on Resize change height

    jQuery(window).resize(function(){
    jQuery("#testimonials-section .testimonial-content-box").height("");
    var title = 0;
    jQuery("#testimonials-section .testimonial-content-box").each(function(){
      if ($(this).height() > title) { title = $(this).height(); }
    });
    jQuery("#testimonials-section .testimonial-content-box").height(title);
    });
</script> 

   <?php }

