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.144.227.73


Current Path : /var/www/html/gcg/adm/src/
Upload File :
Current File : //var/www/html/gcg/adm/src/applicationFormReportSBM.php

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

class applicationFormReport 
{	
	function DefaultConstructor($aobj_context)
	{
		$this->aobj_context=$aobj_context;
		//$this->pdf=  new FPDF();
		$this->pdf= new TCPDF();
		$this->pdf=$this;
		$this->app_no = trim($this->aobj_context->mobj_data["app_no"]);
		$this->ip=$_SERVER["REMOTE_ADDR"];
		$get_date="select date_format(now(),'%d-%m-%Y') 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 FPDF('L');	
		$this->pdf= new TCPDF('L');
		$this->pdf->SetMargins(2,2);			
		//$this->pdf->addPage('L');	
	}
 
	function formcolldata()
	{
		$get_coll_name="select FUNIVNAME as 'FUNIVNAME',FUNIVCODE,
		FUNIVADD1 as 'state', pdf_logo_path,
		ifnull(FEXAMAPPREQ,'F') as FEXAMAPPREQ From control";

		$lobj_get_coll_name=$this->aobj_context->mobj_db->GetRow($get_coll_name);
		
		$results = $this->aobj_context->mobj_db->GetRow($query);
		
		$this->FUNIVNAME=$lobj_get_coll_name['FUNIVNAME'];
		$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->FUNIVCODE=$lobj_get_coll_name['FUNIVCODE']; 
	}
	 
	function GetBankDetails()
	{
		//$this->FPAYMENTYPE = "VIJAYA BANK";
		$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(strpos($this->app_no, '533') !== false)
		{
			$get_app_no =" select FAPPNO, FREGNO ,FRECPTNO, FRECPTDATE, FREGFEE, 
				d.FDESCPN, FPAYMENTYPE
				from candsum inner join degree d
				on candsum.fdegree = d.fdegree and d.fexamno = 'A'
				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->reg_no=$obj_get_app_no['FREGNO'];
			$this->FRECPTDATE=$obj_get_app_no['FRECPTDATE'];
			$this->ftotfee=$obj_get_app_no['FREGFEE'];
			$this->FPAYMENTYPE=$obj_get_app_no['FPAYMENTYPE'];
			$this->FDESCPN=$obj_get_app_no['FDESCPN'];
			$get_other_details="select 	date_format(current_date,'%d/%m/%Y') as curr_date,fcaste,
			FDEGREE,FCOLLCODE,FNAME,date_format(now(),'%d/%m/%Y') as fcurrent_date
			from student where   FREGNO='{$this->reg_no}' ";	 
			$lobj_get_name = $this->aobj_context->mobj_db->GetRow($get_other_details);

			$this->fcollcode=$lobj_get_name['FCOLLCODE'];
			$this->degree=$lobj_get_name['FDEGREE'];
			$this->fname=$lobj_get_name['FNAME'];
			$this->fcaste       = $lobj_get_name['fcaste'];
			$this->curr_date=$lobj_get_name['fcurrent_date'];
		
			
		}else	
		{
			$get_app_no="select fappno,fname,
			(ifnull(ftotfee,0) + ifnull(studadm.fadmfine,0)) as ftotfee,studadm.fdegree,fcollcode,fcaste,FPAYMENTTYPE,d.FDESCPN,studadm.fexamno,
			date_format(fapplastdate,'%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 
			where fappno='{$this->app_no}'";
			$obj_get_app_no=$this->aobj_context->mobj_db->GetRow($get_app_no);
			//var_dump($get_app_no);
			$this->fappno       = $obj_get_app_no['fappno'];
			$this->fname        = $obj_get_app_no['fname'];
			$this->ftotfee      = $obj_get_app_no['ftotfee'];
			$this->fdegree      = $obj_get_app_no['fdegree'];
			$this->fcollcode    = $obj_get_app_no['fcollcode'];
			$this->fcaste       = $obj_get_app_no['fcaste'];
			$this->curr_date    = $obj_get_app_no['fcurrent_date'];
			$this->FPAYMENTYPE  = $obj_get_app_no['FPAYMENTTYPE'];
			$this->FDESCPN      = $obj_get_app_no['FDESCPN'];
			$this->lastdate     = $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->GetBankDetails();
	}
	
	function WriteRect()
	{
		$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,15,15);
			$this->pdf->Image($img_logo_path,$width+6,7,15,15);
			$this->pdf->Image($img_logo_path,$width+$width+7,7,15,15);
			
			$img_logo_path = $this->aobj_context->main_src.'img/umy.jpg';
			$this->pdf->Image($img_logo_path,82,6,15,15);
			$this->pdf->Image($img_logo_path,180,6,15,15);
			$this->pdf->Image($img_logo_path,278,6,15,15);
			
		}
		$this->pdf->setY(5);
	}	
		
