<?php
session_start();
$date1=$_GET[date1];
$date2=$_GET[date2];
$id_type=$_GET[id_type];
require('./PDF/fpdf.php');
define('FPDF_FONTPATH','font/');
class PDF extends FPDF
{
function change_date($val){
if($val == "" || $val == "dete1"){
$val = "date2";
}else{
$exdate = strtotime($value, 1198494000);
$val = date("Y-m-d", $exdate);
}
return $val;
}
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->Ln(3);
$this->Cell(90,11,iconv( 'UTF-8','cp874' , 'วันที่ไถ่ถอน :' ),0,0,'C');
$this->Cell(-30,11,iconv('UTF-8','TIS-620', $_GET["date1"]),0,0,'C');
$this->Cell(90,11,iconv( 'UTF-8','cp874' , 'ถึงวันที่ :' ),0,0,'C');
$this->Cell(-30,11,iconv('UTF-8','TIS-620', $_GET["date2"]),0,0,'C');
//ปัดบรรทัด กำหนดความกว้างของบรรทัด 35 หน่วย
$this->Ln(16);
$this->AddFont('cordiab','','cordiab.php');
$this->SetFont('cordiab','',14);
$this->Cell(9,7,iconv('UTF-8','TIS-620','ลำดับ'),1,0,'C');
$this->Cell(20,7,iconv('UTF-8','TIS-620','วันที่ขายฝาก'),1,0,'C');
$this->Cell(23,7,iconv('UTF-8','TIS-620','เลขใบขายฝาก'),1,0,'C');
$this->Cell(38,7,iconv('UTF-8','TIS-620','ชื่อ - นามสกุล'),1,0,'C');
$this->Cell(25,7,iconv('UTF-8','TIS-620','ประเภทสินค้า'),1,0,'C');
$this->Cell(12,7,iconv('UTF-8','TIS-620','น้ำหนัก'),1,0,'C');
$this->Cell(15,7,iconv('UTF-8','TIS-620','ราคา'),1,0,'C');
$this->Cell(12,7,iconv('UTF-8','TIS-620','จำนวน'),1,0,'C');
$this->Cell(15,7,iconv('UTF-8','TIS-620','ราคารวม'),1,0,'C');
$this->Cell(20,7,iconv('UTF-8','TIS-620','วันที่ไถ่ถอน'),1,0,'C');
$this->Ln();
}
function Footer()
{
$this->SetLineWidth(0.5);
$this->SetY(-15);
$this->Ln(5);
//พิมพ์วัน-เวลา ตรงมุมขวาล่าง
$this->Cell(0,0,iconv('UTF-8','TIS-620','เวลาพิมพ์ :: '). date('d').'/'. date('m').'/'.( date('Y')+543 ).' ');
}
}
//end class