<?php
/**
* @project ApPHP Hotel Site
* @copyright (c) 2010 - 2013 ApPHP
* @author ApPHP <info@apphp.com>
* @license http://www.apphp.com/php-hotel-site/index.php?page=template_license
*/

// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------

?>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">        
	<meta name="keywords" content="<?php echo Application::Get('tag_keywords'); ?>" />
	<meta name="description" content="<?php echo Application::Get('tag_description'); ?>" />
        
    <title><?php echo Application::Get('tag_title'); ?></title>

    <base href="<?php echo APPHP_BASE; ?>" />
	<link href="<?php echo APPHP_BASE; ?>images/icons/apphp.ico" rel="SHORTCUT ICON" />
    
    <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Oswald">

    <link rel="stylesheet" href="<?php echo APPHP_BASE; ?>templates/<?php echo Application::Get('template');?>/css/style.css" media="all">

	<?php if(Application::Get('lang_dir') == 'rtl'){ ?>
		<link href="<?php echo APPHP_BASE; ?>templates/<?php echo Application::Get('template');?>/css/style-rtl.css" type="text/css" rel="stylesheet" />
	<?php } ?>
	<!--[if IE]>
	<link href="<?php echo APPHP_BASE; ?>templates/<?php echo Application::Get('template');?>/css/style-ie.css" type="text/css" rel="stylesheet" />
	<![endif]-->

	<script type="text/javascript" src="<?php echo APPHP_BASE; ?>js/main.js"></script>
	<script type="text/javascript" src="<?php echo APPHP_BASE; ?>js/cart.js"></script>	

    <?php echo Application::SetLibraries(); ?>    	
	<?php
	    $banner_image = '';
        if(!$objLogin->IsLoggedIn() || Application::Get('preview') == 'yes'){
			Banners::DrawBannersTop($banner_image, false);
        }
    ?>		

</head>
<body class="homepage">

	<!-- HEADER -->
	<?php include_once 'templates/'.Application::Get('template').'/header.php'; ?>

    <div class="container">
        <div class="row-fluid">
			
			<div class="row">			
			<div id="search-box">
				<?php if(in_array(Application::Get('page'), array('home', 'check_availability', 'booking')) && Application::Get('customer') == ''){ ?>                
					<div class="hotel-search">
						<h2 class="search-reservation"><strong><?php //echo _RESERVATION; ?></strong></h2>                            
						<?php echo Rooms::DrawSearchAvailabilityBlock(true, '', '', 8, 3, 'main-inline', '', '', false); ?>
					</div>                        
				<?php } ?>
			</div>			
			</div>
			<?php
				 if(Application::Get('page') != '' && Application::Get('page') == 'home' || Application::Get('page') == 'check_availability' || Application::Get('page') == 'booking_details' || Application::Get('page') == 'booking_checkout'){
					 $clase = 'span-center';
					 $mostarBookingDetail = 1;
				 }else{
					 $clase = 'span-center2';
					 $mostarBookingDetail = 0;
				 }
				 if(Application::Get('customer') != ''){
					 $clase = 'span-center2';
					 $mostarBookingDetail = 0;
				 }
			?>
			<div class="container">
			<div class="row-fluid">
			<div class="<?=$clase?>" >
				<div class="inner plain-inner cms-data">
				<?php
					echo $banner_image;

					if(Application::Get('page') != '' && Application::Get('page') != 'home'){							
						if(file_exists('page/'.Application::Get('page').'.php')){	 
							include_once('page/'.Application::Get('page').'.php');
						}else{
							include_once('page/404.php');
						}
					}else if(Application::Get('customer') != ''){					
						if(Modules::IsModuleInstalled('customers') && file_exists('customer/'.Application::Get('customer').'.php')){	
							include_once('customer/'.Application::Get('customer').'.php');
						}else{
							include_once('customer/404.php');
						}
					}else if((Application::Get('admin') != '') && file_exists('admin/'.Application::Get('admin').'.php')){
						include_once('admin/'.Application::Get('admin').'.php');
					}else{
						if(Application::Get('template') == 'admin'){
							include_once('admin/home.php');
						}else{
							include_once('page/pages.php');										
						}
					}
				?>
                
<?php
if(Application::Get('page') != '' && Application::Get('page') == 'booking'){
echo '<script>location.href=\'index.php\'</script>';			
}
?>

				</div>
			</div>
            <?php
				 if($mostarBookingDetail == 1){
				 
			?>
            <div class="span-part">
			    <div class="inner plain-inner">
				<?
					if(Application::Get('page') == 'booking_checkout'){	 
					include_once('page/booking_checkout_Antigua.php');
					}else{
						include_once('page/booking_home.php');
					}

				?>
				</div>
			</div>
            
            <?
				if(Application::Get('page') == 'check_availability' && $mostrarAlerta == 1){	 
				echo '<div class="span-part">
						<div class="inner plain-inner">
							<table>
								<tr>
									<td><img src="/templates/x-voyage/images/1411434768_ktip.png" style="height:48px"/></td>
									<td>Please use the <b>"Check Availability"</b> box at the top of the page to select rooms for an additional reservation.  Click <b>"Book"</b> to continue with your current reservation.</td>
								</tr>
							</table>
						</div>
					</div>';
				}
			?>
                
            
            <?php
				 }
			?>
			</div>
            <div class="">
			    <div class="inner plain-inner" style="height:153px;width:512px;">
				<?php
					// Draw menu tree
					Menu::DrawMenu('left', true, array('search_availability' => false));						
				?>
				</div>
			</div>
			</div>
					
		</div>
	</div>
    
	<!-- FOOTER -->
	<?php include_once 'templates/'.Application::Get('template').'/footer.php'; ?>    


	<?php Rooms::DrawSearchAvailabilityFooter(); ?>    
</body>
</html>