I just want to add some "Approved By: _______________" and "Prepared By: ______" and so on in the bottom of the page. Don't mind the mysql_query i just want to know to position it first.
Herewith is my sample print document.
MY CODE
<?php
class PDF extends FPDF
{
function Header()
{
$this->SetFont('Helvetica','',25);
$this->SetFontSize(40);
//Move to the right
$this->Cell(80);
//Line break
$this->Ln();
}
//Page footer
function Footer()
{
}
//Load data
function LoadData($file)
{
//Read file lines
$lines=file($file);
$data=array();
foreach($lines as $line)
$data[]=explode(';',chop($line));
return $data;
}
//Simple table
function BasicTable($header,$data)
{
$this->SetFillColor(255,255,255);
//$this->SetDrawColor(255, 0, 0);
$w=array(38,21,90,7,12,7);
//Header
$this->SetFont('Arial','B',7);
for($i=0;$i<count($header);$i++)
$this->Cell($w[$i],7,$header[$i],1,0,'L',true);
$this->Ln();
//Data
$this->SetFont('Arial','',7);
foreach ($data as $eachResult)
{ //width
$this->Cell(10);
$this->Cell(38,6,$eachResult["ecr_desc"],1);
$this->Cell(21,6,$eachResult["itemcode"],1);
$this->Cell(90,6,$eachResult["ite_desc"],1);
$this->Cell(7,6,$eachResult["tqty"],1);
$this->Cell(12,6,$eachResult["icount"],1);
$this->Cell(7,6,$eachResult["total1"],1);
$this->Ln();
}
}
//Better table
}
$pdf=new PDF();
$header=array('Model','Code','Desc','XFR','ACTUAL', 'DIFF');
//************************//
//*** Table 1 ***//
$pdf->AddPage();
$pdf->SetFont('Helvetica','',14);
$pdf->Cell(75);
$pdf->Write(5, 'Stock Receiving');
$pdf->Ln();
$pdf->Cell(22);
$pdf->SetFontSize(8);
$pdf->Cell(57);
$result=mysql_query("select date_format(now(), '%W, %M %d, %Y') as date");
while( $row=mysql_fetch_array($result) )
{
$pdf->Write(5,$row['date']);
}
$pdf->Ln();
//count total numbers of visitors
$pdf->Cell(0);
$pdf->Write(3, ' REFERENCE NUMBER: '.$Rid.'');
$pdf->Ln();
$pdf->Cell(0);
$pdf->Write(2, ' DATE RECEIVED: '.$date.'');
$pdf->Ln();
$pdf->Cell(0);
$pdf->Write(2, ' TOTAL ITEM: '.$icount.'');
$pdf->Ln();
$pdf->Ln(5);
$pdf->Ln(0);
$pdf->Cell(10);
$pdf->BasicTable($header,$resultData);
//forme();
//$pdf->Output("$d.pdf","F");
$pdf->Output();
?>