Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/11/2006, 20:55
Avatar de ikaroraul
ikaroraul
 
Fecha de Ingreso: octubre-2006
Ubicación: La Paz
Mensajes: 391
Antigüedad: 17 años, 7 meses
Puntos: 16
ayuda con reportes por favor!!! :(

hola que tal tengo el siguiente codigo este codigo muestra datos de dos tablas cooomo se ve en la siguiente imagen:



la idea es que esta tabla pueda imprimirse en un documento pdf como podria hacerlo? ayuda por favor
este es el codigo que tengo:
Código PHP:

<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK href="Classic.css" type=text/css rel=stylesheet>
</head>

<body>

<?
include("conexion.php");
$link=Conectarse();
$sql1=mysql_query("select * from newquim",$link);
?>


  <table width="779" align="center">
    <tr> 
      <td colspan="2" align="center"><img src="imagenes/log300.jpg" width="300" height="64"></td>
    </tr>
    <tr> 
      <td width="497" align="left"> 
        <? 
$dias 
= array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sábado");
echo 
"Hoy es ".$dias[date('w')];
echo 
date (" d ");
$mes = array("","Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
echo 
"de ".$mes[date('n')];
echo (
" de ");echo date(" Y ");
?>
      </td>
      <td width="270" align="right"><?php echo $_COOKIE['nombrev']; ?></td>
    </tr>
    <tr> 
      <td colspan="2" align="left" bgcolor="#FFFFFF"> 
                  
                <ul id="udm" class="udm">
                <li><a class="navicon nohref" id="navarrow">OPCIONES</a> 
                  <ul>
                    
                    
                        <li><a href="javascript:window.location='mosquim.php'" >Ver Lista de Quimicos </a></li>
                        <li><a href="javascript:window.location='addformula.php'" >Crear Nueva Formula para Bloques de Espuma </a></li>                   
                        <li><a href="javascript:window.location='quimedit.php'" >Listado de Formulas </a></li>
                        <li><a href="javascript:window.location='addpedido21.php'" >Realizar Pedido Bloques de Espuma</a></li>
                        <li><a href="javascript:window.location='pedprod.php'" >Listado de pedidos en produccion</a> </li>
                    <!-- <li><a href="javascript:window.location='index.html'" > Votra 
                      cosa</a> </li> -->
                  </ul>
                </li>
        </ul>
      </td>
    </tr>
    <tr>
      <td colspan="2" align="center"><hr color="#000099"></td>
    </tr>
    <tr> 
      <td colspan="2" align="center">TITULO DEL FORMULARIO</td>
    </tr>
    <tr> 
      <td colspan="2" align="center"><hr color="#000099"></td>
    </tr>
     <tr> 
      
    <td colspan="2" align="center">    </td>
    </tr>
  </table>

<form action="prueba.php" method="post">
<center><input name="nombreform" type="submit" value="Enviar pedido(s) a Produccion"></center><br><hr>

<?php 
include("conexinven.php");
$linkin=Conectarseinv();
$sqlquimicos=mysql_query("select * from newquim",$linkin);
?>
<table width="100%" align="center" border="1">
<tr class="gen">
    <td align="center">Nº</td>
    <td align="center">Densidad</td>
    <td align="center">Dimensiones</td>    
<?php
$i
=0;
while(
$col mysql_fetch_array($sqlquimicos))
{
echo 
"<td align='center'>".$col['item']."<br>".$col['tipo']."</td>";
$vecq[$i]=$col['item'];
$i=$i+1;
}
?>
    <td align="center">Guardar</td>
</tr>
<?php 
$link
=Conectarse();
$sql mysql_query("select * from pgeren where estado ='1'",$link);    
$k=1;
$ck='idcaja';
$nkck=$ck.$k;
while(
$rows mysql_fetch_array($sql))
{
$a=$rows["Id"];
echo 
"<tr class='gen'>";
echo 
"<td align='center'>1</td>";
echo 
"<td align='center'>".$rows['densidad']."</td>";
echo 
"<td align='center'>".$rows['dimensiones']."</td>";
        
$idq mysql_query("select * from quimicospg where id_quimico ='$a'",$link);    
        for(
$y=0;$y<$i;$y=$y+1)
        {
        
$vecmos[$y]='-';
        }
        while(
$rowqmysql_fetch_array($idq))
          {     
         if(
$rowq['id_quimico']==$idquimico)
         {
         
$valor='Yes';
         
$valorid=$idquimico;
         echo 
"<input type='HIDDEN' name='$nkck' value='".$rowq['Id']."'>";
         
$k=$k+1;
         
$nkck=$ck.$k;
         }
         
            for(
$j=0;$j<$i;$j=$j+1)
            {
                if(
$vecq[$j]==$rowq['item'])
                {
                
$vecmos[$j]=$rowq['Can_quimico'];
                }
             }        
         
         }
        
//echo $valor;
        
if($valor=='Yes')
        {
        
$n=0;
        
$a='caja';
        
$z=$a.$n;
            for(
$y=0;$y<$i;$y=$y+1)
            { 
                if(
$vecmos[$y]=='-')
                {
                echo 
"<td align='center'>".$vecmos[$y]."</td>";
                
$valor='No';
                }
            else
                {
                
$n=$n+1;
                
$z=$a.$n;
            
                echo 
"<td align='center'><input type='text' name='$z' value=".$vecmos[$y]." size='5'></td>";
                
$valor='No';
                }
            }
                    echo 
"<td>";?><input type="submit" name="Submit" value="Enviar"><? echo "</td>";


        }
        else
        {
            for(
$y=0;$y<$i;$y=$y+1)
            { echo 
"<td align='center'>".$vecmos[$y]."</td>";}
        
        }
        
    echo 
"</tr>";    
}
echo 
"<input type='HIDDEN' name='idpedido' value='$idquimico'>";
echo 
"<input type='HIDDEN' name='cantidadkk' value='$n'>";
?>



</table>
</form>


</body>
</html>
espero puedan ayudarme por favor!