Foros del Web » Programando para Internet » PHP »

problemas con fpdf

Estas en el tema de problemas con fpdf en el foro de PHP en Foros del Web. Buenas, hace tiempo que trabajo con fpdf, para genar pdf's desde una consulta a la BD (postgresql) hata ahora todo bien, pro los problemas empezaron ...
  #1 (permalink)  
Antiguo 28/10/2005, 07:08
Avatar de polaya  
Fecha de Ingreso: diciembre-2004
Ubicación: Chile
Mensajes: 191
Antigüedad: 19 años, 3 meses
Puntos: 0
Pregunta problemas con fpdf

Buenas, hace tiempo que trabajo con fpdf, para genar pdf's desde una consulta a la BD (postgresql) hata ahora todo bien, pro los problemas empezaron cuando debia intercalar codigo propio de fpdf con codigo necesario para obtener los resultados de la consulta...alguien sabe que pasa????. Intente agregar el codigo en este mensaje pero el sistema me bota a cada rato y me pide ingresar nuevamente como usuario...
Cualquier ayuda se agradece.
__________________
La vida da muchas vueltas...debe ser por eso que uno se marea.
  #2 (permalink)  
Antiguo 28/10/2005, 09:35
Avatar de davidangel  
Fecha de Ingreso: abril-2005
Mensajes: 124
Antigüedad: 18 años, 11 meses
Puntos: 0
si creo q ahora han puesto un limite a la session pero demasiado corta

y seria mejor q pases tu codigo para poderte ayudar

saludos
__________________
Angel de Madrid
-------------------------------------------------
guarda tus favoritos http://markerbox.com (no requiere correo) :arriba:
  #3 (permalink)  
Antiguo 28/10/2005, 10:00
Avatar de polaya  
Fecha de Ingreso: diciembre-2004
Ubicación: Chile
Mensajes: 191
Antigüedad: 19 años, 3 meses
Puntos: 0
ahi va el codigo, es bastante largo pero tiene que ir completo

Código PHP:
$pdf=new FPDF('L','cm','legal');

    
$pdf->SetMargins(1,1,1);

    
$pdf->AddPage('L');

    
$pdf->SetFont('Arial','',10);

    
$pdf->SetFillColor(200);

    
$pdf->Cell(23,1,'Digital Documents',0,0,'L'); 

    
$pdf->Cell(8,1,"Direct Image 2.5",0,0,'R');

    
$pdf->Ln(1);

    
$pdf->Cell(31,1,'PLANILLA RESULTADO BUSQUEDA',0,0,'C'); 

    
$pdf->Ln(1);

    
$pdf->Cell(10,0.5,"Cliente",1,0,'C',1);

    
$pdf->Cell(9,0.5,"Departamento",1,0,'C',1);
    
$pdf->Cell(9,0.5,"Doc. Buscado",1,0,'C',1);
    
$pdf->Cell(3,0.5,"Encontrados",1,0,'C',1);
    
$pdf->Ln();

    
$pdf->Cell(10,1,"$cliente",1,0,'C');

    
$pdf->Cell(9,1,"$iddepto",1,0,'C');
    
$pdf->Cell(9,1,"$idtipo",1,0,'C');
    
$pdf->Cell(3,1,"$bus",1,0,'C');
    
$pdf->Ln(1.5); 
    
