<?php
//print_r($_GET);exit;
/*
 *      PrintCetakKtmPdf.pdf.class.php
 *      Copyright 	:2009 
 *      Author 		:Lathifah R. Indrayanti <Lr.indrayanti@gmail.com> modified by M.Rifqi Ma'arif<rifqi_mrf@yahoo.com>
 *      Project      : '.strtoupper($univ_singkat).'  
 */
//define IN_CB true, dibutuhkan untuk mengakses barcode technology
define('IN_CB',true);

//including the barcode technology
require_once GTFWConfiguration::GetValue('application', 'gtfw_base').'main/lib/barcode/class/index.php';
require_once GTFWConfiguration::GetValue('application', 'gtfw_base').'main/lib/barcode/class/FColor.php';
require_once GTFWConfiguration::GetValue('application', 'gtfw_base').'main/lib/barcode/class/BarCode.php';
require_once GTFWConfiguration::GetValue('application', 'gtfw_base').'main/lib/barcode/class/FDrawing.php';
require_once GTFWConfiguration::GetValue('application', 'gtfw_base').'main/lib/barcode/class/code39.barcode.php';
require_once GTFWConfiguration::GetValue('application', 'gtfw_base').'main/lib/barcode/class/code128.barcode.php'; 
require_once GTFWConfiguration::GetValue('application', 'gtfw_base').'main/lib/fpdf/image_alpha.php';
 
require_once GTFWConfiguration::GetValue( 'application', 'docroot') . 'module/cetak_ktm/business/AppCetakKtm.class.php';
require_once GTFWConfiguration::GetValue( 'application', 'docroot') . 'module/cetak_ktm/business/AppMahasiswaSia.class.php';
require_once GTFWConfiguration::GetValue( 'application', 'docroot') .'main/function/date.php';

class PrintCetakKtmMasalPdf extends PdfResponse {
	
   function GetFileName() {
      // name it whatever you want
      return 'KtmMasal_.pdf';
   }
   
   function CreateBarcode($idMhsBarcode) {
      #Creating some Color (arguments are R, G, B)

      $color_black = new FColor(0,0,0);
      $color_white = new FColor(255,255,255);
      
      $dokObjBarcode=new AppCetakKtm();
      //$dataCetakBarcode = $dokObjBarcode->GetDataCetak($idMhsBarcode);
	  $dataCetakBarcode = $idMhsBarcode;

      #replace character
      $char = array('\\', '/', ':', '*', '?', '"', '<', '>', '|');
      $this->array_file[0] = str_replace($char, '', $dataCetakBarcode);
       
      $code_generated =& new code128(60,$color_black,$color_white,3,$dataCetakBarcode,0);
      $drawing =& new FDrawing(1024,1024,'',$color_white);
      $drawing->init(); // You must call this method to initialize the image
      $drawing->add_barcode($code_generated);
      $drawing->draw_all(); 
      $im =& $drawing->get_im();
       
      #Next line create the little picture, the barcode is being copied inside
      $im2 = imagecreate($code_generated->lastX,$code_generated->lastY);
      imagecopyresized($im2, $im, 0, 0, 0, 0, $code_generated->lastX, $code_generated->lastY, $code_generated->lastX, $code_generated->lastY);
      $drawing->set_im($im2); 
       
      imagejpeg($im2, GTFWConfiguration::GetValue('application', 'barcode_path') . $dataCetakBarcode . '.jpeg');
       
      unset($im);
      unset($im2);
      unset($drawing);
      unset($code_generated);
         
   }
   
