Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > php pdf ใส่เส้นและตัว header บางส่วนในหน้าที่ 2.....



 

php pdf ใส่เส้นและตัว header บางส่วนในหน้าที่ 2.....

 



Topic : 096720



โพสกระทู้ ( 386 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter



1111111

ต้องการใส้เส้นในบรรทัดล่างสุดที่เป็นสีแดง และตัดส่วนหัวที่กากบาทไว้ออกในหน้าที่สอง

ไม่รู้ว่าเปลี่ยนโค้ดตรงไหนบ้าง ช้วยดูไห้หน่อยได้มั้ยค่ะ บอกหลักการก้อได้



Tag : PHP, MySQL







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-06-18 15:53:29 By : PALM26 View : 1875 Reply : 1
 

 

No. 1



โพสกระทู้ ( 386 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter

Code (PHP)
<?php
require('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()
{
	include("time.php"); 
	$this->Image('image/logo.jpg',5,6,20);
	$this->AddFont('cordiab','','cordiab.php');
    $this->SetFont('cordiab','',12);
	$this->Cell(0,0,iconv( 'UTF-8','TIS-620','หน้าที่... '.$this->PageNo()),0,1,"R");
	$this->SetLeftMargin( 30 );
    $this->Cell(0,5,iconv('UTF-8','TIS-620','บจก. ตั้งใจกลการพัฒนา (ศูนย์ซ่อมบำรุง)'), 0 , 1  );
    $this->Cell(0,5,iconv('UTF-8','TIS-620','เลขที่ 62/49 ถ.วังตอ ต.ทับเที่ยง อ.เมือง จ.ตรัง 92000'), 0 , 1 );
    $this->Cell(0,5,iconv('UTF-8','TIS-620','โทรศัพท์ : 081-111-2233                                                                                                        เวลาพิมพ์ ').date('d').'/'. date('m').'/'.(  date('Y')+543 ).' '. date('H:i:s'), 0 , 1  );
	$this->line(5, 28,200,28);
	$this->SetLeftMargin( 5 );
	$this->AddFont('cordiab','','cordiab.php');
    $this->SetFont('cordiab','',18);
	$this->Ln(10);
	$this->Cell(0,5,iconv('UTF-8','TIS-620','ใบสั่งซื้อรถ'), 0 , 1 ,'C' );
	$this->Ln(34);
	$this->AddFont('cordiab','','cordiab.php');
    $this->SetFont('cordiab','',15);
	$this->Cell( 283  , -10 , iconv( 'UTF-8','cp874' , 'กำหนดส่งรถ:' ) , 0 , 1 ,'C' );
	$this->Cell( 280  , -10 , iconv( 'UTF-8','cp874' , 'วันที่ซื้อรถ :' ) , 0 , 1,'C'  );
	$this->Cell( 288  , -10 , iconv( 'UTF-8','cp874' , 'เลขที่ :') , 0 , 1,'C'  );
	
	$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
	$objDB = mysql_select_db("motor");
	$strSQL = "SELECT M.branch_no,M.date_order,E.branch_name,E.address,E.tel
				FROM po_detail B, po_mas M,branch E
				WHERE 
				B.po_id = M.po_id 		AND 
				M.branch_no = E.branch_no AND  
				B.po_id =  '".$_GET["po_id"]."'  ";
	$objQuery = mysql_query($strSQL);
	$objResult = mysql_fetch_array($objQuery);
	$branch_no = $objResult["branch_no"];
	$branch_name = $objResult["branch_name"];
	$address = $objResult["address"];
	$tel = $objResult["tel"];
	$date_order = $objResult["date_order"];
	
	$this->Ln(30);
	$this->AddFont('cordia','','cordia.php');
    $this->SetFont('cordia','',15);
	$this->Cell(  0 , -10, iconv( 'UTF-8','cp874' , $date_order ) , 0 , 1,'R'  );
	$this->Cell(  0 , -10 , iconv( 'UTF-8','cp874' , $date_order ) , 0 , 1,'R'  );
	$this->Cell(  0 , -10 , iconv( 'UTF-8','cp874' , $_GET['po_id'] ) , 0 , 1,'R' );

	$this->Ln(31);
	$this->AddFont('cordiab','','cordiab.php');
    $this->SetFont('cordiab','',15);
	$this->Cell( 70  , -10 , iconv( 'UTF-8','cp874' , 'เบอร์โทร  :' ) , 0, 1 , 'L' );
	$this->Cell( 70  , -10 , iconv( 'UTF-8','cp874' , 'ที่อยู่ :' ) , 0, 1 , 'L' );
	$this->Cell( 70  , -10 , iconv( 'UTF-8','cp874' , 'ซื้อรถจากสาขา :') , 0, 1 , 'L' );
	
	$this->AddFont('cordia','','cordia.php');
    $this->SetFont('cordia','',15);
	$this->Ln(30);
	$this->Cell( 82 , -10, iconv( 'UTF-8','cp874' , $tel ) , 0 , 1,'C'  );
	$this->Cell( 86 , -10, iconv( 'UTF-8','cp874' , $address  ) , 0 , 1,'C'  );
	$this->Cell( 140, -10, iconv( 'UTF-8','cp874' , $branch_no.'-'.$branch_name ) , 0 , 1,'C'  );
	
	//ปัดบรรทัด กำหนดความกว้างของบรรทัด 35 หน่วย
	$this->Ln(35);
	$this->AddFont('cordiab','','cordiab.php');
    $this->SetFont('cordiab','',14);
	$this->SetFillColor(224,235,255);
	$this->Cell(10,8,iconv('UTF-8','TIS-620','ลำดับ'),1,0,'C',true);
	$this->Cell(45,8,iconv('UTF-8','TIS-620','เลขเครื่อง'),1,0,'C',true); 
	$this->Cell(45,8,iconv('UTF-8','TIS-620','เลขถัง'),1,0,'C',true); 
	$this->Cell(20,8,iconv('UTF-8','TIS-620','ยี่ห้อ'),1,0,'C',true);
	$this->Cell(35,8,iconv('UTF-8','TIS-620','รุ่น'),1,0,'C',true); 
	$this->Cell(20,8,iconv('UTF-8','TIS-620','สี'),1,0,'C',true);
	$this->Cell(25,8,iconv('UTF-8','TIS-620','ราคาซื้อ(บาท)'),1,0,'C',true);
	$this->Ln();
}
}
//end class
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("motor");
$strSQL = "SELECT M.branch_no,B.chassis_id,B.machine_id,M.date_order,B.brand,C.type_name,B.color,B.color1,D.color_name,F.color_name1,B.buy,A.brand_name,E.branch_name
			FROM po_detail B, po_mas M,brand A,model C,color D,color1 F,branch E
			WHERE 
			b.po_id = m.po_id 		AND 
			a.brand_id = b.brand 	AND 
			c.type_id = b.type 		AND
			d.color_id = b.color 	AND 
			F.color_id1 = b.color1 	AND 
			M.branch_no = E.branch_no AND  
			b.po_id =  '".$_GET["po_id"]."' ";
//echo mysql_error();
$objQuery = mysql_query($strSQL);
$rows = mysql_num_rows($objQuery);
$num=1; //ลำดับที่ 123 
$i=0;
$rows=23;
$pdf=new PDF('P','mm','A4');
$pdf->AddPage();
while($objResult = mysql_fetch_array($objQuery))
{
	$i++;
	$buy = $objResult["buy"];
	$color = $objResult["color"];
	$color1 = $objResult["color1"];
	$total = $total +$buy;

$pdf->AddFont('cordia','','cordia.php');
$pdf->SetFont('cordia','',13);

$pdf->cell(10,8,$num,'L'); 
$pdf->cell(45,8,$objResult["machine_id"]); //ชื่อ
$pdf->cell(45,8,$objResult["chassis_id"]); 
$pdf->cell(20,8,iconv('UTF-8','TIS-620',$objResult["brand_name"]));
$pdf->cell(35,8,iconv('UTF-8','TIS-620', $objResult["type_name"]));
$pdf->cell(20,8,iconv('UTF-8','TIS-620',$objResult["color_name"].'-'.$objResult["color_name1"]));
$pdf->cell(25,8,number_format($buy,2),'R'); 
$pdf->Ln();
		if ($i%$rows==0){
				$pdf->AddPage();
				for($i=0;$i<count($header);$i++)
				$pdf->Cell($w[$i],7,iconv('UTF-8', 'TIS-620', $header[$i]));
				$i=0;
				$rows=23;
				
			}
		$num++; 
} 
$pdf->AddFont('cordia','B','cordia.php');
$pdf->SetFont('cordia','B',12);
$pdf->Cell(80,0,iconv( 'UTF-8','TIS-620','__________________________________'),0,1,"C");
$pdf->Cell(320,0,iconv( 'UTF-8','TIS-620','__________________________________'),0,1,"C");
$pdf->Ln(16);
$pdf->Cell(320,0,iconv( 'UTF-8','TIS-620','คู่ค้า'),0,1,"C");
$pdf->Cell(80,0,iconv( 'UTF-8','TIS-620','ฝ่ายจัดซื้อ'),0,1,"C");

$pdf->Output("report_po.pdf","F");
?>








แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-06-18 15:53:53 By : PALM26
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : php pdf ใส่เส้นและตัว header บางส่วนในหน้าที่ 2.....
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 00
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่