Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/02/2018, 12:34
pako1707
Invitado
 
Mensajes: n/a
Puntos:
Tabla responsiva.

¿Algún consejo o ayuda de cómo convertir una tabla dinámica con un WHILE
----> a algo responsivo? estoy usando bootstrap por medio de wordpress.

éste es mi code:

Código PHP:

<html>

<table>
    <tr>
        <!--<th>ID</th>-->
        <th>MOVIMIENTO</th>
        <th>FINALIZAR</th>
        <th>QUIÉN</th>
        <th>FECHA</th>
        <th>EXISTENCIA [LLA]</th>
        <th>DOC. T</th>
        <th>DOC. S</th>
        <th>CANTIDAD</th>
        <th># PARTE</th>
        <th>BO</th>
        <th>SUC</th>
        <th>FACTURA</th>
        <th>ENVIADA [FAC]</th>
        <th>MANUAL</th>
        <th>ADD MANUAL</th>
        <th>CDF</th>
        <th>NOTAS</th>
    </tr>

<?php

$sql  
= "SELECT... ";
$sqlcount = "SELECT... ";

$result  = $conn->query($sql);
$result2 = $conn->query($sqlcount);
$numero = mysqli_num_rows($result);

if (
$result->num_rows > 0) {
    
// output data of each row
        
    
while($row = $result->fetch_assoc()) {

        
"<input type='hidden' name='id[]' value=". $row["id"]."></input>";

?>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"  id="boxes">

    <tr>

        <td><?php echo $row["movimiento"] ?></td>
        
        <td><input type="hidden" name="g_check[]" value="<?php echo $row["id"] ?>" checked /> 
            
        <input type="submit" name="procesar" value="Finalizar" class="button" /></td>

        <td><a href="/members/<?php echo $row["userlog"]?>" target="_blank"><?php echo $row["userlog"] ?>             </td>
        <td><?php echo $row["fecha"] ?>             </td>
        <td><?php echo $row["existencia"] ?>        </td>
        <td><?php echo $row["documentoT"] ?>      </td>
        <td><?php echo $row["documentoS"] ?>      </td>
        <td><?php echo $row["cantidad"] ?>          </td>
        <td><?php echo $row["noparte"] ?>           </td>
        <td><?php echo $row["bo"] ?>                </td>
        <td><?php echo $row["suc"] ?>               </td>
        <td><?php echo $row["factura"] ?>           </td>
        <td><?php echo $row["facEnviada"] ?>        </td>
        <td><?php echo $row["manual"] ?>            </td>
        <td><?php echo $row["addmanual"] ?>         </td>
        <td><?php echo $row["cfd"] ?>               </td>
        <td><?php echo $row["notas"] ?>             </td>

    </tr>

</form>

<div>

<?php
}
if(isset(
$_POST['procesar'])){
$opciones = $_POST['g_check'];
 
// Con esto te imprime cuales opciones se seleccionaron 
if(empty($opciones)){
echo 
"<p>No hay opciones seleccionadas.</p>\n";
}else{
$totalSeleccionados = count($opciones);

for(
$i=0; $i < $totalSeleccionados; $i++){

echo 
"Aprobado con éxito";
//echo ("Se aprobó el: ".$opciones[$i] . " ");

    
$sqlaut = "UPDATE...";

    
$result = $conn->query($sqlaut);

$url='#';
echo 
'<meta http-equiv=refresh content="1; '.$url.'">';

}
echo 
"<p></p>";
}
 
} 
// cierre post procesar
}   

if (
$numero < 1) {
    echo 
"<center><h2>No hay pendientes.</h2></center><br/>";
}
else
{
    echo 
"<center><h2>Hay ".$numero." por finalizar.</h2></center><br/>";
}
$conn->close();



?>    
</table>

</html>
Les agradezco cualquier apoyo.