   function ProcessRequest() {
      $tahunMasukAwal = Dispatcher::Instance()->Decrypt($_GET['tahunMasukAwal']);
      $tahunMasukAkhir = Dispatcher::Instance()->Decrypt($_GET['tahunMasukAkhir']);
      $semsMasukAwal = Dispatcher::Instance()->Decrypt($_GET['semsMasukAwal']);
      $semsMasukAkhir = Dispatcher::Instance()->Decrypt($_GET['semsMasukAkhir']);
      $notes_nim = Dispatcher::Instance()->Decrypt($_GET['notes_nim']);
      $status = Dispatcher::Instance()->Decrypt($_GET['status']);
      $prodi = Dispatcher::Instance()->Decrypt($_GET['prodi']);
      $nama = Dispatcher::Instance()->Decrypt($_GET['nama']);      
     
      return $this->PrintKtmVersiB($tahunMasukAwal,$tahunMasukAkhir,$notes_nim,$status,$prodi,$nama, $semsMasukAwal,$semsMasukAkhir);     
   }
      function PrintKtmVersiB($tahunMasukAwal,$tahunMasukAkhir,$notes_nim,$status,$prodi,$nama, $semsMasukAwal,$semsMasukAkhir){
      	$dokObj=new AppCetakKtm();
      	$dataPejabat = $dokObj->GetDataPejabat();
      	$univ=GTFWConfiguration::GetValue('organization', 'company_name');
      	$univ_singkat=GTFWConfiguration::GetValue('organization', 'company_short_name');
      	$address=GTFWConfiguration::GetValue('organization', 'company_city');
      
		#--------------count the data----------------------------------------------------------------------------------------------------------------
 		$countCetakMasal=$dokObj->GetCountDataCetakMasal($tahunMasukAwal,$tahunMasukAkhir,
                                                      $notes_nim,$status,$prodi,$nama, 
                                                      $semsMasukAwal,$semsMasukAkhir);
								  
      	$total = $countCetakMasal[0]['total'];
 
                  //print_r($countCetakMasal);
                  //exit();
		$loop = ($total / 5);		  
		$today=getdate();
		
        if ($today[mon]>6) {
        	$t=($today[year]+1);
        	$berlaku='30 September '.$t;
        	$t_back=($t % 2);
        	if($t_back== 0){
        	   $cardfront='file/images/ktm_front_2.png';
        	   $cardback='file/images/ktm_back_2.jpg';
        	}else{
        	   $cardfront='file/images/ktm_front_1.png';
        	   $cardback='file/images/ktm_back_1.jpg';
        	}
        }else{
        	$t=($today[year]);
        	$berlaku='30 September '.$t;
        	$t_back=($t % 2);
        	if($t_back== 0){
        	   $cardfront='file/images/ktm_front_2.png';
        	   $cardback='file/images/ktm_back_2.jpg';
        	}else{
        	   $cardfront='file/images/ktm_front_1.png';
        	   $cardback='file/images/ktm_back_1.jpg';
        	}     
        }               

      #----------------------Constructor---------------------------------------------------------------------------------------------------------
 
		  //$this->FPDF('p','mm','A4');
		  $pdf=new PDF_ImageAlpha();
		  $this->AddPage('p','A4');
          $this->SetAutoPageBreak(off);
          $this->SetMargins(0,0);
          $leftmargin=6;
          $leftleftmargin=105;
          $topmargin=3;
          $this->SetFont('Arial','B',6);
          
		      $data=0;
		      $lembar=1;
		      while($data<$total){
		            $leftmargin=6;
          			$leftleftmargin=105;
		          #-------------------------fetching data-----------------------------------------------------------------------------------------------------------------
      	       $dataCetakMasal=$dokObj->GetDataCetakMasal($tahunMasukAwal,$tahunMasukAkhir,
                                                            $notes_nim,$status,$prodi,$nama,
                                                            $semsMasukAwal,$semsMasukAkhir,$data,1);
		          #-------------------------fetching data-----------------------------------------------------------------------------------------------------------------                                                            
                  //print_r($dataCetakMasal[0]['NIM']);
                  //exit();

				$this->CreateBarcode($dataCetakMasal[0]['NIM']);
				$maskImg = $pdf->Image('file/images/mask2.png', 0,0,0,0, '', '', true);
				
                #Kiri
                  $this->Image($cardback,$leftmargin,$topmargin,89,0);                  
                  $this->Line($leftleftmargin, $topmargin, $leftleftmargin, $topmargin+57);
                  $idMargin=$leftleftmargin+9;
                  $this->SetXY($idMargin,$topmargin+19);
               
			  #Foto Mahasiswa
			  $this->SetX($idMargin+26);
			  $lokasi_foto=GTFWConfiguration::GetValue('application', 'photo_move_path');

			  if (empty($dataCetakMasal[0]['FOTO'])) {
			  // #nampilin kotak kosong ada tulisan foto - bila foto belum di upload
				 #$this->SetXY($leftMargin+9,$topMargin+64);
				 #$this->Cell(56, 66,'Foto','',2,'C');
				 #$this->SetFont('Arial', 'B', 6);
			  }else{
				 $foto = $lokasi_foto.$dataCetakMasal[0]['FOTO'];
				 if (file_exists($foto)) {
					 $this->Image($foto,$idMargin+6.5,$topmargin+19,20,0);
					 #$this->image($foto,$leftMargin+9,$topMargin+50,54,64);
				 }
			  }


				#kanan
				$idMargin=$leftleftmargin+9;
				$this->Image($cardfront,$idMargin,$topmargin,89,0,'','', false, $maskImg);
				$this->SetXY($idMargin,$topmargin+19);
				
				$this->SetFillColor(255,255,255);
				$this->Rect(32, $topmargin+48,38,9,'F');
				$this->SetFillColor(0,0,0);		
				
				#Blok Barcode
				$this->CreateBarcode($dataCetakMasal[0]['NIM']);
				$lokasi_barcode=GTFWConfiguration::GetValue('application', 'barcode_path');
				if (empty($dataCetakMasal[0]['NIM'])) {
					$this->Cell($cellLengthItem,5,'',0,1);
				}else{
					$barcode=$lokasi_barcode.$dataCetakMasal[0]['NIM'].'.jpeg';
					//$this->image($barcode,65,$topmargin+38,'20','10');
					$this->image($barcode,37,$topmargin+48,'28','9');
					//$this->SetFont('Arial','B',6);
					//$this->cell(10,$topmargin+27,$dataCetak[0]['NIM'],0,1);
				}                       			
                  #Baris Nama   
                  $this->SetX($idMargin+30 );
                  $this->SetFont('Arial','B',10);
                  $this->MultiCell(50, 3,$dataCetakMasal[0]['NAMA'],0,1);
                  $this->SetFont('Arial','B',6);
              
                  #Baris NIM
                  $this->SetX($idMargin+30);
                  $this->SetFont('Arial','',6);
                  $this->cell(5,3,'NIM',0,0);
                  $this->SetFont('Arial','B',10);
                  $this->cell(43,4,$dataCetakMasal[0]['NIM'],0,1);
                  $this->SetFont('Arial','B',6);

                  #Baris Program Studi  
                  $this->SetX($idMargin+30);
                  $this->SetFont('Arial','B',6);
                  $this->Multicell(50,2,'Program Studi '.ucwords(strtolower($dataCetakMasal[0]['PROGRAM_STUDI'])),0,1);
                  $this->SetFont('Arial','B',6);
            
                  #Baris Angkatan dan tahun 
                  $this->SetX($idMargin+30);
                  $this->SetFont('Arial','B',6);
                  $this->Multicell(50,2,'Jenjang '.$dataCetakMasal[0]['JENJANG'].' ('.$dataCetakMasal[0]['JENJANGKODE'].')'.', Angkatan '.$dataCetakMasal[0]['ANGKATAN'].'/'.ucwords(strtolower($dataCetakMasal[0]['TA_MASUK'])),0,1);
                  $this->SetFont('Arial','B',6);
                          
                  #Baris Tempat Tanggal Lahir  
                  $dataCetakMasal[0]['tgl_lahir']=ConvertDate($dataCetakMasal[0]['tgl_lahir'],"YYYY-MM-DD","DD-MM-YYYY");
                  $ttl=$dataCetakMasal[0]['tgl_lahir'].' di '.ucwords(strtolower($dataCetakMasal[0]['tpt_lahir']));
                  
                  $this->SetY($this->GetY()+1);
                  $this->SetX($idMargin+30);
                  $this->SetFont('Arial','B',6);
                  $this->Cell(14,2,'Lahir tanggal',0,0);
                  $this->MultiCell(35,2,$ttl);
                  $this->SetFont('Arial','B',6);
                 
                  #Baris Alamat
                	if(empty($dataCetakMasal[0]['ALAMAT_ASAL'])) {
                  	$alamatCetak=$dataCetakMasal[0]['ALAMAT_LOKAL'];
                  	}else{
                  	$alamatCetak=$dataCetakMasal[0]['ALAMAT_ASAL'];
                  	}                       
                  $this->SetX($idMargin+30);
                  $this->SetFont('Arial','B',6);
                  $this->Cell(14,2,'Alamat Asal',0,0);
                  $this->MultiCell(35,2,ucwords(strtolower($alamatCetak)),0,'L');
                  $this->SetFont('Arial','B',6);

                  #Baris habis masa berlaku
                  $today=getdate();
                  $this->SetY($this->GetY()+1);
                  $this->SetX($idMargin+30);
                  $this->SetFont('Arial','B',6);
                  $this->Multicell(50,3,'Kartu ini berlaku s.d. '.$berlaku,0,1);
                  $this->SetFont('Arial','B',6);
                  
                  $topmargin=$topmargin+57;

          $data=$data+1;
          $lembar=$lembar+1;
            if($lembar>5 AND $data<$total){
              $this->AddPage();
              $leftmargin=6;
              $leftleftmargin=105;
              $topmargin=3;
              $this->SetFont('Arial','B',6);         

              $lembar=1;
            }
          }
      //$this->Output('KTM_Massal','D');
      //$this->close();
      return true;
        }
  
