combobox
Publicado por WALTER (3 intervenciones) el 23/08/2005 19:35:55
hola buen dia sr. necesito una ayuda
tengo mi script en php el cual debe de mostrar una lista de consultores activo, e inactivos el problema es que necesito crear un combobox que me muestre tales listas en la misma paguina al seleccionar activos me muestre los que estan activos y al seleccionar inactivos haga lo mismo.
cuando $m=$mostrar->seleccionar('activo=1');......
activo=1 me muestra los consultores activos
activo=0 los no activos.
este es mi script estoy trabajando con php5 , pear. apache2 ..db->oracle 8i
-----------------consultor.php---------------
<html>
<head><br>
<body>
<form method = "POST" action = "">
<strong>Palabra clave:</strong>
<input type="text" name="buscar" size="20">
<input type="submit" value="Buscar">
</form>
<table><tr><td>
<form method="POST" action="consultor.php">
<table>
<select name="Categoria" onChange='this.form.submit()'>
<option >Activados</option>
<option>Desactivados</option>
</select></td>
</form>
</table>
</body>
<?php
require_once('TablaConsultor.php');
$mostrar=new TablaConsultor("alfa_consultor");
$m=$mostrar->seleccionar('activo=1');
echo '<table border=1 >'
.' <tr><td><img src="./imagenes/s_fulltext.png" ></td>'
.' <td>Numero Documento</td>'
.' <td>ID Documento</td>'
.' <td>ID Ocupacion</td>'
.' <td>ID </td>'
.' <td>ACTIVO</td>';
foreach ($m as $campo)
{
echo '<tr><td>'
.' <a href="./eliminar.php?id=' . $campo["COD_CONSULTOR"] . '"><img src="./imagenes/eliminar.png" ></a>'
//.' <FORM METHOD="POST" ACTION="./eliminar.php?id=' . $campo["COD_CONSULTOR"] . '"><INPUT TYPE=IMAGE NAME="imagen" SRC="./imagenes/eliminar.png"></FORM>'
//. ' <FORM METHOD="POST" ACTION="./actualizar.php?id=' . $campo["COD_CONSULTOR"] . '"><INPUT TYPE=IMAGE NAME="imagen" SRC="./imagenes/editar.png"></FORM></td>'
.' <a href="./actualizar.php?id=' . $campo["COD_CONSULTOR"] . '"><img src="./imagenes/editar.png" </a>'
.' <td>'. $campo["NUM_DOCUMENTO"].'</td>'
.' <td>'. $campo["COD_TPODOC_IDENTIDAD"].'</td>'
.' <td>'. $campo["COD_OCPCION"].'</td>'
.' <td>'. $campo["COD_CONSULTOR"].'</td>'
.' <td>'. $campo["ACTIVO"].'</td>'
.' </tr>';
}
echo "</table> \n";
?>
<body>
<form method="post" action="insertar.php">
<table border="0" align="left" cellpadding="0" summary="" width="400"><td><h4>Agregar Consultor</h4></td>
<tr><td>Nº. Documento</td><td>ID Documento</td><td>ID Ocupacion</td><td>Activo</td></tr>
<td width="140"><font face="Verdana" align="center" size="1"></font><input size="20" name="NUM_DOCUMENTO" type="text"></td>
<td width="140"><font face="Verdana" align="center" size="1"></font><input size="10" name="COD_TPODOC_IDENTIDAD" type="text"></td>
<td width="140"><font face="Verdana" align="center" size="1"></font><input size="10" name="COD_OCPCION" type="text"> </td>
<td width="140"><font face="Verdana" align="center" size="1"></font><input size="1" name="ACTIVO" disabled type="text" value="1"> </td>
</tr><br><br>
<td><input type="submit" name="crear" value="Agregar" ></td>
</table>
</form>
</body>
</head>
</html>
tengo mi script en php el cual debe de mostrar una lista de consultores activo, e inactivos el problema es que necesito crear un combobox que me muestre tales listas en la misma paguina al seleccionar activos me muestre los que estan activos y al seleccionar inactivos haga lo mismo.
cuando $m=$mostrar->seleccionar('activo=1');......
activo=1 me muestra los consultores activos
activo=0 los no activos.
este es mi script estoy trabajando con php5 , pear. apache2 ..db->oracle 8i
-----------------consultor.php---------------
<html>
<head><br>
<body>
<form method = "POST" action = "">
<strong>Palabra clave:</strong>
<input type="text" name="buscar" size="20">
<input type="submit" value="Buscar">
</form>
<table><tr><td>
<form method="POST" action="consultor.php">
<table>
<select name="Categoria" onChange='this.form.submit()'>
<option >Activados</option>
<option>Desactivados</option>
</select></td>
</form>
</table>
</body>
<?php
require_once('TablaConsultor.php');
$mostrar=new TablaConsultor("alfa_consultor");
$m=$mostrar->seleccionar('activo=1');
echo '<table border=1 >'
.' <tr><td><img src="./imagenes/s_fulltext.png" ></td>'
.' <td>Numero Documento</td>'
.' <td>ID Documento</td>'
.' <td>ID Ocupacion</td>'
.' <td>ID </td>'
.' <td>ACTIVO</td>';
foreach ($m as $campo)
{
echo '<tr><td>'
.' <a href="./eliminar.php?id=' . $campo["COD_CONSULTOR"] . '"><img src="./imagenes/eliminar.png" ></a>'
//.' <FORM METHOD="POST" ACTION="./eliminar.php?id=' . $campo["COD_CONSULTOR"] . '"><INPUT TYPE=IMAGE NAME="imagen" SRC="./imagenes/eliminar.png"></FORM>'
//. ' <FORM METHOD="POST" ACTION="./actualizar.php?id=' . $campo["COD_CONSULTOR"] . '"><INPUT TYPE=IMAGE NAME="imagen" SRC="./imagenes/editar.png"></FORM></td>'
.' <a href="./actualizar.php?id=' . $campo["COD_CONSULTOR"] . '"><img src="./imagenes/editar.png" </a>'
.' <td>'. $campo["NUM_DOCUMENTO"].'</td>'
.' <td>'. $campo["COD_TPODOC_IDENTIDAD"].'</td>'
.' <td>'. $campo["COD_OCPCION"].'</td>'
.' <td>'. $campo["COD_CONSULTOR"].'</td>'
.' <td>'. $campo["ACTIVO"].'</td>'
.' </tr>';
}
echo "</table> \n";
?>
<body>
<form method="post" action="insertar.php">
<table border="0" align="left" cellpadding="0" summary="" width="400"><td><h4>Agregar Consultor</h4></td>
<tr><td>Nº. Documento</td><td>ID Documento</td><td>ID Ocupacion</td><td>Activo</td></tr>
<td width="140"><font face="Verdana" align="center" size="1"></font><input size="20" name="NUM_DOCUMENTO" type="text"></td>
<td width="140"><font face="Verdana" align="center" size="1"></font><input size="10" name="COD_TPODOC_IDENTIDAD" type="text"></td>
<td width="140"><font face="Verdana" align="center" size="1"></font><input size="10" name="COD_OCPCION" type="text"> </td>
<td width="140"><font face="Verdana" align="center" size="1"></font><input size="1" name="ACTIVO" disabled type="text" value="1"> </td>
</tr><br><br>
<td><input type="submit" name="crear" value="Agregar" ></td>
</table>
</form>
</body>
</head>
</html>
Valora esta pregunta


0