|
|
ตามหัวข้อเลยคะ จะต้องแก้ตรงไหนคะ
ตาม code php ด้านล่างนี้ตัว setY จะเซทได้แค่หน้าแรกคะ หน้าที่ 2 มันเซทไม่ได้ ต้องทำยังไงคะ
Code (PHP)
function BasicTable($header,$pagemoney)
{
$this->SetY(101);
}
code ทั้งหมดของหน้าแบบฟอร์มคะ และส่วนของ fpdf.php ต้องแก้ตรงไหนบ้างคะ
Code (PHP)
<? include("connect.php");?>
<html>
<head>
<title>PDF_Money</title>
<meta charset="utf-8">
</head>
<body>
<?php
function DateDiff($strDate1,$strDate2)
{
return (strtotime($strDate2) - strtotime($strDate1))/ ( 60 * 60 * 24 ); // 1 day = 60*60*24
}
function TimeDiff($strTime1,$strTime2)
{
return (strtotime($strTime2) - strtotime($strTime1))/ ( 60 * 60 ); // 1 Hour = 60*60
}
function DateTimeDiff($strDateTime1,$strDateTime2)
{
return (strtotime($strDateTime2) - strtotime($strDateTime1))/ ( 60 * 60 ); // 1 Hour = 60*60
}
require('fpdf_money.php');
class PDF extends FPDF
{
function Header(){
//$this->Image('thaicreate-logo.jpg',87,0,40);
$this->AddFont('angsa','','angsa.php');
$this->SetFont('angsa','',22);
$this->Cell(0,10,iconv( 'UTF-8','TIS-620','แบบประเมิณการทำงาน'),0,1,"C");
$this->Cell(0,10,iconv( 'UTF-8','TIS-620','ของพนักงานแผนก IT Programmer'),0,1,"C");
$this->Ln(8);
$this->SetFont('angsa','',16);
$strSQL_1 = "SELECT * FROM user WHERE Username = '".$_SESSION['Username']."' ";
$objQuery_1 = mysql_query($strSQL_1) or die(mysql_error());
$objResult_1 = mysql_fetch_array($objQuery_1);
$this->Cell(0,0,iconv( 'UTF-8','TIS-620','แบบประเมิณการทำงานพนักงาน บริษัท ธเนศพัฒนา แผนก IT Programmer '),0,1,"L");
$this->Ln(10);
$this->Cell(0,0,iconv( 'UTF-8','TIS-620',' หมายเลข 5 หมายถึง ดีมาก'),0,1,"L");
$this->Ln(8);
$this->Cell(0,0,iconv( 'UTF-8','TIS-620',' หมายเลข 4 หมายถึง ดี'),0,1,"L");
$this->Ln(8);
$this->Cell(0,0,iconv( 'UTF-8','TIS-620',' หมายเลข 3 หมายถึง พอใช้'),0,1,"L");
$this->Ln(8);
$this->Cell(0,0,iconv( 'UTF-8','TIS-620',' หมายเลข 2 หมายถึง ควรปรับปรุง'),0,1,"L");
$this->Ln(8);
$this->Cell(0,0,iconv( 'UTF-8','TIS-620',' หมายเลข 1 หมายถึง แย่'),0,1,"L");
$this->Ln(8);
$this->Cell(0,0,iconv( 'UTF-8','TIS-620','รายชื่อผู้เข้าปฏิบัติงาน : .............................................................................................................................................'),0,1,"L");
$this->Ln(8);
$this->Cell(0,0,iconv( 'UTF-8','TIS-620','หมายเหตุ. : การประเมิณนี้จะเป็นการดีสำหรับการปรับปรุงตัวของพนักงาน'),0,1,"L");
$this->Ln(5);
//$this->Cell(95,7,'ความเห็นในประเด็นต่างๆ',1,0,'C');
//$header=array('ความเห็นในประเด็นต่างๆ','5','4','3','2','1','ข้อเสนอแนะ');
$this->Cell(95,7,iconv( 'UTF-8','TIS-620','ความเห็นในประเด็นต่างๆ'),1,0,'C');
$this->Cell(9,7,iconv( 'UTF-8','TIS-620','5'),1,0,'C');
$this->Cell(9,7,iconv( 'UTF-8','TIS-620','4'),1,0,'C');
$this->Cell(9,7,iconv( 'UTF-8','TIS-620','3 '),1,0,'C');
$this->Cell(9,7,iconv( 'UTF-8','TIS-620','2'),1,0,'C');
$this->Cell(9,7,iconv( 'UTF-8','TIS-620','1'),1,0,'C');
$this->Cell(50,7,iconv( 'UTF-8','TIS-620','ข้อเสนอแนะ'),1,0,'C');
//------------------------------------------------------
//------------------------------------------------------
}
//Simple table
function BasicTable($header,$pagemoney)
{
$this->SetY(101);
//Header
$w=array(95,9,9,9,9,9,50);
//Header
for($i=0;$i<count($header);$i++)
//$this->Cell($w[$i],7,$header[$i],1,0,'C');
$this->Cell($w[$i],7,iconv('UTF-8', 'TIS-620', $header[$i]),1,0,'C');
$this->Ln();
$this->Cell(190,9,iconv( 'UTF-8','TIS-620','1. การตรงต่อเวลา'),1,0,'L');
$this->Ln();
$this->Cell(95,9,iconv( 'UTF-8','TIS-620',' 1.1 เข้าปฎิบัติงานตรงตามเวลาที่กำหนดหรือไม่'),1,0,'L');
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(50,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Ln();
$this->Cell(95,9,iconv( 'UTF-8','TIS-620',' 1.2 ส่งมอบงานที่รับรับมาตรงตามเวลาหรือไม่'),1,0,'L');
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(50,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Ln();
$this->Cell(95,9,iconv( 'UTF-8','TIS-620',' 1.3 มีการตามงานหรืออัพเดทโปรแกรมอย่างต่อเนื่องหรือไม่'),1,0,'L');
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(50,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Ln();
$this->Cell(190,9,iconv( 'UTF-8','TIS-620','2. การติดต่อสื่อสาร'),1,0,'L');
$this->Ln();
$this->Cell(95,9,iconv( 'UTF-8','TIS-620',' 2.1 การติดต่อสื่อสาร/การเข้าใจในเนื้องานที่ได้ติดต่อกันไว้'),1,0,'L');
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(50,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Ln();
$this->Cell(190,9,iconv( 'UTF-8','TIS-620','3. ตัวโปรแกรม'),1,0,'L');
$this->Ln();
$this->Cell(95,9,iconv( 'UTF-8','TIS-620',' 3.1 โปรแกรมที่ใช้งานสามารถใช้งานได้ดีหรือไม่'),1,0,'L');
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(50,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Ln();
$this->Cell(95,9,iconv( 'UTF-8','TIS-620',' 3.2 โปรแกรมที่ใช้งานมีปัญหาหรือไม่'),1,0,'L');
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(50,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Ln();
$this->Cell(95,9,iconv( 'UTF-8','TIS-620',' 3.3 การสาธิตการใช้งานเครื่อง/โปรแกรม'),1,0,'L');
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(50,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Ln();
$this->Cell(95,9,iconv( 'UTF-8','TIS-620',' 3.4 มีความพร้อมในการปฎิบัติงานหรือไม่'),1,0,'L');
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(50,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Ln();
$this->Cell(190,9,iconv( 'UTF-8','TIS-620','4. ความรับผิดชอบ'),1,0,'L');
$this->Ln();
$this->Cell(95,9,iconv( 'UTF-8','TIS-620',' 4.1 มีความเป็นทีมขณะปฎิบัติงานหรือไม่'),1,0,'L');
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(50,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Ln();
$this->Cell(95,9,iconv( 'UTF-8','TIS-620',' 4.2 มีการแบ่งงาน/แบ่งหน้าที่ ขณะปฏิบัติงานหรือไม่'),1,0,'L');
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(50,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Ln();
$this->Cell(95,9,iconv( 'UTF-8','TIS-620',' 4.3 การแก้ไขปัญหาต่างๆ'),1,0,'L');
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(50,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Ln();
$this->Cell(95,9,iconv( 'UTF-8','TIS-620',' 4.4 มีความสนใจต่องานที่ทำหรือไม่'),1,0,'L');
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(50,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Ln();
$this->Cell(95,9,iconv( 'UTF-8','TIS-620',' 4.5 มีความชำนาญในงานที่ทำหรือไม่'),1,0,'L');
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(50,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Ln();
$this->Cell(190,9,iconv( 'UTF-8','TIS-620','5. บุคลิกภาพ'),1,0,'L');
$this->Ln();
$this->Cell(95,9,iconv( 'UTF-8','TIS-620',' 5.1 การแต่งกายมีความเรียบร้อยหรือไม่'),1,0,'L');
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(50,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Ln();
$this->Cell(190,9,iconv( 'UTF-8','TIS-620','6. อื่นๆ'),1,0,'L');
$this->Ln();
$this->Cell(95,9,iconv( 'UTF-8','TIS-620',' 6.1 '),1,0,'L');
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(9,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Cell(50,9,iconv( 'UTF-8','TIS-620',''),1);
$this->Ln();
$this->Ln(5);
//---------------------------------------------------------------------------------------------------------
return $SUM_ALL;
}// END function BasicTable
}
$pdf=new PDF();
//$pdf=new FPDF( 'P' , 'mm' , array( 100,200 ) );
$pdf->AddFont('angsa','','angsa.php');
$pdf->SetFont('angsa','',16);
//Column titles
//$header=array('ความเห็นในประเด็นต่างๆ','5','4','3','2','1','ข้อเสนอแนะ');
//Data loading
include("connect.php");
//*** Load MySQL Data ***//
//$_SESSION["ID_Plan"] = 15;
//************************//
$pdf->SetFont('angsa','',16);
//*** Table 1 ***//
$pdf->AddPage();
$pdf->AddFont('angsa','','angsa.php');
$pdf->BasicTable($header);
$pdf->Ln(70);
$pdf->SetFont('angsa','',16);
$pdf->Output("MyPDF/MyPDF_Money.pdf","F");
echo "
<script language='javascript'>
window.location='MyPDF/MyPDF_Money.pdf';
</script>";
?>
</body>
</html>
หน้า แรก
หน้าที่ 2
Tag : PHP
|
ประวัติการแก้ไข 2014-03-05 09:03:02 2014-03-05 09:07:24
|
|
|
|
|
Date :
2014-03-05 09:00:35 |
By :
nunidnaja |
View :
890 |
Reply :
0 |
|
|
|
|
|
|
|
|
|