<?php
/*
	Template Name: Home
*/
?>
<?php get_header('home'); ?>

<?php wp_reset_postdata(); ?>

<?php 
	
	$autoPlaySlider = get_field('auto_play_slider');
	$autoPlayVideo = get_field('auto_play_video');
	$slider = get_field('slider');
	$innerContentType = get_field('inner_content_type');
	$mainTypeClass = '';
	if($innerContentType == 'rooms'){
		$mainTypeClass = 'hasRooms';
	}
	elseif($innerContentType == 'widgets'){
		$mainTypeClass = 'hasWidgets';
	}
	$coverClass = '';
	if($autoPlayVideo){
		$coverClass = 'noCover';
	}

?>



<main class="content homePage <?php echo $mainTypeClass; ?>">
     <?php putRevSlider("homepage_slider","homepage") ?>
     
      <?php if($innerContentType == "rooms" || $innerContentType == "widgets"): ?>
		 <section class="homeBoxes" style="display:none;">
		 	
		
		 	
            <div class="container">
                <div class="row homeWidget_masonry um_masonry">	
					<?php if($innerContentType == "rooms"): ?>
						<?php get_template_part('content','homeRooms'); ?>
			 	<?php elseif($innerContentType == "widgets"): ?>			
						<?php if ( is_active_sidebar( 'sidebar-home' ) ):?>
										<?php dynamic_sidebar( 'sidebar-home' );?>
						<?php endif; ?>
				<?php endif; ?>
            	
            	</div>
        	</div>
    	</section>  	  
  	 
  	  <?php endif; ?> 
   
</main>
<div class="pic-holder container">
<div class="col-md-4">
<section id="grid" class="grid clearfix">
<a href="http://mogulsl.com/wordpress/Acasia/?page_id=263" data-path-hover="m 180,34.57627 -180,0 L 0,0 180,0 z">
					<figure>
						   <img src="http://mogulsl.com/wordpress/Acasia/wp-content/uploads/2015/04/room-thumb.jpg" />
						<!--<svg viewBox="0 0 10 1420" preserveAspectRatio="none"><path d="M 180,160 0,218 0,0 180,0 z"/></svg>-->
						<figcaption>
							
							<p class="sp">ROOMS</p>
							<button>View</button>
						</figcaption>
					</figure>
				</a>
                </section>

</div>
<div class="col-md-4">
<section id="grid" class="grid clearfix">
<a href="http://mogulsl.com/wordpress/Acasia/?page_id=134" data-path-hover="m 180,34.57627 -180,0 L 0,0 180,0 z">
					<figure>
						   <img src="<?php echo get_template_directory_uri() ?>/assets/images/pic_rooftop-1.jpg" />
						<!--<svg viewBox="0 0 10 1420" preserveAspectRatio="none"><path d="M 180,160 0,218 0,0 180,0 z"/></svg>-->
						<figcaption>
							
							<p class="sp">ROOF TOP DINNER</p>
							<button>View</button>
						</figcaption>
					</figure>
				</a>
                </section>

</div>
<div class="col-md-4">
<section id="grid" class="grid clearfix">
<a href="http://mogulsl.com/wordpress/Acasia/?page_id=493" data-path-hover="m 180,34.57627 -180,0 L 0,0 180,0 z">
					<figure>
						   <img src="http://mogulsl.com/wordpress/Acasia/wp-content/uploads/2015/04/sp_thumb.jpg" />
						<!--<svg viewBox="0 0 10 1420" preserveAspectRatio="none"><path d="M 180,160 0,218 0,0 180,0 z"/></svg>-->
						<figcaption>
							
							<p class="sp">SPECIAL OFFERS</p>
							<button>View</button>
						</figcaption>
					</figure>
				</a>
                </section>

</div>
	</div>
    
 <!---Home Content-->
<div class="home-content">
 <div class="container">
  <?php
				$postCount = 0;
				$the_query = new WP_Query( array( 'post_type' => 'homecontent', 'showposts' => $roomCount ) );
				if ( $the_query->have_posts() ) {
					while ( $the_query->have_posts() ) {
						$the_query->the_post();
						$postCount++;
			?>
<div class="col-md-4">
  <!-- <span class="overlay"></span>-->
                                	
 <h2> <?php the_title(); ?> </h2>
                      <?php the_content(); ?>
                      <?php the_post_thumbnail('full'); ?>
 </div>
                 
                    
                    <?php
					}
				} else {
			?>				
			<p><?php _e("There's no offer to show!",'nation'); ?></p>
			<?php
				}
				/* Restore original Post Data */
				wp_reset_postdata();
			?>
           
            </ul>
            </div>
<div class="clear"></div>
			
					
				
      

						
            	

                 
					
				</div>
 </div>
 <!---Home Content-->
	<script>
		var autoPlayHomeSlider = '<?php echo $autoPlaySlider; ?>';
		var autoPlayVideo = '<?php echo $autoPlayVideo; ?>';
	</script>

<?php get_footer(); ?>