<?php  
/**
 *
 * @package luzuk
 */
if(get_theme_mod('counter_area_disable') != 'on' ){?>
	<?php 
			if( get_theme_mod('countersectionTpadding',true) ) {
                $countersectionTpadding = 'padding-top:'.esc_attr(get_theme_mod('countersectionTpadding')).';';
            }
            if( get_theme_mod('countersectionBpadding',true) ) {
                $countersectionBpadding = 'padding-bottom:'.esc_attr(get_theme_mod('countersectionBpadding')).';';
            }
            if( get_theme_mod('countersectionLpadding',true) ) {
                $countersectionLpadding = 'padding-left:'.esc_attr(get_theme_mod('countersectionLpadding')).';';
            }
            if( get_theme_mod('featuredsection_rightpadding',true) ) {
                $featuredsection_rightpadding = 'padding-right:'.esc_attr(get_theme_mod('featuredsection_rightpadding')).';';
            }
		?>	

	<section id="counter-section" class="ht-section " style="<?php echo esc_attr($countersectionTpadding); ?>" "<?php echo esc_attr($countersectionBpadding); ?>" "<?php echo esc_attr($countersectionLpadding); ?>" "<?php echo esc_attr($featuredsection_rightpadding); ?>">
			<div class="counterhighlight"></div>
				<div class="boxnumbercount col-md-9 col-sm-12 padding0">	
					<div class="counterbox">			
					<?php
						$showStatic = true;
						for( $i = 1; $i < 4; $i++ ){
							$lz_fitness_counter_page_id = get_theme_mod('lz_fitness_counter_page_number'.$i); 
							if(!empty($lz_fitness_counter_page_id)){
								$showStatic = false;
								break;
							}
						}
					
					?>
						
					<?php 
						if( get_theme_mod('counterwrapperTpadding',true) ) {
			                $counterwrapperTpadding = 'padding-top:'.esc_attr(get_theme_mod('counterwrapperTpadding')).';';
			            }
			            if( get_theme_mod('counterwrapperBpadding',true) ) {
			                $counterwrapperBpadding = 'padding-bottom:'.esc_attr(get_theme_mod('counterwrapperBpadding')).';';
			            }
			            if( get_theme_mod('counterwrapperRpadding',true) ) {
			                $counterwrapperRpadding = 'padding-left:'.esc_attr(get_theme_mod('counterwrapperRpadding')).';';
			            }
			            if( get_theme_mod('counterwrapperLpadding',true) ) {
			                $counterwrapperLpadding = 'padding-right:'.esc_attr(get_theme_mod('counterwrapperLpadding')).';';
			            }
					?>	
					<div class="ourinfo-post-wrap">
						<div class="overlay"></div>
							<div class="row ourinfo-post-boxes" style="<?php echo esc_attr($counterwrapperTpadding); ?>" "<?php echo esc_attr($counterwrapperBpadding); ?>" "<?php echo esc_attr($counterwrapperLpadding); ?>" "<?php echo esc_attr($counterwrapperRpadding); ?>">
								<?php
								$cols = get_theme_mod('luzuk_counter_npp_count', 2);
								$cols++;
							// echo '$cold: '.$cols;
								switch($cols){
									case 1:
									$colCls = 'col-md-3 col-sm-3 col-xs-12';
									break;
									case 2:
									$colCls = 'col-md-3 col-sm-3 col-xs-12';
									break;
									case 3:
									case 5:
									case 6:
									$colCls = 'col-md-3 col-sm-3 col-xs-12';
									break;
									case 4:
									$colCls = 'col-md-3 col-sm-3 col-xs-12';
									break;

									default: 
									$colCls = 'col-md-3 col-sm-3 col-xs-12';
									break;
								}
								$icons = array(1=>'heart', 2=>'star', 3=>'flash', 4=>'bell',5=>'heart', 6=>'star', 7=>'flash', 8=>'bell');
								?>
								<div class="counter-post-boxes">
									<?php
									for( $i = 1; $i <= $cols; $i++ ){
										if($showStatic === true){
											$lz_fitness_counter_page_title = get_theme_mod('lz_fitness_counter_page_title_'.$i, 'Project Completed');
											$lz_fitness_counter_page_number = get_theme_mod('lz_fitness_counter_page_number_'.$i, '250+');
											$lz_fitness_counter_page_id = get_theme_mod('lz_fitness_counter_page'.$i);

											?>

											
												<div class="ourinfo-post text-center">
													<!-- <div class="module"> -->
													<div class="details">
														<h5 class="count"><?php echo $lz_fitness_counter_page_number; ?></h5>
														<h3><?php echo $lz_fitness_counter_page_title; ?></h3>
													</div>
													<div class="clearfix"></div>
													<!-- </div> -->
													<div class="clearfix"></div>
												</div>
											

											<?php	
										}else{?>
											
												<div class="ourinfo-post text-center">
													<div class="details ">
														<h5 class="count">250+</h5>
														<h3>Project Completed</h3>
													</div>
													
													<div class="clearfix"></div>
												</div>
											
										<?php }

									}?>
									<div class="clearfix"></div>
								</div>
							</div>
						</div>	
						<div class="clearfix"></div>
					</div>
					<div class="clearfix"></div>	
				</div>
			<div class="coun-img col-md-3 col-sm-12 padding0">
				<?php 
					$coun_image = get_theme_mod('coun_image');
					if(!empty($coun_image)){
						echo '<img alt="'. esc_html(get_the_title()) .'" src="'.esc_url($coun_image).'" class="img-responsive secondry-bg-img" />';
					}else{
						echo '<img alt="coun us" src="'.get_template_directory_uri().'/images/counter-img.jpg" class="img-responsive" />';
					}

				?>
			</div> 	
			<div class="clearfix"></div>	
	</section>
	<script type="text/javascript">
      var title = 0;
      jQuery("#counter-section .details").each(function(){
        if ($(this).height() > title) { title = $(this).height(); }
      });
      jQuery("#counter-section .details").height(title);


      // on Resize change height

      jQuery(window).resize(function(){
        jQuery("#counter-section .details").height("");
        var title = 0;
        jQuery("#counter-section .details").each(function(){
          if ($(this).height() > title) { title = $(this).height(); }
        });
        jQuery("#counter-section .details").height(title);
      });
  </script>
	
	<script>
	$(document).ready(function() {

  var counters = $(".count");
  var countersQuantity = counters.length;
  var counter = [];

  for (i = 0; i < countersQuantity; i++) {
    counter[i] = parseInt(counters[i].innerHTML);
  }

  var count = function(start, value, id) {
    var localStart = start;
    setInterval(function() {
      if (localStart < value) {
        localStart++;
        counters[id].innerHTML = localStart;
      }
    }, 40);
  }

  for (j = 0; j < countersQuantity; j++) {
    count(0, counter[j], j);
  }
});
</script>

<?php }