<?php global $access; if($access != 1){ exit("Direct Access not allowed"); } ?>

	<div id="CheckOutSummary">
                <h1 class="heading">HOTEL SUMMARY</h1>
                <h2 class="heading"><?php echo $hotelname; ?></h2>
                <div class="LocationMark">
                  <img src="<?php echo PATH; ?>images/location-icon.png" class="image">
                </div>
                <h4 class="heading"><?php echo $hotel_address; ?> | <?php echo $city_id; ?>, <?php echo $hotel_country; ?>, <?php echo $hotel_zipcode; ?></h4>
                
                <div class="StarsUnderline"></div>
                <table class="table table-condensed">
                  <thead>
                    <tr></tr>
                  </thead>
                  <tbody>
                    <tr>
                      <td class="SummaryLC">Rooms</td>
                      <td class="SummaryRC"><?php echo $rooms; ?></td>
                    </tr>
                    <tr>
                      <td class="SummaryLC">Room Type</td>
                      <td class="SummaryRC"><?php echo $roomname; ?></td>
                    </tr>                   
                    <tr>
                      <td class="SummaryLC">Check-In</td>
                      <td class="SummaryRC"><?php echo $checkin; ?></td>
                    </tr>
                    <tr>
                      <td class="SummaryLC">Check-Out</td>
                      <td class="SummaryRC"><?php echo $checkout; ?></td>
                    </tr>
                    <tr>
                      <td class="SummaryLC">Nights</td>
                      <td class="SummaryRC"><?php echo $diasestadia; ?></td>
                    </tr>
                    <tr>
                      <td class="SummaryLC">&nbsp;</td>
                      <td class="SummaryRC">&nbsp;</td>
                    </tr>
                    <?php
					for($i=0;$i<$rooms;$i++) {
						$roomy = $i+1;
						$roomyfecha = $i;
						$subtothab = $subtotalhabitacion[$i]['subtotal']*$finaltotal;//new currency
						$subtothabformat = number_format($subtothab, 2, '.', '');
						echo "
						<tr>
                      		<td class='SummaryLC'><b>Room $roomy</b></td>
                      		<td class='SummaryRC'></td>
                    	</tr>
						<tr>
                      		<td class='SummaryLC'>Adult(s)</td>
                      		<td class='SummaryRC'>$adults[$i]</td>
                    	</tr>
						<tr>
                      		<td class='SummaryLC'>Children(s)</td>
                      		<td class='SummaryRC'>$children[$i]</td>
                    	</tr>";
											
						for ($j = 0; $j < $children[$i]; $j++) {
							$agees   = $j + 1;
							$edadkid = $childrenArray['room-' . $i . '-child-' . $j . '-age'];
							echo "
							<tr>
								<td class='SummaryLC'>Children $agees Age</td>
								<td class='SummaryRC'>$edadkid</td>
							</tr>";
						}
						
						echo "
						<tr>
                      		<td class='SummaryLC'><strong><i>Room Price:</i></strong></td>
                      		<td class='SummaryRC'><strong><i>$subtothabformat</i></strong></td>
                    	</tr>";
						for ( $fecharoom = 1 ; $fecharoom  <= $intday_ava ; $fecharoom  ++)      
    					{
							$roomyfechaint = $fecharoom - 1;
							$fechahab = $preciohabitacionescompleto[$roomyfecha][$roomyfechaint]['date_price'];
							$preciodiahab = $preciohabitacionescompleto[$roomyfecha][$roomyfechaint]['room_price']*$finaltotal;//new currency
							$preciodiahabformat = number_format($preciodiahab, 2, '.', '');
							echo "
							<tr>
								<td class='SummaryLC'>$fechahab</td>
								<td class='SummaryRC'>$preciodiahabformat</td>
							</tr>";
						}						
					}
                    ?>                       
                  </tbody>
                </table>
                <h1 class="heading">CHARGES</h1>
                <table class="table table-condensed">
                  <thead>
                    <tr></tr>
                  </thead>
                  <tbody>
                    <tr>
                      <td class="SummaryLC">Room Subtotal:</td>
                      <td class="SummaryRC"><?php echo $currencysymbol . number_format($roompricetotal, 2, '.', ''); ?></td>
                    </tr>
                    <tr>
                      <td class="SummaryLC">Tax &amp; Fees:</td>
                      <td class="SummaryRC"><?php echo $currencysymbol . number_format($roompricetax, 2, '.', ''); ?></td>
                    </tr>
                    <tr>
                      <td class="SummaryLC"> <strong>GRAND TOTAL:</strong> 
                      </td>
                      <td class="SummaryRC"><h3><?php echo $currencysymbol . number_format($hotelroomfinalprice, 2, '.', ''); ?></h3></td>
                    </tr>
                  </tbody>
                </table>
              </div>