Código PHP:
<?php require_once('Connections/modulo_1.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$colname_buscar_linea = "-1";
if (isset($_POST['nombre_operador'])) {
$colname_buscar_linea = $_POST['nombre_operador'];
}
mysql_select_db($database_modulo_1, $modulo_1);
$query_buscar_linea = sprintf("SELECT * FROM linea_autobus WHERE nombre_operador = %s ORDER BY id_linea_autobus ASC", GetSQLValueString($colname_buscar_linea, "text"));
$buscar_linea = mysql_query($query_buscar_linea, $modulo_1) or die(mysql_error());
$row_buscar_linea = mysql_fetch_assoc($buscar_linea);
$totalRows_buscar_linea = mysql_num_rows($buscar_linea);
?><!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>Documento sin título</title>
<style type="text/css">
<!--
.Estilo7 {color: #333333; font-weight: bold; font-family: Tahoma; font-size: small; }
-->
</style>
</head>
<body>
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td>
<table border="1" cellpadding="1" cellspacing="1">
<tr>
<td>Id de la Línea</td>
<td>nombre del operador</td>
<td>código de la línea</td>
<td>Modalidad</td>
<td>Ttipologia de las unidades</td>
<td>Cupo max asignado</td>
<td>Dirección</td>
<td>Fecha de expedición</td>
<td>Fecha de Vencimiento</td>
<td>Rif</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_buscar_linea['id_linea_autobus']; ?></td>
<td><?php echo $row_buscar_linea['nombre_operador']; ?></td>
<td><?php echo $row_buscar_linea['codigo_linea']; ?></td>
<td><?php echo $row_buscar_linea['modalidad']; ?></td>
<td><?php echo $row_buscar_linea['tipologia_unidades']; ?></td>
<td><?php echo $row_buscar_linea['cupo_max_asignado']; ?></td>
<td><?php echo $row_buscar_linea['direccion']; ?></td>
<td><?php echo $row_buscar_linea['fecha_exp_contrato']; ?></td>
<td><?php echo $row_buscar_linea['fecha_venc_contrato']; ?></td>
<td><?php echo $row_buscar_linea['Rif']; ?></td>
</tr>
<?php } while ($row_buscar_linea = mysql_fetch_assoc($buscar_linea)); ?>
</table></td></tr>
<tr>
<td> </td>
</tr>
<tr>
<td> <?php echo $totalRows_buscar_linea ?> Registro(s) se ha(n) encontrado</td>
</tr>
</table>
<br />
</body>
</html>
<?php
mysql_free_result($buscar_linea);
?>
lo que me falta y no hayo o no se como hacerlo es agregar un campo de texto o preferible un listbox en este caso se mostraria una lista con todos los nombres de los operadores(seria lo ideal) y atravez de un boton buscar(al presionarlo) me mostrara el registro con toda la informacion cargada en ese valor.
por los momentos el codigo me muestra registros vacios ya que como les dig no se donde tendria que colocar el valor para cargar la varible...
Espero me entiedan y puedan ayudarme gracias de antemano...
![sonriente](http://static.forosdelweb.com/fdwtheme/images/smilies/smile.png)