   function PrintKtmVersi2($tahunMasukAwal,$tahunMasukAkhir,$notes_nim,$status,$prodi,$nama, $semsMasukAwal,$semsMasukAkhir){
      //sudah ditest pakai printer HPLaserJet2 pagescaling : none
      $dokObj=new AppCetakKtm();
      //$dokObjSia = new AppMahasiswaSia();
      
      $dataPejabat = $dokObj->GetDataPejabat();
      $univ=GTFWConfiguration::GetValue('organization', 'company_name');
      $univ_singkat=GTFWConfiguration::GetValue('organization', 'company_short_name');
      $address=GTFWConfiguration::GetValue('organization', 'company_city');
      
      #--------------count the data----------------------------------------------------------------------------------------------------------------
      $countCetakMasal=$dokObj->GetCountDataCetakMasal($tahunMasukAwal,$tahunMasukAkhir,
                                                      $notes_nim,$status,$prodi,$nama, 
                                                      $semsMasukAwal,$semsMasukAkhir);   
      $total = $countCetakMasal[0]['total'];
      $loop = ($total / 10); 
      
      #----------------------Constructor---------------------------------------------------------------------------------------------------------
      
      $this->FPDF('p', 'pt', 'A4');
      $this->SetFont('Arial', 'B', 10);
      
      #----------------------Bagian depan-----------------------------------------------------------------------------------------------------------
      
      $limit = 0;
      for($a=0; $a<$loop; $a++){
         $this->AddPage();
         $jarak_atas = 0;
         $y = 0;
         for($j=0; $j<5; $j++){
            $jarak_tengah = 0;
            $x = 0;
            for($i=0; $i<2; $i++){
               #-------------------------fetching data-----------------------------------------------------------------------------------------------------------------
               $dataCetakMasal=$dokObj->GetDataCetakMasal($tahunMasukAwal,$tahunMasukAkhir,
                                                            $notes_nim,$status,$prodi,$nama,
                                                            $semsMasukAwal,$semsMasukAkhir,$limit,2);
               #-------------------------------------------------------------------------------------------------------------------------------------------------------
               
               if($dataCetakMasal[$i]['NAMA'] == ''){
                  #------do nothing------------------------
               } else {
                  $leftMargin = 44.6+$x+$jarak_tengah; //leeft margin sudah difixan secara proporsional agar margin kanan dan kiri lebarnya sama = 44.6 pt
                  $topMargin = 31+$y+$jarak_atas;
                  
                  #background
                  $this->image("file/images/ktm.jpg",$leftMargin,$topMargin,239,150);
                  
                  #Foto Mahasiswa
                  $lokasi_foto=GTFWConfiguration::GetValue('application', 'photo_move_path');
                  
                  if (empty($dataCetakMasal[$i]['FOTO'])) {
                  // #nampilin kotak kosong ada tulisan foto - bila foto belum di upload
                     $this->SetXY($leftMargin+9,$topMargin+64);
                     $this->Cell(56, 66,'Foto','',2,'C');
                     $this->SetFont('Arial', 'B', 6);
                     //$this->image("file/images/test.jpg",$leftMargin+9,$topMargin+63,54,64);
                  }else{
                     $foto = $lokasi_foto.$dataCetakMasal[$i]['FOTO'];
                     $this->image($foto,$leftMargin+9,$topMargin+63,54,64);
                  }
                  
                  #Baris Nama   
                  $this->SetXY($leftMargin+69,$topMargin+66);
                  $this->Cell(58,2,'Nama',0,0);
                  $this->SetFont('Arial', 'B', 6);
                  $this->Cell(23,2," : ".ucwords(strtolower($dataCetakMasal[$i]['NAMA'])),0,2);
                  $this->SetFont('Arial', 'B', 6);
                  
                  #Baris NIM   
                  $this->SetXY($leftMargin+69,$topMargin+73);
                  $this->Cell(58,2,'NIM',0,0);
                  $this->SetFont('Arial', 'B', 6);
                  $this->Cell(23,2," : ".$dataCetakMasal[$i]['NIM'],0,2);
                  $this->SetFont('Arial', 'B', 6);
                  
                  #Baris Golongan Darah   
                  $this->SetXY($leftMargin+69,$topMargin+80);
                  $this->Cell(58,2,'Gol. Darah',0,0);
                  $this->SetFont('Arial', 'B', 6);
                  $this->Cell(23,2," : A / B / O / AB",0,2);
                  $this->SetFont('Arial', 'B', 6);
                  
                  #Baris Tempat Tanggal Lahir  
                  $this->SetXY($leftMargin+69,$topMargin+87);
                  $dataCetakMasal[0]['tgl_lahir']=ConvertDate($dataCetakMasal[0]['tgl_lahir'],"YYYY-MM-DD","DD-MM-YYYY");
                  $ttl=$dataCetakMasal[0]['tpt_lahir'].'/'.$dataCetakMasal[0]['tgl_lahir'];
                  $this->Cell(58,2,'Tempat / Tgl. Lahir',0,0);
                  $this->SetFont('Arial', 'B', 6);
                  $this->Cell(23,2," : ".$ttl,0,2);
                  $this->SetFont('Arial', 'B', 6);
                  
                  #Baris Fakultas  
                  $this->SetXY($leftMargin+69,$topMargin+94);
                  $this->Cell(60,6,'Fakultas',0,0);
                  $this->SetFont('Arial', 'B', 6);
                  $this->Cell(3,6,':',0,0);
                  $this->SetFont('Arial', 'B', 6);
                  $this->MultiCell(93,6,ucwords(strtolower($dataCetakMasal[$i]['FAKULTASTANPASINGKAT'])),0,2);
                  $this->SetFont('Arial', 'B', 6);
                  
                  #Baris Program Studi  
                  $this->SetXY($leftMargin+69,$topMargin+107);
                  $this->Cell(60,6,'Prog.Studi',0,0);
                  $this->SetFont('Arial', 'B', 6);
                  $this->Cell(3,6,':',0,0);
                  $this->SetFont('Arial', 'B', 6);
                  $this->MultiCell(93,6,ucwords(strtolower($dataCetakMasal[$i]['PROGRAM_STUDI'])),0,2);
                  $this->SetFont('Arial', 'B', 6);
                  
                  #Baris Alamat 
                  $this->SetXY($leftMargin+69,$topMargin+120);
                  $this->Cell(60,6,'Alamat',0,0);
                  $this->SetFont('Arial', 'B', 6);
                  $this->Cell(3,6,':',0,0);
                  $this->SetFont('Arial', 'B', 6);
                  $this->MultiCell(93,6,ucwords(strtolower($dataCetakMasal[$i]['ALAMAT_LOKAL'])),0,2);
                  $this->SetFont('Arial', 'B', 6);
               }
               $jarak_tengah = $jarak_tengah + 28;
               $x = $x + 239;
            }
            $jarak_atas = $jarak_atas + 1;
            $y = $y + 150;
            $limit = $limit + 2;
         }
      }
         
      #--------------------------Bagian belakang--------------------------------------------------------------------------------------------------------
            
      $limit = 0;
      for($a=0; $a<$loop; $a++){
         $this->AddPage();
      
         $jarak_atas = 0;
         $y = 0;
         for($h=0; $h<5; $h++){
            $jarak_tengah = 0;
            $x = 0;
            for($i=0; $i<2; $i++){
               #-------------------------fetching data-----------------------------------------------------------------------------------------------------------------
               $dataCetakMasal=$dokObj->GetDataCetakMasal($tahunMasukAwal,$tahunMasukAkhir,
                                                            $notes_nim,$status,$prodi,$nama,
                                                            $semsMasukAwal,$semsMasukAkhir,$limit,2);
               #-------------------------------------------------------------------------------------------------------------------------------------------------------
               if($dataCetakMasal[$i+1]['ID']==''){
                     $bar_id = $dataCetakMasal[$i-1]['ID'];
                  } else {
                     $bar_id = $dataCetakMasal[$i+1]['ID'];
                  }
               
               if($bar_id == ''){
                  #------do nothing------------------------
               } else {
                          
                  $this->CreateBarcode($bar_id);
               
                  $leftMargin = 44.6+$x+$jarak_tengah;
                  $topMargin = 31+$y+$jarak_atas;
                  
                  $this->SetXY($leftMargin,$topMargin);
                  $this->Cell(239,150,'',1,0);
                  
                                
                  $this->SetXY($leftMargin+88,$topMargin+7);
                  $this->SetFont('Times', 'B', 10);
                  $this->Cell(62, 10, 'K E T E N T U A N',0,2,'C');
                  
                  #Ketentuan 1  
                  $this->SetXY($leftMargin+10,$topMargin+19);
                  $this->SetFont('Times', '', 6);
                  $this->Cell(5,9,'1.',0,0,'L');
                  $this->SetFont('Times','', 6);
                  $this->MultiCell(220,9,'Kartu ini milik '.ucwords(strtolower($univ)).' berlaku selama 5 tahun atau Mahasiswa yang namanya tersebut pada kartu ini masih terdaftar aktif di '.strtoupper($univ_singkat).'',0,2);
                  
                  #Ketentuan 2  
                  $this->SetXY($leftMargin+10,$topMargin+39);
                  $this->SetFont('Times', '', 6);
                  $this->Cell(5,9,'2.',0,0,'L');
                  $this->SetFont('Times','', 6);
                  $this->MultiCell(220,9,'Kartu ini hanya berlaku di '.ucwords(strtolower($univ)).' dan bukan pengenal identitas di luar kampus '.strtoupper($univ_singkat).'',0,2);
                     
                  #Ketentuan 3  
                  $this->SetXY($leftMargin+10,$topMargin+59);
                  $this->SetFont('Times', '', 6);
                  $this->Cell(5,9,'3.',0,0,'L');
                  $this->SetFont('Times','', 6);
                  $this->MultiCell(220,9,''.ucwords(strtolower($univ)).' tidak bertanggung jawab apabila Kartu ini disalah gunakan di luar kampus '.strtoupper($univ_singkat).'',0,2);
                  
                  #Ketentuan 4 
                  $this->SetXY($leftMargin+10,$topMargin+79);
                  $this->SetFont('Times', '', 6);
                  $this->Cell(5,9,'4.',0,0,'L');
                  $this->SetFont('Times','', 6);
                  $this->MultiCell(220,9,'Bila kartu ini diketemukan mohon dikembalikan kepada pemiliknya',0,2);
                  
                  #blok barcode
                  $this->SetXY($leftMargin+15,$topMargin+99);
                  $this->SetFont('Arial', 'B', 6);
                  $this->Cell(68,2,'Personal ID Barcode',0,0);
                  $lokasi_barcode=GTFWConfiguration::GetValue('application', 'barcode_path');
                  if(empty($dataCetakMasal[$i+1]['NIM'])){
                     $temp = $dataCetakMasal[$i-1]['NIM'];
                  } else {
                     $temp = $dataCetakMasal[$i+1]['NIM'];
                  }
                  if (empty($temp)) {
                     $this->Cell(50,20,'barcode_here',1,2,'C');
                     $this->SetFont('Arial', 'B', 6);
                  }else{
                     $barcode=$lokasi_barcode.$temp.'.jpeg';
                     $this->image($barcode,$leftMargin+20,$topMargin+105,'60','30');
                     }
                  
                  #Tanda Tangan Pejabat
                  $this->SetXY($leftMargin+150,$topMargin+99);
                  $this->SetFont('Times','', 5);
                  $date = getdate();
                  $tanggal = $date['mday'].'-'.$date['mon'].'-'.$date['year'];
                  $this->Cell(20,5, ucwords(strtolower($address)).','.IndonesianDate($tanggal,"DD-MM-YYYY"),0,2);
                  $this->SetFont('Times','', 5);
                  $this->Cell(20,5,$dataPejabat[0]['jabatan'],0,2);
                  $lokasi_ttd=GTFWConfiguration::GetValue('application', 'ttd_path');
                  if (empty($dataPejabat[0]['judul'])) {
                        $this->Cell(20,15,'ttd.',0,1);
                     }else{
                        $ttd=$lokasi_ttd.$dataPejabat[0]['judul'];
                        $this->image($ttd,$leftMargin+155,$topMargin+110,30,15);
                     }
                  $this->SetXY($leftMargin+150,$topMargin+127);
                  $this->SetFont('Times', 'U', 5);
                  $this->Cell(20, 4,$dataPejabat[0]['nama'],0,2);
                  $this->SetXY($leftMargin+150,$topMargin+133);
                  $this->SetFont('Times', '', 5);
                  $this->Cell(20, 4,'NIP. '.$dataPejabat[0]['nip'],0,1);
               }
               
               $jarak_tengah = $jarak_tengah + 28;
               $x = $x + 239;
            }
            $jarak_atas = $jarak_atas + 1;
            $y = $y + 150;
            $limit = $limit + 2;
         }
      
      }
      //$return['dataCetakMasal']=$dataCetakMasal;
      //$return['dataFoto'] = $dataFoto;
      //return $return;
      return true;
   }
   
}
?>
