Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require('mysql_table.php');
- class PDF extends PDF_MySQL_Table
- {
- function Header()
- {
- //Title
- $this->SetFont('Arial','',18);
- $this->Cell(0,6,'Fichas Técnicas',0,1,'C');
- $this->Ln(10);
- //Ensure table header is output
- parent::Header();
- }
- }
- //Connect to database
- mysql_connect('*****','********','*******');
- mysql_select_db('******');
- $pdf=new PDF();
- $pdf->AddPage();
- //First table: put all columns automatically
- $pdf->Table('select * from fichas');
- $pdf->AddPage();
- //Second table: specify 3 columns
- $pdf->AddCol('id_ficha',15,'','ID da Ficha');
- $pdf->AddCol('avaria',60,'Avaria');
- $pdf->AddCol('id_user',15,'','ID do Cliente');
- $pdf->AddCol('observacoes',120,'Observações','R');
- $pdf->AddCol('observacoes_privadas', 120,'Observações Privadas');
- $pdf->AddCol('estado', 57, 'Estado');
- $prop=array('HeaderColor'=>array(255,150,100),
- 'color1'=>array(210,245,255),
- 'color2'=>array(255,255,210),
- 'padding'=>2);
- $pdf->Table('select * from fichas',$prop);
- $pdf->Output();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment