|
 |
|
จะให้ปรากฎข้อความด้านล่างสุดของรายงานค่ะ ยังทำไม่ได้เลย..... |
|
 |
|
|
 |
 |
|
Code (PHP)
<?
require('thaipdfclass.php');
require ("../connect.php");
$pdf=new ThaiPDF();
$pdf->SetThaiFont();
$pdf->SetHeader('' , 1, 'R', 1);
$pdf->SetFont('FreesiaUPC','');
$pdf->SetTextColor(0,0,0);
$pdf->SetFooter(0,10,'Time '. date('d').'/'. date('m').'/'.( date('Y')+543 ).' '. date('H:i:s') ,0,0,'R');
$pdf->SetFooter(0,0,iconv( 'UTF-8','TIS-620','งานแนะแนว'),0,1,"L");
$pdf->AddPage();
$pdf->Cell(10);
$pdf->Image('logo.jpg',94,15,20);
$pdf->Ln(28);
$pdf->SetFont('FreesiaUPC','B',14);
$pdf->SetTextColor(0,0,0);
$pdf->Cell(0,0,'รายชื่อนักศึกษาที่ขอกู้'.' '.'ปีการศึกษา'.' '.$_POST['yearloan'].' '.'ภาคเรียนที่'.' '.$_POST['termloan'],0,1,'C');
$pdf->Ln(5);
$pdf->SetFont('FreesiaUPC','B',14);
$pdf->SetTextColor(0,0,0);
//$pdf->Cell(0,0,'' ,0,1,'L');
$pdf->Cell(0,0,'คณะ'.' '.iconv('UTF-8','CP874',$_POST['faculty']),0,1,'C');
$pdf->Ln(10);
$pdf->SetFont('FreesiaUPC','B',12);
//$pdf->SetFillColor(200,220,255);
$pdf->Cell(7,5,'ที่',1,0,'C');
$pdf->Cell(20,5,'รหัสนักศึกษา',1,0,'C');
$pdf->Cell(60,5,'ชื่อ - นามสกุล',1,0,'C');
$pdf->Cell(50,5,'ชั้นปีที่',1,0,'C');
$pdf->Cell(55,5,'โปรแกรม',1,0,'C');
$pdf->Ln(5);
//connect DB comv
$SQL = "select LOANS.\"year_edu\",LOANS.\"term\",STUDENT.\"student_id\",STUDENT.\"prefix\", STUDENT.\"name_stud\",STUDENT.\"surname_stud\",STUDENT.\"program_name\",STUDENT.\"faculty_name\" from student,loans where LOANS.\"student_id\"=STUDENT.\"student_id\" and LOANS.\"year_edu\"='".$_POST['yearloan']."' and LOANS.\"term\"='".$_POST['termloan']."' and STUDENT.\"faculty_name\"='".$_POST['faculty']."' ORDER BY STUDENT.\"faculty_name\",STUDENT.\"program_name\" ";
$stmt=oci_parse($objConnect,$SQL);
oci_execute($stmt,OCI_DEFAULT);
// row of data Table
while($row = oci_fetch_array($stmt,OCI_BOTH))
{
$pdf->SetFont('FreesiaUPC','',12);
$pdf->Cell(7,5,++$i . '.',1,0,'C');
$pdf->Cell(20,5,$row['student_id'],1,0,'C');
$pdf->Cell(60,5,iconv('UTF-8','CP874',$row['prefix'].$row['name_stud'].' '.$row['surname_stud']),1,0,'L');
$pdf->Cell(50,5,iconv('UTF-8','CP874',),1,0,'L');
$pdf->Cell(55,5,iconv('UTF-8','CP874',$row['program_name']),1,0,'L');
$pdf->Ln();
}
$pdf->Ln(10);
$pdf->SetFont('','',10);
$pdf->SetTextColor(0,0,0);
//$pdf->Cell(0,0,'' ,0,1,'L');
$pdf->Ln();
$pdf->Output();
?>
อยากให้ด้านล่างสุดของรายงาน มีวันที่และ คำว่า งานแนะแนว หนู SetFooter แล้วตามโค้ดด้านบนแต่ไม่ปรากฎค่ะ
หนูเคยโพสถามเเล้วค่ะ https://www.thaicreate.com/php/forum/076766.html
พี่เขาเเนะนำตามลิงค์ https://www.thaicreate.com/community/php-pdf-fpdf-header-footer.html นี้เเล้ว
แต่หนูยังทำไม่ได้ค่ะ รบกวนช่วยดูโค้ดที่หนูโพสด้านบนด้วยค่ะว่าจะทำยังไงให้ปรากฎ วันที่ และ งานแนะแนว ที่ด้านล่างสุดของรายงาน
Tag : PHP, Oracle

|
|
 |
 |
 |
 |
Date :
2012-04-08 11:42:44 |
By :
banana_bnn |
View :
922 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คุณคงจะต้อง Apply เอาเองน่ะครับ โดยใช้การปรับแต่งบนและรันทดสอบดูผลลัพธ์เรื่อย ๆ ครับ
|
 |
 |
 |
 |
Date :
2012-04-08 20:35:50 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|