Viewing file:      v_rptRis305.php (6.2 KB)      -rwxr-xr-x Select action/file-type:    (+) |   (+) |   (+) | Code (+) | Session (+) |   (+) | SDB (+) |   (+) |   (+) |   (+) |   (+) |   (+) |
 
<?php
 define('FPDF_FONTPATH',$this->config->item('path_application').'/font/');
 //$this->load->library('fpdf_thai');
 
 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,'RIS999',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);
         $this->SetY(-7);
         $this->SetFont('AngsanaNew','',14);
         //Page number
         $this->Cell(0,0,'หน้า '.$this->PageNo().'/{nb}',0,0,'R');
         $this->SetY(-7);
         $this->Cell(0,0,'วันที่พิมพ์ : '.date("d/m/y H:i"),0,0,'L'); 
     }
 } //End class
 
 //Create new pdf file
 $pdf=new PDF();
 $pdf->cfgClgLogo = $this->config->item('rg_upload_picture').$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 y axis position per page
 $y_axis_initial = 40;
 
 //Set Row Height
 $row_height = 6;
 
 $pdf->SetFontSize(18);
 $pdf->Cell(105);
 $pdf->SetY(27);
 $pdf->Cell(0,0,'จำนวนนักศึกษาเต็มเวลาเทียบเท่า (FTES)',0,0,'C');
 $pdf->Ln(7);
 $pdf->SetFontSize(16);
 if($divisorType == 'S')
     $pdf->Cell(0,0,'ประจำปีการศึกษา '.$acY.'  ภาคการศึกษา '.$tmId,0,0,'C');
 else if($divisorType == 'Y')
     $pdf->Cell(0,0,'ประจำปีการศึกษา '.$acY,0,0,'C');
 
 //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(120,6,'หลักสูตร',1,0,'C',1);
 $pdf->Cell(10,6,'รุ่นที่',1,0,'C',1);
 $pdf->Cell(20,6,'SCH',1,0,'C',1);
 $pdf->Cell(30,6,'หมายเหตุ',1,0,'C',1);
 
 $y_axis = $y_axis_initial + $row_height;
 
 //initialize counter
 $i = 0;
 $r = 1;
 $sumSCH = 0;
 
 //Set maximum rows per page
 $max = 20;
 
 foreach($arr as $key => $value){
 
         //If the current row is the last one, create new page and print column title
         if ($i == $max) {
             //Set $i variable to 0 (first row)
             $i = 0;
 
             $pdf->AddPage();
 
             $pdf->SetFont('AngsanaNew','B',18);
             $pdf->Cell(105);
             $pdf->SetY(27);
             $pdf->Cell(0,0,'จำนวนนักศึกษาเต็มเวลาเทียบเท่า (FTES)',0,0,'C');
             $pdf->Ln(7);
             $pdf->SetFontSize(16);
             if($divisorType == 'S')
                 $pdf->Cell(0,0,'ประจำปีการศึกษา '.$acY.'  ภาคการศึกษา '.$tmId,0,0,'C');
             else if($divisorType == 'Y')
                 $pdf->Cell(0,0,'ประจำปีการศึกษา '.$acY,0,0,'C');
 
             //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(120,6,'หลักสูตร',1,0,'C',1);
             $pdf->Cell(10,6,'รุ่นที่',1,0,'C',1);
             $pdf->Cell(20,6,'SCH',1,0,'C',1);
             $pdf->Cell(30,6,'หมายเหตุ',1,0,'C',1);
             
             //Go to next row
             $y_axis = $y_axis_initial + $row_height;
         }
 
         $pdf->SetFont('AngsanaNew','',14);
         $pdf->SetY($y_axis);
         $pdf->Cell(10,6,$r,1,0,'C');
 
         if( strlen(iconv('UTF-8','TIS-620',$arr[$key]['curName'])) > 65){
         $pdf->SetFont('AngsanaNew','',10.5);
         }
         $pdf->Cell(120,6,iconv('UTF-8','CP874',$arr[$key]['curName']),1,0,'L');
 
         $pdf->SetFont('AngsanaNew','',14);
 
         $pdf->Cell(10,6,iconv('UTF-8','CP874',$arr[$key]['genNo']),1,0,'C');
         $pdf->Cell(20,6,number_format($arr[$key]['SCH'], 2),1,0,'R');
         $pdf->Cell(30,6,'FTES = '.number_format((($arr[$key]['SCH'])/$divisor), 2),1,0,'L');
 
         //Go to next row
         $y_axis = $y_axis + $row_height;
         $i = $i + 1;
         $r = $r + 1;
         $sumSCH += $arr[$key]['SCH'];
     }
 
         $pdf->SetFont('AngsanaNew','B',14);
         $pdf->SetY($y_axis);
         $pdf->Cell(140,6,'หน่วยกิตนักศึกษา (Student Credit Hours : SCH)',1,0,'C');
         $pdf->Cell(20,6,number_format($sumSCH, 2),1,0,'R');
         $pdf->Cell(30,6,'',1,0,'R');
         
         $y_axis = $y_axis + $row_height;
         
         $pdf->SetY($y_axis);
         $pdf->Cell(140,6,'จำนวนนักศึกษาเต็มเวลาเทียบเท่า (FTES)',1,0,'C');
         $pdf->Cell(20,6,'',1,0,'R');
         $pdf->Cell(30,6,'FTES = '.number_format($sumSCH/$divisor, 2),1,0,'L');
 
         $y_axis = $y_axis + $row_height;
         
         $pdf->SetY($y_axis + $row_height);
         $pdf->Cell(0,6,'หมายเหตุ',0,0,'L');
         $pdf->Ln(7);
         $pdf->SetFont('AngsanaNew','',14);
         $pdf->SetX(20);
         $pdf->Cell(0,6,'จำนวนนักศึกษาเต็มเวลาเทียบเท่า (Full Time Equivalent Student : FTES)',0,0,'L');
         $pdf->Ln(7);
         $pdf->SetX(20);
         $pdf->Cell(0,6,'หมายถึง จำนวนนักศึกษาที่ได้จากการลงทะเบียนในหลักสูตรต่างๆ ตามเกณฑ์มาตรฐาน',0,0,'L');
         $pdf->Ln(7);
         $pdf->SetX(20);
         $pdf->Cell(0,6,'ทบวงมหาวิทยาลัย ในที่นี้ได้กำหนดหน่วยกิตเพื่อใช้ในการคำนวณจำนวนนักศึกษาเต็มเวลา',0,0,'L');
         $pdf->Ln(7);
         $pdf->SetX(20);
         $pdf->Cell(0,6,'ในระดับปริญญาตรีในการจัดการศึกษาระบบทวิภาคดังนี้',0,0,'L');
         $pdf->Ln(7);
         $pdf->SetX(20);
         $pdf->Cell(0,6,'ระดับปริญญาตรี จำนวน 18 หน่วยกิตต่อภาคการศึกษา หรือจำนวน 36 หน่วยกิตต่อปีการศึกษา',0,0,'L');
         $pdf->Ln(7);
         $pdf->SetX(20);
         $pdf->Cell(0,6,'ใช้สูตร FTES (ปีการศึกษา) = SCH/36 หรือ FTES (ภาคการศึกษา) = SCH/18',0,0,'L');
         $pdf->Ln(7);
         $pdf->SetX(20);
         $pdf->Cell(0,6,'ในระดับประกาศนียบัตรในการจัดการศึกษาระบบทวิภาคดังนี้',0,0,'L');
         $pdf->Ln(7);
         $pdf->SetX(20);
         $pdf->Cell(0,6,'ระดับประกาศนียบัตร จำนวน 19 หน่วยกิตต่อภาคการศึกษา หรือจำนวน 38 หน่วยกิตต่อปีการศึกษา',0,0,'L');
         $pdf->Ln(7);
         $pdf->SetX(20);
         $pdf->Cell(0,6,'ใช้สูตร FTES (ปีการศึกษา) = SCH/38 หรือ FTES (ภาคการศึกษา) = SCH/19',0,0,'L');
         $pdf->Ln(7);
         $pdf->SetX(20);
         $pdf->Cell(0,6,'SCH = หน่วยกิตนักศึกษา (Student Credit Hours) : ผลรวมของผลคูณระหว่างจำนวน',0,0,'L');
         $pdf->Ln(7);
         $pdf->SetX(20);
         $pdf->Cell(0,6,'นักศึกษาที่ลงทะเบียนเรียนกับจำนวนหน่วยกิตของแต่ละรายวิชาที่เปิดสอน',0,0,'L');
 //Create file
 $pdf->Output();
 ?>
  |