Oye, y como puedo hacer que ejecute el texto en el RichTextBox1 cada vez que cambie el valor de la variable a true o false?
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúPrivate Sub FlighInfo_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Try
If lights.Value(LightType.Landing) = True Then
Me.RichTextBox1.Text = "Landing Lights ON"
End If
Catch ex As Exception
End Try
End Sub
Private Sub RichTextBox1_TextChanged(sender As Object, e As EventArgs) Handles RichTextBox1.TextChanged
End Sub
If lights.Value(LightType.Landing) = True Then
Me.RichTextBox1.Text = "Landing Lights ON"
End If
<?php
$value = $_GET['Value'];
if($value == 1){
?>
<table>
<tr><td class=Forms>First Class: </td><td><input maxlength="3" value="150" type="text" name="pax" /></td></tr>
</table>
<?php
}
?>
<!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>
<link rel="STYLESHEET" type="text/css" href="./style.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Insert Aircraft</title>
</head>
<body>
<script>
//Ajax Script
function require(){
try{
req = new XMLHttpRequest();
}catch(err1){
try{
req = new ActiveXObject("Microsoft.XMLHTTP");
}catch(err2){
try{
req = new ActiveXObject("Msxml2.XMLHTTP");
}catch(err3){
req = false;
}
}
}
return req;
}
var request = require();
function callAjax(){
var ramdom = parseInt(Math.random()*999999999);
valor = document.getElementById("numberclasses").value;
var url="classes.php?Value="+valor+"&r="+ramdom;
request.open("GET",url,true);
request.onreadystatechange = answerAjax;
request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
request.send(null);
}
function answerAjax(){
if(request.readyState==4){
if(request.status==200){
//alert(request.responseText);
document.getElementById("classes").innerHTML=request.responseText;
}else{
alert("ha ocurrido un error"+request.statusText);
}
}
}
</script>
<?
$boton = $_POST['enviar'];
$nombre = $_POST['nombre'];
$precio = $_POST['precio'];
$pax = $_POST['pax'];
$ICAO = $_POST['ICAO'];
if($boton == 'Insertar')
{
include('./db.inc.php');
$ICAO = strtoupper($ICAO);
mysql_query("INSERT INTO flota(ICAO, nombre, precio, capacidad) VALUES('$ICAO', '$nombre', '$precio', '$pax')") or die('<h4 style="color: red;">Ha habido un problema con la insercion.</h4>');
mysql_close();
echo '<h3 style="color: green;">Aeronave adquirida correctamente.<h3/>';
}
else
{
?>
<form action="insertar-modelo.php" method="post" enctype="application/x-www-form-urlencoded">
<table>
<tr><td class=Forms>ICAO: </td><td><input type="text" value="" name="ICAO" /></td></tr>
<tr><td class=Forms>Name: </td><td><input type="text" value="Airbus A320" name="nombre" /></td></tr>
<tr><td class=Forms>Price: </td><td><input maxlength="9" value="1000000" type="text" name="precio" /> €</td></tr>
<div id="dep">
<tr><td class=Forms>Number Classes: </td></td><td><select name="numberclasses" id="numberclasses" onchange="callAjax()">
<option>Select Number of Classes</option>
<?php
echo'<option value="1">One</option>';
?>
</select></td></tr>
</div>
<div id="classes">
<tr><td class=Forms>First Class: </td><td><input maxlength="3" value="150" type="text" name="classes" id="classes"/></td></tr>
</div>
<tr><td class=Forms>Capacidad: </td><td><input maxlength="3" value="150" type="text" name="pax" /> pasajeros</td></tr>
</table><br />
<input type="submit" name="enviar" value="Insertar"/>
</form>
<?
}
?>
</body>
</html>
<?php
$value = $_GET['Value'];
if($value == 1){
?>
<tr><td class=Forms>First Class: </td><td><input maxlength="3" value="150" type="text" name="pax" /></td></tr>
<?php
}
?>
$res2 = mysql_query("SELECT * FROM Pilots WHERE Licencia = '$usuario'");
$loc = mysql_result($res2, 0, 'LOC');
$res = "SELECT * FROM flights WHERE acft in(SELECT C172 FROM Pilots WHERE Licencia = '$id')";
$res = $res ." UNION ";
$res = $res ."SELECT * FROM flights WHERE acft in(SELECT PA28 FROM Pilots WHERE Licencia = '$id')";
$res2 = mysql_query("SELECT * FROM Bookings WHERE Licencia = '$usuario'");
$filas2 = mysql_num_rows($res2);
$result = mysql_query($res);
if($filas2 == 0){
?>
<table cellpadding="2" cellspacing="0" style="text-align: center; width: 100%;">
<tr style="background-color: #000046; font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: white; text-align: center;"><td></td><td>Num. Vuelo</td><td>Modelo</td><td>Salida</td><td>Llegada</td><td>EET</td><td>Precio</td><td>Reservar</td></tr>
<?
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$id = $row['id'];
$icao = $row['acft'];
$sal = $row['departure'];
$lleg = $row['destination'];
$precio = $row['precio'];
$codigo = "<a href=\"reservar-aeronave.php?vuelo=$id&loc=$loc&icao=$icao\"><img src=\"http://airiberova.x10.mx/vasystem/images/tick.png\" alt=\"si\" /></a>";
$res3 = mysql_query("SELECT Matricula FROM Bookings WHERE Vuelo = '$id'");
for($j = 0; $j < mysql_num_rows($res3); $j++)
{
$mat = mysql_result($res3, $j);
$res4 = mysql_query("SELECT icao FROM aeronaves WHERE matricula = '$mat'");
$icaores = mysql_result($res4, 0);
$res2 = mysql_query("SELECT tipo FROM flota WHERE icao = '$icaores'");
$tipo = mysql_result($res2, 0);
if($icaores == $icao) $codigo = '<img src="http://airiberova.x10.mx/vasystem/images/no.png" alt="no" />';
}
$eet = mysql_result($res, $i, 'eet');
$color = $i % 2 == 0 ? $color = 'white' : '#CCC';
echo "<tr style=\"text-align: center; font-size: 10px; font-family: Arial, Helvetica, sans-serif; background-color: $color;\"><td><img src='http://airiberova.x10.mx/vasystem/images/vuelo.gif'></td><td>$id</td><td>$icao</td><td>$sal</td><td>$lleg</td><td>$eet</td><td>$precio €</td><td>$codigo</td></tr>\n";
}
echo '</table>';
}
$var = mysql_result($result, $i, 'departure');
var Destinos = {
autozoom: true,
zoom: 5,
center: new google.maps.LatLng(40.84706, -2.944336),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), Destinos);
<?php
for($i = 0; $i < mysql_num_rows($query); $i++){
$lat = mysql_result($query, $i, 'Lat');
$lon = mysql_result($query, $i, 'Lon');
$icao = mysql_result($query, $i, 'ICAO');
$city = mysql_result($query, $i, 'City');
?>
var Airport1 = new google.maps.InfoWindow({
content: '<h3 align="center" style="font-family:Arial, Helvetica, sans-serif"><?php echo $icao; ?> - <?php echo $city; ?></h3>'
});
var image = 'http://mapicons.nicolasmollet.com/wp-content/uploads/mapicons/shape-default/color-d22328/shapecolor-color/shadow-1/border-dark/symbolstyle-white/symbolshadowstyle-dark/gradient-no/airport.png';
var myLatLng = new google.maps.LatLng(<?php echo $lat; ?>, <?php echo $lon; ?>);
var Airport = new google.maps.Marker({
position: myLatLng,
map: map,
icon: image,
title:"<?php echo $icao; ?> - <?php echo $city; ?>"
});
google.maps.event.addListener(Airport, 'click', function(){
Airport1.open(map, Airport);
});
<?php
}
?>
}