	function formData($label)
	{
		$line_height=5;
		$width=96;
		$x_pos=2;
		
		$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
			);
		
		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',7);
		//var_dump($this->FUNIVNAME);
		$this->pdf->SetX($x_pos);
		$this->pdf->SetFont('Times','B',8);
		$this->pdf->Cell($jump_width,4,$this->FUNIVNAME,'0',1,'C');	
		$this->pdf->SetFont('Times','B',6);
		$this->pdf->SetX($x_pos);
		$this->pdf->Cell($jump_width,4,$this->s_state,'0',1,'C');	
		$this->pdf->SetFont('Times','B',8);
		$this->pdf->SetX($x_pos);
		$this->pdf->Cell($jump_width,$line_height,"Challan - ".$label,'0',1,'C');	
		/* $this->pdf->SetFont('Times','BU',9);
		$this->pdf->SetX($x_pos);
		$this->pdf->Cell($jump_width,$line_height,$label,'0',1,'C'); */	

		$this->pdf->SetFont('Times','B',8);
		$this->pdf->SetX($x_pos);
		$this->pdf->Cell($jump_width,$line_height,"A/C No. : {$this->acc_no}"." / IFSC CODE: {$this->ifsc_code}",'0',1,'C');	
		$this->pdf->ln(2);
		/* $this->pdf->SetX($x_pos);
		$this->pdf->Cell($jump_width,$line_height,"{$this->bank_name}",'0',1,'C'); 
		
		$this->pdf->SetX($x_pos);
		$this->pdf->Cell($jump_width,$line_height,"IFSC CODE: {$this->ifsc_code}",'0',1,'C');	
		//$this->pdf->Cell($jump_width,$line_height,"BRANCH CODE: {$this->branch_code} | IFSC CODE: {$this->ifsc_code}",'0',1,'C');	
		$this->pdf->SetX($x_pos);
		$this->pdf->Cell($jump_width,$line_height,"BANK USE ONLY",'0',1,'C');	*/	
				
		$td1_width=$jump_width*(0.30)-1;
		$td2_width=$jump_width-$td1_width-2;
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell($td1_width,$line_height,"Bank",'1',0,'L');	
		$this->pdf->Cell($td2_width,$line_height,"{$this->bank_name}",'1',1,'L');	
			
		
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell($td1_width,$line_height,"Branch Name",'1',0,'L');	
		$this->pdf->Cell($td2_width,$line_height,"{$this->branch_name}",'1',1,'L');	
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell($td1_width,$line_height,"Branch Code",'1',0,'L');	
		$this->pdf->Cell($td2_width,$line_height,"{$this->branch_code}",'1',1,'L');
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell($td1_width,$line_height,"Journal No",'1',0,'L');	
		$this->pdf->Cell($td2_width,$line_height,"",'1',1,'L');
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell($td1_width,$line_height,"Date",'1',0,'L');	
		$this->pdf->Cell($td2_width,$line_height,"{$this->curr_date}",'1',1,'L');	
		$line_height = 4;
		
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell($jump_width,$line_height,"Reference No: {$this->fappno}",'0',1,'L');	

		if($this->fregno !='')
		{		
			$this->pdf->SetX($x_pos+1);
			$this->pdf->Cell($jump_width,$line_height,"Register No: {$this->fregno}",'0',1,'L');	
		}
		
		
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell($jump_width,$line_height,"Applicant Name: {$this->fname}",'0',1,'L');	

		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell($jump_width,$line_height,"College / Degree: {$this->fcollcode} / {$this->FDESCPN} {$this->fexamname}",'0',1,'L');	
			

		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell($jump_width,$line_height,"Valid Upto : {$this->lastdate}",'0',1,'L');	
	
		
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell($jump_width,$line_height,"Fee: {$this->ftotfee}/-",'0',1,'L');	
		
