<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Agencia de Viajes</title>
<link rel="stylesheet" type="text/css" href="vuelos.css"/>
</head>
<body>
<?php
if(!isset($_SESSION["login"])){
?>
<fieldset id="form">
<legend align="center">ALERTA</legend>
<p align="center" >No ha iniciado sesion <a href="../login.php">Identifiquese</a> en nuestro sistema.</p><br>
<p align="center" >Sino esta registrado puede <a href="../registro.php">Registrarse</a></p><br>
</fieldset>
<?php
}
else {
if($_POST['origen']==$_POST['destino']){
?>
<form action="comprar1.php" method="post" >
<fieldset id="identi">
<legend align="center">ALERTA</legend><BR>
<div align="center">
<p align="center" >Por Favor Seleccione dos Ubicaciones Distintas </p><br>
<input type="hidden" name="aerolinea" value="<?php echo $_POST['aerolinea']; ?>">
<input type="submit" value="Regresar" class="btn" onclick = "this.form.action = 'comprar1.php'" />
</div>
<?php
} else {
$origen=$_POST['origen'];
$destino=$_POST['destino'];
$aerolinea=$_POST['aerolinea'];
or
die ("No se puede conectar con el servidor");
or
die ("No se puede seleccionar la base de datos");
$consulta=mysql_query("SELECT id,codavion,origen,destino,partida FROM vuelos where relacion='$aerolinea' && origen='$origen' && destino='$destino'"); $consulta2=mysql_query("SELECT id,codavion,origen,destino,partida FROM vuelos where relacion='$aerolinea' && origen='$destino' && destino='$origen'"); $prueba=mysql_query("SELECT id,codavion,origen,destino,partida FROM vuelos where relacion='$aerolinea' && origen='$destino' && destino='$origen'"); ?>
<form action="comprar3.php" method="post" >
<?php
if($prueba_row){ ?>
<fieldset id="identi">
<legend align="center ">SELECCIONE EL HORARIO DE SU PREFERENCIA</legend><BR>
<div align="center">
<table width="93%" border="1">
<tr>
<th width="9%">Vuelo</th>
<th width="16%" >Origen</th>
<th width="15%" >Destino</th>
<th width="9%" >Hora</th>
<th width="20%" >Fecha</th>
<th width="15%" >Clase</th>
<th width="16%" >Selección</th>
</tr>
<?php
// Voy imprimiendo el primer select compuesto por los paises
{ ?> <tr>
<th><?php echo"".$registro[1]."";?> </th>
<th ><?php echo"".$registro[2]."";?> </th>
<th ><?php echo"".$registro[3]."";?></th>
<th ><?php echo"".$registro[4]."";?></th>
<th width="20%" ><SELECT class="nac" name="mesida"> <OPTION value="NULL" selected>Mes</OPTION>
<OPTION value=1>Enero</OPTION> <OPTION
value=2>Febrero</OPTION> <OPTION value=3>Marzo</OPTION>
<OPTION value=4>Abril</OPTION> <OPTION
value=5>Mayo</OPTION> <OPTION value=6>Junio</OPTION>
<OPTION value=7>Julio</OPTION> <OPTION
value=8>Agosto</OPTION> <OPTION value=9>Septiembre</OPTION>
<OPTION value=10>Octubre</OPTION> <OPTION
value=11>Noviembre</OPTION> <OPTION
value=12>Diciembre</OPTION></SELECT> <SELECT name="diaida" class="nac">
<OPTION value="NULL" selected>Día</OPTION>
<OPTION>1</OPTION> <OPTION>2</OPTION>
<OPTION>3</OPTION> <OPTION>4</OPTION>
<OPTION>5</OPTION> <OPTION>6</OPTION>
<OPTION>7</OPTION> <OPTION>8</OPTION>
<OPTION>9</OPTION> <OPTION>10</OPTION>
<OPTION>11</OPTION> <OPTION>12</OPTION>
<OPTION>13</OPTION> <OPTION>14</OPTION>
<OPTION>15</OPTION> <OPTION>16</OPTION>
<OPTION>17</OPTION> <OPTION>18</OPTION>
<OPTION>19</OPTION> <OPTION>20</OPTION>
<OPTION>21</OPTION> <OPTION>22</OPTION>
<OPTION>23</OPTION> <OPTION>24</OPTION>
<OPTION>25</OPTION> <OPTION>26</OPTION>
<OPTION>27</OPTION> <OPTION>28</OPTION>
<OPTION>29</OPTION> <OPTION>30</OPTION>
<OPTION>31</OPTION></SELECT> <SELECT name="anoida" class="nac">
<OPTION value="NULL" selected>Año</OPTION>
<OPTION
value="2012">2012</OPTION> <OPTION
value="2011">2011</OPTION> </SELECT></th>
<th ><SELECT class="nac" name="clase"> <OPTION value="NULL" selected>Clase</OPTION>
<OPTION value="VIP">V.I.P</OPTION> <OPTION
value="PRI">Primera Clase</OPTION> <OPTION value="ECO">Economica</OPTION>
</SELECT> </th>
<th ><INPUT type="radio" name="partida" value="<?php echo"".$registro[4]."";?>"></th>
</tr>
<?php }?>
</table>
<BR>
<table width="93%" border="1">
<tr>
<th width="9%">Vuelo</th>
<th width="16%" >Origen</th>
<th width="15%" >Destino</th>
<th width="9%" >Hora</th>
<th width="20%" >Fecha</th>
<th width="15%" >Clase</th>
<th width="16%" >Selección</th>
</tr>
<?php
{ ?>
<tr>
<th><?php echo"".$registro[1]."";?> </th>
<th ><?php echo"".$registro[2]."";?> </th>
<th ><?php echo"".$registro[3]."";?></th>
<th ><?php echo"".$registro[4]."";?></th>
<th width="20%" ><SELECT class="nac" name="messo"> <OPTION value="NULL" selected>Mes</OPTION>
<OPTION value=1>Enero</OPTION> <OPTION
value=2>Febrero</OPTION> <OPTION value=3>Marzo</OPTION>
<OPTION value=4>Abril</OPTION> <OPTION
value=5>Mayo</OPTION> <OPTION value=6>Junio</OPTION>
<OPTION value=7>Julio</OPTION> <OPTION
value=8>Agosto</OPTION> <OPTION value=9>Septiembre</OPTION>
<OPTION value=10>Octubre</OPTION> <OPTION
value=11>Noviembre</OPTION> <OPTION
value=12>Diciembre</OPTION></SELECT> <SELECT name="diaso" class="nac">
<OPTION value="NULL" selected>Día</OPTION>
<OPTION>1</OPTION> <OPTION>2</OPTION>
<OPTION>3</OPTION> <OPTION>4</OPTION>
<OPTION>5</OPTION> <OPTION>6</OPTION>
<OPTION>7</OPTION> <OPTION>8</OPTION>
<OPTION>9</OPTION> <OPTION>10</OPTION>
<OPTION>11</OPTION> <OPTION>12</OPTION>
<OPTION>13</OPTION> <OPTION>14</OPTION>
<OPTION>15</OPTION> <OPTION>16</OPTION>
<OPTION>17</OPTION> <OPTION>18</OPTION>
<OPTION>19</OPTION> <OPTION>20</OPTION>
<OPTION>21</OPTION> <OPTION>22</OPTION>
<OPTION>23</OPTION> <OPTION>24</OPTION>
<OPTION>25</OPTION> <OPTION>26</OPTION>
<OPTION>27</OPTION> <OPTION>28</OPTION>
<OPTION>29</OPTION> <OPTION>30</OPTION>
<OPTION>31</OPTION></SELECT> <SELECT name="anoso" class="nac">
<OPTION value="NULL" selected>Año</OPTION>
<OPTION
value="2012">2012</OPTION> <OPTION
value="2011">2011</OPTION> </SELECT></th>
<th ><SELECT class="nac" name="claseso"> <OPTION value="NULL" selected>Clase</OPTION>
<OPTION value="VIP">V.I.P</OPTION> <OPTION
value="PRI">Primera Clase</OPTION> <OPTION value="ECO">Economica</OPTION>
</SELECT> </th>
<th ><INPUT type="radio" name="venida" value="<?php echo"".$registro[4]."";?>"> </th>
</tr>
<?php }
?></table>
<BR> <BR>
<input type="hidden" name="aerolinea" value="<?php echo $_POST['aerolinea']; ?>">
<input type="hidden" name="origen" value="<?php echo $_POST['origen']; ?>">
<input type="hidden" name="destino" value="<?php echo $_POST['destino']; ?>">
<input type="submit" value="Regresar" class="btn" onclick = "this.form.action = 'comprar1.php'" />
<input type="submit" value="Siguiente" class="btn" onclick = "this.form.action = 'comprar3.php'" />
<BR><BR>
</fieldset>
<?php
}
else {
?>
<form action="comprar1.php" method="post" >
<fieldset id="identi">
<legend align="center">ALERTA</legend><BR>
<div align="center">
<p align="center" >No Tenemos Vuelos Disponibles </p><br>
<input type="hidden" name="aerolinea" value="<?php echo $_POST['aerolinea']; ?>">
<input type="submit" value="Regresar" class="btn" onclick = "this.form.action = 'comprar1.php'" />
</div>
<?php } }}
?>
</body>
</html>