|
 |
|
FPDF พึ่งโหลดมา พอเอาใช้แล้วมันขึ้น error แบบนี้น่ะครับ |
|
 |
|
|
 |
 |
|
Code (PHP)
<?php
require("./FPDF/ThaiPDF.class.php");
$pdf = new ThaiPDF();
$pdf->AddThaiFont("cordia");
$pdf->AddPage();
$pdf->SetFont("cordia", '', 16);
$conn = @mysql_connect("localhost","root","") or die ("<center><h1>Connection Error...</h1></center></body></html>");
mysql_query("SET CHARACTER SET utf8;");
mysql_query("SET NAMES UTF8",$conn);
$sqlselect = mysql_select_db("cutemons_MooDB");
if(!$sqlselect){
echo ("ไม่มีฐานข้อมูลนี้");
}
$receipt_id = $_GET['receipt'];
$search_receipt = "SELECT `receipt`.`receipt_ID` , `sec`.`Sec_ID` , `course`.`Course_ID` , `course`.`Course_Name` , `tutor`.`Tutor_Name` , `sec`.`Sec_Time` , `sec`.`Sec_Price` , `regist`.`Regist_Name` , `regist`.`school` , `regist`.`Date`
FROM sec, course, regist, receipt, tutor
WHERE `receipt`.`Receipt_ID` = '$receipt_id'
AND `receipt`.`Sec_ID` = `sec`.`Sec_ID`
AND `sec`.`Course_ID` = `course`.`Course_ID`
AND `receipt`.`Sec_ID` = `regist`.`Sec_ID`
AND `course`.`Tutor_ID` = `tutor`.`Tutor_ID`
GROUP BY `receipt`.`receipt_ID`";
$receipt_qry = mysql_query($search_receipt);
if(!$receipt_qry){
echo("ใบลงทะเบียนผิดพลาด");
}
if(!$data = mysql_fetch_row($receipt_qry)) {
echo ("การดึงข้อมูลผิดพลาด");
}
$html = "
<center><strong><u>ใบแจ้งชำระค่าลงทะเบียนเรียน<u></strong></center><br/><br/>
ใบแจ้งชำระเลขที่ : <b>$data[0]</b> <br/>
<i><u>รายละเอียดการลงทะเบียน<u><i> <br/>
<pre>
รหัสคอร์ส : $data[1] รหัสวิชา : $data[2]<br/>
ชื่อวิชา : $data[3] ผู้สอน : $data[4]<br/>
เวลาเรียน : $data[5]<br/>
<p/>
ชื่อผู้เรียน : $data[7]<br/>
โรงเรียน : $data[8]<br/>
ลงทะเบียนเวลา : $data[9]<br/><br/>
ค่าลงทะเบียน : $data[6]<br/>
$pdf->WriteHTML($html);
$pdf->Output();
?>
code php ที่เขียนเป็นแบบนี้ครับ
|
 |
 |
 |
 |
Date :
2011-01-19 00:44:55 |
By :
moo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<p/>
ชื่อผู้เรียน : $data[7]<br/>
โรงเรียน : $data[8]<br/>
ลงทะเบียนเวลา : $data[9]<br/><br/>
ค่าลงทะเบียน : $data[6]<br/>";
$pdf->WriteHTML($html);
$pdf->Output();
?>
แก้ไข้นิดครับ
|
 |
 |
 |
 |
Date :
2011-01-19 00:45:52 |
By :
moo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|