Foros del Web » Programando para Internet » PHP »

referenciar un combobo para bscar un registro

Estas en el tema de referenciar un combobo para bscar un registro en el foro de PHP en Foros del Web. quiero buscar un registro por medio de un combobox pero no se como hacer la referencia a la opcion lo trato de hacer con case ...
  #1 (permalink)  
Antiguo 09/12/2008, 16:52
 
Fecha de Ingreso: octubre-2005
Mensajes: 129
Antigüedad: 18 años, 6 meses
Puntos: 0
referenciar un combobo para bscar un registro

quiero buscar un registro por medio de un combobox pero no se como hacer la referencia a la opcion

lo trato de hacer con case pero n puedo


<?
include 'conector/conexion.php';


$nreport=$_POST["nreport"];
?>

<html>
<head>
<title>Busqueda General</title>
<script language="JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>
<body>
<form method="Post" action="">
<table border="1" bordercolor="#99CCFF" bordercolor="#99CCFF" >
<table border =1>
<tr>
<td>Parametro de busqueda</td>
<td width="130">
<input type="text" name="nreport" value="">
</td>
<td width="67">
<input type="submit" name ="busca_report" value=" Buscar" >
</td>
</tr>
<tr>
<td height="23">Buscar Por:</td>
<td colspan="2" valign="top">
<select name="select">
<option value="n_report">N&ordm; Report</option>
<option value="tipo_equipo">Tipo Equipo</option>
<option value="proceso_report">Proceso</option>
</select>
</td>
</tr>
</table>


<p>&nbsp;</p>
<table border=1 width="67%">
<tr>
<td width="8%"><b>N de reporte</b></td>
<td width="9%"><b>Serie del equipo</b></td>
<td width="8%"><b>Proceso</b></td>
<td width="8%"><b>Tipo Equipo</b></td>
</tr>
</table>
</form>
<?
if (isset($_POST[busca_report]))
{

switch($buscar)
{


case isset($_POST[n_report]):

$nreport=$_POST["nreport"];
$conteo=mysql_query("select count(*) as resultado from reportseguimientos where n_report=$nreport");
$resultado=mysql_query("select distinct r.n_report, r.serie_equipo, e.tipo_equipo, pro.nombre_proceso
from reportes.reportgenerados as r inner join reportes.reportseguimientos as rs
on r.n_report=rs.n_report inner join reportes.equipos as e on
r.equipo=e.id_equipo inner join
reportes.proceso as pro on
rs.proceso_report=pro.id_proceso where
r.n_report='$nreport'");

while($row=mysql_fetch_array($conteo))
{
if ($row["resultado"]==0)
{
echo("<font size=\"5\" color=\"Red\"><marquee>No coincide nÏmero de reporte</font></marquee>");
}
else
{
while($fila=mysql_fetch_array($resultado))
{
echo"<form action=\"\" method=\"POST\">";
echo"<table border=\"1\" width=\"90%\" >";
echo "<tr><td width=\"10%\"><font size=\"4\" color=\"Red\">".$fila['n_report']."</font></td>";
echo "<td width=\"12%\"><font size=\"4\" color=\"Red\">".$fila['serie_equipo']."</font></td>";
echo "<td width=\"10%\"><font size=\"4\" color=\"Red\">".$fila['tipo_equipo']."</font></td>";
echo "<td width=\"10%\"><font size=\"4\" color=\"Red\">".$fila['nombre_proceso']."</font></td>";
echo "<td width=\"10%\"><font size=\"4\" color=\"Red\">".$fila['fecha_report']."</font></td>";
echo "<td width=\"15%\"><input type=\"hidden\" name=\"n_report\" value=\"$fila[n_report]\">",
"<a href=\"cerrar_report.php?n_report=$nreport\">Cerra r Reporte</a></td>";

echo"</tr>";
echo"</table>";
echo"</form>";

}
mysql_free_result($resultado);
mysql_close();
}
}
break;


//case isset():

break;
}
}
else
{

$_pagi_sql="select r.n_report, r.serie_equipo, p.nombre_proceso, e.tipo_equipo from
reportes.reportgenerados as r inner join reportes.proceso as p on r.proceso=p.id_proceso
left join reportes.equipos as e on r.equipo=e.id_equipo";

$_pagi_cuantos = 10;
include("paginator.inc.php");

echo"<table border=\"1\" width=\"90%\" >";
while($row=mysql_fetch_array($_pagi_result))
{
echo"<form action=\"\" method=\"POST\">";
echo "<tr><td width=\"10%\"><font size=\"4\" >".$row['n_report']."</font></td>";
echo "<td width=\"12%\"><font size=\"4\" color=\"black\">".$row['serie_equipo']."</font></td>";
echo "<td width=\"10%\"><font size=\"4\" color=\"black\">".$row['nombre_proceso']."</font></td>";
echo "<td width=\"10%\"><font size=\"4\" color=\"black\">".$row['tipo_equipo']."</font></td>";
echo "<td width=\"8%\"><input type=\"hidden\" name=\"n_report\" value=\"$row[n_report]\">",
"<a href=\"cerrar_report.php?n_report=$row[n_report]\">Cerrar Reporte</a></td>";
echo "<td width=\"15%\"><input type=\"hidden\" name=\"n_report\" value=\"$row[n_report]\">",
"<a href=\"buscar_report.php?n_report=$row[n_report]\">Seguimiento</a></td>";
echo"</tr>";
echo"</form>";
}
echo"</table>";
echo"<p>".$_pagi_navegacion."</p>";

}
?>
</body>
</html>
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 08:24.