<?php
/**
 *
 * @package LZ Premium
 */
if(get_theme_mod('lz_fitness_premium_facility_section_disable') != 'on' ){?>
 
	<section id="facility-content-section" class="ht-section">	
		<div class="container">
		
		<div class="facilitybox">
			<div class="facility-box">
				
					<?php
					$showStatic = true;
					for( $i = 1; $i < 4; $i++ ){
						$lz_fitness_facility_page_id = get_theme_mod('lz_fitness_facility_page_icon'.$i); 
						if(!empty($lz_fitness_facility_page_id)){
							$showStatic = false;
							break;
						}
					}
					$lz_fitness_facility_title = get_theme_mod('lz_fitness_facility_title', 'Our Features');
					?>
					<div class="row">
						<div class="ht-section-title-tagline">
							<h2 class="ht-section-title lz-facility-heading">
								<?php
								if(!empty($lz_fitness_facility_title))	{
									echo ($lz_fitness_facility_title);
								} ?>
							</h2>
							<div class="dlab-separator-outer m-b0">
								<div class="dlab-separator text-primary style-icon"><i class="fa fa-birthday-cake"></i></div>
							</div>
							<div class="clearfix"></div>
						</div>
						<div class="clearfix"></div>
					</div>
					<div class="clearfix"></div>
					<div class="row">
					<div class="facility-post-wrap">
							<?php
							$cols = get_theme_mod('lz_fitness_facility_npp_count', 2);
							$cols++;
					// echo '$cold: '.$cols;
							switch($cols){
								case 1:
								$colCls = 'col-md-12 col-sm-12';
								break;
								case 2:
								$colCls = 'col-md-6 col-sm-6';
								break;
								case 3:
								case 5:
								case 6:
								case 9:
								$colCls = 'col-md-4 col-sm-6';
								break;
								default: 
								$colCls = 'col-md-3 col-sm-6';
								break;
							}
							$icons = array(1=>'heart', 2=>'star', 3=>'flash', 4=>'bell',5=>'heart', 6=>'star', 7=>'flash', 8=>'bell');
							?>
							<div class="row facility-post-boxes">
								<?php
								for( $i = 1; $i <= $cols; $i++ ){
									if($showStatic === false){
										$lz_fitness_facility_page_title = get_theme_mod('lz_fitness_facility_page_title_'.$i, 'Creativity');
										$lz_fitness_facility_page_description = get_theme_mod('lz_fitness_facility_page_description_'.$i, 'There are many variations passages Lorem Ipsum available, but majority have suffered.');
										$lz_fitness_facility_page_id = get_theme_mod('lz_fitness_facility_page'.$i);
										$lz_fitness_facility_page_icon = get_theme_mod('lz_fitness_facility_page_icon'.$i);
										if($lz_fitness_facility_page_icon){

											?>

											<div class="<?php echo $colCls;?> facspace">
												<div class="facility-post wow zoomIn">
													<div class="facility-icon-box">
														<div class="facility-icon">
															<span class="<?php echo $lz_fitness_facility_page_icon; ?>"></span>
														</div>
													</div>
													<div class="content-box">
														<h5><?php echo $lz_fitness_facility_page_title; ?>
														</h5>
														<div class="facility-data"><?php echo $lz_fitness_facility_page_description; ?>
														</div>
													</div>
													<div class="clearfix"></div>
												</div>
											</div>
											
											<?php
										}	
									}else{?>
										<div class="<?php echo $colCls;?> facspace">
											<div class="facility-post wow zoomIn">
												<div class="facility-icon-box">
													<div class="facility-icon">
														<span class="fa fa-sign-language"></span>
													</div>
												</div>
												<div class="content-box">
													<h5>Creativity</h5>	
													<div class="facility-data">There are many variations passages Lorem Ipsum available, but majority have suffered.</div>
												</div>
												<div class="clearfix"></div>
											</div>
										</div>
									<?php }

								}?>
								<div class="clearfix"></div>
							</div>
						</div>
				</div>
				<div class="clearfix"></div>
			</div>
			<div class="clearfix"></div>
		</div>
		</div>
		<div class="clearfix"></div>
	</section>
	<script>
	jQuery.noConflict();
	$(function(){
		function facspaceHeight(){
			var ht = 0;
			$('#facility-content-section .content-box').each(function(i){
				var tHt = $(this).height();
				if(ht<tHt){
					ht=tHt;
				}
			});
			$('#facility-content-section .content-box').height(ht+'px');
		}
		facspaceHeight();
	});
	$( window ).resize(function(){
		facspaceHeight();
	});
</script>
<?php }