0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.145.79.214


Current Path : /proc/thread-self/root/var/www/html/mum/src/
Upload File :
Current File : //proc/thread-self/root/var/www/html/mum/src/applicationFormReportPOSTOFFICE.php

<?php
$main_src=substr($_SERVER['SCRIPT_FILENAME'],0,strlen($_SERVER['SCRIPT_FILENAME'])-7);
$pdf_writer_class =$main_src."/tarka_pdf/fpdf.php";
//require_once($pdf_writer_class);

$pdf_writer_class =$main_src."/tcpdf/tcpdf.php";
require_once($pdf_writer_class);

require('rotation.php');
require_once("report_hall_ticket.php");	
//require('code39.php');
class applicationFormReport 
{

	function DefaultConstructor($aobj_context)
	{
		$this->aobj_context=$aobj_context;
		$this->pdf= new TCPDF();
		//$this->pdf=$this;

		$this->app_no = trim($this->aobj_context->mobj_data["app_no"]);
		$this->screen = trim($this->aobj_context->mobj_data["screen"]);
		$this->screen = 'ack';
		$this->screentype = trim($this->aobj_context->mobj_data["screentype"]);
		//var_dump($this->screentype);
		$this->ip=$_SERVER["REMOTE_ADDR"];
	}
 
	function formcolldata()
	{
		$get_coll_name="select FUNIVCODE, FUNIVNAME as 'FUNIVNAME',
				FUNIVADD1 as 'state', pdf_logo_path,ifnull(FEXAMAPPREQ,'F') as FEXAMAPPREQ, FSHORTUNIV From control";
		$lobj_get_coll_name=$this->aobj_context->mobj_db->GetRow($get_coll_name);
		$this->FUNIVCODE=$lobj_get_coll_name['FUNIVCODE'];
		$this->FUNIVNAME=$lobj_get_coll_name['FUNIVNAME'];
		$this->FSHORTUNIV=$lobj_get_coll_name['FSHORTUNIV'];
		$this->s_state=$lobj_get_coll_name['state'];
		$this->f_year=$lobj_get_coll_name['f_year'];
		$this->pdf_logo_path=$lobj_get_coll_name['pdf_logo_path'];
		$this->FEXAMAPPREQ=$lobj_get_coll_name['FEXAMAPPREQ'];
		$this->pdf_Postlogo_path="/img/post_logo.jpg";	
		
	 }

	 function GetBankDetails()
	 {
		$get_data="SELECT  bank_name, acc_no, 	branch_name, 	branch_code, 	ifsc_code, 	cheque_favour, 	place,bank_charge
				FROM  acc_mas where payment_type='{$this->FPAYMENTYPE}'";
		$lobj_get_data= $this->aobj_context->mobj_db->GetRow($get_data);	
		$this->bank_name=$lobj_get_data['bank_name'];	
		$this->acc_no=$lobj_get_data['acc_no'];	
		$this->branch_name=$lobj_get_data['branch_name'];	
		$this->branch_code=$lobj_get_data['branch_code'];	
		$this->ifsc_code=$lobj_get_data['ifsc_code'];	
		$this->cheque_favour=$lobj_get_data['cheque_favour'];	
		$this->place=$lobj_get_data['place'];	
		$this->bank_charge=$lobj_get_data['bank_charge'];	
	 }

