Ver Mensaje Individual
  #6 (permalink)  
Antiguo 23/12/2010, 12:21
juanmh
 
Fecha de Ingreso: septiembre-2010
Mensajes: 10
Antigüedad: 13 años, 8 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>";
}