Ver Mensaje Individual
  #3 (permalink)  
Antiguo 28/05/2011, 11:20
Slithice
 
Fecha de Ingreso: marzo-2011
Mensajes: 33
Antigüedad: 13 años, 1 mes
Puntos: 0
Respuesta: Tablas en PHP "Dinamicas"

Esta es la tabla Principal (De toda la página web).

Código PHP:
<TABLE Width='100%' Border='1'>
    <TR valign='top' align='center'>
        <TD Colspan='3'><?include "Cabecera.php";?></TD>
    </TR>
    <TR valign='top'>
        <TD width='15%' valign='TOP' align='left'><?include "Prueba.php";?></TD>
        <TD width='70%'>
        <? 
            
if ($Cazadoras){
                include 
"Cazadoras.php";
            }
        
?>
        </TD>
        <TD width='15%' valign='TOP'>
            <?
                
include "Registro.php";
            
?>
        </TD>
    </TR>
</TABLE>
Este es un ejemplo de la celda del medio (la grande).

Tabla de Cazadoras:

Código PHP:
echo "<center><TABLE Width='20%' border='1'>";
            if (
$_SESSION){
                if (
$_SESSION['NombreSesionUsuario']=='Administrador'){
                    echo 
"<FORM Action='ModificacionDirecta.php' METHOD='POST'>";
                    echo 
"<tr>";
                        echo 
"<td rowspan='5' Width='200' Height='255'><img Width='200' src=./Imagenes/$Imagen></td>";
                        echo 
"<td Height='200' VALIGN='TOP'><font color='red'>$Nombre</font></td>";
                    echo 
"</tr>";
                    echo 
"<tr>";
                        echo 
"<td Height='20'>Código de Barras: <font color='red'>$CBA</font>";
                        echo 
"<input type='hidden' value=$CBA name='Bar'>";
                        echo 
"</td>";
                    echo 
"</tr>";
                    echo 
"<tr>";
                        echo 
"<td Height='20'>Precio: <font color='red'>$Precio €</font></td>";
                    echo 
"</tr>";
                    echo 
"<tr>";
                        echo 
"<td Height='20'>Talla: <input type='text' name='MiTalla' class='mayusculas'></td>";
                    echo 
"</tr>";
                    echo 
"<tr>";
                        echo 
"<td><input type='submit' value='Modificar artículo'</font></td>";
                    echo 
"</tr>";
                    echo 
"</FORM>";
                }else{
                    echo 
"<FORM Action='TiendaRopa.php?Barritas=$CBA' METHOD='POST'>";
                    echo 
"<tr>";
                        echo 
"<td Width='200' Height='255'><img Width='200' src=./Imagenes/$Imagen></td>";
                    echo 
"</tr>";
                    echo 
"<tr>";
                        echo 
"<td Height='20' VALIGN='TOP'><font color='red'>$Nombre</font></td>";
                    echo 
"</tr>";
                    echo 
"<tr>";
                        echo 
"<input type='hidden' value=1 name='Hombre'>";
                        echo 
"<input type='hidden' value=$CBA name='Bar'>";
                        echo 
"<td Height='20'>Precio: </font><font color='red'>$Precio €</td>";
                    echo 
"</tr>";
                    echo 
"<tr valign='bottom'>";
                        
//echo "<td><input type='submit' value='Añadir al carrito'</font></td>";
                        
echo "<td>****<input title='Comprar' alt='Comprar' Width='50' src='./Imágenes/carrito_compra.gif' type='image'/></td>";
                    echo 
"</tr>";
                    echo 
"</FORM>";
                }
            }else{
                echo 
"<tr>";
                    echo 
"<td rowspan='3' Width='200' Height='255'><img Width='200' src=./Imagenes/$Imagen></td>";
                    echo 
"<td Height='200' VALIGN='TOP'><font color='red'>$Nombre</font></td>";
                echo 
"</tr>";
                echo 
"<tr>";
                    echo 
"<td Height='20'>Precio: <font color='red'>$Precio €</font></td>";
                echo 
"</tr>";
                echo 
"<tr>";
                    echo 
"<td Height='20'><font color='green'>Debes estar registrado para poder comprar.</font></td>";
                echo 
"</tr>";
            }
        }
        echo 
"</center></TABLE>"