<?php 
/**
 * 
 * @package luzuk
 */

if(get_theme_mod('testimonials_area_disable') != 'on' ){ ?> 
    <?php 
      if( get_theme_mod('testimonials_areaTpadding',true) ) {
        $testimonials_areaTpadding = 'padding-top:'.esc_attr(get_theme_mod('testimonials_areaTpadding')).';';
      }
      if( get_theme_mod('testimonials_areaBpadding',true) ) {
        $testimonials_areaBpadding = 'padding-bottom:'.esc_attr(get_theme_mod('testimonials_areaBpadding')).';';
      }

    ?>  
 
<div id="testimonials"class="testimonials-area " >
<!-- <div class="tes-olay"></div> -->
    <?php
        $testi_title1 = get_theme_mod('testititle1', 'CLIENT');
        $testi_title2 = get_theme_mod('testi_title2', 'Review');
    ?>
    <div class="container">
       
        <?php if($testi_title1 || $testi_title2 ){ ?> 
        <div class="section-title">
            <?php if($testi_title1 ){ ?> 
            <h2>
                <?php echo ($testi_title1); ?>
                <div class="t-brd"></div>
            </h2>   
            <?php }?>

            <?php if($testi_title2 ){ ?> 
            <h3><?php echo ($testi_title2); ?></h3>
            <?php }?>
        </div>
        <?php }?>
      
    </div>
    <div class="container">      
        <div class="row mr-0">
              <div class="tesbox">
                <div class="testimonials-single-area"> 
                    <div class="owl-carousel "> 
                      <?php  
                        $showStatic = true;
                        $cols = get_theme_mod('test_npp_count', 5);
                        $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:
                            $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++ ){
                          $testimonials_page_id = get_theme_mod('testimonials_page'.$i); 
                          $testimonials_page_icon = get_theme_mod('testimonials_page_icon'.$i);
                          if($testimonials_page_id){
                            $showStatic = false;
                            echo testimonialShortCode($testimonials_page_id, $isCustomizer=true, $i);
                        }
                      }

                        // adding the static content
                        if($showStatic === true){
                          for( $i = 1; $i <= $cols; $i++ ){ ?>
                        <div class="item items innertest-item ">        
                            <div class="ts-area-single ">
                                <div class="tsarea-inn">
                                    <div class="ts-area-thumb">
                                        <div class="testiimginn">
                                            <img class="img-responsive" src="<?php echo get_template_directory_uri(); ?>/images/testi.jpg" alt="">
                                        </div>
                                    </div>
                                    <div class="ts-area-content">
                                        <div class="ts-area-c">   
                                            <p>Vestibulum efficitur est quis condimentum eleifend. Morbi in libero gravida, lacinia mi accumsan, tincidunt massa. Curabitur convallis turpis quam.</p>
                                        </div>  
                                    
                                        <div class="ts-area-bx">
                                            <h3 class="ts-area-title">Jenny Wilsone</h3>
                                            <div class="text-designation">House Owner</div>
                                            <div class="clearfix"></div>
                                        </div>
                                        <div class="triangle_right"></div>
                                        <div class="clearfix"></div>
                                    </div>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                          <?php }

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

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


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

<script>
    $(document).ready(function() {
      $('.testimonials-area .owl-carousel').owlCarousel({
        refreshClass: 'owl-refresh',
        autoplayTimeout:5000,
        loop: true,
        margin: 30,
        autoHeight: true,
        autoWidth: false,
        autoplay: true,
        // animateOut: 'zoomIn',
        responsiveClass: true,
        responsive: {
          0: {
            items: 1,
            nav: true,
            margin: 10
          },
          600: {
            items:1,
            nav: true,
            margin: 10
          },

          760: {
            items:2,
            nav: true,
            margin: 30
          },

          1000: {
            items:2,
            nav: true,
            loop: true,
            margin: 100
          }
        }
      })
    })
</script> 

<?php } 