		$this->pdf->SetX($x_pos+1);
		$this->pdf->SetFont('Times','',8);
		$this->pdf->MultiCell($jump_width,$line_height,"PAID TO THE CREDIT OF {$this->cheque_favour} ",0,"L");
		$line_height = 4;
		$this->pdf->SetX($x_pos+1);
		$this->pdf->SetFont('Times','B',8);
		$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($tdd1_width,$line_height,"Particulars",'1',0,'C');	
		$this->pdf->Cell($tdd2_width,$line_height,"Admission Fee",'1',0,'C');	
		$this->pdf->Cell($tdd3_width,$line_height,"Bank Charges",'1',0,'C');
		$this->pdf->Cell($tdd4_width,$line_height,"Total",'1',1,'C');

		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell($tdd1_width,$line_height,"Amount",'1',0,'C');
		
		$this->pdf->Cell($tdd2_width,$line_height,"Rs. {$this->ftotfee}/-",'1',0,'C');	
		$this->pdf->Cell($tdd3_width,$line_height,"Rs. {$this->bank_charge}/-",'1',0,'C');
		$total=($this->ftotfee+$this->bank_charge);
		$this->pdf->Cell($tdd4_width,$line_height,"Rs. {$total}/-",'1',1,'C');
			

		$this->pdf->SetX($x_pos+1);
		$in_words=getNumber($total);
		//var_dump($in_words);	
		$this->pdf->Cell($jump_width,$line_height,"Rupees In Words : ".$in_words,'0',1,'L');
		$this->pdf->ln(3);
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell($td1_width,$line_height,"Date",'0',0,'L');			 
		$this->pdf->Cell($td2_width,$line_height,"Signature of Remitter    ",'0',1,'R');

		$this->pdf->ln(3);				
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell($jump_width,$line_height,"Received Rupees",'0',1,'L');	


		$this->pdf->ln(4);
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell($td1_width,$line_height,"Date & Seal",'0',0,'L');			 
		$this->pdf->Cell($td2_width,$line_height,"Signature of Receiver   ",'0',1,'R');

		$this->pdf->SetFont('Times','',8);
		
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell(30,4,"Denomination",'1',0,'L');
		$this->pdf->Cell(10,4,"No.s",'1',0,'L');
		$this->pdf->Cell(20,4,"Rs.",'1',1,'L');
		
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell(30,4,"2000x",'1',0,'L');
		$this->pdf->Cell(10,4,"",'1',0,'L');
		$this->pdf->Cell(20,4,"",'1',1,'L');
		
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell(30,4,"500x",'1',0,'L');
		$this->pdf->Cell(10,4,"",'1',0,'L');
		$this->pdf->Cell(20,4,"",'1',1,'L');
		
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell(30,4,"100x",'1',0,'L');
		$this->pdf->Cell(10,4,"",'1',0,'L');
		$this->pdf->Cell(20,4,"",'1',1,'L');
		
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell(30,4,"50x",'1',0,'L');
		$this->pdf->Cell(10,4,"",'1',0,'L');
		$this->pdf->Cell(20,4,"",'1',1,'L');
		
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell(30,4,"20x",'1',0,'L');
		$this->pdf->Cell(10,4,"",'1',0,'L');
		$this->pdf->Cell(20,4,"",'1',1,'L');
		
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell(30,4,"10x",'1',0,'L');
		$this->pdf->Cell(10,4,"",'1',0,'L');
		$this->pdf->Cell(20,4,"",'1',1,'L');
		
		$this->pdf->SetX($x_pos+1);
		$this->pdf->Cell(30,4,"Total",'1',0,'L');
		$this->pdf->Cell(10,4,"",'1',0,'L');
		$this->pdf->Cell(20,4,"",'1',1,'L');
		
		/* $this->pdf->SetX($x_pos+1);
		$this->pdf->MultiCell($jump_width,$line_height,'1.  Accepted at all branches of ANDHRA BANK ',0,"L"); */

