Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/05/2013, 15:16
Calle7
 
Fecha de Ingreso: enero-2008
Ubicación: Lima
Mensajes: 127
Antigüedad: 16 años, 3 meses
Puntos: 0
Busqueda Exportar registros a Excel

Que tal comunidad, tengo un pequeno reto que hacer espero puedan ayudarme a resolverlo.


Tengo el siguiente código que me genera una tabla html, algo sencillo, nada fuera de lo normal. Notaran que dentro del codigo agrego un CheckBox que tiene un codigo auto_incrementable generado por la variable $i.

Código PHP:
<table>
</tr>
<tr bgcolor="#F0F8FF" align="center"> 
<th width="18" height="50">Id</th>
<th width="63" height="50">Nombre</th>
<th width="99" height="50">Direcci&oacute;n</th>
<th width="50" height="50">Nro.</th>
<th width="55" height="50">Distrito</th>
<th width="223" height="50">Tipo</th>
<th width="191" height="50">Mensaje</th>
<th width="89" height="50">Fecha</th>
<th width="67" height="50">Hora</th>
<th width="75" height="50">IP</th>
<th width="64" height="50">Marcar</th>
</tr>
    <?php
    $i
=0;
    
$stm mysql_query("SELECT * FROM  USUARIO",$cn);
    while(
$row=mysql_fetch_array($stm))
    {
        
$i++;
        echo
"<tr>
             <td>$row[NOMBRE]</td>
             <td>$row[EMPRESA]</td>
             <td align='center'>$row[EMAIL]</td>
             <td align='center'>$row[DIST]</td>
             <td>$row[TIPO]</td>
             <td align='justify'>$row[MENSAJE]</td>
             <td>$row[FECHA]</td>
             <td>$row[HORA]</td>
             <td>$row[IP]</td>
             <td align='center'><input type='checkbox' name='$i'  value='$i'>$i</td>
             </tr>"
;


    }
    
?>
      </table>


esto quedaria algo asi:




Lo que busco, es que cuando marque cualquier CheckBox y presione el boton Submit me exporte dichos registros a Excel . OJO solo aquellos que estan marcados.

Una vez que este archivo excel sea haya generado, los CheckBox que marque quedaran inhabilitados.

Aparentemente esta facil pero por favor pido puedan revisar un poco a edtalle lo que implica exportar dichos registros y sobre todo, se me hace dificil hacerlo habiendo creado los CheckBox de manera dinamica.


Espero puedan brindarme su apoyo.



Saludos