why can not I get the values from one page to another in php?

0

Good afternoon I have a query:

I have passed values by parameter href from one page to another .. but I can not get them I think I'm doing everything right. Please check to see what's wrong.

I realize that I can not get it because when I want to put it in the title 'REPORTE DE GUIA'.$cid I do not see anything just the REPORTE DE GUIA

<?php 
require('fpdf.php'); 
$cid = $_GET['id'];
$guia = $_GET['guia'];
$serie = $_GET['nserie'];
//$id = 'hshsashsh';

class PDF extends FPDF 
{ 
  public $sucursal; 
  public $f_ini; 
  public $f_fin; 

  //Cabecera de página 


    function Header() 
    { 

       $this->Rect(1,1,213,31); 
       $this->Rect(1,31,213,1,'DF'); 
        //Logo 
       // $this->Image('../css/images/Logog.jpg',13,2,25,27); 
        //Arial bold 15 
        $this->SetFont('Arial','B',14); 
        //Movernos a la derecha 
        $this->Cell(30); 
        //Título 
        $this->Cell(170,4,$cid,0,0,'C'); 
        $this->Ln(2); 
        $this->SetFont('Arial','B',10); 
        $this->Cell(36);  
        $this->MultiCell(170,5,'REPORTE DE GUIA'**.$cid**); 
        //$this->SetFont('Arial','',6); 

        $this->SetFont('Arial','',7); 
        $this->Line(1,32,214,32); 

        $this->Text(12,36,'SERIE.'); 
        $this->Text(22,36,'ORDEN'); 
        $this->Text(35,36,'CLIENTE'); 
        $this->Text(95,36,'CANTIDAD');      
        $this->Text(120,36,'FECHA VENCIMIENTO');    
        $this->Line(1,38,214,38); 
        $this->Line(1,39,214,39); 
        //Salto de línea 
        $this->Ln(10); 
        $this->SetY(45);



    }


    //Pie de página 
    function Footer() 
    { 

      //Posición: a 1,5 cm del final 
        $this->SetY(-15); 
        //Arial italic 8 
        $this->SetFont('Arial','I',7); 
        //Número de página 
        $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C'); 
      $fecha= date("Y-m-d"); 
       $hora=date("H:i:s"); 
      $this->Line(1,266,214,266); 
      $this->Line(1,273,214,273); 
      $fecha= date("Y-m-d"); 
       $hora=date("H:i:s"); 
       $this->Text(10,270.5,$fecha); 
        $this->Text(30,270.5,$hora); 
        $this->Text(148,270.5,$this->f_ini); 
        $this->Text(180,270.5,$this->f_fin); 
    } 

    function __construct() 
    {        
        //Llama al constructor de su clase Padre. 
        //Modificar aka segun la forma del papel del reporte 
        parent::__construct('P','mm','Letter'); 
    } 
} 

    //Creación del objeto de la clase heredada 
    $pdf=new PDF(); 
    $pdf->SetTopMargin(5.4); 
    $pdf->SetLeftMargin(4.5);     
    $pdf->AliasNbPages(); 
    $pdf->SetFont('Times','',7); 

$cadconex="dbname=basenex host=192.168.1.10 port=5432 user=postgres password=abc123"; 
$conexion = pg_connect($cadconex); 



        $cadbusca = "select
det.serie as serie,
det.orden as orden,
 max( cli.cliente) as cliente,
CAST(count(*) as integer) as cantidad,
max(ord.fechavencimiento) as fechavencimiento,
det.estadoveri as tpguia,
case when det.estadoveri='MA' then 'DOCUMENTOS MASIVO' when det.estadoveri='CO' then 'DOCUMENTOS COURIER' end destpguia
from despacho des
left outer join detdespacho det on des.serieguia=det.serieguia and des.nroguia = det.nroguia
left outer join personal per on per.codigopersonal=des.codmensajero
left outer join t_empresa emp on emp.codempresa=per.codempresa
left outer join ordenes ord on ord.serie=det.serie and ord.orden = det.orden
left outer join cliente cli on cli.codcliente=ord.codcliente
left outer join sedesprov sede on sede.codsede=des.codsede
where des.serieguia='001' and des.nroguia='761171'
group by det.serie,det.orden,det.estadoveri
order by det.estadoveri,det.serie,det.orden"; 

            $result=pg_query($cadbusca) or die('La consulta fallo: ' . pg_last_error()); 


    $pdf->AddPage();     

         while($row = pg_fetch_array($result)) 
        { 
          $serie = $row["serie"];             
          $orden = $row["orden"]; 
          $cliente = $row["cliente"]; 
          $cantidad = $row["cantidad"]; 
          $fechavencimiento = $row["fechavencimiento"]; 


          $pdf->Text(13,$pdf->GetY(),$serie); 
          $pdf->Text(22,$pdf->GetY(),$orden); 
          $pdf->Text(35,$pdf->GetY(),$cliente); 
          $pdf->Text(100,$pdf->GetY(),$cantidad); 
          $pdf->Text(120,$pdf->GetY(),$fechavencimiento);  
          $pdf->cell(0,5.5,'',0,1); 

        } 

$pdf->Output();

?>
    
asked by ingswsm 06.12.2016 в 22:10
source

1 answer

0

You are declaring a class and within it are not defended the variables that are at the beginning I recommend you read the official documentation link

an example of what you should do seriously

<?php

class calculadoraEuro{

public $dolar_euro;

// el constructor tiene que ser un metodo publico
public function __construct(){
    $this->dolar_euro = 0.74;
    echo 'El valor del euro es: '. $this->dolar_euro;
}

  public function dolaresEuros( $dolares){
    return $dolares.' dolares son '. ($dolares * $this->dolar_euro) .' euros';  
 }
}
$calculadora = new calculadoraEuro(); 
echo $calculadora->dolaresEuros(5);
 ?>

If you have more questions go to link

    
answered by 06.12.2016 в 22:35