	function GetData()
	{
		if($this->screentype == 're')
		{	
			$get_app_no = "select cs.fappno, s.fname,s.fcaste,
			ifnull(cs.fregfee,0) as ftotfee,cs.fdegree,cs.fcollcode,
			FADMPAYMENTTYPE as FPAYMENTTYPE,d.FDESCPN,cs.fexamno,
			ifnull(cs.fregno,'') as fregno,d.fexamname,
			date_format(now(),'%d/%m/%Y') as fcurrent_date,
			date_format(fadmto,'%d/%m/%Y') as lastdate
			from candsum cs inner join degree d
			on cs.fdegree = d.fdegree and d.fexamno = cs.ffreshexam 
			inner join collexam c on cs.fdegree = c.fdegree and cs.fexamno = c.fexamno and cs.fcollcode = c.fcollcode
			inner join student s on  cs.fregno = s.fregno
			where cs.fappno='{$this->app_no}'";

		}else
		{	
			$get_app_no = "select studadm.fslno, fappno, fname,fcaste,
			ifnull(FFEEPAID,0) as ftotfee,studadm.fdegree,studadm.fcollcode,fcaste,
			FPAYMENTTYPE,d.FDESCPN,studadm.fexamno,
			date_format(fadmto,'%d/%m/%Y') as lastdate,ifnull(studadm.fregno,'') as fregno,d.fexamname,
			date_format(now(),'%d/%m/%Y') as fcurrent_date from studadm  inner join degree d
			on studadm.fdegree = d.fdegree and d.fexamno = studadm.fexamno 
			inner join collexam on studadm.fdegree = collexam.fdegree and studadm.fexamno = collexam.fexamno
			and collexam.fcollcode = studadm.fcollcode
			where fappno='{$this->app_no}'";			
		}
		$obj_get_app_no = $this->aobj_context->mobj_db->GetRow($get_app_no); 	
		
		$this->fappno        = $obj_get_app_no['fappno'];
		$this->student_name  = $obj_get_app_no['fname'];
		$this->FTOTALFEE     = $obj_get_app_no['ftotfee'];
		$this->degree        = $obj_get_app_no['fdegree'];
		$this->college_code  = $obj_get_app_no['fcollcode'];
		$this->FCATEGORY     = $obj_get_app_no['fcaste'];
		$this->curr_date     = $obj_get_app_no['fcurrent_date'];
		$this->fdate         = $obj_get_app_no['fcurrent_date'];
		$this->FPAYMENTYPE   = $obj_get_app_no['FPAYMENTTYPE'];
		$this->FDESCPN       = $obj_get_app_no['FDESCPN'];
		$this->fappto        = $obj_get_app_no['lastdate'];
		$this->fexamno       = $obj_get_app_no['fexamno'];
		$this->fregno        = $obj_get_app_no['fregno'];
		$this->fexamname     = $obj_get_app_no['fexamname'];	 
		$this->fslno     = $obj_get_app_no['fslno'];	 

		$this->GetBankDetails();
	}
	 
	function WriteRect()
	{
		$get_date="select date_add(date_add(now(),INTERVAL 13 hour),interval 30 minute) as now_date";
		$obj=$this->aobj_context->mobj_db->GetRow($get_date);
		require_once("getnumword.php");
		$this->current_date=$obj[now_date];	
		//$this->pdf = new PDF_Rotate();	
		$this->pdf= new TCPDF();
		$this->pdf->SetMargins(2,5,2);			
		$this->pdf->addPage('L'); 
		
		$width=96;
		$this->pdf->Rect(2,5,$width,200);
		$this->pdf->Rect(2+$width+2,5,$width,200);
		$this->pdf->Rect(2+$width+$width+4,5,$width,200);
		if(!empty($this->pdf_logo_path))
		{
			$img_logo_path=$this->aobj_context->main_src.$this->pdf_logo_path;
			$this->pdf->Image($img_logo_path,4,7,13);
			$this->pdf->Image($img_logo_path,$width+6,7,13);
			$this->pdf->Image($img_logo_path,$width+$width+7,7,13);
		}
		
		
		$width=96;
		$this->pdf->Rect(2,5,$width,200);
		$this->pdf->Rect(2+$width+2,5,$width,200);
		$this->pdf->Rect(2+$width+$width+4,5,$width,200);
		if(!empty($this->pdf_Postlogo_path))
		{
			$img_logo_path=$this->aobj_context->main_src.$this->pdf_Postlogo_path;
			$this->pdf->Image($img_logo_path,80,7,13);
			$this->pdf->Image($img_logo_path,$width+82,7,13);
			$this->pdf->Image($img_logo_path,$width+$width+85,7,13);
		}

		$this->pdf->setY(5);
	}	
		
