 |
|

คือตอนนี้ผมสร้างฟอร์มไว้แล้วแต่อยากจะดึงฐานข้อมูลมาใส่ตามที่วงกลมเอาไว้ ปัญหาคือไม่รู้จะเริ่มต้นอย่างไร อยากให้พี่ๆช่วย ทำโค๊ดให้ดูหน่อยได้ไหมครับ สักตัวอย่างนึง ขอบคุณครับ (ผมค้นหาแล้วแต่ยังไม่เข้าใจ ไม่รู้จะเอาตรงไหนมาใส่อ่าครับ รบกวณด้วยนะครับ)
Code (PHP)
<?php
define('FPDF_FONTPATH','fonts/');
require('fpdf.php');
$pdf=new FPDF();
$pdf->AddFont('angsana','','angsa.php');
$pdf->AddPage();
$pdf->SetFont('angsana','',14);
$pdf->Image('ds.jpg',10,12,30,0,'');$pdf->Cell( 35 , 10 , '' , 1 );$pdf->Cell( 100 , 10 , ' บริษัท ขายหญ้าออนไลน์ จำกัด' , 1);$pdf->Cell( 20 , 10 , '' , 1);$pdf->Cell( 30 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 35 , 10 , '' , 0);$pdf->Cell( 100 , 10 , ' อาคารชาญอิสสระทาวเวอร์ 2 ชั้น 35 2922/333 ถนนเพชรบุรีตัดใหม่' , 1);$pdf->Cell( 20 , 10 , '' , 1);$pdf->Cell( 30 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 35 , 10 , '' , 0);$pdf->Cell( 100 , 10 , ' แขวงบางกะปิ เขตห้วยขวาง กรุงเทพฯ 10310 โทร : 02-715-4000' , 1);$pdf->Cell( 20 , 10 , '' , 1);$pdf->Cell( 30 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 35 , 10 , '' , 0);$pdf->Cell( 100 , 10 , ' ใบสั่งซื้อสินค้า' , 1);$pdf->Cell( 20 , 10 , '' , 1);$pdf->Cell( 30 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 35 , 10 , '' , 1);$pdf->Cell( 100 , 10 , '' , 1);$pdf->Cell( 20 , 10 , 'เลขที่ใบสั่งซื้อ' , 1);$pdf->Cell( 30 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 35 , 10 , '' , 1);$pdf->Cell( 100 , 10 , '' , 1);$pdf->Cell( 20 , 10 , 'วันที่เอกสาร' , 1);$pdf->Cell( 30 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 35 , 10 , 'รหัสลูกค้า' , 1);$pdf->Cell( 100 , 10 , '' , 1);$pdf->Cell( 20 , 10 , '' , 1);$pdf->Cell( 30 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 35 , 10 , 'ชื่อลูกค้า' , 1);$pdf->Cell( 100 , 10 , '' , 1);$pdf->Cell( 20 , 10 , '' , 1);$pdf->Cell( 30 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 35 , 10 , 'ที่อยู่' , 1);$pdf->Cell( 100 , 10 , '' , 1);$pdf->Cell( 20 , 10 , '' , 1);$pdf->Cell( 30 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 35 , 10 , 'โทรศัพท์' , 1);$pdf->Cell( 100 , 10 , '' , 1);$pdf->Cell( 20 , 10 , '' , 1);$pdf->Cell( 30 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 35 , 10 , '' , 1);$pdf->Cell( 100 , 10 , '' , 1);$pdf->Cell( 20 , 10 , '' , 1);$pdf->Cell( 30 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 35 , 10 , 'รหัสสินค้า' , 1);$pdf->Cell( 50 , 10 , 'รายการ' , 1);$pdf->Cell( 20 , 10 , 'ราคา/หน่วย' , 1);$pdf->Cell( 30 , 10 , 'จำนวน' , 1);$pdf->Cell( 50 , 10 , 'จำนวนเงิน' , 1);
$pdf->Ln();
$pdf->Cell( 35 , 10 , '' , 1);$pdf->Cell( 50 , 10 , '' , 1);$pdf->Cell( 20 , 10 , '' , 1);$pdf->Cell( 30 , 10 , '' , 1);$pdf->Cell( 50 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 35 , 10 , '' , 1);$pdf->Cell( 50 , 10 , '' , 1);$pdf->Cell( 20 , 10 , '' , 1);$pdf->Cell( 30 , 10 , '' , 1);$pdf->Cell( 50 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 35 , 10 , '' , 1);$pdf->Cell( 50 , 10 , '' , 1);$pdf->Cell( 20 , 10 , '' , 1);$pdf->Cell( 30 , 10 , '' , 1);$pdf->Cell( 50 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 35 , 10 , '' , 1);$pdf->Cell( 50 , 10 , '' , 1);$pdf->Cell( 20 , 10 , '' , 1);$pdf->Cell( 30 , 10 , '' , 1);$pdf->Cell( 50 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 35 , 10 , '' , 1);$pdf->Cell( 50 , 10 , '' , 1);$pdf->Cell( 20 , 10 , '' , 1);$pdf->Cell( 30 , 10 , '' , 1);$pdf->Cell( 50 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 35 , 10 , '' , 1);$pdf->Cell( 50 , 10 , '' , 1);$pdf->Cell( 20 , 10 , '' , 1);$pdf->Cell( 30 , 10 , '' , 1);$pdf->Cell( 50 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 35 , 10 , '' , 1);$pdf->Cell( 50 , 10 , '' , 1);$pdf->Cell( 20 , 10 , '' , 1);$pdf->Cell( 30 , 10 , '' , 1);$pdf->Cell( 50 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 105 , 10 , '' , 1);$pdf->Cell( 30 , 10 , 'รวมเงิน' , 1);$pdf->Cell( 50 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 105 , 10 , '' , 1);$pdf->Cell( 30 , 10 , 'ภาษีมูลค่าเพิ่ม 7%' , 1);$pdf->Cell( 50 , 10 , '' , 1);
$pdf->Ln();
$pdf->Cell( 105 , 10 , '' , 1);$pdf->Cell( 30 , 10 , 'จำนวนเงินทั้งสิ้น' , 1);$pdf->Cell( 50 , 10 , '' , 1);
$pdf->Output();
?>
PDF Created Click <a href="test.pdf">here</a> to Download
Tag : PHP, MySQL, Windows

|
|
 |
 |
 |
 |
Date :
2013-02-22 20:05:19 |
By :
เอก |
View :
1609 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |