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

if(get_theme_mod('lz_fitness_premium_facility_section_disable') != 'on' ){
	?> 
	<section id="facility-content-section" class="ht-section"  style="<?php echo $style;?>"> 
		<div class="lightbox">
		<div class="facilitymain-content-box">
			<div class="wow fadeInUp" data-wow-duration="1s">
				<?php
				$showStatic = true;
				for( $i = 1; $i < 3; $i++ ){
					$url = get_theme_mod('lz_fitness_facility_page_url_'.$i, '#');
					$link = get_theme_mod('lz_fitness_facility_page_link'.$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', 'WE OFFERS'); 
				//extra//
                $countword=str_word_count($lz_fitness_facility_title);
        // echo ' hLF '.
                $halfWd = floor($countword / 2);
                $wds = explode(' ',$lz_fitness_facility_title);
                $lz_fitness_facility_title_new = '';
                foreach($wds as $k=>$wd){
                    if($k == $halfWd){
                        $lz_fitness_facility_title_new .= '<span>';
                    }
                    $lz_fitness_facility_title_new .= $wd.' ';
                    if(($k+1) == $countword){
                        $lz_fitness_facility_title_new .= '</span>';
                    }
                }
        // extra//
				$lz_fitness_facility_sub_title = get_theme_mod('lz_fitness_facility_sub_title', 'There are many variations passes Lorem Ipsum available but the majority have suffered alteation some form.');
				?>
				<div class="row">
						<div class="ht-section-title-tagline">
							<h2 class="ht-section-title lz-offer-heading">
								<?php 
							 if(!empty($lz_fitness_facility_title))	{
								 echo ($lz_fitness_facility_title);
							} ?>
							</h2> 
							<div class="clearfix"></div>
							<div class="col-md-6 col-md-offset-3 lz-offer-subheading">
								<?php 
							 if(!empty($lz_fitness_facility_sub_title))	{
								 echo ($lz_fitness_facility_sub_title);
							} ?>
							</div>
							<div class="clearfix"></div>
						</div>
						
						</div>
					<div class="clearfix"></div>
				</div>
				<div class="row">
						<div class="about-post-wrap">
							<?php
							$cols = get_theme_mod('lz_fitness_facility_npp_count', 7);
							$cols++;
							// echo '$cold: '.$cols;
							switch($cols){
								case 1:
								$colCls = 'col-md-12 col-sm-12 padding0';
								break;
								case 2:
								$colCls = 'col-md-6 col-sm-6 padding0';
								break;

								case 3:
								case 5:
								case 6:
								$colCls = 'col-md-4 col-sm-6 padding0';
								break;
								case 7:
								case 8:
								$colCls = 'col-md-3 col-sm-6 padding0';
								break;

								default: 
								$colCls = 'col-md-3 col-sm-6 padding0';
								break;
							}
							$icons = array(1=>'heart', 2=>'star', 3=>'flash', 4=>'bell',5=>'heart', 6=>'star', 7=>'flash', 8=>'bell');
							?>
							<div class="row about-post-boxes">
								<?php
								for( $i = 1; $i <= $cols; $i++ ){
									if($showStatic === false){
										$url = get_theme_mod('lz_fitness_about_page_url_'.$i, '#');
										
										$lz_fitness_facility_page_title = get_theme_mod('lz_fitness_facility_page_title_'.$i, 'Bachata');
										$lz_fitness_facility_page_description = get_theme_mod('lz_fitness_facility_page_description_'.$i, 'There are many vartins passes Lorem Ipsum available but the majority 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;?>">
														<div class="facility-post text-center">
															<div class="facility-icon">
																<a href="<?php echo esc_url(!empty($url)?$url:'#');?>">
																<img src="<?php echo esc_url($lz_fitness_facility_page_icon); ?>" class="img-responcive" />
															</a>
															</div>
															<div class="details">
															<h5><?php echo $lz_fitness_facility_page_title; ?></h5>
															<div class="facility-excerpt">
																<p>
														<?php echo $lz_fitness_facility_page_description; ?>
																</p>
															</div>
														</div>
															<?php
										$lz_fitness_facility_page_id = get_theme_mod('lz_fitness_facility_page');
										//$lz_fitness_facility_page_button_title = get_theme_mod('lz_fitness_facility_page_button_title_'.$i, 'Read More');
										?>
										<!-- <a href="<?php //echo esc_url(!empty($url)?$url:'#');?>"> -->
															<!-- <div class="facility-link"> -->
																<!-- <a href="<?php// echo esc_url(get_permalink()); ?>"><?php// _e( 'Read More', 'total' ); ?></a> -->
																<!-- <button> <?php //echo $lz_fitness_facility_page_button_title; ?></button> -->
															<!-- </div> -->
														<!-- </a> -->
															<div class="clearfix"></div>
														</div>
													</div>
													<?php
												
										}
									}else{?>
										<div class="<?php echo $colCls;?>">
											<div class="facility-post text-center">
												<div class="facility-icon">
													<a href="#">	
												<img src="<?php echo esc_html(get_template_directory_uri()); ?>/images/dance.png" class="img-responcive" />
											</a>
												</div>
												<div class="details">
													<h5>Bachata</h5>
													<div class="facility-excerpt">
														<p>There are many vartins passes Lorem Ipsum available but the majority suffered.</p>
													</div>	
													<!-- <a href="#">	 --> 										
													<!-- <div class="facility-link"> -->
														<!-- <a href="#"><? //php _e( 'Read More', 'lz-fitness' ); ?></a> -->
														<!-- <button>Read More</button> -->
													<!-- </div> -->
												<!-- </a> -->
											</div>
													<div class="clearfix"></div>												
											</div>
										</div>
									<?php }

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