	function formData($label)
	{
		$style = array(
			'position' => 'right',
			'align' => 'C',
			'stretch' => false,
			'fitwidth' => true,
			'cellfitalign' => '',
			'border' => false,
			'hpadding' => 'auto',
			'vpadding' => 'auto',
			'fgcolor' => array(0,0,0),
			'bgcolor' => false, //array(255,255,255),
			'text' => true,
			'font' => 'helvetica',
			'fontsize' => 8,
			'stretchtext' => 3
		);

		$line_height=5;
		$width=96;
		$x_pos=2;
		if($this->pos==2)
			$x_pos=2+$width+2;
		if($this->pos==3)
			$x_pos=2+$width+2+$width+2;
		
		$jump_width=$width;
		
		if($this->pos==2)
			$jump_width=$width;
		else if($this->pos==3)
			$jump_width=$width;

		$this->pdf->SetX($x_pos);
		$this->old_y=$this->pdf->GetY();
		$this->pdf->SetFont('Times','B',9);
		if($this->FUNIVCODE=="032")
			$this->pdf->multiCell($jump_width,3,$this->FUNIVNAME,0,"C");
		else
			$this->pdf->Cell($jump_width,$line_height,$this->FUNIVNAME,'0',1,'C');	
		
		$this->pdf->SetFont('Times','B',8);
		$this->pdf->SetX($x_pos);
		$this->pdf->Cell($jump_width,$line_height,$this->s_state,'0',1,'C');	
		
		$this->pdf->SetFont('Times','BU',9);
		$this->pdf->SetX($x_pos);
		$this->pdf->Cell($jump_width,$line_height,'Payment Challan - '.$label,'0',1,'C');	
		$this->pdf->Ln(2);
		$this->pdf->SetFont('Times','B',9);	

		// Postal charges calculation.
		if($this->FUNIVCODE=="003" || $this->FUNIVCODE=="008")
		{
			if($this->FTOTALFEE <= 1500)
				$postal_charges = 20;
			else if($this->FTOTALFEE >1500 && $this->FTOTALFEE <=5000)
				$postal_charges = 30;
			else if($this->FTOTALFEE >5000 && $this->FTOTALFEE <=10000)
				$postal_charges = 40;
			else if($this->FTOTALFEE >10000 && $this->FTOTALFEE <=15000)
				$postal_charges = 50;
			else 
				$postal_charges = 60;
		}
		else if($this->FUNIVCODE=="026"  || $this->FUNIVCODE=="033" || $this->FUNIVCODE=="034")
		{
			$postal_charges = 20;
		}
		else if($this->FUNIVCODE == "017")
		{
			$postal_charges = 0;
		}		
		
		
		if($this->FUNIVCODE=="033")
			$biller = "Divisional Biller ID";
		else
			$biller = "Circle Biller ID";
		
		if($this->screentype == 're')
		{	
			$this->barcodeNo = $this->app_no.$this->fregno.str_pad($this->FTOTALFEE+$postal_charges,5, "0", STR_PAD_LEFT);
		}else
		{	
		
			$this->barcodeNo = $this->app_no.$this->fslno.$this->college_code.str_pad($this->FTOTALFEE+$postal_charges,5, "0", STR_PAD_LEFT);
		}
		

		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell(($jump_width-2)*.35,$line_height,"{$biller}",'1',0,'L');	
		$this->pdf->Cell(($jump_width-2)*.65,$line_height,"{$this->FSHORTUNIV}",'1',1,'L');	
		$this->pdf->SetX($x_pos+1);
		
		$this->pdf->Cell(($jump_width-2)*.35,$line_height,"Reference No. ",'1',0,'L');	
		$this->pdf->Cell(($jump_width-2)*.65,$line_height,"{$this->app_no}",'1',1,'L');	
		$this->pdf->SetX($x_pos+1);
		
		$this->pdf->Cell(($jump_width-2)*.35,$line_height,"Reg. No. ",'1',0,'L');	
		$this->pdf->Cell(($jump_width-2)*.65,$line_height,"{$this->reg_no}",'1',1,'L');	
		$this->pdf->SetX($x_pos+1);
		
		$this->pdf->Cell(($jump_width-2)*.35,$line_height,"Total Amount ",'1',0,'L');	
		$this->pdf->Cell(($jump_width-2)*.65,$line_height,"{$this->FTOTALFEE}/-",'1',1,'L');	
		$this->pdf->SetX($x_pos+1);
		
		$this->pdf->Cell(($jump_width-2)*.35,$line_height,"Degree ",'1',0,'L');	
		$this->pdf->Cell(($jump_width-2)*.65,$line_height,"{$this->degree}",'1',1,'L');	
		$this->pdf->Ln(2);
		$this->pdf->SetX($x_pos+1);
		$this->pdf->SetFont('Times','B',10);
		if($this->FUNIVCODE !="017")
		{
			$tdd1_width=$jump_width*(0.25)-1;
			$tdd2_width=($jump_width)*.25 ;
			$tdd3_width=($jump_width)*.25 ;
			$tdd4_width=($jump_width)*.25-1;
			
			$this->pdf->Cell($tdd2_width,$line_height,"Course Fee",'1',0,'C');	
			$this->pdf->Cell($tdd3_width,$line_height,"Postal Charges",'1',0,'C');
			$this->pdf->Cell($tdd4_width,$line_height,"Total",'1',1,'C');
			
			$this->pdf->SetX($x_pos+1);
			$this->pdf->Cell($tdd2_width,$line_height,"Rs {$this->FTOTALFEE}/-",'1',0,'C');	

			$this->pdf->Cell($tdd3_width,$line_height,"Rs {$postal_charges}/-",'1',0,'C');
			
			$total=($this->FTOTALFEE+$postal_charges);
			$this->pdf->Cell($tdd4_width,$line_height,"Rs {$total}/-",'1',1,'C');
			
		}
		$this->pdf->Ln(2);
		$this->pdf->SetX($x_pos+1);
		$line_height=4;
		$this->pdf->Cell(($jump_width-2)*.25,$line_height,"Name              :",'0',0,'L');	
		$this->pdf->MultiCell($jump_width*.80,$line_height,$this->student_name,0,"L");
		
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell(($jump_width-2)*.25,$line_height,"College           :",'0',0,'L');	
		$this->pdf->Cell($jump_width*.80,$line_height," {$this->college_code}",'0',1,'L');	
		
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell(($jump_width-2)*.25,$line_height,"Category        :",'0',0,'L');	
		$this->pdf->Cell($jump_width*.80,$line_height," {$this->FCATEGORY}",'0',1,'L');	

		/*$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell(($jump_width-2)*.25,$line_height,"Fee Type        :",'0',0,'L');	
		$this->pdf->Cell($jump_width*.70,$line_height," {$this->FFEETYPE}",'0',1,'L');	*/

		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell(($jump_width-2)*.25,$line_height,"Challan         ",'0',1,'L');	
		
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell(($jump_width-2)*.25,$line_height,"Valid Upto     : ",'0',0,'L');
		$this->pdf->Cell($jump_width*.70,$line_height," {$this->fappto}",'0',1,'L');
		
		$this->pdf->ln(30);
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell($jump_width,$line_height,"Date                                   Signature of Remitter",'0',1,'L');			 				
		$this->pdf->ln(20);
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell($jump_width,$line_height,"Date & Seal                      Signature of Receiver",'0',1,'L');			 
		
		$this->pdf->SetFont('Times','',9);
	 	$this->pdf->Ln(5);			
		$this->pdf->SetX($x_pos+1);
		if($this->FUNIVCODE=="026")
		{
			$this->pdf->MultiCell($jump_width-20,$line_height,'Note: 1. Payment accepted at all e payment Post Offices across the state.',0,"L");
		}
		else
		{
			$this->pdf->MultiCell($jump_width-20,$line_height,'Note: 1. Payment accepted at all e payment Post Offices in Karnataka only.',0,"L");
		}		

		$this->pdf->Ln(1);	
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell(($jump_width-2)*.10,$line_height,"Date : ",'0',0,'L');
		$this->pdf->Cell($jump_width*.80,$line_height,"{$this->fdate}",'0',1,'L');
		
	 	$this->pdf->SetX($x_pos+5); 
		$this->pdf->write1DBarcode($this->barcodeNo, 'C39', '1', '173.9','100', 16, 0.22, $style, 'R');				
		$this->pdf->write1DBarcode($this->barcodeNo, 'C39', '100', '173.9','100', 16, 0.22, $style, 'R');
		$this->pdf->write1DBarcode($this->barcodeNo, 'C39', '199', '173.9','100', 16, 0.22, $style, 'R');

		$this->pdf->SetY($this->old_y);
		$img_path = $this->aobj_context->main_src.$this->photo_path;
	}

