filtro
Publicado por Armando G. (2 intervenciones) el 12/12/2005 19:33:30
estoy tratando de traer unos registros de una base de datos por medio de un filtro, ¿que instruccion puedo utilizar para lograrlo, la idea es que cuando yo escriba por ejemplo el numero del rif; aparezca el numero del rif y el nombre de la empresa en una tabla de tres columnas.
si pueden ayudarme en algo por favor.
gracias.
este es el codigo que estoy haciendo:
<?php
session_start();
include("conectar.php");
?>
<html>
<head>
<link rel="stylesheet" href="./estilos/portal.css" type="text/css">
<script type='text/javascript' src='../../recursos/formularios.js'></script>
<script language="javascript">
<script type="text/javascript">
function ponerMayusculas(nombre)
{
nombre.value = nombre.value.toUpperCase();
}
function mensaje()
{
var name = elegir("Desea Eliminar este registro?")
if (name==true)
{
window.location "eliminar.php?nRif=<?php echo $registro[nrorif]?>"
}
else
{
window.close()
}
}
</script>
</head>
<body>
<table align="center" class="div1">
<tr class="negrita">
<td class="shadow" align="left">ISLR</td>
<td align="center"> <span class="shadow">LISTADO DE CONTRATISTAS</span></td>
</tr>
</table>
<table width="499" height="28">
<tr>
<td width="41"> </td>
</tr>
</table>
<table>
<tr>
<td>Número del Rif:<input type="text" name="rif" id="rif" size="12" onfocus='EntradaRIF(this,9)' onblur='SalidaRIF(this,9)' maxlength="12"></td>
<td>Nombre de la Empresa:<input type="text" name="empresa" id="empresa" size="50" maxlength="75"></td>
</tr>
</table>
<?php
?>
<form>
<table align="center" border="1" class="div1" link="0000FF">
<tr align="center">
<th>Número del Rif</th>
<th>Nombre de la Empresa</th>
<th>Eliminar</th>
</tr>
<?php
$query = "SELECT * FROM maestro";
$resultado = coneccion('islr',$query,TRUE,$conectar);
while($registro = mysql_fetch_array($resultado))
{
?>
<tr>
<td align="center"><?php echo $registro[nrorif]?></td>
<td align="left"><a href="modificarrif.htm?nRif=<?php
echo $registro[nrorif]?>"><?php echo $registro[nombre]?></a></td>
<!--<td align="center"><a href="modificarrif.htm?nRif=<?php
echo $registro[nrorif]?>"><img src="iconos\modificar.gif" alt="Modificar" border=0></td>-->
<td align="center"><a href="eliminar.php?nRif=<?php echo $registro[nrorif]?>"><img src="iconos\eliminar.gif" alt="Eliminar" border=0 onClick="mensaje()"></a></td>
</tr>
<?php
}
?>
</table>
</form>
</body>
</html>
si pueden ayudarme en algo por favor.
gracias.
este es el codigo que estoy haciendo:
<?php
session_start();
include("conectar.php");
?>
<html>
<head>
<link rel="stylesheet" href="./estilos/portal.css" type="text/css">
<script type='text/javascript' src='../../recursos/formularios.js'></script>
<script language="javascript">
<script type="text/javascript">
function ponerMayusculas(nombre)
{
nombre.value = nombre.value.toUpperCase();
}
function mensaje()
{
var name = elegir("Desea Eliminar este registro?")
if (name==true)
{
window.location "eliminar.php?nRif=<?php echo $registro[nrorif]?>"
}
else
{
window.close()
}
}
</script>
</head>
<body>
<table align="center" class="div1">
<tr class="negrita">
<td class="shadow" align="left">ISLR</td>
<td align="center"> <span class="shadow">LISTADO DE CONTRATISTAS</span></td>
</tr>
</table>
<table width="499" height="28">
<tr>
<td width="41"> </td>
</tr>
</table>
<table>
<tr>
<td>Número del Rif:<input type="text" name="rif" id="rif" size="12" onfocus='EntradaRIF(this,9)' onblur='SalidaRIF(this,9)' maxlength="12"></td>
<td>Nombre de la Empresa:<input type="text" name="empresa" id="empresa" size="50" maxlength="75"></td>
</tr>
</table>
<?php
?>
<form>
<table align="center" border="1" class="div1" link="0000FF">
<tr align="center">
<th>Número del Rif</th>
<th>Nombre de la Empresa</th>
<th>Eliminar</th>
</tr>
<?php
$query = "SELECT * FROM maestro";
$resultado = coneccion('islr',$query,TRUE,$conectar);
while($registro = mysql_fetch_array($resultado))
{
?>
<tr>
<td align="center"><?php echo $registro[nrorif]?></td>
<td align="left"><a href="modificarrif.htm?nRif=<?php
echo $registro[nrorif]?>"><?php echo $registro[nombre]?></a></td>
<!--<td align="center"><a href="modificarrif.htm?nRif=<?php
echo $registro[nrorif]?>"><img src="iconos\modificar.gif" alt="Modificar" border=0></td>-->
<td align="center"><a href="eliminar.php?nRif=<?php echo $registro[nrorif]?>"><img src="iconos\eliminar.gif" alt="Eliminar" border=0 onClick="mensaje()"></a></td>
</tr>
<?php
}
?>
</table>
</form>
</body>
</html>
Valora esta pregunta


0