Viewing file: v_repRis111.php (10.07 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
define('FPDF_FONTPATH',$this->config->item('path_application').'/font/');
class PDF extends FPDF {
var $cfgClgLogo;
var $cfgClgName;
var $cfgSiteName;
//Page header
function Header() {
//Logo
//AngsanaNew bold 15
//Move to the right
$this->SetY(10);
$this->SetX(30);
//Title
//$this->Cell(0,0,$this->cfgClgName,0,0,'L');
$this->SetX(-10);
$this->SetFontSize(12);
$this->Cell(0,0,'RIS103',0,0,'R');
/*
$this->Ln(7);
$this->SetX(30);
$this->SetFontSize(15);
//$this->Cell(0,0,$this->cfgSiteName,0,0,'L');
//Draw line
$this->SetLineWidth(0.4);
$this->Line(10,22,286,22);
*/
}
//Page footer
function Footer() {
/*
//Position at 3.0 cm from bottom
$this->SetLineWidth(0.4);
$this->Line(10,196,286,196);
$this->SetY(-10);
$this->SetFont('AngsanaNew','',14);
//Page number
// $this->Cell(0,0,'หน้า '.$this->PageNo().'/{nb}',0,0,'R');
$this->SetY(-10);
$this->Cell(0,0,'วันที่พิมพ์ : '.date("d/m/y H:i"),0,0,'L');
*/
}
} //End class
//Create new pdf file
$pdf=new PDF();
$pdf->Output();
/*define('FPDF_FONTPATH',$this->config->item('path_application').'/font/');
class PDF extends FPDF {
var $cfgClgLogo;
var $cfgClgName;
var $cfgSiteName;
//Page header
function Header()
{
//Logo
$this->Image($this->cfgClgLogo,10,3,18,15);
//AngsanaNew bold 15
$this->SetFont('AngsanaNew','B',15);
//Move to the right
$this->SetY(7);
$this->SetX(30);
//Title
$this->Cell(0,0,$this->cfgClgName,0,0,'L');
$this->SetX(-10);
$this->SetFontSize(12);
$this->Cell(0,0,'RIS111',0,0,'R');
$this->Ln(7);
$this->SetX(30);
$this->SetFontSize(15);
$this->Cell(0,0,$this->cfgSiteName,0,0,'L');
//Draw line
$this->SetLineWidth(0.4);
$this->Line(10,19,200,19);
}
//Page footer
function Footer()
{
//Position at 3.0 cm from bottom
$this->SetLineWidth(0.4);
$this->Line(10,286,200,286);
//Arial italic 8
$this->SetY(-7);
$this->SetFont('AngsanaNew','',14);
//Page number
$this->Cell(0,0,'หน้า '.$this->PageNo().'/{nb}',0,0,'R');
$this->SetY(-7);
//$this->Cell(10);
$this->Cell(0,0,'วันที่พิมพ์ : '.date("d/m/y H:i"),0,0,'L');
}
}
//Connect to your database
//Create new pdf file
$pdf=new PDF('L');
$pdf->cfgClgLogo = "images/".$this->config->item("rg_folder").$cfgClgLogo;
$pdf->cfgClgName = iconv('UTF-8','TIS-620',$cfgClgName);
$pdf->cfgSiteName = iconv('UTF-8','TIS-620',$cfgSiteName);
//Set thai font
$pdf->SetThaiFont();
$pdf->AliasNbPages();
//Open file
$pdf->Open();
//Disable automatic page break
$pdf->SetAutoPageBreak(false);
//Add first page
$pdf->AddPage();
//Set initial x position of table
$x_axis_initial = 10;
//Set Row Height
$row_height = 6;
$pdf->SetFont('AngsanaNew','B',18);
$pdf->SetX(105);
$pdf->SetY(24);
$pdf->Cell(0,0,'ใบสรุปผลการเรียนนักศึกษาจำแนกตามรายวิชา',0,0,'C');
$pdf->Ln(7);
$pdf->SetFontSize(16);
$pdf->Cell(25,0,'รายวิชา',0,0,'L');
$pdf->Cell(120,0,//$oCo->courseCode.' '.$oCo->courseName,0,0,'L');
$pdf->Cell(18,0,'หน่วยกิต',0,0,'L');
$pdf->Cell(0,0,//$oCo->courseUnit,0,0,'L');
$pdf->Ln(7);
$pdf->Cell(25,0,'หลักสูตร',0,0,'L');
$pgNamesArr = explode(', ', $pgNames);
//for($j=0; $j<count($pgNamesArr); $j++) {
// if($j != 0) {
// $pdf->Ln(7);
// $pdf->SetX(35);
// }
// $pdf->Cell(120,0,$pgNamesArr[$j],0,0,'L');
}
$pdf->SetY(38);
$pdf->SetX(155);
$pdf->Cell(18,0,'ระดับ',0,0,'L');
$pdf->Cell(0,0,//$oLv->levelName,0,0,'L');
//$pdf->SetY(38 + (7 * count($pgNamesArr)));
$pdf->Cell(25,0,'ภาคการศึกษาที่',0,0,'L');
//$pdf->Cell(120,0,$semester,0,0,'L');
$pdf->Cell(18,0,'ปีการศึกษา',0,0,'L');
//$pdf->Cell(0,0,$acadYear,0,0,'L');
$pdf->Ln(7);
$pdf->Cell(25,0,'อาจารย์ผู้สอน',0,0,'L');
//$pdf->Cell(0,0,$officerNames,0,0,'L');
//Set initial y axis position per page
//$y_axis_initial = 50 + (7 * count($pgNamesArr));
//print column titles for the actual page
$pdf->SetFillColor(232,232,232);
$pdf->SetFontSize(14);
$pdf->SetY($y_axis_initial);
$pdf->Cell(10,6,'ที่',1,0,'C',1);
$pdf->Cell(20,6,'รหัสนักศึกษา',1,0,'C',1);
$pdf->Cell(90,6,'ชื่อ-สกุล',1,0,'C',1);
$pdf->Cell(20,6,'เกรด',1,0,'C',1);
$pdf->Cell(50,6,'หมายเหตุ',1,0,'C',1);
$y_axis = $y_axis_initial + $row_height;
//initialize counter
$i = 0;
$r = 1;
//Set maximum rows per page
$max = 35 - count($pgNamesArr) + 1;
$oEi->RSEnrollItemByClIdAndStudying($classId);
while($oEi->GetRecord()) {
if($i == $max) {
$i = 0;
$pdf->AddPage();
$pdf->SetFont('AngsanaNew','B',18);
$pdf->SetX(105);
$pdf->SetY(24);
$pdf->Cell(0,0,'ใบสรุปผลการเรียนนักศึกษาจำแนกตามรายวิชา',0,0,'C');
$pdf->Ln(7);
$pdf->SetFontSize(16);
$pdf->Cell(25,0,'รายวิชา',0,0,'L');
$pdf->Cell(120,0,//$oCo->courseCode.' '.$oCo->courseName,0,0,'L');
$pdf->Cell(18,0,'หน่วยกิต',0,0,'L');
$pdf->Cell(0,0,//$oCo->courseUnit,0,0,'L');
$pdf->Ln(7);
$pdf->Cell(25,0,'หลักสูตร',0,0,'L');
//$pgNamesArr = explode(', ', $pgNames);
//for($j=0; $j<count($pgNamesArr); $j++) {
if($j != 0) {
$pdf->Ln(7);
$pdf->SetX(35);
}
//$pdf->Cell(120,0,$pgNamesArr[$j],0,0,'L');
}
$pdf->SetY(38);
$pdf->SetX(155);
$pdf->Cell(18,0,'ระดับ',0,0,'L');
$pdf->Cell(0,0,//$oLv->levelName,0,0,'L');
//$pdf->SetY(38 + (7 * count($pgNamesArr)));
$pdf->Cell(25,0,'ภาคการศึกษาที่',0,0,'L');
$pdf->Cell(120,0,//$semester,0,0,'L');
$pdf->Cell(18,0,'ปีการศึกษา',0,0,'L');
//$pdf->Cell(0,0,$acadYear,0,0,'L');
$pdf->Ln(7);
$pdf->Cell(25,0,'อาจารย์ผู้สอน',0,0,'L');
//$pdf->Cell(0,0,$officerNames,0,0,'L');
//print column titles for the current page
$pdf->SetFillColor(232,232,232);
$pdf->SetFontSize(14);
$pdf->SetY($y_axis_initial);
$pdf->Cell(10,6,'ที่',1,0,'C',1);
$pdf->Cell(20,6,'รหัสนักศึกษา',1,0,'C',1);
$pdf->Cell(90,6,'ชื่อ-สกุล',1,0,'C',1);
$pdf->Cell(20,6,'เกรด',1,0,'C',1);
$pdf->Cell(50,6,'หมายเหตุ',1,0,'C',1);
//Go to next row
$y_axis = $y_axis_initial + $row_height;
}
//$oSm->SearchByKey($oEi->studentId);
//$oSm->GetRecord();
//$oPf->SearchByKey($oSm->prefixId);
//$oPf->GetRecord();
$pdf->SetFont('AngsanaNew','',14);
$pdf->SetY($y_axis);
$pdf->Cell(10,6,$r,1,0,'C');
$pdf->Cell(20,6,//$oSm->studentCode,1,0,'C');
$pdf->Cell(90,6,//$oPf->prefixName.$oSm->studentName.' '.$oSm->studentSurname,1,0,'L');
//if($oCl->sendGradeStatus == 'Y')
// $pdf->Cell(20,6,$oEi->grade,1,0,'C');
//else
$pdf->Cell(20,6,'',1,0,'C');
$pdf->Cell(50,6,'',1,0,'C');
//Go to next row
$y_axis = $y_axis + $row_height;
$i = $i + 1;
$r = $r + 1;
} //End while
if($i > ($max-8)) {
$i = 0;
$pdf->AddPage();
$pdf->SetFont('AngsanaNew','B',18);
$pdf->SetX(105);
$pdf->SetY(24);
$pdf->Cell(0,0,'ใบสรุปผลการเรียนนักศึกษาจำแนกตามรายวิชา',0,0,'C');
$pdf->Ln(7);
$pdf->SetFontSize(16);
$pdf->Cell(25,0,'รายวิชา',0,0,'L');
//$pdf->Cell(120,0,$oCo->courseCode.' '.$oCo->courseName,0,0,'L');
$pdf->Cell(18,0,'หน่วยกิต',0,0,'L');
//$pdf->Cell(0,0,$oCo->courseUnit,0,0,'L');
$pdf->Ln(7);
$pdf->Cell(25,0,'หลักสูตร',0,0,'L');
//$pgNamesArr = explode(', ', $pgNames);
//for($j=0; $j<count($pgNamesArr); $j++) {
// if($j != 0) {
// $pdf->Ln(7);
// $pdf->SetX(35);
// }
// $pdf->Cell(120,0,$pgNamesArr[$j],0,0,'L');
//}
$pdf->SetY(38);
$pdf->SetX(155);
$pdf->Cell(18,0,'ระดับ',0,0,'L');
$pdf->Cell(0,0,//$oLv->levelName,0,0,'L');
//$pdf->SetY(38 + (7 * count($pgNamesArr)));
$pdf->Cell(25,0,'ภาคการศึกษาที่',0,0,'L');
$pdf->Cell(120,0,//$semester,0,0,'L');
$pdf->Cell(18,0,'ปีการศึกษา',0,0,'L');
$pdf->Cell(0,0,//$acadYear,0,0,'L');
$pdf->Ln(7);
$pdf->Cell(25,0,'อาจารย์ผู้สอน',0,0,'L');
$pdf->Cell(0,0,$officerNames,0,0,'L');
//print column titles for the current page
$pdf->SetFillColor(232,232,232);
$pdf->SetFontSize(14);
$pdf->SetY($y_axis_initial);
$pdf->Cell(10,6,'ที่',1,0,'C',1);
$pdf->Cell(20,6,'รหัสนักศึกษา',1,0,'C',1);
$pdf->Cell(90,6,'ชื่อ-สกุล',1,0,'C',1);
$pdf->Cell(20,6,'เกรด',1,0,'C',1);
$pdf->Cell(50,6,'หมายเหตุ',1,0,'C',1);
//Go to next row
$y_axis = $y_axis_initial + $row_height;
}
$y_axis = $y_axis + $row_height;
$pdf->SetFont('AngsanaNew','',14);
$pdf->SetY($y_axis);
$pdf->Cell(0,0,'สรุป',0,0,'L');
$y_axis = $y_axis + $row_height;
$i = 0;
$oGc->RSGradeConfig();
while($oGc->GetRecord()) {
if(($i%5) == 0) {
$pdf->SetY($y_axis);
$y_axis = $y_axis + $row_height;
$x_axis = $x_axis_initial;
}
$pdf->SetX($x_axis);
$pdf->Cell(5,0,$oGc->grade,0,0,'L');
if($oCl->sendGradeStatus == 'Y')
//$pdf->Cell(34,0,' จำนวน '.$oEi->RSEnrollItemCountStIdByGrade($classId, $acadYear, $semester, $oGc->grade).' คน',0,0,'L');
else
$pdf->Cell(34,0,' จำนวน 0 คน',0,0,'L');
$x_axis = $x_axis + 39;
$i++;
}
$y_axis = $y_axis + $row_height;
//$oOf->SearchByKey($oCl->officerId);
//$oOf->GetRecord();
//$oPf->SearchByKey($oOf->prefixId);
//$oPf->GetRecord();
$pdf->SetY($y_axis);
$pdf->Cell(0,0,'ผู้รับผิดชอบวิชา..................................................',0,0,'C');
$y_axis = $y_axis + $row_height;
$pdf->SetY($y_axis);
//$pdf->Cell(0,0,'('.$oPf->prefixName.$oOf->officerName.' '.$oOf->officerSurname.')',0,0,'C');
//Create file
$pdf->Output(); */
?>
|