	function WriteHallTicket()
	{
		$aobj_context=$this->aobj_context;
		ini_set("memory_limit",-1);
		ini_set('max_execution_time',3300);
				
		if($this->screentype == 're') // 10354210089
		{	
			$query = "SELECT  DISTINCT s.FNAME, s.FFATNAME,s.FCOLLCODE, 
			ifnull(s.fregno,'') as fregno,s.FMOTNAME, 
			s.FFAT_OCC, s.FCASTE, if(s.FSEX = 'M','Male','Female') as  FSEX,
			s.FNATIONAL,'Post Offices' as FPAYMENTTYPE,
			cs.fregfee as FTOTFEE,
			s.fphotopath,
			date_format(s.FDOB,'%d/%m/%Y') as fdob, 
			s.FAADHARNO,concat(ifnull(s.FCURRADD1,''),'  ',
			ifnull(s.FCURRADD2,''), '  ',
			ifnull(s.FCURRADD3,''),'  ') as fadd, 
			concat(ifnull(s.FPERMADD1,''),'  ',
			ifnull(s.FPERMADD2,''), '  ',
			ifnull(s.FPERMADD3,''),'  ') as fperadd,s.FCONTACT_NO,  
			s.FEMAIL,
			s.FDEGREE, 
			GROUP_CONCAT(distinct sb.FSUBSHORT,'->',
			sb.FSUBNAME ORDER BY sb.FSUBCODE 
			SEPARATOR '~') AS subjdet,
			cd.FEXAMNO,d.fdescpn as fdegname,d.fexamname as fexamname,
			CONCAT(c.FCOLLNAME,', ',c.FTOWN) as FCOLLNAME
			FROM student s inner join canddet cd on 
			s.FREGNO = cd.fregno and s.FCOLLCODE = cd.FCOLLCODE
			inner join subject sb on cd.fdegree = sb.fdegree  and 
			cd.fexamno = sb.fexamno and cd.fsubcode = sb.fsubcode 
			inner join college c on cd.FCOLLCODE = c.fcollcode 
			inner join degree d on cd.fdegree = d.fdegree 
			and cd.fexamno  = d.fexamno 
			inner join candsum cs on cd.FREGNO = cs.FREGNO 
			and cd.FCOLLCODE = cs.fcollcode
			where ifnull(s.fdeleted,'') <> 'T'
			AND cs.FAPPNO = '{$this->app_no}'
			GROUP BY cd.fregno";

		}else
		{
			$query = "SELECT  DISTINCT studadm.FNAME, studadm.FFATNAME,studadm.FCOLLCODE, 
			ifnull(studadm.fregno,'') as fregno, 
			studadm.FFAT_OCC, studadm.FCASTE, if(studadm.FSEX = 'M','Male','Female') as  FSEX,
			studadm.FNATIONAL,'Post Offices' as FPAYMENTTYPE,
			studadm.FFEEPAID as FTOTFEE,studadm.FMOTNAME,
			studadm.fphotopath,
			date_format(studadm.FDOB,'%d/%m/%Y') as fdob, 
			studadm.FAADHARNO,concat(ifnull(studadm.FCURRADD1,''),'  ',
			ifnull(studadm.FCURRADD2,''), '  ',
			ifnull(studadm.FCURRADD3,''),'  ') as fadd, 
			concat(ifnull(studadm.FPERMADD1,''),'  ',
			ifnull(studadm.FPERMADD2,''), '  ',
			ifnull(studadm.FPERMADD3,''),'  ') as fperadd,
			studadm.FCONTACT_NO,  
			studadm.FEMAIL,
			studadm.FINCOME, studadm.FDEGREE, 
			studadm.FCOMBCODE,
			GROUP_CONCAT(distinct subject.FSUBSHORT,'->',
			subject.FSUBNAME ORDER BY subject.FSUBCODE 
			SEPARATOR '~') AS subjdet,
			studadm.FQUOTA,studadm.FQUALIFY,studadm.FPERCENT,
			studadm.FBOARDRUNIV,studadm.FAADHARNO,
			if(studadm.FPH = 'F','NO','YES') as fph,
			options.FEXAMNO,degree.fdescpn as fdegname,degree.fexamname as fexamname,
			CONCAT(college.FCOLLNAME,', ',college.FTOWN) as FCOLLNAME
			FROM studadm ,options,subject,college,degree
			WHERE subject.FSUBCODE = options.FSUBCODE 
			AND subject.FDEGREE = options.FDEGREE
			AND options.FDEGREE = degree.FDEGREE 
			AND subject.FDEGREE = degree.FDEGREE
			and studadm.fexamno = degree.fexamno
			AND college.FCOLLCODE = studadm.FCOLLCODE 
			AND college.FCOLLCODE = options.FCOLLCODE 
			AND options.FCOLLCODE=studadm.FCOLLCODE 
			AND studadm.FEXAMNO= options.FEXAMNO 
			AND studadm.FDEGREE = options.FDEGREE 
			AND studadm.FSLNO = options.FSLNO 
			AND ifnull(studadm.fdeleted,'') <> 'T'
			AND studadm.FAPPNO = '{$this->app_no}'
			GROUP BY options.FSLNO"; 
			
		}	
		$results =$this->aobj_context->mobj_db->GetRow($query);	

		$pdf_writer_class =$this->aobj_context->main_src."/tcpdf/tcpdf.php";
		require_once($pdf_writer_class);		  	
		 
		//$this->pdf = new TCPDF();
		$pdf=$this->pdf;	
		//var_dump($query);
		$pdf->SetMargins(20,5,20,5);	
		//$pdf->SetMargins(28,3);
		$pdf->aobj_context =$aobj_context ;
		$pdf->SetFillColor(248, 248 ,255);		
		$pdf->SetFont('Times','',10);
		$pdf->AddPage("P");

		$pdf->Rect(5,05,200,289);

		$img_path = $aobj_context->main_src."/img/logo.jpg";
		if(file_exists($img_path)) 
			$pdf->Image($img_path,15,6,20,20);
		
		$pdf->SetFont('helvetica','B',15);
		$pdf->Ln(2);
		$pdf->Cell(180,4,$this->FUNIVNAME,0,1,'C');
		$pdf->SetFont('Times','',12);
				 
		$pdf->SetFont('helvetica','B',12);
		$pdf->Ln(2);
		
		if($this->latral == 'T')
		{
			$pdf->Cell(180,5,'Application for Admission : '.$results['fdegname'].' '.$results['fexamname'].' Lateral Entry',0,1,'C');
		}
		else
		{
			$cur_year = date("Y");
			$pdf->Cell(180,5,'Application for Admission ('.$cur_year.')','0',1,'C');
			$pdf->SetFont('helvetica','',10);
			$pdf->Cell(180,5,'Degree : '.$results['fdegname'],'0',1,'C');
			$pdf->Cell(180,5,'Semester : '.$results['fexamname'],'0',1,'C');
			//.$results['fdegname'].' '.$results['fexamname']
		}
		
		$pdf->SetMargins(14,2);
		$html = '<h4 style="background-color: #afaaa9; color: rgb(255, 255, 255);"> Personal Details</h4>';
		$pdf->writeHTMLCell(188,0,13,33,$html, false,1, false, true, '', false);
		$y = $pdf->getY();
		$pdf->SetFont('helvetica','',10);
		$z = 5;
		$pdf->setY($y-4);
		if($results['fregno']  != '')
		{	
			$pdf->Cell(30,$z,'Register No.',0,0,'L');
			$pdf->SetFont('courier','',10);
			$pdf->Cell(100,$z,$results['fregno'] ,0,1,'L');
		}
		$pdf->SetFont('helvetica','',10);
		$pdf->Cell(30,$z,'Application No',0,0,'L');
		$pdf->SetFont('courier','',10);
		$pdf->Cell(100,$z,$this->app_no,0,1,'L');

		$pdf->SetFont('helvetica','',10);
		$pdf->Cell(30,$z,'Name',0,0,'L');
		$pdf->SetFont('courier','',10);
		$pdf->Cell(100,$z,$results['FNAME'],0,1,'L');
		$pdf->ln(1);
		$pdf->SetFont('helvetica','',10);
		$pdf->Cell(30,$z,'Father Name',0,0,'L');
		$pdf->SetFont('courier','',10);
		$pdf->Cell(100,$z,$results['FFATNAME'],0,1,'L');
		$pdf->ln(1);
		$pdf->SetFont('helvetica','',10);
		$pdf->Cell(30,$z,'Mother Name',0,0,'L');
		$pdf->SetFont('courier','',10);
		$pdf->Cell(100,$z,$results['FMOTNAME'],0,1,'L');

		$pdf->ln(2);

//fphotopath,studadm.fsignpath $results['fphotopath'] 
		//"/img/logo.jpg";
		$img_path = $aobj_context->main_src.$results['fphotopath'];
		//$img_path = $aobj_context->main_src."/img/logo.jpg";
		$url  = $aobj_context->main_src;
		$url = str_replace('kusdde/adm','kusdde',$url);	
		$url_208 = trim($url."/".$results['fphotopath']);
				
		if(file_exists($img_path)) 
			$pdf->Image($img_path,170,40,25,25);
		
		if(file_exists($url_208))
			$pdf->Image($url_208,170,40,25,25);
		
		$photopath = substr($results['fphotopath'],0,-3);
		$ext = substr($results['fphotopath'],-3);
		$photopath = $photopath.strtoupper($ext);
		$url_208 = trim($url."/".$photopath);
		if(file_exists($url_208))
			$pdf->Image($url_208,170,40,25,25);
		
		$img_path = $aobj_context->main_src.$results['fsignpath'];
		//$img_path = $aobj_context->main_src."/img/logo2.jpg";
		if(file_exists($img_path)) 
			$pdf->Image($img_path,170,70,25,10);


		$pdf->SetFont('helvetica','',10);
		$pdf->Cell(30,$z,'Date of Birth',0,0,'L');
		$pdf->Cell(30,$z,'Gender',0,0,'L');
		$pdf->Cell(30,$z,'Category',0,0,'L');
		$pdf->Cell(30,$z,'Physically Disabled?',0,1,'L');

		$pdf->SetFont('courier','',10);
		$pdf->Cell(30,$z,$results['fdob'],0,0,'L');
		$pdf->Cell(30,$z,$results['FSEX'],0,0,'L');
		$pdf->Cell(30,$z,$results['FCASTE'],0,0,'L');
		$pdf->Cell(30,$z,$results['fph'],0,1,'L');

		$pdf->ln(2);

		$pdf->SetFont('helvetica','',10);
		$pdf->Cell(30,$z,'Nationality',0,0,'L');
		$pdf->Cell(30,$z,'Occupation',0,0,'L');
		$pdf->Cell(30,$z,'Aadhaar No.',0,0,'L');
		$pdf->Cell(30,$z,'Quota',0,1,'L');
		//$pdf->ln(2);

		$pdf->SetFont('courier','',10);
		$pdf->Cell(30,$z,$results['FNATIONAL'],0,0,'L');
		$pdf->Cell(30,$z,$results['FFAT_OCC'],0,0,'L');
		$pdf->Cell(30,$z,$results['FAADHARNO'],0,0,'L');
		$pdf->Cell(30,$z,$results['FQUOTA'],0,1,'L');
		$pdf->ln(2);

		$pdf->SetFont('helvetica','',10);
		$pdf->Cell(30,$z,'Address',0,0,'L');
		$pdf->SetFont('courier','',10);
		$pdf->MultiCell(115,$z,$results['fadd'],0,'L');

		$pdf->ln(2);

		$pdf->SetFont('helvetica','',10);
		$pdf->Cell(30,$z,'Mobile',0,0,'L');
		$pdf->Cell(30,$z,'Email',0,1,'L');
		

		$pdf->SetFont('courier','',10);
		$pdf->Cell(30,$z,$results['FCONTACT_NO'],0,0,'L');
	
		$c = $pdf->getY();
		$c -= 8;
		$pdf->Cell(30,$z,$results['FEMAIL'],0,1,'L');

		

		$this->pdf->write1DBarcode($this->app_no, 'C39', '167', $c,'33', 10, 0.5, $style, 'R');
		$pdf->SetFont('helvetica','',10);
		$pdf->Ln(1);
		$html = '<h4 style="background-color: #afaaa9; color: rgb(255, 255, 255);"> Opted Course Details</h4>';
		$x = $pdf->GetX();
		$y = $pdf->GetY();
		$pdf->writeHTMLCell(188,0,$x,$y,$html, false,1, false, true, '', false);
		$y = $pdf->getY();
		$pdf->setY($y-4);
		$pdf->Cell(20,$z,'Course',0,0,'L');
		$pdf->SetFont('courier','',10);
		if($this->latral == 'T')
			$pdf->Cell(60,$z,$results['fdegname'].' '.$results['fexamname'].' Lateral Entry',0,1,'L');
		else
			$pdf->Cell(60,$z,$results['fdegname'].' '.$results['fexamname'],0,1,'L');
		
		$pdf->SetFont('helvetica','',10);
		$pdf->Cell(20,$z,'Medium',0,0,'L');
		$pdf->SetFont('courier','',10);
		$pdf->Cell(50,$z,$results['FENGLISH'],0,1,'L');
		$pdf->Ln(1);
		
		if($this->latral != 'T')
		{	
			$sub = explode('~',$results['subjdet']);
			
			$pdf->SetFont('helvetica','',10);
			$pdf->Cell(2,$z,'',0,0,'L');
			$pdf->Cell(12,$z,'Sl. No.',1,0,'L');
			$pdf->Cell(130,$z,'Subjcet Name',1,0,'C');
			$pdf->Cell(30,$z,'Sub. Short Name',1,1,'C');
			$i = 1;
			
			foreach ($sub as $key => $value) 
			{
				$subname = explode('->',$value);
				$pdf->SetFont('courier','',10);
				$pdf->Cell(2,$z,'',0,0,'C');
				$pdf->Cell(12,$z,$i,1,0,'C');
				$pdf->Cell(130,$z,$subname[1],1,0,'L');
				$pdf->Cell(30,$z,$subname[0],1,1,'L');
				$i++;
			}
		}
		
		if($results['fregno'] == '')
		{	
			$pdf->Ln(1);
			$pdf->SetFont('helvetica','',10);
			$html = '<h4 style="background-color: #afaaa9; color: rgb(255, 255, 255);"> Basic Qualification Details</h4>';
			$x = $pdf->GetX();
			$y = $pdf->GetY();
			$pdf->writeHTMLCell(188,0,$x,$y,$html, false,1, false, true, '', false);
			$y = $pdf->getY();
			$pdf->setY($y-4);
			$pdf->SetFont('helvetica','',10);
			$pdf->Cell(40,$z,'Qualification',0,0,'L');
			$pdf->Cell(40,$z,'Percentage',0,1,'L');

			$pdf->SetFont('courier','',10);
			$pdf->Cell(40,$z,$results['FQUALIFY'],0,0,'L');
			$pdf->Cell(40,$z,$results['FPERCENT'],0,1,'L');

			$pdf->Ln(1);
			
			$pdf->SetFont('helvetica','',10);
			$pdf->Cell(40,$z,'Board / University',0,1,'L');
			
			$pdf->SetFont('courier','',10);
		
			$pdf->Cell(40,$z,$results['FBOARDRUNIV'],0,1,'L');
			
			if($this->latral == 'T')
			{	
				$pdf->SetFont('helvetica','',10);
				$pdf->Cell(180,$z,'From which University the applying course is unfinished',0,1,'L');
				 
				$pdf->SetFont('courier','',10);
				$pdf->Cell(180,$z,$results['FPASSUNIV'],0,1,'L');
			}
			
		}
		$pdf->SetFont('helvetica','',10);
		$pdf->Ln(1);

		$html = '<h4 style="background-color: #afaaa9; color: rgb(255, 255, 255);"> Contact College Details</h4>';
		$x = $pdf->GetX();
		$y = $pdf->GetY();
		$pdf->writeHTMLCell(188,0,$x,$y,$html, false,1, false, true, '', false);
		$y = $pdf->getY();
		$pdf->setY($y-4);
		$pdf->SetFont('helvetica','',10);
		$pdf->Cell(20,$z,'Code',0,0,'L');
		$pdf->Cell(120,$z,'College Name',0,1,'L');
		//$pdf->Cell(30,$z,'District',0,1,'L');

		$pdf->SetFont('courier','',10);
		$pdf->Cell(20,$z,$results['FCOLLCODE'],0,0,'L');
		$pdf->Cell(120,$z,$results['FCOLLNAME'],0,1,'L');

		$pdf->SetFont('helvetica','',10);
		$pdf->Ln(1);
		if($this->latral != 'T')
		{	
			$html = '<h4 style="background-color: #afaaa9; color: rgb(255, 255, 255);"> Fee Details</h4>';
			$x = $pdf->GetX();
			$y = $pdf->GetY();
			$pdf->writeHTMLCell(188,0,$x,$y,$html, false,1, false, true, '', false);
			$y = $pdf->getY();
			$pdf->setY($y-4);	
			
			$pdf->SetFont('helvetica','',10);
			$pdf->Cell(55,$z,'Payment Mode',0,0,'L');
			$pdf->Cell(20,$z,'Amount',0,1,'L');
			
			$pdf->SetFont('courier','',10);
			$pdf->Cell(55,$z,$results['FPAYMENTTYPE'],0,0,'L');
			$pdf->SetFont('helvetica','',10);
			$pdf->Cell(20,$z,$results['FTOTFEE'],0,1,'L');
		}
		$pdf->Ln(1);
		$pdf->SetFont('helvetica','B',10);
		$pdf->Cell(180,7,'DECLARATION',0,1,'C');
		$pdf->SetFont('helvetica','',9);

		$str = "I hereby solemnly and sincerely affirm that the statements made and information furnished in my application and also in the enclosures submitted by me are true. Should it, however be found that the information furnished therein is not factually true, I know that I am liable for prosecution and forfeiture of my admission. I have also taken note that once the admission process is over, fee shall not be refunded by the university. In case of my grievances, I shall approach the university and in case of any arbitration and any redressal of grievances I shall abide by the arbitration and territorial jurisdiction clause laid in the prospectus.";
		$pdf->MultiCell(180,$z,$str,0,'J');
		$str = "I hereby agree that the application submitted under Lateral Entry Scheme is considered only after the verification of original documents submitted by me and after the approval from the office of the Director, DDE, Kuvempu University. I hereby also declare that I do not continue my present discontinued course at same institution/University.                                     ";
		if($this->latral == 'T')
		{
			$pdf->MultiCell(180,$z,$str,0,'J');
		}
		$pdf->Ln(5);
		$pdf->SetFont('helvetica','',9);
		$pdf->Cell(180,$z,'Date : '.$this->curr_date,0,1,'L');

		$pdf->Cell(130,$z,'Place : ',0,0,'L');
		$pdf->Cell(50,$z,'Signature of the Applicant ',0,1,'R');
	
	}

	function SendOutput()
	{
		$this->pdf->Output("application_letter_{$this->app_no}.pdf","D");
	}	
}

function PrintApplicationFormPOSTOFFICE($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);

	$class_obj=new applicationFormReport();

	$class_obj->DefaultConstructor($aobj_context);

	$class_obj->formcolldata();
	$class_obj->GetData();
	if($class_obj->screen != 'ack')
	{ 
		$class_obj->WriteRect();
		 $class_obj->pos=1;
		$class_obj->formData("Post Office Copy");
		 $class_obj->pos=2;
		$class_obj->formData("College Copy");
		 $class_obj->pos=3;
		$class_obj->formData("Student Copy");
	}

	$class_obj->WriteHallTicket();
	$class_obj->SendOutput();
}
?>