Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/05/2016, 22:55
joscol
 
Fecha de Ingreso: marzo-2015
Ubicación: zulia
Mensajes: 71
Antigüedad: 9 años, 2 meses
Puntos: 0
como puedo pasar variables a una ventana modal

necesito ayuda urgentemente
tengo este código

como van a ver, estoy usando las librerias de POD_Pagination pero eso es lo de menos asi que borre parte del codigo para que se viera lo que mas interesa.


EN MAYUSCULA DENTRO DEL CODIGO VOY EXPLICANDO UN POCO TODO


Código PHP:
<html>
<head>
    <title>usuarios</title>
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript">
        function openVentana(){
        $(".ventana").slideDown(2000);
        }
        function closeVentana(){
        $(".ventana").slideUp("fast");
        }
    </script>
</head>
<body>

    <center>
<table cellpadding="10" cellmargin="5" border="1">
    <tr>
        <th>Cod</th>
        <th>Cedula</th>
        <th>Nombre</th>
        <th>Apellido</th>
        <th>Programa</th>
        <th>Carrera</th>
        <th>Opciones</th>
    </tr>
    <?php
    
foreach($model as $row)
    {
        echo 
"<tr>";
        echo 
"<td>".$row['cod']."</td>";
        echo 
"<td>".$row['cedula']."</td>";
        echo 
"<td>".$row['nombre']."</td>";
        echo 
"<td>".$row['apellido']."</td>";
        echo 
"<td>".$row['programa']."</td>";
        echo 
"<td>".$row['carrera']."</td>";
        echo 
"<td>"?>


ESTA ES LA PARTE QUE MAS ME INTERESA, ES DONDE ESTA EL BOTON EDITAR
COMO VAN A VER, EL ACTION DEL FORM ME DIRIJE A LA VENTANA MODAL


<form action="javascript:openVentana();" method="post">
<input type="hidden" name="cod" value="<?php echo $row['cod'?>" />
<input type="hidden" name="cedula" value="<?php echo $row['cedula'?>" />
<input type="hidden" name="nombre" value="<?php echo $row['nombre'?>" />
<input type="hidden" name="apellido" value="<?php echo $row['apellido'?>" />
<input type="hidden" name="programa" value="<?php echo $row['programa'?>" />
<input type="hidden" name="carrera" value="<?php echo $row['carrera'?>" />
<input type="submit" value="Editar">
</form> 

<form action="eliminar.php" method="post">
<input type="hidden" name="cod" value="<?php echo $row['cod'?>"/>
<input type="submit" value="Eliminar" />
</form> <?php echo "</td>";
        echo 
"</tr>";
    }
    
?>
</table>
        <br>
        <br>
<div>
<?php
$pagination
->pages("btn");
?>
</div>
    </center>


Y ESTA ES LA VENTANA MODAL


<div class="ventana" id="inicio">
    <div class="formedi" >
        <div class="cerrar"><a href="javascript:closeVentana();"><img height='20px' width='20px' src="./imagenes/close.png"></a></div>
        <h3>Editar Usuarios</h3>


<?php

EN ESTA PARTE ESTABA COLOCANDO VARIABLE  CON 
VAR PERO EN LA PAGINA ME DECIA 
Parse error
syntax errorunexpected 'var' (T_VARin C:xampphtdocsusuarioindex.php on line 216

?>

<form action="actualizar.php" method="post">
<input type="hidden" name="cod" value="<?php echo cod?>" />
<br><br>
<label> Cedula: </label>
<input type="text" name="cedula" value="<?php echo cedula?>" />
<br>
<br>
<label> Nombre: </label>
<input type="text" name="nombre" value="<?php echo nombre?>" />
<br>
<br>
<label> Apellido: </label>
<input type="text" name="apellido" value="<?php echo apellido?>" />
<br>
<br>
<label> Programa: </label>
<input type="text" name="programa" value="<?php echo programa?>" />
<br>
<br>
<label> Carrera: </label>
<input type="text" name="carrera" value="<?php echo carrera?>" />
<br>
<br>
<br>
<input type="submit" value="actualizar">
</form>

        </div>
    </div>
</div>


<table class="pie">
    <tr>
        <td class="pieletra" align="middle"> Copyright © 2016 | PNF Informatica Nocturno.
        <br>Todos los Derechos Reservados.</td>
    </tr>
</table>
</body>
</html>