<?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')).';';
    }
  ?>
  <div class="testimonials-area" id="testimonials">
      <div class="container">
    <?php
          $testimonial_page_maintitle = get_theme_mod('testimonial_page_maintitle', '<span>OUR</span> TESTIMONIALS');
      ?>
          <div class="row justify-content-center">
              <?php if($testimonial_page_maintitle){ ?> 
                <div class="section-title">
                  <h2><?php echo ($testimonial_page_maintitle);  ?></h2>
                </div>
              <?php }?>
          </div> 
          <div class="testimonials-single-area wow zoomIn">
              <div class="owl-carousel owl-theme">   
         
                <?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 ">
                  <div class="tetimonoal-area">  
                    <div class="ts-area-content">
                        <h3 class="ts-area-title">Angelina W. Davis</h3>
                        <div class="text-designation">Personnel associate</div>
                        <div class="clearfix"></div>
                        <div class="right-trg"></div>
                    </div>
                    
                    <div class="clearfix"></div>
                    <div class="ts-area-single ">
                      <!-- <div class="col-md-3 col-sm-3"> -->
                          <div class="ts-area-thumb">
                              <img class="img-responsive" src="<?php echo get_template_directory_uri(); ?>/images/testimonial.png" alt="">
                              <div class="ts-bg"></div>
                          </div>
                        <!-- </div> -->
                        <!-- <div class="col-md-9 col-sm-9 pd-0"> -->
                          <div class="ts-area-c">    
                                    <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.
                                    </p>   
                              </div> 
                        <!-- </div> -->
                        <div class="clearfix"></div>
                    </div>
                  </div>
                </div>
          
                <?php 
                }
              } ?>
              </div>
              <div class="clearfix"></div>
            </div>
            <div class="clearfix"></div>
        </div>
        <div class="clearfix"></div>
    </div>
    <script>
        $(document).ready(function() {
          $('.testimonials-area .owl-carousel').owlCarousel({
           slideSpeed : 1500,
            autoplay: false,
             animateOut: 'zoomIn',
              loop: true,
              margin: 30,
              responsiveClass: true,
              responsive: {
                0: {
                  items: 1,
                  nav: false,
                  dots: false
                },
                600: {
                  items:1,
                  nav: false,
                  dots: false
                },
                1000: {
                  items:2,
                  nav: false,
                  loop: false,
                  dots: false,
                  margin: 15
              }
            }
          })
        })
    </script>
    
          <script>
                jQuery.noConflict();
                $(function(){
                    function tsareacHeight(){
                        var ht = 0;
                        $('.testimonials-area .ts-area-c p').each(function(i){
                            var tHt = $(this).height();
                            if(ht<tHt){
                                ht=tHt;
                            }
                        });
                        $('.testimonials-area .ts-area-c p').height(ht+'px');
                    }
                    tsareacHeight();
                });
                $( window ).resize(function(){
                    tsareacHeight();
                });
            </script>
            
    <?php }

