Foros del Web » Programando para Internet » PHP »

PHP OO Inmovilizar pananeles en php

Estas en el tema de Inmovilizar pananeles en php en el foro de PHP en Foros del Web. hola amigos del foro me podrian ayudar, tengo un problema estoy intentando inmovilizar panales como en excel en php ya, les paso el codigo que ...
  #1 (permalink)  
Antiguo 23/12/2010, 11:54
 
Fecha de Ingreso: septiembre-2010
Mensajes: 10
Antigüedad: 13 años, 7 meses
Puntos: 0
Exclamación Inmovilizar pananeles en php

hola amigos del foro me podrian ayudar, tengo un problema estoy intentando inmovilizar panales como en excel en php ya, les paso el codigo que estoy utilizando,

$consulta = "SELECT Part_0.PartNum, Part_0.PartDescription, Part_0.ProdCode, Forecast_0.PartNum, SUM(Forecast_0.ForeQty) AS ForeQty
FROM MFGSYS.PUB.Forecast Forecast_0, MFGSYS.PUB.Part Part_0
WHERE Forecast_0.PartNum = Part_0.PartNum
AND Forecast_0.Company = Part_0.Company AND ((Forecast_0.ForeDate BETWEEN '".$anoinicial."-".$mesini."-".$diaini."' AND '".$anofinal."-".$mesfin."-".$diafin."')) AND ProdCode NOT IN ('', 'AAPLIQUE', 'AFLUORES','AINDUST','AJARDIN','APROYEC','APUBVIAL ','APURBANO','ASUMERG','CONNECT')
GROUP BY Part_0.PartNum, Part_0.PartDescription, Part_0.ProdCode, Forecast_0.PartNum
order by ProdCode Asc";
$result = odbc_exec($db,$consulta);
if (!$result) {
exit("Error en la consulta");
} else {


print" <style type='text/css'>
<!--
.Estilo3 {
font-size: 12px;
font-weight: bold;
color: #000000;
font-family: Arial;
}
.Estilo4 {font-size: 10px}
.Estilo5 {font-size: 10px; font-weight: bold; color: #000000; font-family: Arial; }
body,td,th {
color: #FFF;
}
-->
</style>
<table height='165' border=1 align=center bgcolor=scrollbar>
<td width='1000' height='400'>

<table id='encabezado' border=1 cellspacing=0 cellpadding=2 bgcolor=#cccccc>
<tr>


</tr>
<tr>
<td width='85' height='17' bgcolor='#003366'><div align='center' class='Estilo4'>Numero de parte</div></td>
<td width='107' bgcolor='#003366'><div align='center' class='Estilo4'>Descripci&oacute;n</div></td>
<td width='40' bgcolor='#003366'><div align='center' class='Estilo4'>Linea</div></td>
<td width='80' bgcolor='#003366'><div align='center' class='Estilo4'>Serie</div></td>
<td width='80' bgcolor='#003366'><div align='center' class='Estilo4'>Familia</div></td>

</tr>
</table>
<div style='overflow:auto; height:400px; padding:0'>
";


while ($valor = odbc_fetch_array($result)) {
$PartNum = $valor['PartNum'];
$PartDescription = $valor['PartDescription'];

print "
<table border=1 cellspacing=0 cellpadding=2 id='datos' bgcolor=white>
<tr>
<td width='85' height='21' bgcolor='#66CC99'><div align='center' class='Estilo5'>$PartNum </div></td>
<td width='107' bordercolor='#FFFFFF' bgcolor='#66CC99'><div align='center' class='Estilo3 Estilo4'>$PartDescription</div>
<td width='40' bordercolor='#FFFFFF' bgcolor='#66CC99'><div align='center' class='Estilo3 Estilo4'></div>
<td width='80' bordercolor='#FFFFFF' bgcolor='#66CC99'><div align='center' class='Estilo3 Estilo4'></div>
<td width='80' bordercolor='#FFFFFF' bgcolor='#66CC99'><div align='center' class='Estilo3 Estilo4'></div></td>
</tr>
</table>

</div>

</td>
</table>

lo que pasa que cuando cunsulto la tabla nada mas me inprime una solo vez dentro del <div style='overflow:auto; height:400px; padding:0'>

y los demas me los esta poniendo fuera del div me podrian ayudar amigos se los agradecere.
  #2 (permalink)  
Antiguo 23/12/2010, 12:10
 
Fecha de Ingreso: febrero-2010
Mensajes: 818
Antigüedad: 14 años, 2 meses
Puntos: 55
Respuesta: Inmovilizar pananeles en php

eso lo haces con css.

tienes que dejar el div y el table para abrir y cerrar fuera del while
  #3 (permalink)  
Antiguo 23/12/2010, 12:15
 
Fecha de Ingreso: septiembre-2010
Mensajes: 10
Antigüedad: 13 años, 7 meses
Puntos: 0
Respuesta: Inmovilizar pananeles en php

No te entiendo como hacer eso de dejar el div y table para abrir y cerrar dentro del while
me podrias explicar porfavor

te lo agradecere.
  #4 (permalink)  
Antiguo 23/12/2010, 12:17
 
Fecha de Ingreso: septiembre-2010
Mensajes: 10
Antigüedad: 13 años, 7 meses
Puntos: 0
Respuesta: Inmovilizar pananeles en php

[IMG]C:\Documents and Settings\juanmorales\Mis documentos\Mis imágenes\ima3.png[/IMG]

no entiendo como es eso de de dejar el DIV y el TABLE para abrir y cerrar fuera del while
  #5 (permalink)  
Antiguo 23/12/2010, 12:21
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: Inmovilizar pananeles en php

Cita:
Iniciado por juanmh Ver Mensaje
[IMG]C:\Documents and Settings\juanmorales\Mis documentos\Mis imágenes\ima3.png[/IMG]

no entiendo como es eso de de dejar el DIV y el TABLE para abrir y cerrar fuera del while
Código PHP:
// aqui es fuera
echo '<table>';

while (
/* ... */)
{
  
// aqui es dentro del while... 
}

// aqui es fuera
echo '</table>'
creo que un poco de sentido común ayuda mucho... y de paso, te invito a leer lo siguiente:
http://www.forosdelweb.com/f18/aport...tablas-618528/

PDTA: si quieres mostrar imágenes primero debes subirlas a Internet, no puedes cargar imágenes locales...
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #6 (permalink)  
Antiguo 23/12/2010, 12:21
 
Fecha de Ingreso: septiembre-2010
Mensajes: 10
Antigüedad: 13 años, 7 meses
Puntos: 0
Respuesta: Inmovilizar pananeles en php

ok ya enetendi a si es como funciona les paso el codigo para lo que tengan el mismo problema


<?

$consulta = "SELECT Part_0.PartNum, Part_0.PartDescription, Part_0.ProdCode, Forecast_0.PartNum, SUM(Forecast_0.ForeQty) AS ForeQty
FROM MFGSYS.PUB.Forecast Forecast_0, MFGSYS.PUB.Part Part_0
WHERE Forecast_0.PartNum = Part_0.PartNum
AND Forecast_0.Company = Part_0.Company AND ((Forecast_0.ForeDate BETWEEN '".$anoinicial."-".$mesini."-".$diaini."' AND '".$anofinal."-".$mesfin."-".$diafin."')) AND ProdCode NOT IN ('', 'AAPLIQUE', 'AFLUORES','AINDUST','AJARDIN','APROYEC','APUBVIAL ','APURBANO','ASUMERG','CONNECT')
GROUP BY Part_0.PartNum, Part_0.PartDescription, Part_0.ProdCode, Forecast_0.PartNum
order by ProdCode Asc";
$result = odbc_exec($db,$consulta);
if (!$result) {
exit("Error en la consulta");
} else {


print" <style type='text/css'>
<!--
.Estilo3 {
font-size: 12px;
font-weight: bold;
color: #000000;
font-family: Arial;
}
.Estilo4 {font-size: 10px}
.Estilo5 {font-size: 10px; font-weight: bold; color: #000000; font-family: Arial; }
body,td,th {
color: #FFF;
}
-->
</style>
<table height='165' border=1 align=center bgcolor=scrollbar>
<td width='1000' height='400'>

<table id='encabezado' border=1 cellspacing=0 cellpadding=2 bgcolor=#cccccc>
<tr>


</tr>
<tr>
<td width='85' height='17' bgcolor='#003366'><div align='center' class='Estilo4'>Numero de parte</div></td>
<td width='107' bgcolor='#003366'><div align='center' class='Estilo4'>Descripci&oacute;n</div></td>
<td width='40' bgcolor='#003366'><div align='center' class='Estilo4'>Linea</div></td>
<td width='80' bgcolor='#003366'><div align='center' class='Estilo4'>Serie</div></td>
<td width='80' bgcolor='#003366'><div align='center' class='Estilo4'>Familia</div></td>

</tr>
</table>
<div style='overflow:auto; height:400px; padding:0'>
";


while ($valor = odbc_fetch_array($result)) {
$PartNum = $valor['PartNum'];
$PartDescription = $valor['PartDescription'];

print "
<table border=1 cellspacing=0 cellpadding=2 id='datos' bgcolor=white>
<tr>
<td width='85' height='21' bgcolor='#66CC99'><div align='center' class='Estilo5'>$PartNum </div></td>
<td width='107' bordercolor='#FFFFFF' bgcolor='#66CC99'><div align='center' class='Estilo3 Estilo4'>$PartDescription</div>
<td width='40' bordercolor='#FFFFFF' bgcolor='#66CC99'><div align='center' class='Estilo3 Estilo4'></div>
<td width='80' bordercolor='#FFFFFF' bgcolor='#66CC99'><div align='center' class='Estilo3 Estilo4'></div>
<td width='80' bordercolor='#FFFFFF' bgcolor='#66CC99'><div align='center' class='Estilo3 Estilo4'></div></td>
</tr>
</table>
";
}
odbc_close($db);
print "</div>

</td>
</table>";
}

Etiquetas: Ninguno
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:45.