		$this->pdf->SetX($x_pos+1);
		$this->pdf->MultiCell($jump_width,$line_height,'1. Collecting Branch has to enter Reference No: & Name of the candidate for this transaction in core banking system',0,"L");

		 $this->pdf->SetX($x_pos+1);
		$this->pdf->Cell($jump_width,$line_height,"2. Not Transferable",'0',1,'L');	
		$this->pdf->SetX($x_pos+5);  
		
		$this->pdf->write1DBarcode($this->app_no, 'C39', '10', '173.9','100', 16, 0.3, $style, 'R');				
		$this->pdf->write1DBarcode($this->app_no, 'C39', '110', '173.9','100', 16, 0.3, $style, 'R');
		$this->pdf->write1DBarcode($this->app_no, 'C39', '210', '173.9','100', 16, 0.3, $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;
		$class_obj=new AdmissionTicket($aobj_context);		
		ini_set("memory_limit",-1);
		ini_set('max_execution_time',3300);
				
		if(strpos($this->app_no, '533') !== false) // 10354210089
		{	
			$query = "select cs.fdegree,s.FNAME,s.FFATNAME,d.fdescpn as fdegname,d.fexamname,
			IFNULL(s.fcaste,'GM') as fcaste, a.ffee,cs.fexamno,
			cs.fregno,fpaymenttranid,fpaymentstatus,date_format(fpaymentdate,'%d.%m.%Y') as paydate, fregfee, 
			cs.facountno, cs.fifsccode, cs.faadharno,
			date_format(now(),'%d/%m/%Y') as fcurrent_date,
			s.fmotname, s.fphotopath
			from regcandsum cs inner join student s
			on cs.fregno = s.fregno and cs.fdegree = s.fdegree and cs.fcollcode = s.fcollcode
			inner join degree d on cs.fdegree = d.fdegree and cs.fexamno = d.fexamno
			inner join admfeestr a on cs.fdegree = a.fdegree 
			and cs.fexamno = a.fexamno and a.fcatcode = s.fcaste and  a.fcombcode = 'ADM' 
			where IFNULL(cs.fdeleted,'') <> 'T' and cs.fappno = '{$this->app_no}'";
	
			
		}else
		{
			$query = "SELECT  DISTINCT studadm.FNAME, studadm.FFATNAME,
			ifnull(studadm.FMOTNAME,'') as FMOTNAME,
			ifnull(studadm.FSUBCASTE,'') as FSUBCASTE,
			ifnull(studadm.FBANKACNO,'') as FBANKACNO,
			ifnull(studadm.FBANKBRANCH,'') as FBANKBRANCH,
			ifnull(studadm.FIFSCCODE,'') as FIFSCCODE,
			ifnull(studadm.fregno,'') as fregno, 
			studadm.FFAT_OCC, studadm.FCASTE, 
			date_format(now(),'%d/%m/%Y') as fcurrent_date,
			if(studadm.FSEX = 'M','Male','Female') as  FSEX,
			ifnull(studadm.FHANDICAP,'None') as FHANDICAP,
			studadm.FNATIONAL,studadm.fpaymenttranid as FPAYMENTREMARKS,
			studadm.fphotopath,studadm.fsignpath,studadm.FPAYMENTDATE,
			date_format(studadm.FDOB,'%d/%m/%Y') as fdob, 
			studadm.FAADHARNO,concat(ifnull(studadm.FCURRADD1,''),'  ',
			ifnull(studadm.FCURRADD2,''), '  ',
			ifnull(studadm.FCURRADD3,''),'  ',
			ifnull(studadm.FCURDISTRICT,''), ' ,',
			ifnull(studadm.FCURSTATE,''),' - ', 
			ifnull(studadm.FCURPINCODE,'')) as fadd, 
			concat(ifnull(studadm.FPERMADD1,''),'  ',
			ifnull(studadm.FPERMADD2,''), '  ',
			ifnull(studadm.FPERMADD3,''),'  ',
			ifnull(studadm.FPERDISTRICT,''), ' ,',
			ifnull(studadm.FPERSTATE,''),' - ', 
			ifnull(studadm.FPERPINCODE,'')) as fperadd,studadm.FCONTACT_NO, 
			ifnull(studadm.fadmfine,'') as fadmfine, 
			studadm.FEMAIL,ifnull(studadm.FLANDLINE,' - ') as FLANDLINE,
			studadm.FINCOME, studadm.FDEGREE, studadm.FENGLISH,  
			studadm.FCOMBCODE, studadm.FBASICQAL,studadm.FCENSTATE, 
			studadm.FCENDISTRICT, studadm.FCOLLCODE, 
			studadm.FPREVREGNO,studadm.FPREVCOMB, studadm.FPREVCOLLEGE,
			studadm.FPREVELECTIVE, studadm.FPASSMTHYEAR,
			GROUP_CONCAT(distinct subject.FSUBSHORT,'->',
			subject.FSUBNAME ORDER BY subject.FSUBCODE 
			SEPARATOR '~') AS subjdet,studadm.FPAYMENTTYPE,studadm.FTOTFEE,
			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 options.FAPPNO = '{$this->app_no}' 
			AND ifnull(studadm.fdeleted,'') <> 'T'
			AND studadm.FAPPNO = '{$this->app_no}'
			GROUP BY options.FSLNO"; 
			
		}	
		$results =$this->aobj_context->mobj_db->GetRow($query);			  	
		$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);

