<?php
 if(get_theme_mod('facility_area_disable') != 'on' ){
?>
	<?php 
		if( get_theme_mod('facility_areaTpadding',true) ) {
			$facility_areaTpadding = 'padding-top:'.esc_attr(get_theme_mod('facility_areaTpadding')).';';
		}
		if( get_theme_mod('facility_areaBpadding',true) ) {
			$facility_areaBpadding = 'padding-bottom:'.esc_attr(get_theme_mod('facility_areaBpadding')).';';
		}
	?>			
	<div class="facility-area " id="facility">		  
		<?php			
			$facility_heading = get_theme_mod('facility_heading', 'Our Facility');
			$facsubtext = get_theme_mod('facsubtext', 'Generators On The Internet Tend To Repeat');

			$facbtn_text = get_theme_mod('facbtn_text', 'See All');
			$facbtnlink = get_theme_mod('facbtnlink', '#');
 		?>
 		<div class="container">
				<div class="row ">
						<div class="col-md-9 col-lg-9">
						<?php if($facility_heading || $facsubtext){ ?>	
						<div class="section-title">
								<h2><?php echo ($facility_heading);  ?></h2>
								<h1><?php echo ($facsubtext);  ?></h1>
						</div>
						<?php }?>
						</div>
						<div class="col-md-3 col-lg-3">
							<div class="fac-btn">
								<?php if($facbtn_text ){ ?>	
								<a href="<?php echo ($facbtnlink);  ?>">
										<?php echo ($facbtn_text);  ?>
										<div class="h-brd"></div>
										<div class="stars_an">
								    		<div class="starsinn"></div>
										</div>
								</a>
								<?php }?>
							</div>
						</div>
				</div> 
		</div>

		<div class="container">
				<div class="main-box">
					<?php
						$showStatic = true;
						for( $i = 1; $i < 11; $i++ ){
							$facilityus_page_id = get_theme_mod('facilityus_page_icon'.$i); 
							if(!empty($facilityus_page_id)){
								$showStatic = false;
								break;
							}
						}
					?>
				<div class="row mr-0">
						<div class="facilityus-post-wrap col-lg-6">
							
							<?php
								$cols = get_theme_mod('facilityus_npp_count', 1);
								$cols++;
								// echo '$cold: '.$cols;
								switch($cols){
									case 1:
									$colCls = 'col-md-12 col-sm-12';
									break;
									case 2:	
									$colCls = 'col-md-12 col-sm-12';
									
									case 3:
									case 4:
								
									case 5:
									case 6:

									case 9:
									case 11:
									case 13:
									case 15:
									$colCls = 'col-md-12 col-sm-12';
									break;
									default: 
									$colCls = 'col-md-12 col-sm-12';
									break;
								}
								$icons = array(1=>'heart', 2=>'star', 3=>'flash', 4=>'bell',5=>'heart', 6=>'star', 7=>'flash', 8=>'bell');
							?>
							<div class="facilityus-post-boxes">
								<!-- <div class="owl-carousel owl-theme">  -->
								<div class="row mr-0">
								<?php
									for( $i = 1; $i <= $cols; $i++ ){
										if($showStatic === false){
									$url = get_theme_mod('luzuk_facility_page_url_'.$i, '#');	
									$facilityus_page_title = get_theme_mod('facilityus_page_title'.$i, 'Text here');
									$facility_txt = get_theme_mod('facility_txt'.$i, 'There are many variations of passages of Lorem Ipsum');
									$facilityus_page_id = get_theme_mod('facilityus_page'.$i); 
									$facilityus_page_icon = get_theme_mod('facilityus_page_icon'.$i);
									if($facilityus_page_icon){
											
								?>
								<div class="<?php echo $colCls;?> facilitybx">
									<!-- <div class="item"> -->
											<div class="facilityus-single " data-wow-duration="1s">
												<div class="facility-box"> 
														<div class="row">
																<div class="col-md-8 col-sm-8">
																		<div class="facility-area-data">
																				<div class="f-conbx">
																						<a href="<?php echo esc_url(!empty($url)?$url:'#');?>">
																								<h4 class="inner-area-title">
																								<?php echo $facilityus_page_title; ?>
																							</h4>
																						</a>
																						<p><?php echo $facility_txt; ?></p>
																				</div>
																		</div>
																</div>
																<div class="col-md-4 col-sm-4 pd-0">
																		<div class="hi-icon">
																				<div class="icn-bx">
																						<a href="<?php echo esc_url(!empty($url)?$url:'#');?>">
																							<span class="<?php echo $facilityus_page_icon; ?>"></span>
																						</a>
																				</div>
																		</div>
																</div>
														</div>
												</div>
											</div>
									</div>
								<?php					
									}
								}else{?>
									<div class="<?php echo $colCls;?> facilitybx">
											<div class="facilityus-single " data-wow-duration="1s">
													<div class="facility-box "> 
															<div class="row">
																	<div class="col-md-8 col-sm-8">
																			<div class="facility-area-data">
																					<div class="f-conbx">
																							<a href="#"><h4 class="inner-area-title">Text here</h4></a>
																							<p>There are many variations of passages of Lorem Ipsum</p>
																					</div>
																			</div>
																	</div>
																	<div class="col-md-4 col-sm-4 pd-0">
																			<div class="hi-icon">
																					<div class="icn-bx">
																						<a href="#"><span class="fa fa-globe"></span></a>
																					</div>
																			</div>
																	</div>	
															</div>
													</div> 			
											</div>
									</div>
									<?php }

									}?>
								</div> 
							</div>
						</div>

	<!-- 2nd -->

						<div class="facilityus-post-wrap-rhs col-lg-6">
							
							<?php
								$cols = get_theme_mod('facilityus_npp_count_rhs', 1);
								$cols++;
								// echo '$cold: '.$cols;
								switch($cols){
									case 1:
									$colCls = 'col-md-12 col-sm-12';
									break;
									case 2:	
									$colCls = 'col-md-12 col-sm-12';
									
									case 3:
									case 4:
								
									case 5:
									case 6:

									case 9:
									case 11:
									case 13:
									case 15:
									$colCls = 'col-md-12 col-sm-12';
									break;
									default: 
									$colCls = 'col-md-12 col-sm-12';
									break;
								}
								$icons = array(1=>'heart', 2=>'star', 3=>'flash', 4=>'bell',5=>'heart', 6=>'star', 7=>'flash', 8=>'bell');
							?>
							<div class="facilityus-post-boxes-rhs">
								<!-- <div class="owl-carousel owl-theme">  -->
								<div class="row mr-0">
								<?php
									for( $i = 1; $i <= $cols; $i++ ){
										if($showStatic === false){
									$url = get_theme_mod('luzuk_facility_page_rhs_url_'.$i, '#');	
									$facilityus_page_title_rhs = get_theme_mod('facilityus_page_title_rhs'.$i, 'Text here');
									$facility_rhs_txt = get_theme_mod('facility_rhs_txt'.$i, 'There are many variations of passages of Lorem Ipsum');
				 
									$facilityus_page_icon_rhs = get_theme_mod('facilityus_page_icon_rhs'.$i);
									if($facilityus_page_icon_rhs){
												
								?>
									<div class="<?php echo $colCls;?> facilitybx-rhs">
									<!-- <div class="item"> -->
											<div class="facilityus-single-rhs " data-wow-duration="1s">
												<div class="facility-box-rhs"> 
														<div class="row">
																<div class="col-md-4 col-sm-4 pd-0">
																		<div class="hi-icon-rhs">
																				<div class="icn-bx-rhs">
																						<a href="<?php echo esc_url(!empty($url)?$url:'#');?>">
																							<span class="<?php echo $facilityus_page_icon_rhs; ?>"></span>
																						</a>
																				</div>
																		</div>
																</div>
																<div class="col-md-8 col-sm-8">
																		<div class="facility-area-data-rhs">
																				<div class="f-conbx-rhs">
																						<a href="<?php echo esc_url(!empty($url)?$url:'#');?>">
																								<h4>
																								<?php echo $facilityus_page_title_rhs; ?>
																							</h4>
																						</a>
																						<p><?php echo $facility_rhs_txt; ?></p>
																				</div>
																		</div>
																</div>
														</div>
												</div>
											</div>
									</div>
								<?php					
									}
								}else{?>
									<div class="<?php echo $colCls;?> facilitybx-rhs">
											<div class="facilityus-single-rhs ">
													<div class="facility-box-rhs "> 
															<div class="row">
																	<div class="col-md-4 col-sm-4 pd-0">
																					<div class="hi-icon-rhs">
																							<div class="icn-bx-rhs">
																								<a href="#"><span class="fa fa-clock-o"></span></a>
																							</div>
																					</div>
																			</div>
																	<div class="col-md-8 col-sm-8">
																			<div class="facility-area-data-rhs">
																					<div class="f-conbx-rhs">
																							<a href="#"><h4>Text here</h4></a>
																							<p>There are many variations of passages of Lorem Ipsum</p>
																					</div>
																			</div>
																	</div>
																		
															</div>
													</div> 			
											</div>
									</div>
									<?php }

									}?>
								</div> 
							</div>
						</div>
				</div><!--row -->
				<div class="fac-img">
						<?php 
								$fac_image = get_theme_mod('fac_image');
								if(!empty($fac_image)){
									echo '<img alt="'. esc_html(get_the_title()) .'" src="'.esc_url($fac_image).'" class="img-responsive secondry-bg-img" />';
								}else{
									echo '<img src="'.get_template_directory_uri().'/images/faccentar.png" class="img-responsive" />';
								}
							?>
							<div class="faccir"></div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
    var title = 0;
    jQuery(".service-area .facilityus-single-rhs").each(function(){
      if ($(this).height() > title) { title = $(this).height(); }
    });
    jQuery(".service-area .facilityus-single-rhs").height(title);


    // on Resize change height

    jQuery(window).resize(function(){
      jQuery(".facility-area .facilityus-single-rhs").height("");
      var title = 0;
      jQuery(".facility-area .facilityus-single-rhs").each(function(){
        if ($(this).height() > title) { title = $(this).height(); }
      });
      jQuery(".facility-area .facilityus-single-rhs").height(title);
    });
	</script>
	<script type="text/javascript">
    var title = 0;
    jQuery(".facility-area .facilityus-single").each(function(){
      if ($(this).height() > title) { title = $(this).height(); }
    });
    jQuery(".facility-area .facilityus-single").height(title);


    // on Resize change height

    jQuery(window).resize(function(){
      jQuery(".facility-area .facilityus-single").height("");
      var title = 0;
      jQuery(".facility-area .facilityus-single").each(function(){
        if ($(this).height() > title) { title = $(this).height(); }
      });
      jQuery(".facility-area .facilityus-single").height(title);
    });
	</script>
<?php }  