<?php
require('./PDF/fpdf.php');
define('FPDF_FONTPATH','font/');
class PDF extends FPDF
{
function LoadData($file)
{
//Read file lines
$lines=file($file);
$data=array();
foreach($lines as $line)
$data[]=explode(';',chop($line));
return $data;
}
function Header()
{
$this->AddFont('cordiab','','cordiab.php');
$this->SetFont('cordiab','',17);
$this->Cell(0,10,iconv('UTF-8','TIS-620','ห้างทอง'),0,1,'C');
$this->Cell(0,10,iconv('UTF-8','TIS-620','เลขที่ อ.นิคมพัฒนา จระยอง 21180'),0,1,'C');
$this->Cell(0,10,iconv('UTF-8','TIS-620','โทรศัพท์ :8'),0,1,'C');
$this->Cell(0,10,iconv('UTF-8','TIS-620','ใบขายฝาก'),0,1,'C');
$this->Ln(34);
$this->AddFont('cordiab','','cordiab.php');
$this->SetFont('cordiab','',15);
//ปัดบรรทัด กำหนดความกว้างของบรรทัด 35 หน่วย
$this->Ln();
}
function Footer()
{
$this->SetLineWidth(0.5);
$this->AddFont('cordia','B','cordia.php');
$this->SetFont('cordia','B',12);
//นับจากขอบกระดาษด้านล่างขึ้นมา 15 มม.
$this->SetY(-15);
$this->Cell(0,0,iconv( 'UTF-8','TIS-620',''),1,0,"C");
//นับจากขอบกระดาษด้านล่างขึ้นมา 10 มม.
$this->SetY(-15);
$this->Ln(5);
//พิมพ์วัน-เวลา ตรงมุมขวาล่าง
$this->Cell(0,0,iconv('UTF-8','TIS-620','เวลาพิมพ์ :: '). date('d').'/'. date('m').'/'.( date('Y')+543 ).' ',0,0,'R');
}
}
//end class
$pdf=new PDF('P','mm','A4');
$pdf->AliasNbPages();//จำนวนหน้าทั้งหมด
$pdf->AddPage();
$id_dep = $_GET['id_dep'];
include "config.inc.php";
$strSQL = "SELECT bill_deposit.*,deposit.*,member.*,type.* FROM bill_deposit,deposit,member,type WHERE deposit.id_dep = '$id_dep' AND bill_deposit.id_dep = deposit.id_dep AND bill_deposit.id_mem = member.id_mem AND deposit.id_type = type.id_type " ;
//echo mysql_error();
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
$pdf->Cell( 283 , -10 , iconv( 'UTF-8','cp874' , $branch_no ) , 0 , 1 ,'C' );
$pdf->Cell( 270 , -10 , iconv( 'UTF-8','cp874' , 'วันที่ขายฝาก :' ) , 0 , 1,'C' );
$pdf->Cell( 270 , -10 , iconv( 'UTF-8','cp874' , 'เบอร์โทร :' ) , 0, 1 , 'C' );
$pdf->Ln(31);
$pdf->Cell( 70 , -10 , iconv( 'UTF-8','cp874' , 'ประเภททรัพย์ :' ) , 0, 1 , 'L' );
$pdf->Cell( 70 , -10 , iconv( 'UTF-8','cp874' , 'ที่อยู่ :' ) , 0, 1 , 'L' );
$pdf->Cell( 70 , -10 , iconv( 'UTF-8','cp874' , 'ชื่อผู้ขายฝาก :') , 0, 1 , 'L' );
$pdf->Cell( 70 , -10 , iconv( 'UTF-8','cp874' , 'เลขใบขายฝาก :') , 0 , 1,'L' );
$pdf->Output();
?>