<?php
include('mysqli_table.php');
class PDF extends PDF_mysqli_Table
{
function Header()
{
	//Title
	$this->SetFont('Arial','',18);
	$this->Cell(0,8,'World populations',0,1,'C');
	$this->Ln(10);
	//Ensure table header is output
	parent::Header();
}
}

//Connect to database
include("../opendb.php");

$pdf=new PDF();
$pdf->AddPage();
//First table: put all columns automatically
$pdf->Table('select empcode,brcode,empname,br from empmaster where br="CALICUT" order by empname desc');
$pdf->AddPage();
//Second table: specify 3 columns

$prop=array('HeaderColor'=>array(255,150,100),
			'color1'=>array(210,245,255),
			'color2'=>array(255,255,210),
			'padding'=>2);
$pdf->Table('select brcode, brname, brpass from branch order by brname limit 0,10',$prop);
$pdf->Output();
?>
