All pastes #520461 Raw Edit

k001

public php v1 · immutable
#520461 ·published 2007-05-29 22:59 UTC
rendered paste body
<?phpinclude("../includes/definiciones_hoteles.php");include("../includes/funcionesbd_hoteles.php");if (!$date1){	header('Location: hoteles1.php');	exit();}$date2   = $_POST['date2'];$date1   = $_POST['date1'];$destino = $_POST['destino'];$rooms   = $_POST['rooms'];  ?><html><head><title>Olympus Tours</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link href="../styles/styles.css" rel="stylesheet" type="text/css"><script language='javascript' src="../libs/popcalendar.js"></script><script><!--function showcell( szCellId){	thecell=document.getElementById( szCellId );	if (thecell.style.display =='none' )	{ thecell.style.display = '';}	else	{ thecell.style.display = 'none'; }		if (szCellId =='destinationscell') document.location.href="destinations.html";}function MM_swapImgRestore() { //v3.0  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}function MM_preloadImages() { //v3.0  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}function MM_findObj(n, d) { //v4.01  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);  if(!x && d.getElementById) x=d.getElementById(n); return x;}function MM_swapImage() { //v3.0  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}//--></script><style type="text/css"><!--.style2 {	color: #353D92;	font-weight: bold;	font-size: 13px;}.style3 {	color: #B46715;	font-weight: bold;}--></style><style type="text/css"><!--.style4 {font-size: 11px}.style5 {color: #000000}.style8 {font-size: 13px}.style9 {font-size: 12px}.style1 {color: #FFFFFF;	font-weight: bold;}--></style></head><body  leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('../images/carrito_cyan.gif','../images/go2.gif')"><form name="form1" method="post" action=""><a name="top"></a><table width="750"  border="0" align="center" cellpadding="0" cellspacing="0" class="bodytext">  <tr align="left" valign="top">    <td width="102" background="../images/left-menu_04.jpg"><table width="145" border="0" cellpadding="0" cellspacing="0" class="menu" id="Table_01">      <tr>        <td><img src="../images/left-menu_01.jpg" width="145" height="125" alt=""></td>      </tr>      <tr>        <td align="left" valign="top" background="../images/left-menu_02.jpg" class="menu"><table width="145" border="0" cellpadding="0" cellspacing="0" class="menu" id="Table_01">          <tr>            <td align="left" valign="top" background="../images/left-menu_02.jpg" class="menu"><table width="93%"  border="0" align="right" cellpadding="0" cellspacing="0" class="menu">                <tr>                  <td class="menu"><img src="../images/menu-arrow-down.jpg" width="8" height="9" align="absmiddle">&nbsp;<strong><a href="../eng/tours.php">Services</a></strong> </td>                </tr>                <tr>                  <td><table width="135"  border="0" cellpadding="0" cellspacing="0" class="menu">                      <tr>                        <td width="9">&nbsp;</td>                        <td width="126"><p><img src="../images/menu-arrow-item.jpg">&nbsp;<a href="../eng/tours.php">Tours</a><br>                                <img src="../images/menu-arrow-item.jpg">&nbsp;<a href="../eng/transfers.php">Transfers</a> <br>                        </p></td>                      </tr>                  </table></td>                </tr>                <tr>                  <td>&nbsp;</td>                </tr>                <tr>                  <td><img src="../images/menu-arrow-down.jpg" width="8" height="9" align="absmiddle">&nbsp;<strong><a href="../eng/destinations.php">Destinations</a></strong></td>                </tr>                <tr>                  <td><table width="135"  border="0" cellpadding="0" cellspacing="0" class="menu">                      <tr>                        <td width="9">&nbsp;</td>                        <td width="126"><p><img src="../images/menu-arrow-item.jpg">&nbsp;<a href="../cancun/cancun-about.html">Cancun</a><br>                                <img src="../images/menu-arrow-item.jpg">&nbsp;<a href="../cozumel/cozumel-about.html">Cozumel</a><br>                                <img src="../images/menu-arrow-item.jpg">&nbsp;<a href="../riviera_maya/riviera-maya-about.html">Riviera Maya <br>                                </a><img src="../images/menu-arrow-item.jpg"> <a href="../los_cabos/los-cabos-about.html">Los Cabos<br>                                </a><img src="../images/menu-arrow-item.jpg"> <a href="../puerto_vallarta/puerto-vallarta-about.html">Puerto Vallarta</a><br>                                <img src="../images/menu-arrow-item.jpg"> <a href="../mexico_city/mexico-city-about.html">Mexico City </a></p></td>                      </tr>                  </table></td>                </tr>                <tr>                  <td>&nbsp;</td>                </tr>                <tr>                  <td><img src="../images/menu-arrow.jpg" width="9" height="8" align="absmiddle">&nbsp;<strong><a href="../eng/groups-incentives.html">Groups &amp; Incentives</a></strong></td>                </tr>                <tr>                  <td>&nbsp;</td>                </tr>                <tr>                  <td><img src="../images/menu-arrow.jpg" width="9" height="8" align="absmiddle">&nbsp;<strong><a href="../eng/customer-service.html">Customer Service</a></strong></td>                </tr>                <tr>                  <td>&nbsp;</td>                </tr>                <tr>                  <td><img src="../images/menu-arrow.jpg" width="9" height="8" align="absmiddle">&nbsp;<strong><a href="../eng/clients-comments.html">Client's Comments</a></strong></td>                </tr>                <tr>                  <td>&nbsp;</td>                </tr>                <tr>                  <td><img src="../images/menu-arrow.jpg" width="9" height="8" align="absmiddle">&nbsp;<strong><a href="../eng/employment.php">Employment</a> </strong></td>                </tr>                <tr>                  <td>&nbsp;</td>                </tr>                <tr>                  <td><img src="../images/menu-arrow.jpg" width="9" height="8" align="absmiddle">&nbsp;<strong><a href="../eng/about-us.html">About Us </a></strong></td>                </tr>                <tr>                  <td>&nbsp;</td>                </tr>                <tr>                  <td><img src="../images/menu-arrow.jpg" width="9" height="8" align="absmiddle">&nbsp;<strong><a href="../eng/site-map.php">Site Map</a></strong></td>                </tr>                <tr>                  <td>&nbsp;</td>                </tr>            </table></td>          </tr>        </table></td>      </tr>      <tr>        <td><img src="../images/left-menu_03.jpg" width="145" height="112" alt=""></td>      </tr>    </table></td>    <td width="648"><table width="606" height="566" border="0" cellpadding="0" cellspacing="0" id="Table_01">      <tr align="left" valign="middle" background="../images/top-inner_02.jpg">        <td height="23" background="../images/top-inner_02.jpg" colspan="3"><div align="right"><span class="languages"> <a href="../esp/index.html">Espa&ntilde;ol</a>&nbsp;| <a href="../index.html">HOME</a>&nbsp;&nbsp; </span></div></td>      </tr>      <tr align="left" valign="top">        <td height="42" colspan="2"><img src="../images/inner-tour_03.jpg" width="416" height="54" alt=""></td>        <td width="254" rowspan="2"><table width="190" border="0" cellpadding="0" cellspacing="0" id="Table_01">          <tr align="left" valign="top">            <td width="190" height="41" align="center" valign="middle" background="../images/inner-tour_04.jpg" class="title3">Hotels</td>          </tr>          <tr>            <td ><table width="100%" border="0" cellspacing="0" cellpadding="3">                <tr class="bodytext">                  <td width="100%" height="12" nowrap background="../images/inner-tour_09.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="3">                      <tr valign="middle" class="bodytext">                        <td height="12" colspan="3">&nbsp;&nbsp;Destinations:</td>                      </tr>                      <tr valign="middle" class="bodytext">                        <td height="12" colspan="2">                          <select name="destinations" class="form-combos" id="select" onBlur="this.className='form-combos'" onclick="this.className='form-combos1'">                        <?php			$link = ConectarDB( _BD_NOMBRE );			mysql_select_db(_BD_NOMBRE, $link);			$szQuery = "SELECT * FROM destinos WHERE DI_id <= 6";			$resultado = mysql_query( $szQuery, $link);			$i=0;                        while ($row = @mysql_fetch_array($resultado))				{					$szContenido = $row["DI_Nombre"];					if ($row["DI_id"]==$destino)					{						echo '<option selected value="' . 'tours-list.php?d=' . $row["DI_id"]. '">' . $szContenido . '</option>';					}					else					{						echo '<option value="' . 'tours-list.php?d=' . $row["DI_id"]. '">' . $szContenido . '</option>';					}				}			mysql_select_db("hoteles", $link);			?>                          </select>                        </td>                        <td width="63%" height="12"><input onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3811','','../images/go2.gif',1)" name="Image3811" type="image" src="../images/go1.gif" width="23" height="20" border="0"></td>                      </tr>                      <tr valign="top">                        <td height="37" colspan="4" background="../images/inner-tour_08.jpg" class="title3"><div align="center"><span class="style1"> </span>                                <table width="100%" height="29"  border="0" cellpadding="0" cellspacing="0">                                  <tr>                                    <td><div align="center" class="title3">Shopping Cart</div></td>                                    <td><span class="style1"><a href="tours-reservations-cart.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('carrito1','','../images/carrito_cyan.gif',1)"><img src="../images/carrito_azul.gif" name="carrito1" width="23" height="20" border="0" align="baseline" id="carrito1"></a></span></td>                                  </tr>                                </table>                        </div></td>                      </tr>                      <tr>                        <td height="37" background="../images/inner-tour_08.jpg" class="title3" colspan="4"><div align="center">Reservation Status</div></td>                      </tr>                      <tr valign="middle" class="bodytext">                        <td colspan="3" valign="top"><div align="left">Reservation Code: </div></td>                      </tr>                 <script>			function trim(cadena){				for(i=0; i<cadena.length; )				{					if(cadena.charAt(i)==" ")						cadena=cadena.substring(i+1, cadena.length);					else						break;				}						for(i=cadena.length-1; i>=0; i=cadena.length-1)				{					if(cadena.charAt(i)==" ")						cadena=cadena.substring(0,i);					else						break;				}				return cadena;			}			function enterCod () {				document.form2.c.value=document.form2.c1.value				document.form2.c1.value=""				document.form2.c.value=trim(document.form2.c.value);				if (document.form2.c.value=="")				{					alert ("Please specify a Reservation Code.");					return false				}				else				{						return true;				}			}		 </script>                      <tr valign="middle" class="bodytext">                        <td width="22%" valign="top">                          <div align="left">                            <input name="c1" type="text" class="form-combos" id="c1" onBlur="this.className='form-combos'" onClick="this.className='form-combos1'" size="7" maxlength="7">                            <input name="c" type="hidden" id="c">                        </div></td>                        <td width="15%" valign="top"><input name="Image38112" type="image" onMouseOver="MM_swapImage('Image38112','','../images/go2.gif',1)" onMouseOut="MM_swapImgRestore()" src="../images/go1.gif" align="middle" width="23" height="20" border="0"></td>                        <td valign="top">&nbsp;</td>                      </tr>                      <tr valign="middle" class="bodytext">                        <td colspan="3" valign="top">Forgot your code? <a href="../eng/codemail.php"><strong>Click here!</strong></a> </td>                      </tr>                  </table></td>                </tr>            </table></td>          </tr>          <tr>            <td height="37" background="../images/inner-tour_08.jpg" class="title3"><div align="center">Transfers</div></td>          </tr>          <tr>            <td rowspan="3" background="../images/inner-tour_09.jpg">              <input name="destinoh" type="hidden" value="<?php echo $NumeroDestino ?>">              <table width="100%" border="0" cellspacing="0" cellpadding="3">                <tr class="bodytext">                  <td width="100%" height="25" align="left" nowrap><table border="0" cellspacing="0" cellpadding="0">                      <tr class="bodytext">                        <td align="left" nowrap>Destination</td>                        <td>&nbsp;</td>                        <td>&nbsp;</td>                      </tr>                      <tr class="bodytext">                        <td colspan="2" align="left" nowrap><select name="destinations2" class="form-combos" id="destinations2" onBlur="this.className='form-combos'" onClick="this.className='form-combos1'">                            <?php								mysql_select_db("sitio", $link);						$szQuery = "SELECT * FROM destinos";						$resultado = mysql_query( $szQuery, $link);						$i=0;                            while ($row = @mysql_fetch_array($resultado))							{								$szContenido = $row["DI_Nombre"];								if ($row["DI_id"]==$destino)								{									echo '<option selected value="' .  $row["DI_id"]. '">' . $szContenido . '</option>';								}								else								{									echo '<option value="' . $row["DI_id"]. '">' . $szContenido . '</option>';								}							}						  ?>                        </select></td>                        <td>&nbsp;&nbsp;</td>                      </tr>                  </table></td>                </tr>                <tr class="bodytext">                  <td height="25" align="left" nowrap><table border="0" cellspacing="0" cellpadding="0">                      <tr class="bodytext">                        <td align="right" nowrap><input name="radio" type="radio" value="ah" checked></td>                        <td align="right" nowrap>Airport-Hotel:&nbsp;</td>                        <td>&nbsp;</td>                        <td>&nbsp;&nbsp;</td>                      </tr>                  </table></td>                </tr>                <tr class="bodytext">                  <td height="25" align="left" nowrap><table border="0" cellspacing="0" cellpadding="0">                      <tr class="bodytext">                        <td align="right" nowrap><input type="radio" name="radio" value="ha"></td>                        <td align="right" nowrap>Hotel-Airport:&nbsp;</td>                        <td>&nbsp;</td>                        <td>&nbsp;&nbsp;</td>                      </tr>                  </table></td>                </tr>                <tr class="bodytext">                  <td height="25" nowrap><table border="0" cellspacing="0" cellpadding="0">                      <tr class="bodytext">                        <td align="left"><input type="radio" name="radio" value="rt"></td>                        <td>Round Trip&nbsp;</td>                        <td><a href="javascript:document.transfers.submit()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image381','','../images/go2.gif',1)"><img src="../images/go1.gif" name="Image381" width="23" height="20" border="0" id="Image381"></a></td>                      </tr>                  </table></td>                </tr>                <tr class="bodytext">                  <td height="25" nowrap>&nbsp;Private Transfer? <a href="mailto:operations@olympus-tours.com"><strong>Click here!</strong></a></td>                </tr>            </table></td>          </tr>          <tr> </tr>          <tr> </tr>          <tr>            <td height="36" background="../images/inner-tour_08.jpg" class="title3"><div align="center">Offers</div></td>          </tr>          <tr>            <td>              <?php					$link = ConectarDB( _BD_NOMBRE );					mysql_select_db(_BD_NOMBRE, $link);					$sql = "SELECT * FROM tours WHERE recomendar = 1 AND T_Destino=" . $destino . " ORDER BY T_listado ASC";					$resultado = mysql_query($sql);					if (mysql_num_rows($resultado) == 0) { ?>					<table width="100%"  border="0" align="center" cellpadding="3" background="../images/inner-tour_09.jpg" class="bodytext">                		<tr><td>No offers</td></tr>					</table>				  <?php }					//*****************************************************					while ($row=mysql_fetch_array($resultado))					{ ?>              <table width="100%" border="0" align="center" cellpadding="3" background="../images/inner-tour_09.jpg" class="bodytext">                <tr>                  <td>                    <?php 									$fotoT = '../images/' . MuestraInfoEX( "destinos", "DI_id", $row["T_Destino"], 'DI_Folder' ) . '/';									if (MuestraInfoEX( "images", "I_Id", $row["T_Imagenes"], 'image_principal' )!='')									{										 $fotoT .= MuestraInfoEX( "images", "I_Id", $row["T_Imagenes"], 'image_principal' );									}									else									{										$fotoT .= 'image-placeholder.jpg';									}								?>                    <div align="center"><img src="<?php echo $fotoT ?>" width="120" height="135" class="image1"></div></td>                </tr>                <tr>                  <td> <span class="subtitle1"><?php echo $row['T_Nombre'] ?></span>                      <div align="justify"><span class="style4"><?php echo substr($row['T_Dcorta'],0,110) . '...'; ?></span></div>                      <a href="../eng/tours-info.php?t=<?php echo $row['T_Id'] ?>"><img src="../images/moreinfo.jpg" width="61" height="19" vspace="6" border="0"></a></td>                </tr>              </table>              <?php } 					//******************************************?>            </td>          </tr>        </table></td>      </tr>      <tr align="left" valign="top">        <td width="10" height="451"><img src="../images/spacer.gif" width="17" height="17"></td>        <td width="375" class="bodytext" valign="top">          <span class="footer"><a href="../index.html">HOME</a> &gt; <a href="hoteles1.php">Hotels</a> &gt; Search Results </span><br>          <p class="title2">            <?php				$link = ConectarDB( _BD_NOMBRE );				mysql_select_db("hoteles", $link);					$sql = "SELECT hoteles.*, categorias.nombre as categoria FROM (hoteles LEFT JOIN categorias ON hoteles.idCategoria = categorias.idCategoria)  WHERE idDestino =" . $destino ." and recomendar='Si' ORDER BY nombreI";				$resultado = mysql_query($sql);				if (mysql_num_rows($resultado) > 0) {				?><?php while ($row = mysql_fetch_array($resultado)) { ?><?php }		  } 		  mysql_free_result($resultado); ?></p>          <p class="title2">Search Results </p>                      <?php				$campos = array();				$campos1 = array();				$campos2 = array();				$z = 0;				for ($i = 1; $i <= $rooms; $i++) {					$campos[$i-1] = "habitaciones.cantidadAdultos >=" . $_POST['cboAdultos'.$i] . " AND habitaciones.cantidadNinnos >=" . $_POST['cboNenes'. $i];					$campos1[$i-1] = "a$i=" . $_POST['cboAdultos'.$i] . "&n$i=" . $_POST['cboNenes'. $i];					for ($j = 1; $j <= $_POST['cboNenes'. $i]; $j++) {						$campos2[$z] = "e$i$j=" . $_POST['cboEdad'.$i.$j];						$z++;					}				}				$cond =  implode(" AND ", $campos);				//url de Reserve con ctodos los datos de las personas				$cond1 = "h=" . $rooms . "&" . implode("&", $campos1) . "&" . implode("&", $campos2) ;				// calculo de la antelacion				list ($mes,$dia,$ano) = explode ("/",$date1);					$fecha_final = strtotime("$ano-$mes-$dia");				$ant = ceil(($fecha_final-time())/86400);				$cond2 = "antelacion <= $ant";				list ($mes,$dia,$ano) = explode ("/",$date2);					$fecha_final2 = strtotime("$ano-$mes-$dia");				$dias = ceil(($fecha_final2-$fecha_final)/86400);				$cond3 = "noches_min <= $dias";				// fin calculo antelacion				$cond4 = ($_POST['plan'] >0 ? "AND hoteles.idPlan = " . $_POST['plan'] : "");				//echo $cond1;				$sql = "SELECT hoteles.*, planes.nombreI as plan, categorias.nombre as categoria, MIN(habitaciones.cantidadAdultos) FROM (((hoteles LEFT JOIN habitaciones ON hoteles.idHotel = habitaciones.idHotel) LEFT JOIN categorias ON hoteles.idCategoria = categorias.idCategoria) LEFT JOIN planes ON hoteles.idPlan = planes.idPlan) WHERE idDestino =" . $destino ." and hoteles.nombreI like '%" . mysql_escape_string(trim($_POST['hotel'])) . "%' and $cond and $cond2 and $cond3 $cond4 GROUP BY hoteles.idHotel ORDER BY nombreI ";				$resultado = mysql_query($sql);				if (mysql_num_rows($resultado) > 0) {				?>                    <?php while ($row = mysql_fetch_array($resultado)) { ?>            <table width="95%"  class="tableborder1" border="0" cellpadding="6" cellspacing="1" style="background-image:url(../images/bk2.jpg); background-repeat:repeat-x ">            <tr  class="bodytext">              <td colspan="2"  class="title1"><table border="0" cellpadding="0" cellspacing="0">                  <tr>                    <td width="126" align="center" valign="top"><?php $sql = "SELECT * from fotos WHERE idHotel = " . $row['idHotel'] . " Limit 1" ;					$foto = mysql_query($sql);					if (mysql_num_rows($foto) > 0) {						$f = MYSQL_RESULT($foto,0,"foto");						if (!(is_null($f) || $f == "") || $row['idDestino'] == 0 ) { 							mysql_select_db("sitio", $link);							$sql = "SELECT * FROM destinos WHERE DI_id = " . $row['idDestino'];							$d = mysql_query($sql);						?>                      <img src="../images/hoteles/<?php echo MYSQL_RESULT($d,0,"DI_Nombre")?>/<?php echo MYSQL_RESULT($foto,0,"foto")?>" alt="<?php echo MYSQL_RESULT($foto,0,"descripcionI")?>" width="113" height="99" class="image1" style="margin-right:10px">                      <?php 							mysql_select_db("hoteles", $link);							}						else { ?>                      <img src="../images/hoteles/noImage.gif" width="113" height="99" class="image1" style="margin-right:10px">                      <?php } } 						else { ?>                      <img src="../images/hoteles/noImage.gif" width="113" height="99" class="image1" style="margin-right:10px">                      <?php 					} 					?>                        <a href="hotel-info.php?t=<?php echo $row['idHotel'] ?>">More Info</a> <span class="style9">|</span> <a href="hotel-gallery.php?t=<?php echo $row['idHotel'] ?>">Gallery</a><strong>&nbsp;</strong></td>                    <td width="232" align="left" valign="top"><span class="style2"><?php echo strtoupper($row['nombreI']) ?></span><span class="bodytext">                        <?php								$e = $row['categoria'];								if ($e > 0){									$texto = "";									for($j=1;$j<=$e;$j++) {			   							$texto .= '<img src="../images/star.gif" width="14" height="13" align="absmiddle">';			  						}								echo "<br>" . $texto;								}								?>                        <br>						                        <div align="justify" class="style4"><?php echo $row['descripcionI'] ?></div>						<div align="justify" class="style4"><br>Plan: <?php echo $row['plan'] ?></div>                        <table width="98%" height="100%" border="0" cellpadding="3">                          <tr>                            <td width="50%"><table width="70" border="0" align="left" cellpadding="0" cellspacing="0" background="../images/bk3.jpg" style="margin-top:8px">                                <tr>                                  <td height="19" class="tab2"><div align="center">Nights/PAX</div></td>                                </tr>                                <tr>                                  <td class="title2"><div align="center">									<?php																		list ($mes,$dia,$ano) = explode ("/",$date1);									    $f1 = "$ano-$mes-$dia";								    list ($mes,$dia,$ano) = explode ("/",$date2);									    $f2 = "$ano-$mes-$dia";																		$sql = "SELECT ROUND(AVG(tarifa * 1),2) as promedio FROM tarifa, habitaciones WHERE (tarifa.tipoTarifa = 'p' OR tarifa.tipoTarifa is null) AND habitaciones.idHabitacion = tarifa.idHabitacion AND habitaciones.idHotel=" . $row['idHotel'] . " 										  AND (												  (													'$f1' BETWEEN concat(MID(fecha1,7,4),'-',MID(fecha1,4,2),'-',MID(fecha1,1,2)) AND concat(MID(fecha2,7,4),'-',MID(fecha2,4,2),'-',MID(fecha2,1,2)) 													OR 													'$f2' BETWEEN concat(MID(fecha1,7,4),'-',MID(fecha1,4,2),'-',MID(fecha1,1,2)) AND concat(MID(fecha2,7,4),'-',MID(fecha2,4,2),'-',MID(fecha2,1,2))												  ) 											  OR 												 (													('$f1' <= concat(MID(fecha1,7,4),'-',MID(fecha1,4,2),'-',MID(fecha1,1,2))) 													AND ('$f2' >= concat(MID(fecha1,7,4),'-',MID(fecha1,4,2),'-',MID(fecha1,1,2)))												  )											)					  								";									//echo $sql;									$t = mysql_query($sql);									if (mysql_num_rows($t) > 0){										$te = MYSQL_RESULT($t,0,"promedio");										echo (is_null($te)  ? "---" : "$" . $te);									}									else										echo "---";									?>                                  </div></td>                                </tr>                            </table></td>                            <td><table width="70" border="0" align="left" cellpadding="0" cellspacing="0" background="../images/bk3.jpg" style="margin-top:8px">                              <tr>                                <td height="19" class="tab2"><div align="center">Nights/Room</div></td>                              </tr>                              <tr>                                <td class="title2"><div align="center">                                    <?php																		list ($mes,$dia,$ano) = explode ("/",$date1);									    $f1 = "$ano-$mes-$dia";								    list ($mes,$dia,$ano) = explode ("/",$date2);									    $f2 = "$ano-$mes-$dia";																		$sql = "SELECT ROUND(AVG(tarifa * 1),2) as promedio FROM tarifa, habitaciones WHERE tarifa.tipoTarifa = 'h' AND habitaciones.idHabitacion = tarifa.idHabitacion AND habitaciones.idHotel=" . $row['idHotel'] . " 										  AND (												  (													'$f1' BETWEEN concat(MID(fecha1,7,4),'-',MID(fecha1,4,2),'-',MID(fecha1,1,2)) AND concat(MID(fecha2,7,4),'-',MID(fecha2,4,2),'-',MID(fecha2,1,2)) 													OR 													'$f2' BETWEEN concat(MID(fecha1,7,4),'-',MID(fecha1,4,2),'-',MID(fecha1,1,2)) AND concat(MID(fecha2,7,4),'-',MID(fecha2,4,2),'-',MID(fecha2,1,2))												  ) 											  OR 												 (													('$f1' <= concat(MID(fecha1,7,4),'-',MID(fecha1,4,2),'-',MID(fecha1,1,2))) 													AND ('$f2' >= concat(MID(fecha1,7,4),'-',MID(fecha1,4,2),'-',MID(fecha1,1,2)))												  )											)					  								";									//echo $sql;									$t = mysql_query($sql);									if (mysql_num_rows($t) > 0){										$te = MYSQL_RESULT($t,0,"promedio");										echo (is_null($te)  ? "---" : "$" . $te);									}									else										echo "---";									?>                                </div></td>                              </tr>                            </table></td>                          </tr>                          <tr align="left">                            <td colspan="2"><?php	  	$sql = "SELECT facilidades.* FROM hotelfacilidades left join facilidades on hotelfacilidades.idFacilidad = facilidades.idFacilidad where idHotel= ". $row['idHotel'] ;		$temp = mysql_query($sql);		while ($t = mysql_fetch_array($temp)) {			if ($t['icono'] != "") 			 ?>                                <img alt="<?php echo $t['nombreI'] ?>"  src="../images/icons/<?php echo $t['icono'] ?>" width="20" height="20" align="absmiddle" style="margin-right:2px">                                <?php }	  mysql_free_result($temp);   ?></td>                          </tr>                          <tr>                            <td colspan="2"><div align="right"><img src="../images/arrow.jpg" width="8" height="7"> <a href="hotel-reserva.php?id=<?php echo $row['idHotel'];?>&f1=<?php echo $date1;?>&f2=<?php echo $date2;?>&<?php echo $cond1;?>" class="bodytext"><span class="style3">Reserve</span></a></div></td>                          </tr>                      </table></td>                  </tr>              </table></td>            </tr>          </table>		  <br>            <?php }					  } 		  else { ?>		    <span class="footer">No hotels found.</span>			<?php }			 mysql_free_result($resultado); ?></td>      </tr>      <tr>        <td height="20">&nbsp;</td>        <td height="20" colspan="2"><hr size="1" noshade></td>        </tr>      <tr>        <td height="18">&nbsp;</td>        <td><div align="center"><span class="credits"><strong>All rights reserved &copy; Olympus Tours - 2004 </strong><br>    Av. Yaxchilan S.M. 17 Mza. 2 Lote 13, Cancun, Q. Roo <br>    (998) 881-9030 / 887-7006 Fax - <a href="../eng/customer-service.html">Send us an Email</a></span></div></td>        <td height="18" align="right" valign="top"><table width="70" border="0" cellpadding="2" cellspacing="0" class="scroll-up">          <tr>            <td width="88" nowrap class="scroll-up"><p align="center"><a href="#top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Scroll Up&nbsp;&nbsp;</a></p></td>          </tr>        </table></td>      </tr>    </table>    </td>  </tr></table></form></body></html>