Guest User

wegw

a guest
May 9th, 2013
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     <?php
  2.     require('mysql_table.php');
  3.  
  4.     class PDF extends PDF_MySQL_Table
  5.     {
  6.     function Header()
  7.     {
  8.     //Title
  9.     $this->SetFont('Arial','',18);
  10.     $this->Cell(0,6,'Fichas Técnicas',0,1,'C');
  11.     $this->Ln(10);
  12.     //Ensure table header is output
  13.     parent::Header();
  14.     }
  15.     }
  16.  
  17.     //Connect to database
  18.     mysql_connect('*****','********','*******');
  19.     mysql_select_db('******');
  20.  
  21.     $pdf=new PDF();
  22.     $pdf->AddPage();
  23.     //First table: put all columns automatically
  24.     $pdf->Table('select * from fichas');
  25.     $pdf->AddPage();
  26.     //Second table: specify 3 columns
  27.     $pdf->AddCol('id_ficha',15,'','ID da Ficha');
  28.     $pdf->AddCol('avaria',60,'Avaria');
  29.     $pdf->AddCol('id_user',15,'','ID do Cliente');
  30.     $pdf->AddCol('observacoes',120,'Observações','R');
  31.     $pdf->AddCol('observacoes_privadas', 120,'Observações Privadas');
  32.     $pdf->AddCol('estado', 57, 'Estado');
  33.     $prop=array('HeaderColor'=>array(255,150,100),
  34.             'color1'=>array(210,245,255),
  35.             'color2'=>array(255,255,210),
  36.             'padding'=>2);
  37.     $pdf->Table('select * from fichas',$prop);
  38.     $pdf->Output();
  39.     ?>
Advertisement
Add Comment
Please, Sign In to add comment