Código PHP:
<?
include ("coneccion.inc");
// Listado de Tipo de Contactos
if (!empty($_GET['cod_hotel']))
{
// Listamos los tipos de contactos
// Armo una coneccion al servidor mysql
$coneccion = mysql_connect($host_db, $usuario_db, $pass_db);
mysql_select_db($base_db, $coneccion);
// Armo la consulta
$sql = "SELECT * FROM tarifas, habitacion, regimen
WHERE cod_hotel = $cod_hotel";
$sql.=" AND cod_habitacion = id_habitacion";
$sql.=" AND cod_regimen = id_regimen";
$sql.=" ORDER BY single";
$result = mysql_query($sql, $coneccion);
$myrow = mysql_fetch_array($result);
$result = mysql_query($sql, $coneccion);
$sql1 = "SELECT nombre, observaciones FROM hoteles WHERE id_hotel = $cod_hotel";
$result1 = mysql_query($sql1, $coneccion);
$myrow1 = mysql_fetch_array($result1);
$result1 = mysql_query($sql, $coneccion);
if (mysql_error())
{
echo "ERROR al agregar la ciudad - ". mysql_errno().":". mysql_error()."<br>";
}
// Calculo la cantidad de resultados
$cant_resultados = mysql_num_rows($result);
if ($cant_resultados >= 1)
{
// Muestro los resultados
?>
<div align="left">
<table width="78%" border="0">
<tr>
<td width="84%"><span class="subtitulo">Tarifas del Hotel:</span> <span class="Estilo2">"<? echo $myrow1[nombre];?>" </span></td>
<td width="16%"><div align="center"><A HREF="javascript:history.back()"><strong>Volver Atrás </strong></A></div></td>
</tr>
</table>
</div>
<p>
<table width="77%" height="70" border="1" bordercolor="#006600">
<tr class="negrita">
<td width="89" height="32" bgcolor="#009933"><div align="center"><strong>Habitación</strong></div></td>
<td width="54" bgcolor="#009933"><div align="center"><strong>Single</strong></div></td>
<td width="40" bgcolor="#009930"><div align="center"><strong>Doble</strong></div></td>
<td width="39" bgcolor="#009933"><div align="center"><strong>Triple</strong></div></td>
<td width="68" bgcolor="#009933"><div align="center"><strong>Cuadruple</strong></div></td>
<td width="84" bgcolor="#009933"><div align="center"><strong>Family Plan </strong></div></td>
<td width="48" bgcolor="#009933"><div align="center"><strong>Validez</strong></div></td>
<td width="63" bgcolor="#009933"><div align="center"><strong>Regimen</strong></div></td>
<td width="74" bgcolor="#009933"><div align="center"><strong>OBS</strong></div></td>
</tr>
<?
while($myrow = mysql_fetch_array($result))
{
?>
<tr>
<td width="89" height="30" align="left"><? echo $myrow[desc_habitacion]; ?></td>
<td width="54" align="center" valign="middle"><? echo $myrow[single]; ?></td>
<td width="40" align="center" valign="middle"><? echo $myrow[doble]; ?></td>
<td width="39" align="center" valign="middle"><? echo $myrow[triple]; ?></td>
<td width="68" align="center" valign="middle"><? echo $myrow[cuadruple]; ?></td>
<td width="84" align="center" valign="middle"><? echo $myrow[family_plan]; ?></td>
<td width="48" align="center" valign="middle"><? echo $myrow[validez]; ?></td>
<td width="63" align="center" valign="middle"><? echo $myrow[desc_regimen]; ?></td>
<td width="74" align="center" valign="middle"><? echo $myrow[ob]; ?></td>
</tr>
</table>
<?
}
?>
<table width="70%">
<tr>
<td width="70%" align="left"><span class="negrita">Observaciones:</span> <? echo $myrow1[observaciones]; ?>.</td>
</tr>
</table>
<?
}
else
{
// end while
?>
<table width="100%" border="0">
<tr>
<td width="100%" scope="col"><div align="center" class="subtitulo">No hemos encontrado registros</div></td>
</tr>
</table>
<?
}
}
?>
<!-- InstanceEndEditable -->
<p> </p>
<p> </p>
</div>
</body>
<!-- InstanceEnd --></html>