
<?php $featuredImageType = get_field('background_image_type'); ?>
<?php setBgImg();  ?>

<main class="content singleRoomPage <?php echo $featuredImageType; ?>">

		<section class="pageImage">
			<?php if($featuredImageType == "bgImg"): ?>	
				<div class="fullBg"></div>
			<?php elseif($featuredImageType == "headerImg"): ?>
				<div class="um_parallax" data-velocity="-.1"></div>
			<?php endif; ?>
		</section>
	
	
</div>
</main>
<div class="container">
		<div class="row">
			<section class="pageTitle text-center">
                    <div class="um_helper">
                    	<div class="um_middle">
                    		<div class="bookingInfo" style="display:none;">
                    			<h3 class="title titleUp"><?php the_field('room_name'); ?></h3>
                    			<p><?php the_field('price_label'); ?></p>
                    	
	                    		<?php 
									$redirectClass = 'um_book';
									if(get_field('redirect_to') != "booking"){
										$redirectClass = '';	
									}
								 ?>
								<a href="<?php the_field('shop_link'); ?>" data-postID="<?php echo $post->ID; ?>" class="btn btn-default titleUp <?php echo $redirectClass; ?>"><?php the_field('redirect_title'); ?></a>
                    		</div>
                    	</div>
                    </div>
                </section>
			
			<section class="content">
				<div class="col-md-12">
					<section class="innerContent singleRoomContent mainBgColor">
						<div class="row">
							
							<?php 
								$colMdClass = "col-md-9";								
								if(get_field('disable_attributes')){
									$colMdClass = "col-md-12";
								}
							 ?>
                             
							 <?php if($colMdClass == "col-md-9"): ?>
									<div class="col-md-3">
                           <h4 class="conatcttitle">ROOMS</h4>
		                	 <?php
						                $defaults = array(
											'container' 	  => false,
						                    'contact_class'      => 'contact-nav',
						                    'theme_location'   => 'room'
						                );
						                wp_nav_menu( $defaults );
						            ?>
                            
							<div class="um_message text-center">
								<h1></h1>
							</div>  
                            <div class="offer">
                            
                            <h4 class="conatcttitle">SPECIAL OFFER</h4>
                                <?php putRevSlider("special offer") ?></div>	
	                	</div><!-- col-md -->
								<?php endif; ?>
							<div class="<?php echo $colMdClass; ?>">
							<div class="col-md-5">	<div class="roomsDescription">
									<h5 class="title titleUp"><?php the_field('description_text'); ?></h5>
								    
								    <?php wp_reset_postdata(); ?>
									<?php the_content(); ?>
								    	
								</div>
                                
                              
                                </div>
							<div class="col-md-7"><?php $slider = get_field('slider'); ?>
							<?php if($slider): ?>
								<div class="roomsSlider royalSlider rsDefault">
								      
								    <?php foreach($slider as $slide): ?>	
									<div class="sliderItem">
										<?php $type = $slide['type']; ?>
										<?php if($type == 'image'):?>
											<?php $image = wp_get_attachment_image_src($slide['image'],'full');  ?>
											<img class="rsImg img-responsive" src="<?php echo $image[0]; ?>" data-rsTmb="<?php echo $image[0]; ?>"  />
											
											<?php else: ?>
												<?php $videoType = $slide['video_type']; ?>
												<?php if($videoType == 'selfhost'): ?>
													<?php $video_poster = wp_get_attachment_image_src($slide['video_poster'],'full'); ?>
													
														<video preload="none"  poster="<?php  echo $video_poster[0];?>" width="480" height="270">
																<source type="video/mp4" src="<?php echo $slide['video']; ?>">
														</video>
														<img class="rsImg img-responsive" src="<?php echo $video_poster[0]; ?>" data-rsTmb="<?php echo $video_poster[0]; ?>"  />
															<div class="rsPlayBtn selfPlay">
																<div class="rsPlayBtnIcon"></div>
															</div>	
													
												<?php elseif($videoType == 'youtube'): ?>
															<?php 
																$video_id = $slide['video_url']; 
																parse_str( parse_url( $video_id, PHP_URL_QUERY ), $youTubeID );
															?>	
															<?php 
																$poster = "http://img.youtube.com/vi/". $youTubeID['v']."/maxresdefault.jpg";
																if($slide['video_poster']){ 
																	
																	$poster = wp_get_attachment_image_src($slide['video_poster'],'full'); 
																	$poster = $poster[0];
																}
															?>
															
														<img class="rsImg img-responsive" src="<?php echo $poster; ?>" data-rsTmb="<?php echo $poster; ?>"  data-rsVideo="<?php echo $video_id; ?>" />
															
												<?php else: ?>
												
														<?php
															$video_id = $slide['video_url']; 
															preg_match('~^http://(?:www\.)?vimeo\.com/(?:clip:)?(\d+)~', $video_id , $vimeoID);
															$link = 'http://vimeo.com/api/v2/video/'.$vimeoID[1].'.php';
															$link = wp_remote_get($link);
															$link = wp_remote_retrieve_body($link);
															$html_returned = unserialize($link);
															$thumb_url = $html_returned[0]['thumbnail_large'];
													
															$poster = $thumb_url;
															if($slide['video_poster']){ 
																
																$poster = wp_get_attachment_image_src($slide['video_poster'],'full'); 
																$poster = $poster[0];
															}
															?>
														
														<img class="rsImg img-responsive" src="<?php echo $poster; ?>" data-rsTmb="<?php echo $poster; ?>" data-rsVideo="<?php echo $video_id; ?>" />
														
												<?php endif; ?>
												
										<?php endif; ?>
										</div>
									<?php endforeach; ?>
								    
								</div>
							<?php endif; ?>
                            </div>
                            
                            <div class="col-md-12"> <h4 class="conatcttitle">Acacia Accommodation Features:</h4>
                            <?php $id=185; $post = get_page($id); echo $post->post_content;  ?>
                            </div>
								
							</div>
							
								
						</div>								
							
	
					</div>
				</section>
			</div>
		
		</section>
	</div>