$cont=0;
    
    foreach (
$bus as $indice=>$valor)

    { 

        
$dato."=>".$indice.""

        if (!empty(
$valor))
        {
            
$SQLcona="SELECT * FROM adoc where estado='1' and tipodoc='$idtipo' and nombre='$indice' and valor like '%$valor%'";
            
$cona pg_query($IdConexion,$SQLcona);
            While(
$regi=pg_fetch_array($cona))

            {
                
$id_bus[]="$regi[documento]";
            }
            
$cont++;
            
$cua=0;$valida=0;            
            foreach (
$id_bus as $indice=>$valor)

               {
                
$cua++;
                if(
$year!='' and $mes!='' and $cajab==''){$SQLsina="SELECT * FROM documento where estado='1' and cliente='$idcliente' and tipo='$idtipo' and iddocumento='$valor' and year='$year' and mes='$mes' order by caja,year,mesn";}
                if(
$year!='' and $mes=='' and $cajab==''){$SQLsina="SELECT * FROM documento where estado='1' and cliente='$idcliente' and tipo='$idtipo' and iddocumento='$valor' and year='$year' order by caja,mesn";}

                if(
$year=='' and $mes!='' and $cajab==''){$SQLsina="SELECT * FROM documento where estado='1' and cliente='$idcliente' and tipo='$idtipo' and iddocumento='$valor' and mes='$mes' order by caja,year";}
                if(
$year=='' and $mes=='' and $cajab==''){$SQLsina="SELECT * FROM documento where estado='1' and cliente='$idcliente' and tipo='$idtipo' and iddocumento='$valor' order by caja,year,mesn";}

                if(
$year!='' and $mes!='' and $cajab!=''){$SQLsina="SELECT * FROM documento where estado='1' and cliente='$idcliente' and tipo='$idtipo' and iddocumento='$valor' and caja='$cajab' and year='$year' and mes='$mes' order by caja,year,mesn";}
                if(
$year!='' and $mes=='' and $cajab!=''){$SQLsina="SELECT * FROM documento where estado='1' and cliente='$idcliente' and tipo='$idtipo' and iddocumento='$valor' and caja='$cajab' and year='$year' order by caja,year,mesn";}

                if(
$year=='' and $mes!='' and $cajab!=''){$SQLsina="SELECT * FROM documento where estado='1' and cliente='$idcliente' and tipo='$idtipo' and iddocumento='$valor' and caja='$cajab' and mes='$mes' order by caja,year,mesn";}
                if(
$year=='' and $mes=='' and $cajab!=''){$SQLsina="SELECT * FROM documento where estado='1' and cliente='$idcliente' and tipo='$idtipo' and iddocumento='$valor' and caja='$cajab' order by caja,year,mesn";}
                
$sina pg_query($IdConexion,$SQLsina) or die(pg_error());

                
$NFilasd pg_num_rows($sina);
                if(
$NFilasd==0)

                {

                     
$valida++;
                    if(
$cua==$valida)
                    {
                        
//echo "<tr bgcolor='ffffff' align='center'><td><font face='Arial, Helvetica, sans-serif' size='2'><b>No posee $nomtipo asociados</b></td></tr>";
                        //die();

                    
}
                }

                else

                {

                    
$yeare=date("Y");$mese=date("m");
                    
$SQLres="SELECT * FROM atipo where  estado='1' and documento='$tipodoc'";

                    
$res pg_query($IdConexion,$SQLres) or die(pg_error());
                    
$Encontro pg_num_rows($res);
                    if(
$cua==1)
                    {
                        
$pdf->Cell(7,0.5,'Tipo',1,0,'C',1);

                        
$pdf->Cell(4,0.5,'Caja',1,0,'C',1);
                        
$pdf->Cell(5,0.5,'Periodo',1,0,'C',1);

                        
$pdf->Cell(5,0.5,'Sub-Periodo',1,0,'C',1);

                        
$pdf->Cell(3,0.5,'Año',1,0,'C',1);

                        
$pdf->Cell(4,0.5,'Expira',1,0,'C',1);
                        
$pdf->Cell(3,0.5,'Hojas',1,0,'C',1);
                        if(
$Encontro!=0)
                        {
                            if (
$repg_fetch_array($res))

                            {

                                DO

                                {

                                    
$pdf->Cell(5,0.5,'$re[nombre]',1,0,'C',1);
                                }

                                WHILE (
$re=pg_fetch_array($res));
                            }    

                        }
                    }
                    
$pdf->Ln();
                    While(
$row=pg_fetch_array($sina))
                    {
                        
$pdf->Cell(7,0.5,"$row[tipo]",1,0,'L');
                        
$pdf->Cell(4,0.5,"$row[caja]",1,0,'C');

                        
$pdf->Cell(5,0.5,"$row[periodo]",1,0,'C');

                        if(
"$row[mes]"=='No Figura'){$mes='-';}else{$mes="$row[mes]";}

                        
$pdf->Cell(5,0.5,"$mes",1,0,'C');

                        
$pdf->Cell(3,0.5,"$row[year]",1,0,'C');
                        if(
"$row[expira]"==0){$expira='Indef.';}else{$expira="$row[expira]";}

                        
$pdf->Cell(4,0.5,"$expira",1,0,'C');

                        
$pdf->Cell(3,0.5,"$row[hojas]",1,0,'C');
                        
$sqlad="SELECT * FROM adoc where documento='$row[iddocumento]'";

                        
$res=pg_query($IdConexion,$sqlad);
                        
$Encontro pg_num_rows($res);
                        if(
$Encontro==2)
                        {
                            if (
$repg_fetch_array($res))

                            {

                                DO

                                {

                                    
$pdf->Cell(4,0.5,"$re[valor]",1,0,'L');
                                }

                                WHILE (
$re=pg_fetch_array($res));
                            }

                        }
                        if(
$Encontro==1)
                        {
                            if (
$repg_fetch_array($res))

                            {

                                DO

                                {

                                    
$pdf->Cell(4,0.5,"$re[valor]",1,0,'L');
                                    
$pdf->Cell(4,0.5,"",1,0,'L');
                                }

                                WHILE (
$re=pg_fetch_array($res));
                            }

                        }
                        if(
$Encontro==0)
                        {
                            
$pdf->Cell(8,0.5,"-",1,0,'C');
                        }
                        
$pdf->Ln();
                    }

                }
            }
        } 
    }
    

    
$pdf->Ln();

    
$pdf->Cell(8,0.5,"Fecha",1,0,'C',1);
    
$pdf->Cell(8,0.5,"Hora",1,0,'C',1);

    
$pdf->Cell(15,0.5,"Responsable",1,0,'C',1);

    
$pdf->Ln();

    
$pdf->Cell(8,1,"$fecha",1,0,'C');
    
$pdf->Cell(8,1,"$hora",1,0,'C');

    
$pdf->Cell(15,1,"$user",1,0,'C');

    
$pdf->Output(); 
Listo...gracias
__________________
La vida da muchas vueltas...debe ser por eso que uno se marea.
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 06:15.