Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/04/2011, 11:36
Avatar de omar_gutierrez
omar_gutierrez
 
Fecha de Ingreso: febrero-2011
Mensajes: 144
Antigüedad: 13 años, 1 mes
Puntos: 2
Pregunta Como puedo pasar la variable en esta situacion?

En este php lo que hago es mostrar la informacion de una tabla, a un lado hay 2 botones, uno para eliminar el registro de la tabla, y el otro para editar el registro.

Código 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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>E/M TASAS NIVEL PEDIMENTO</title>
<script type="text/javascript">
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
</script>
</head>
<style type="text/css">
a:link { color: #f00; } <--- color del enlace normal
a:visited { color: #0f0; } <--- color del enlace ya visitado
a:hover { color: #00f; } <--- color cuando se le pasa el puntero por encima
a:active { color: #ff0; } <--- color cuando se le hace clic.
</style>
<style type="text/css">

.relleno {
    font-family: Arial Narrow; font-size:16px
}
.titulo_tabla {
    font-family: Arial Narrow; font-size:16
}
</style>

<?php 
//conectar a mysql (ver archivo conexion.php)
include ("conexion.php");

if(@
$_REQUEST['action']=="del")
    {
mysql_query("DELETE
        FROM tasas_nivel_pedimento
        WHERE NUM ="
.round($_REQUEST['NUM']));
    }

?>
<body bgcolor="#CCCCCC">
<div align="center">
  <table class="titulo_tabla" width="533" border="1" cellspacing="0" cellpadding="0"> 
    <tr>
      <th colspan="8">TASAS NIVEL PEDIMENTO</th>
    </tr>
    <tr>
    <td width="175"><div align="center">NUM PEDIMENTO</div></td>
    <td width="86"><div align="center">CONTRIB</div></td>
    <td width="136"><div align="center">CVE T TASA</div></td>
    <td width="72"><div align="center">TASA</div></td>
    <td width="52" colspan="2"><div align="center"></div></td>
    </tr>

    <?php
        $qqq
;
$lista mysql_query("SELECT * FROM tasas_nivel_pedimento ORDER BY NUM DESC");
while(
$rs=mysql_fetch_array($lista)){
    
    echo 
"<tr height=\"30\">".
            
"<td align=\"center\" class=\"titulo_tabla\" >".$rs['NUM_PEDIMENTO']."</td>".
            
"<td align=\"center\" class=\"titulo_tabla\" >".$rs['CONTRIB']."</td>".
            
"<td align=\"center\" class=\"titulo_tabla\" >".$rs['CVE_T_TASA']."</td>".
            
"<td align=\"center\" class=\"titulo_tabla\" >".$rs['TASA']."</td>".
            
"<td align=\"center\" class=\"titulo_tabla\" width=\"30\"><a href=tasas_n_pedimento.php?action=del&NUM=".$rs['NUM']."><img src=\"http://127.0.0.1/testing/IMAGENES/b_drop.png\" alt=\"ELIMINAR\" title=\"Eliminar\"/></a></td>".
            
"<td align=\"center\" class=\"titulo_tabla\" width=\"30\"><a href=\"#\"><img src=\"http://127.0.0.1/testing/IMAGENES/b_edit.png\" alt=\"Eliminar\" title=\"Editar\" onclick=\"MM_openBrWindow('tasas_n_pedimento_edit.php','TASAS','width=570,height=170')\" /></a></td>".
            
"</tr>";
            }
 
?>

    

</table>
  <p>&nbsp;</p>
</div>
</body>
</html>
Para eliminar el registro ya esta listo. Lo que quiero es que cuando le de clic a editar se abra un popup con la informacion del registro seleccionado, poder editarlo, guardar y cerrar. el problema es que no se como hacer esto. Lo del popup ya quedo, puedo abrir la ventana, pero no se como pasar la una variable del renglon seleccionado, (el campo NUM es la llave unica, ese valor no lo muestro en la tabla que visualiza el usuario). He visto que tengo que usar href, pero este ya lo estoy usando para abrir la ventana emergente, que tengo que hacer para que funcione de la manera que pido?

Gracias de antemano.