<?php
/**
*
* @package LZ Fitness Premium
*/ 

if(get_theme_mod('lz_fitness_premium_fewwords_section_disable') != 'on' ){
	?>
	<section id="ht-fewwords-section" class="ht-section" >
		<div class="fewwords-box-content">
				<div class="row row-eq-height">
					<?php
					$lz_fitness_fewwords_page_id = get_theme_mod('lz_fitness_fewwords_page');
					$lz_fitness_fewwords_title = get_theme_mod('lz_fitness_fewwords_title', 'Few Words About');
					$lz_fitness_fewwords_subheading = get_theme_mod('lz_fitness_fewwords_subheading', 'About Petcare'); 
					$lz_fitness_fewwords_text = get_theme_mod('lz_fitness_fewwords_text', 'Lorem ipsum dolor sit amet consectetuer adipiscing elit sed diam nonummy nibh laoreet dolor magna aliquam erat volutpa  enad minim  ipsum dolor sit amet consectetuer adipiscing elit.');
					?>
					<div class="col-md-6 col-sm-12 col-xs-12 padding0 fewwords-box">
						<div class="col-md-offset-3 col-sm-offset-2 inside-full-height">

							<?php 
							if( get_theme_mod('sec_fewwordsTpadding',true) ) {
								$sec_fewwordsTpadding = 'padding-top:'.esc_attr(get_theme_mod('sec_fewwordsTpadding')).';';
							}
							if( get_theme_mod('sec_fewwordsBpadding',true) ) {
								$sec_fewwordsBpadding = 'padding-bottom:'.esc_attr(get_theme_mod('sec_fewwordsBpadding')).';';
							}
							if( get_theme_mod('sec_fewwordsLpadding',true) ) {
								$sec_fewwordsLpadding = 'padding-left:'.esc_attr(get_theme_mod('sec_fewwordsLpadding')).';';
							}
							if( get_theme_mod('sec_fewwordsRpadding',true) ) {
								$sec_fewwordsRpadding = 'padding-right:'.esc_attr(get_theme_mod('sec_fewwordsRpadding')).';';
							}
							?>			


							<div class="lightbox wow slideInLeft" style="<?php echo esc_attr($sec_fewwordsTpadding); ?>" "<?php echo esc_attr($sec_fewwordsBpadding); ?>" "<?php echo esc_attr($sec_fewwordsLpadding); ?>" "<?php echo esc_attr($sec_fewwordsRpadding); ?>"> 

								<div class="ht-section-title-tagline">
									<div class="lz-fitness-fewwords-subheading">
										<?php 
										if(!empty($lz_fitness_fewwords_subheading))	{
											echo ($lz_fitness_fewwords_subheading);
										} ?>
									</div>
									<div class="clearfix"></div>
									<h2 class="ht-section-title lz-fewwords-heading">
										<?php 
										if(!empty($lz_fitness_fewwords_title))	{
											echo ($lz_fitness_fewwords_title);
										} ?>
									</h2>
								</div>
								<div class="lz-fitness-fewwords-text">
									<?php 
									if(!empty($lz_fitness_fewwords_text))	{
										echo ($lz_fitness_fewwords_text);
									} ?>
								</div>
								<!-- for counter box -->
								<div class="fewwords-countbox">
									<div class="fewwordscounter-box">				
										<?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;
											}
										}
										?>

										<div class="fewwords-cbox">
											<div class="counter-post-wrap">
												<?php
												$cols = get_theme_mod('lz_fitness_counter_npp_count', 3);
												$cols++;
							// echo '$cold: '.$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-6 col-sm-6 col-xs-12';
													break;
													default: 
													$colCls = 'col-md-4 col-sm-4 col-xs-12';
													break;
												}
												$icons = array(1=>'heart', 2=>'star', 3=>'flash', 4=>'bell',5=>'heart', 6=>'star', 7=>'flash', 8=>'bell');
												?>
												<div class="row 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, 'Clients loved poopet services');
															$lz_fitness_counter_page_number = get_theme_mod('lz_fitness_counter_page_number_'.$i, '480');
															$lz_fitness_counter_page_id = get_theme_mod('lz_fitness_counter_page'.$i);

															?>

															<div class="<?php echo $colCls;?> padding17 details">
																<div class="counter-detailsbx fewwordsmainbx"  data-wow-duration="3s">
																	<div class="counter-detailsbx-number count">
																		<?php echo $lz_fitness_counter_page_number; ?>
																	</div>
																	<h5><?php echo $lz_fitness_counter_page_title; ?></h5>
																	<div class="clearfix"></div>
																</div>
															</div>

															<?php	
														}else{?>
															<div class="<?php echo $colCls;?> padding17 details">
																<div class="counter-detailsbx wow bounceInLeft animated fewwordsmainbx" data-wow-duration="3s">
																	<div class="counter-detailsbx-number count">
																		480
																	</div>
																	<h5>Clients loved poopet services</h5>
																	<div class="clearfix"></div>
																</div>
															</div>
														<?php }

													}?>
													<div class="clearfix"></div>
												</div>
											</div>
										</div>	
										<div class="clearfix"></div>
									</div>
								</div>
								<!-- for counter box -->
							</div>
						</div>
						<div class="clearfix"></div>
					</div>
					<div class="col-md-6 col-sm-12 col-xs-12 fewwords padding0 wow slideInRight animated">
						<div class="inside-full-height img-list">
							
							<?php 
							$lz_fitness_fewwords_image = get_theme_mod('lz_fitness_fewwords_image');
							if(!empty($lz_fitness_fewwords_image)){
								echo '<img alt="'. esc_html(get_the_title()) .'" src="'.esc_url($lz_fitness_fewwords_image).'" class="img-responsive" />';
							}else{
								echo '<img alt="About Us" src="'.get_template_directory_uri().'/images/pet.jpg" class="img-responsive aboutbox-img" />';
							}
							?>
						</div>
					</div>
				</div>
			<div class="clearfix"></div>
		</div>

	</section>
	<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>
	<script>
		jQuery.noConflict();
		$(function(){
			function fewwordsmainbxHeight(){
				var ht = 0;
				$('section#ht-fewwords-section .fewwordsmainbx').each(function(i){
					var tHt = $(this).height();
					if(ht<tHt){
						ht=tHt;
					}
				});
				$('section#ht-fewwords-section .fewwordsmainbx').height(ht+'px');
			}
			fewwordsmainbxHeight();
		});
		$( window ).resize(function(){
			fewwordsmainbxHeight();
		});
	</script>
<?php } 