		/*$html = '<h4 style="background-color: rgb(255, 0, 0); color: rgb(255, 255, 255);">background color</h4>';
		$pdf->writeHTML($html, true, false, true, false, '');*/

		$img_path = $aobj_context->main_src."/img/logo.jpg";
		if(file_exists($img_path)) 
			$pdf->Image($img_path,15,6,20,20);
		// $img_path = $aobj_context->main_src."/img/logo2.jpg";
		// if(file_exists($img_path)) 
		// 	$pdf->Image($img_path,180,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->Cell(120,4,$this->s_state ,'0',1,'C'); 
				 
		$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,'Student Name',0,0,'L');
		$pdf->SetFont('courier','',10);
		$pdf->Cell(100,$z,$results['FNAME'],0,1,'L');
		
		
		
		//$pdf->Cell(30,3,'',0,1,'L');

		$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');
		
		if($results['fregno']  != '')
		{	

			$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->SetFont('helvetica','',10);
			$pdf->Cell(30,$z,'Aadhar No.',0,0,'L');
			$pdf->SetFont('courier','',10);
			$pdf->Cell(100,$z,$results['faadharno'] ,0,1,'L');

			$pdf->SetFont('helvetica','',10);
			$pdf->Cell(30,$z,'Bank A/c number',0,0,'L');
			$pdf->SetFont('courier','',10);
			$pdf->Cell(100,$z,$results['facountno'] ,0,1,'L');

			$pdf->SetFont('helvetica','',10);
			$pdf->Cell(30,$z,'IFSC Code',0,0,'L');
			$pdf->SetFont('courier','',10);
			$pdf->Cell(100,$z,$results['fifsccode'] ,0,1,'L');
			$photo_url = "https://university-student-photos.s3.ap-south-1.amazonaws.com/033";
			//var_dump($photo_url);
			
			$photo = $results['fphotopath'];
			//var_dump($photo);
			$x = $pdf->GetX();
			$y = $pdf->GetY();

			$html = '<img width="100" height="100" src="'.$photo_url.'/'.$photo.'" />';
			//var_dump('<img width="100" height="100" src="'.$photo_url.'/'.$photo.'" />');
			$pdf->writeHTMLCell(188,0,150,40,$html, false,1, false, true, '', false);
			
			
		}
		$pdf->ln(5);
		if(strpos($this->app_no, '533') !== false)
		{

		
			$query = "select distinct fsubname,forder from regcanddet cd inner join 
			subject s on cd.fdegree = s.fdegree and cd.fexamno= s.fexamno 
			and cd.fsubcode = s.fsubcode
			where cd.fappno = '{$this->app_no}'";
			$resultssub =$this->aobj_context->mobj_db->GetAll($query);	
			if($resultssub)
			{	
				$html = '<h4 style="background-color: #afaaa9; color: rgb(255, 255, 255);"> Subject 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->ln(5);
				$pdf->SetFont('helvetica','',10);
				$pdf->Cell(2,$z,'',0,0,'L');
				$pdf->Cell(12,$z,'Sl. No.',1,0,'L');
				$pdf->Cell(160,$z,'Subject Name',1,1,'C');
				$i = 1;

				foreach ($resultssub as $key => $value) 
				{
					$pdf->SetFont('courier','',10);
					$pdf->Cell(2,$z,'',0,0,'C');
					$pdf->Cell(12,$z,$i,1,0,'C');
					$pdf->Cell(160,$z,$value['fsubname'],1,1,'L');
					$i++;
				}
			}

			$pdf->ln(5);

			$html = '<h4 style="background-color: #afaaa9; color: rgb(255, 255, 255);"> Payment 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(50,$z,"Amount  ",0,0,'L');
			$pdf->Cell(130,$z,$results['fregfee'],0,1,'L');

			$pdf->Cell(50,$z,"Payment Transaction Id  ",0,0,'L');
			$pdf->Cell(130,$z,$results['fpaymenttranid'],0,1,'L');

			$pdf->Cell(50,$z,"Payment Status  ",0,0,'L');
			$pdf->Cell(130,$z,$results['fpaymentstatus'],0,1,'L');

			$pdf->Cell(50,$z,"Payment Date ",0,0,'L');
			$pdf->Cell(130,$z,$results['paydate'],0,1,'L');

		}else
		{	
		$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('oasis/gcg/adm','studentportal2/gcg',$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,'Caste',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['FSUBCASTE'],0,1,'L');

		$pdf->ln(2);

		$pdf->SetFont('helvetica','',10);
		$pdf->Cell(30,$z,'Handicap',0,0,'L');
		$pdf->Cell(30,$z,'Nationality',0,0,'L');
		$pdf->Cell(30,$z,'Annual Income',0,0,'L');
		$pdf->Cell(30,$z,'Occupation',0,1,'L');

		$pdf->SetFont('courier','',10);
		$pdf->Cell(30,$z,$results['FHANDICAP'],0,0,'L');
		$pdf->Cell(30,$z,$results['FNATIONAL'],0,0,'L');
		$pdf->Cell(30,$z,$results['FINCOME'],0,0,'L');
		$pdf->Cell(30,$z,$results['FFAT_OCC'],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(40,$z,'Landline',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');
		$pdf->Cell(40,$z,$results['FLANDLINE'],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(2);

		$pdf->SetFont('helvetica','',10);
		$pdf->Cell(30,$z,'Bank Branch',0,0,'L');
		$pdf->Cell(40,$z,'IFSC Code',0,0,'L');
		$pdf->Cell(30,$z,'Bank A/C No',0,1,'L');

		$pdf->SetFont('courier','',10);
		$pdf->Cell(30,$z,$results['FBANKBRANCH'],0,0,'L');
		$pdf->Cell(40,$z,$results['FIFSCCODE'],0,0,'L');
		$c = $pdf->getY();
		$c -= 8;
		$pdf->Cell(30,$z,$results['FBANKACNO'],0,1,'L');
		$pdf->SetFont('helvetica','',10);
		$pdf->Ln(2);
		$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,'Subject 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(2);
			$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,'Combination',0,0,'L');
			$pdf->Cell(40,$z,'Electives',0,0,'L');
			$pdf->Cell(40,$z,'Register No',0,1,'L');

			$pdf->SetFont('courier','',10);
			$pdf->Cell(40,$z,$results['FBASICQAL'],0,0,'L');
			$pdf->Cell(40,$z,$results['FPREVCOMB'],0,0,'L');
			$pdf->Cell(40,$z,$results['FPREVELECTIVE'],0,0,'L');
			$pdf->Cell(40,$z,$results['FPREVREGNO'],0,1,'L');

			$pdf->Ln(2);
			
			$pdf->SetFont('helvetica','',10);
			$pdf->Cell(40,$z,'Month / Year of Passing',0,0,'L');
			$pdf->Cell(40,$z,'Institution / University',0,1,'L');

			$pdf->SetFont('courier','',10);
			$pdf->Cell(40,$z,$results['FPASSMTHYEAR'],0,0,'L');
			$pdf->Cell(40,$z,$results['FPREVCOLLEGE'],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(2);

		$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(2);
		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');
			
			
			if($results['FPAYMENTTYPE'] == "VIJAYA BANK")
			{
				$pdf->Cell(18,$z,'Amount',0,0,'L');
				$str = "(Make the payment at the bank along with the challan and";
				$pdf->Cell(117,$z,$str,0,1,'J');
			}
			else
			{
				$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);

			if($results['FPAYMENTTYPE'] == "VIJAYA BANK")
			{
				$pdf->Cell(18,$z,$results['FTOTFEE'],0,0,'L');
				$str = "attach the challan copy while submitting application to the College)";
				$pdf->Cell(117,$z,$str,0,1,'J');
			}
			else
			{
				$pdf->Cell(20,$z,$results['FTOTFEE'],0,1,'L');
			}

			$pdf->Ln(2);
			$studreg = "";
			
			if($results['fadmfine'] != '' and $results['fadmfine'] != 0)
				 $pdf->Cell(42,$z,'Fine :'.$results['fadmfine'],0,1,'L');

			if($results['fregno'] != '')
				$studreg = " Register No : ".$results['fregno'];
				$pdf->Cell(42,$z,'Reference No : '.$this->fappno .' '.$studreg,0,1,'L');
			
			$pdf->Cell(42,$z,'Payment Date',0,0,'L');
			$pdf->Cell(43,$z,'UTR No',0,0,'L');
			$pdf->Cell(43,$z,'Drawee Bank',0,0,'L');
			$pdf->Cell(42,$z,'Bank Branch',0,1,'L');

			$pdf->SetLineStyle(array('width' => 0.3, 'cap' => 'butt', 'join' => 'miter', 'dash' => 1, 'color' => '#000000'));
			
			
			
			$pdf->SetFont('courier','',10);
			$pdf->Cell(40,$z,$results['FPAYMENTDATE'],1,0,'L');
			$pdf->Cell(3,$z,'',0,0,'L');
			$pdf->Cell(40,$z,$results['FPAYMENTREMARKS'],1,0,'L');
			$pdf->Cell(3,$z,'',0,0,'L');
			$pdf->Cell(40,$z,'',1,0,'L');
			$pdf->Cell(3,$z,'',0,0,'L');
			$pdf->Cell(40,$z,'',1,1,'L');
			$z = 4;
		}
	}
		$pdf->Ln(9);
		$pdf->SetLineStyle(array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => '#000000'));
		$pdf->SetFont('helvetica','',10);
		$pdf->Cell(180,$z,'Date : '.$results['fcurrent_date'],0,1,'L');

		$pdf->Cell(130,$z,'Place : ',0,0,'L');
		$pdf->Cell(50,$z,'Signature of the Applicant ',0,1,'R');
		$pdf->setY(268);
		
		$pdf->Cell(180,7,'Page - 1',0,1,'C');

		$pdf->SetMargins(20,20,20,5);	
		//$pdf->SetMargins(28,3);
		$z = 5;
		$pdf->aobj_context =$aobj_context ;
		$pdf->SetFillColor(248, 248 ,255);		
		$pdf->SetFont('Times','',10);
		$pdf->AddPage("P");

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


		
		$pdf->SetFont('helvetica','B',10);
		$pdf->Cell(180,7,'DECLARATION',0,1,'C');
		$pdf->SetFont('helvetica','',9);

		/*$str = "<span>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,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I know that I am liable for prosecution and forfeiture of my admission. I have also taken note
		that once the admission process &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</span>";
	
		//$x = $pdf->GetX();
		$y = $pdf->GetY();
		$pdf->writeHTMLCell(188,0,$x,$y,$str, false,1, false, true, '', false);*/
		$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');
		$pdf->Ln(10);
		$pdf->SetFont('helvetica','',9);
		$pdf->Cell(180,$z,'Date : '.$results['fcurrent_date'] ,0,1,'L');

		$pdf->Cell(130,$z,'Place : ',0,0,'L');
		$pdf->Cell(50,$z,'Signature of the Applicant ',0,1,'R');
	
		$pdf->setY(268);
		$pdf->Cell(180,7,'Page - 2',0,1,'C');
	}
		
	function SendOutput()
	{
		$this->pdf->Output("application_letter_{$this->app_no}.pdf","I");
	}	 
}

function PrintApplicationFormSBM($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->FPAYMENTYPE == 'BANK')
	{	
		$class_obj->WriteRect();
		$class_obj->pos=1;
		$class_obj->formData("Bank 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();
}
?>