Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/09/2003, 23:21
jcantomarin
 
Fecha de Ingreso: agosto-2003
Ubicación: Cancun
Mensajes: 97
Antigüedad: 20 años, 8 meses
Puntos: 0
Mensaje codigo y después duda...

<html>
<head>
<meta http-equiv="Cache-Control" content="no-cache">
<meta HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<title> LISTA DE CONTRATOS</title>

<?php
include("inc_classes.php");
?>
<script language=javascript>
function recibir(a, b)
{
document.forms.hoteles.zona.value = a;
document.forms.hoteles.tarifa.value = b;
ventana.close();
ventana = false;
}
var ventana = false;
function abrir()
{
var popup = "<html><head><title>CRITERIOS DE FILTRADO</title></head><body bgcolor=lavender>";
popup += "<form name=enviar action='javascript: ";
popup += "opener.recibir(enviar.a.value, enviar.b.value)' >";
popup += "<div align=center>";
popup += "<font face=arial size=1 color=#000080>ZONA &nbsp;";
popup += "<input type=text name=a size=5 maxlength=3 style='background: white;border:1px solid blue;color:red;font-weight:normal;font-size:8pt'>&nbsp;&nbsp;"
popup += "<font face=arial size=1 color=#000080>TIPO TARIFA &nbsp;";
popup += "<input type=text name=b size=5 maxlength=3 style='background: white;border:1px solid blue;color:red;font-weight:normal;font-size:8pt'>"
popup += "<hr>"
popup += "<input type=submit></form></body></html>";
popup += "</div>";
ventana = window.open('contratofilter.php','','width=500,hei ght=200,left=150,top=150');
ventana.document.writeln(popup);
ventana.document.close();
}
</script>
</head>

<body bgcolor="lavender">

<?php
$db = mysql_connect("localhost", "root", "crypt");
mysql_select_db("myeurodb");
?>

<form name=hoteles method="get">
<input type=hidden name=zona>
<input type=hidden name=tarifa>
<input type="submit" name="submit" value="submit">
</form>

<div align=center>
<table width=600 border=1>
<tr>
<td width=200>
<div align=center>
<input type="button" class="boton" name="submit" value=" A G R E G A R " OnClick="window.location='contrato.php'">
</div>
</td>
<td width=200>
<div align=center>
<input type="submit" class="boton" name="submit" value="&nbsp;&nbsp;&nbsp; B U S C A R &nbsp;&nbsp;" OnClick=abrir()>
</div>
</td>
<td width=200>
<div align=center>
<input type="button" class="boton" name="submit" value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; S A L I R &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" OnClick="window.location='valusr.php'">
</div>
</td>
</tr>
</table>
<hr>
</div>

<?php
if(isset($_GET['zona'])):

if (!$_GET['zona'] == "")
{
$zona = $_GET['zona'];
}
else
{
$zona = "%";
}

if (!$_GET['tarifa'] == "")
{
$tarifa = $_GET['tarifa'];
}
else
{
$tarifa = "%";
}

$sSql = "select a.cveproveedor, b.nombrecomercial, a.cvetipotarifariohotel, c.descripcion from tarifariohotel a, proveedores b, tipotarifariohotel c " .
"where a.cveproveedor = b.cveproveedor and a.cvetipotarifariohotel = c.cvetipotarifariohotel and tipotarifario = 'C' and substring(a.cveproveedor,1,3) like '" .
$zona . "' and a.cvetipotarifariohotel like '" . $tarifa . "' order by a.cveproveedor";
echo "<div align=center>";
$rsSql = mysql_query($sSql,$db);
$rows = mysql_num_rows($rsSql);
$fields = mysql_num_fields($rsSql);

echo "<table border=1>";
echo "<tr bgcolor='#CCCCFF'>" .
"<th width=30><font face='arial' size=1 color = darkblue>CVE HOTEL</font></th> " .
"<th width=300><font face='arial' size=1 color = darkblue>NOMBRE HOTEL</font></th> " .
"<th width=30><font face='arial' size=1 color = darkblue>CVE TARIFA</font></th> " .
"<th width=300><font face='arial' size=1 color = darkblue>DESCRIPCION TARIFA</font></th> " .
"</tr>";

while ($arr = mysql_fetch_array($rsSql))
{
echo "<tr>";
echo "<td><font face='arial' size=1 color = blue>" . $arr['cveproveedor'] . "</font></td>";
echo "<td><font face='arial' size=1 color = blue>" . $arr['nombrecomercial'] . "</font></td>";
echo "<td><font face='arial' size=1 color = blue>" . $arr['cvetipotarifariohotel'] . "</font></td>";
echo "<td><font face='arial' size=1 color = blue>" . $arr['descripcion'] . "</font></td>";
}
echo "</table>";
echo "</div>";

mysql_free_result($rsSql);
mysql_close($db);

endif;
?>
</body>
</html>