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


Current Path : /var/www/html/kusdde/Report_details/
Upload File :
Current File : /var/www/html/kusdde/Report_details/generatePostAdmissionTicket_12122018.php

<?php

class AdmissionTicket
{
	
	public $aobj_context;
	public $degree_code;
	public $registor_no_starts;
	public $registor_no_ends;
	public $print_per_page;
	public $sub_appearing_count;
	public $std_adm_count;
	public $sub_arr;
	public $std_arr;
// university
	public $std_FUNIVNAME ;
	public $std_FUNIVCODE ;
	public $std_FTOWN;	
// college info	
	public $college_code;
	public $college_name;
	public $college_address;
// student info
	public $STD_RegNo;
	public $STD_CollCode;
	public $STD_Course;
	public $STD_Name;
	public $STD_FAT;
	public $STD_MAT;
	public $STD_DOB;	
	public $CollDetails;	
	public $ADMNUM;	
	public $bth_flag;
	public $FUNIVCODE;	
	
	
	function __construct($aobj_context)
    {
		$this->aobj_context=$aobj_context;
		$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
		session_start();
		//$this->college_code = $_SESSION['collcode']; 
		
		$bth_flag=0;
		$main_src_obj=(explode("/",$_SERVER["REQUEST_URI"]));
		$this->main_src=$main_src_obj[1];
	}
	
	function getUniversityDetails()
	{
		$page_header_university = "select FUNIVNAME,FTOWN,FHTTEXT,FUNIVADD1  from control";		
		$lobj_page_header_university = $this->aobj_context->mobj_db->GetRow($page_header_university);		
		$this->std_FUNIVNAME = $lobj_page_header_university[FUNIVNAME];
		$this->std_FTOWN = $lobj_page_header_university[FTOWN];
		$this->std_FHTTEXT = $lobj_page_header_university[FHTTEXT];
		$this->std_FUNIVADD1 = $lobj_page_header_university[FUNIVADD1];
		//var_dump($this->std_FHTTEXT);
	}	
	
	function getCollegeDetails()
	{
		$page_header_college = "select c.FCOLLCODE, c.FCOLLNAME, c.FEXAMCNTR,
		ec.FCOLLNAME AS exam_center_name,
		CONCAT(c.FCOLLADD1,SPACE(2), c.FTOWN,'\n',c.FEXAMCNTR) AS COLLEGE_ADRS 
		FROM college c LEFT JOIN college ec ON ec.FCOLLCODE=c.FEXAMCNTR
		WHERE c.FCOLLCODE='{$this->college_code}'";
		//var_dump($class_obj->fcollcode); 
		$lobj_page_header_college = $this->aobj_context->mobj_db->GetRow($page_header_college);
		$this->college_code = $lobj_page_header_college['FCOLLCODE'];
		$this->FEXAMCNTR = $lobj_page_header_college['FEXAMCNTR'];
		$this->exam_center_name = $lobj_page_header_college['exam_center_name'];
		$this->college_name = $lobj_page_header_college['FCOLLNAME'];
		$this->college_address = $lobj_page_header_college['COLLEGE_ADRS'];

	}
	
	function getStudentDetails()
	{
		session_start();
	//	$FUNIVCODE = $_SESSION['FUNIVCODE'];
		$FUNIVCODE = $this->FUNIVCODE;
		if($FUNIVCODE == '008')
		{
			$fyear = "1=1";
		}else
		{
			$fyear = "D.fmeyear = cs.fyear";
		}
		
		if($this->exam != 'all')
			$examstr = "and D.fexamno = '{$this->exam}'";
		else
			$examstr = "";

		$get_student_data = "SELECT distinct S.FDEGREE,S.FREGNO,S.FCOLLCODE,ifnull(S.FPHOTOPATH,'') as photo_path,
		concat(left(col.FCOLLNAME,100),',',space(1), left(col.FTOWN,100)) as CollDetails  ,
		concat(ec.FCOLLNAME,', ',ec.ftown) AS exam_center_name,col.FCOLLNAME as FCOLLNAME,
		cs.FCNTRCODE AS FEXAMCNTR,col.FCOLLCODE,CONCAT(D.FDESCPN) AS COURSE, D.FEXAMDATE,
		S.FNAME,S.FFATNAME,S.FMOTNAME,S.fstudid,DATE_FORMAT(S.FDOB,'%d/%m/%Y') AS FDOB
		FROM student S INNER JOIN degree D ON S.FDEGREE=D.FDEGREE 
		INNER JOIN college col ON S.FCOLLCODE=col.FCOLLCODE
		INNER join candsum cs on S.fdegree = cs.fdegree and S.fregno = cs.fregno
		LEFT JOIN college ec ON ec.FCOLLCODE=cs.FCNTRCODE
		INNER join colldeg on colldeg.fdegree = cs.fdegree and colldeg.fcollcode = cs.fcollcode
		WHERE S.FREGNO>='{$this->registor_no_starts}' AND S.FREGNO<='{$this->registor_no_ends}' 
		AND S.FDEGREE='{$this->degree_code}' and cs.FCOLLCODE='{$this->college_code}'
		and cs.frecptdate is not null 
		and ifnull(S.fexamappblk,'') <> 'T' and ifnull(S.fmp,'') <> 'T' 
		and {$fyear} and left(D.fmeexamtyp,1) = left(cs.fexamtype,1)
		order by S.FREGNO";	
		//var_dump($get_student_data);
		$lobj_get_student_data = $this->aobj_context->mobj_db->GetAll($get_student_data);
		$this->std_adm_count = count($lobj_get_student_data);
	//var_dump($get_student_data);
		$query = "select distinct r.FDESCPN from degree d,reason r where r.FREASONCD = d.FFACULTY and d.FDEGREE='{$this->degree_code}'";
		$this->result = $this->aobj_context->mobj_db->GetRow($query);
		$this->FFACULTY = $this->result['FDESCPN'];
		
		foreach($lobj_get_student_data as  $rek=>$rev)
		{		
			
			$full_photo_path="";
			$full_photo_path = trim($this->aobj_context->main_src."/".$rev['photo_path']);
			if($this->rptype == 'wp')
			{	
				if(file_exists($full_photo_path) && !empty($rev['photo_path']))
				{
					$this->std_arr[$rev['FREGNO']]['FREGNO'] = $rev['FREGNO'];
					$this->std_arr[$rev['FREGNO']]['FCOLLCODE'] = $rev['FCOLLCODE'];
					$this->std_arr[$rev['FREGNO']]['FCOLLCODE'] = $rev['FCOLLCODE'];
					$this->std_arr[$rev['FREGNO']]['COURSE'] = $rev['COURSE'];
					$this->std_arr[$rev['FREGNO']]['FNAME'] = $rev['FNAME'];
					$this->std_arr[$rev['FREGNO']]['FFATNAME'] = $rev['FFATNAME'];
					$this->std_arr[$rev['FREGNO']]['FMOTNAME'] = $rev['FMOTNAME'];
					$this->std_arr[$rev['FREGNO']]['FDOB'] = $rev['FDOB'];
					$this->std_arr[$rev['FREGNO']]['EXAMDATE'] = $rev['FEXAMDATE'];
					$this->std_arr[$rev['FREGNO']]['FCOLLNAME'] = $rev['FCOLLNAME'];
					$this->std_arr[$rev['FREGNO']]['CollDetails'] = $rev['CollDetails'];
					$this->std_arr[$rev['FREGNO']]['photo_path'] = $rev['photo_path'];
					$this->std_arr[$rev['FREGNO']]['fstudid'] = $rev['fstudid'];
					$this->std_arr[$rev['FREGNO']]['FEXAMCNTR'] = $rev['FEXAMCNTR'];
					$this->std_arr[$rev['FREGNO']]['exam_center_name'] = $rev['exam_center_name'];
					
				}
			}
			else if($this->rptype == 'wop')
			{
				
				if(!file_exists($full_photo_path))
				{
					$this->std_arr[$rev['FREGNO']]['FREGNO'] = $rev['FREGNO'];
					$this->std_arr[$rev['FREGNO']]['FCOLLCODE'] = $rev['FCOLLCODE'];
					$this->std_arr[$rev['FREGNO']]['FCOLLCODE'] = $rev['FCOLLCODE'];
					$this->std_arr[$rev['FREGNO']]['COURSE'] = $rev['COURSE'];
					$this->std_arr[$rev['FREGNO']]['FNAME'] = $rev['FNAME'];
					$this->std_arr[$rev['FREGNO']]['FFATNAME'] = $rev['FFATNAME'];
					$this->std_arr[$rev['FREGNO']]['FMOTNAME'] = $rev['FMOTNAME'];
					$this->std_arr[$rev['FREGNO']]['FDOB'] = $rev['FDOB'];
					$this->std_arr[$rev['FREGNO']]['EXAMDATE'] = $rev['FEXAMDATE'];
					$this->std_arr[$rev['FREGNO']]['FCOLLNAME'] = $rev['FCOLLNAME'];
					$this->std_arr[$rev['FREGNO']]['CollDetails'] = $rev['CollDetails'];
					$this->std_arr[$rev['FREGNO']]['photo_path'] = $rev['photo_path'];
					$this->std_arr[$rev['FREGNO']]['fstudid'] = $rev['fstudid'];
					$this->std_arr[$rev['FREGNO']]['FEXAMCNTR'] = $rev['FEXAMCNTR'];
					$this->std_arr[$rev['FREGNO']]['exam_center_name'] = $rev['exam_center_name'];
				}
			}
			else
			{
					$this->std_arr[$rev['FREGNO']]['FREGNO'] = $rev['FREGNO'];
					$this->std_arr[$rev['FREGNO']]['FCOLLCODE'] = $rev['FCOLLCODE'];
					$this->std_arr[$rev['FREGNO']]['FCOLLCODE'] = $rev['FCOLLCODE'];
					$this->std_arr[$rev['FREGNO']]['COURSE'] = $rev['COURSE'];
					$this->std_arr[$rev['FREGNO']]['FNAME'] = $rev['FNAME'];
					$this->std_arr[$rev['FREGNO']]['FFATNAME'] = $rev['FFATNAME'];
					$this->std_arr[$rev['FREGNO']]['FMOTNAME'] = $rev['FMOTNAME'];
					$this->std_arr[$rev['FREGNO']]['FDOB'] = $rev['FDOB'];
					$this->std_arr[$rev['FREGNO']]['EXAMDATE'] = $rev['FEXAMDATE'];
					$this->std_arr[$rev['FREGNO']]['FCOLLNAME'] = $rev['FCOLLNAME'];
					$this->std_arr[$rev['FREGNO']]['CollDetails'] = $rev['CollDetails'];
					$this->std_arr[$rev['FREGNO']]['photo_path'] = $rev['photo_path'];
					$this->std_arr[$rev['FREGNO']]['fstudid'] = $rev['fstudid'];
					$this->std_arr[$rev['FREGNO']]['FEXAMCNTR'] = $rev['FEXAMCNTR'];
					$this->std_arr[$rev['FREGNO']]['exam_center_name'] = $rev['exam_center_name'];
					$this->std_arr[$rev['FREGNO']]['FFACULTY'] = $this->FFACULTY;
			}
		} 	 
	}
	
	function getSubjectAppearing() //date_format(FDOE,'%d/%m/%Y')
	{
		session_start();
		$FUNIVCODE = $_SESSION['FUNIVCODE'];
		
		$FUNIVCODE = $this->FUNIVCODE;
		/* if($FUNIVCODE == '008')
		{
			$present = "1=1";	
		}else
		{
			$present = "c.fpresent = 'P'";
		} */
		
		if($FUNIVCODE == '026')
		{
			$order = "ORDER BY s.FTHEORY desc, s.FCSUBCODE";
		}
		else
		{
			$order = "ORDER BY s.FTHEORY desc,s.FDOE, s.FSESSION,d.FEXAMNO";
		}

		$sub = "GROUP_CONCAT(c.FEXAMNO,'->',s.FCSUBCODE ,'->',s.FSUBNAME,' ',concat('[',s.FSSUBNAME,']'),'->',if(s.fcsubcode = a.fsubcode,a.fremarks,''),'->', 
		s.FSHORTNAME,'->',concat(if(date_format(FDOE,'%d/%m/%Y')!='00/00/0000',
		date_format(FDOE,'%d/%m/%Y'),''),' - ',ifnull(rs.fdescpn,''),'->',if('{$FUNIVCODE}' = '018',FSUBSHORT,FQPCODE)) 
		{$order}  SEPARATOR '~')";
		$subsidary = "";
		

		if($this->exam != 'all')
			$examstr = "and d.fexamno = '{$this->exam}'";
		else
			$examstr = "";

		$get_subject_appearing = "SELECT c.FDEGREE, cs.FREGNO AS FREGNO , 
		GROUP_CONCAT(d.FEXAMNAME ORDER BY s.FTHEORY desc, s.FDOE, s.FSESSION,d.FEXAMNO) EXAMNAME,a.FREMARKS,
		GROUP_CONCAT(c.FEXAMNO ORDER BY c.FEXAMNO,c.FSUBCODE) FEXAMNO, c.FREGNO,
		{$sub} AS SUBCODE , 
		GROUP_CONCAT(ifnull(s.FSUBNAME,''),' ',ifnull(s.FSSUBNAME,''),
		' [',ifnull(FSUBSHORT,''),']' ORDER BY s.FCSUBCODE) AS SUBDECPN,
		ifnull(FRECPTDATE,'') as receipt_date FROM canddet c INNER JOIN subject s ON
		c.FDEGREE=s.FDEGREE AND c.FEXAMNO=s.FEXAMNO AND c.FSUBCODE=s.FSUBCODE AND s.FINTASS!='T' 
		AND INSTR(ifnull(c.fthpr,''), s.ftheory) <= 0
		left outer join reason rs on s.fsession = rs.freasoncd
		inner join degree d on c.FDEGREE= d.FDEGREE AND c.FEXAMNO=d.FEXAMNO
		and d.FADYEAR=c.FYEAR
		and left(d.FADEXAMTYP,1)=left(c.FEXAMTYPE,1)
		inner join candsum cs on 
		cs.FDEGREE=c.FDEGREE AND cs.FREGNO=c.FREGNO AND 
		cs.FCOLLCODE=c.FCOLLCODE
		left join attshort a on a.fregno = c.fregno and s.fcsubcode = a.fsubcode
		AND c.FYEAR=cs.FYEAR
		and left(c.FEXAMTYPE,1)=left(cs.FEXAMTYPE,1)
		WHERE c.FDEGREE='{$this->degree_code}' 
		AND c.FCOLLCODE='{$this->college_code}' 
		AND ifnull(c.FPASSMTH,'') = '' AND c.fpresent = 'P'
		and c.FREGNO >= '{$this->registor_no_starts}' 
		AND c.FREGNO <='{$this->registor_no_ends}' 
		and cs.frecptdate is not null  is not null {$subsidary}
		GROUP BY c.FREGNO, c.FDEGREE";	
		//var_dump($get_subject_appearing);
		$this->aobj_context->mobj_db->execute("SET @@session.group_concat_max_len=100000");	
		$this->lobj_get_subject_appearing = $this->aobj_context->mobj_db->GetAll($get_subject_appearing);
		$this->receipt_date_arr=array();
	
		foreach($this->lobj_get_subject_appearing as $suk=>$suv)
		{		
			//var_dump($suv['SUBCODE']);
			
			$this->std_arr[$suv[FREGNO]]['SUBCODE']=$suv['SUBCODE'];
			$this->std_arr[$suv[FREGNO]]['FEXAMNO']=$suv['FEXAMNO'];
			$this->std_arr[$suv[FREGNO]]['EXAMNAME']=$suv['EXAMNAME'];
			$this->std_arr[$suv[FREGNO]]['FREMARKS']=$suv['FREMARKS'];
			if(!empty($suv['receipt_date']))
			$this->receipt_date_arr[$suv[FREGNO]]=$suv['receipt_date'];	

		} 
			
	}	
}

function generatePostAdmissionTicket($aobj_context)
{
		include_once("stringspliter.php");
		session_start();
		$FUNIVCODE = $_SESSION['FUNIVCODE'];
		
		
		$class_obj=new AdmissionTicket($aobj_context);		
		ini_set("memory_limit",-1);
		ini_set('max_execution_time',3300);
		$class_obj->degree_code	= $aobj_context->mobj_data["degree_code"];
		
		
		if(preg_match('[^BTH]', $class_obj->degree_code))
		$class_obj->bth_flag=1;
		
		$class_obj->registor_no_starts= $aobj_context->mobj_data["reg_starts"];
		$class_obj->registor_no_ends= $aobj_context->mobj_data["reg_ends"]; 
		$class_obj->college_code = $aobj_context->mobj_data["fcollcode"];
		$class_obj->FUNIVCODE = $aobj_context->mobj_data["FUNIVCODE"];
		$FUNIVCODE = $aobj_context->mobj_data["FUNIVCODE"];
				
		$class_obj->rptype = $aobj_context->mobj_data["rptype"];  
		$class_obj->exam = $aobj_context->mobj_data["exam"]; 
		
		 
		$main_src=substr($_SERVER['SCRIPT_FILENAME'],0,strlen($_SERVER['SCRIPT_FILENAME'])-7);
		$pdf_writer_class =$main_src."/tcpdf/tcpdf.php";
		//$pdf_writer_class =$main_src."/tarka_pdf/fpdf.php";
		include_once("stringspliter.php");
		require_once($pdf_writer_class);
		
		//include($pdf_writer_class);		
		//$pdf= new FPDF();
		$pdf= new TCPDF();;
		$main_src_obj=(explode("/",$_SERVER["REQUEST_URI"]));
	$main_src=$main_src_obj[1];
	
	$pdf_reader_class=$aobj_context->main_src."/tarka_pdf/fpdi/FPDI_Protection.php";	
	$pdf_psw_function=$aobj_context->main_src."/tarka_pdf/TarkaPDFEncryption.php";
	$pdf_writer_class=$aobj_context->main_src."/tarka_pdf/fpdf.php";
	$root_pdf_file_download=$aobj_context->main_src."/Report_details/output/report_adm_ticket.pdf";

	include($pdf_writer_class);		
	$pdf= new FPDF(); 	
	$pdf->SetMargins(10,5,15);	
	$pdf->aobj_context =$aobj_context ;
	$pdf->WhichReport = 'AdmissionTicket';
	$pdf->SetFillColor(248, 248 ,255);		
	$pdf->SetFont('Times','',10);
	$pdf->AddPage();
	$pdf->Rect(5,10,200,280);

		$adm_details=$class_obj->getUniversityDetails();
	$adm_details=$class_obj->getCollegeDetails();
	$adm_details=$class_obj->getStudentDetails();
	$adm_details=$class_obj->getSubjectAppearing();
	$page_cnt=1;
	//var_dump($class_obj->std_arr);
	foreach($class_obj->std_arr as $reg_k=>$reg_v)
	{
		
		
		$url = $aobj_context->main_src;
		$full_photo_path = "";
		$full_photo_path = trim($url."/".$reg_v['photo_path']);
		$photo2 = substr($reg_v['photo_path'],0,-3).'JPG';
		$full_photo_path_2 = trim($url."/".$photo2);
		//var_dump($url);
		$url2 = str_replace('oasis/kusdde','studentportal2/kusdde',$url);
		$regphoto_path = $url2.'/student_photos/'.$class_obj->college_code.'/'.strtolower($class_obj->degree_code).'/'.strtoupper($class_obj->registor_no_starts).'.jpg';
		
		if(file_exists($full_photo_path) && !empty($reg_v['photo_path']))
		{
			$pdf->Image($full_photo_path,165,$pdf->GetY(),27,27);	
			
		}else if(file_exists($full_photo_path_2))
		{
			$pdf->Image($full_photo_path_2,165,$pdf->GetY(),27,27);	
		}
		else if(file_exists($regphoto_path))
		{
			$pdf->Image($regphoto_path,165,$pdf->GetY(),27,27);	
		}		
		else
		{	
			continue;	
		}	
		
		$pdf->Ln(-3);	
		//$pdf->SetLineWidth(0.01);
		$pdf->SetLineWidth(0.01);
		$pdf->SetFont('Times','B',16);	
		$img_path=$aobj_context->main_src."/img/report_uni_logo.jpg";
		if(file_exists($img_path)) 
		$pdf->Image($img_path,15,17,22);
		$pdf->Cell(0,4,$class_obj->std_FUNIVNAME,0,1,'C');
		$pdf->SetFont('Times','',8);
		$pdf->Cell(0,4,$class_obj->std_FUNIVADD1,0,1,'C');
		$pdf->SetFont('Times','B',11);
		$pdf->Ln(1);
		$pdf->Cell(0,5,'ADMISSION TICKET ' ,'0',1,'C'); 
		$pdf->SetFont('Times','',8);
		$pdf->Cell(0,5,$reg_v['EXAMDATE'].' EXAMINATION ' ,'0',1,'C'); 
		$pdf->SetFont('Times','',10);
		$pdf->Ln(4);
		$pdf->SetFont('Times','',10);
		$pdf->SetFont('Times','B',9); 
		$pdf->Cell(25,5,' Course',0,0,'L');	$pdf->Cell(3,5,' :  ',0,0,'L');	
		$pdf->SetFont('Times','',9);				
		$pdf->Cell(120,5,''.$reg_v['COURSE'],0,1,'L'); 
			 
				 
		$pdf->SetFont('Times','B',9); 
		$pdf->Cell(25,5,' College / Centre',0,0,'L'); $pdf->Cell(3,5,' :  ',0,0,'L');
		$pdf->SetFont('Times','',9); 
		$pdf->MultiCell(96,5,''. $reg_v['FCOLLCODE']." - ".$reg_v['CollDetails'],0,"L");
		$pdf->SetFont('Times','B',9); 
		$pdf->Cell(25,5,' Exam Centre',0,0,'L'); $pdf->Cell(3,5,' :  ',0,0,'L');
		$pdf->SetFont('Times','',9); 
		$pdf->MultiCell(100,5,''. $reg_v['FEXAMCNTR']." - ".$reg_v['exam_center_name'],0,'L'); 
		//$pdf->Cell(120,6,'As per the Notification',0,1,'L'); 
		
		$pdf->SetFont('Times','B',9); 
		$pdf->Cell(25,5,' Reg. No.',0,0,'L'); $pdf->Cell(3,5,' :  ',0,0,'L');
		$pdf->SetFont('Times','B',9); 
		$pdf->Cell(120,5,''.$reg_v['FREGNO']. '      Student Id.: '.$reg_v['fstudid'],0,1,'L'); 
		$pdf->SetFont('Times','B',9); 
		$pdf->Cell(25,5," Student's Name",0,0,'L'); $pdf->Cell(3,5,' :  ',0,0,'L');
		$pdf->SetFont('Times','',9); 
		$pdf->Cell(120,5,''.$reg_v['FNAME'],0,1,'L'); 
			
				 
		$pdf->Ln(1);
		$pdf->SetFont('Times','B',10);
		$pdf->Cell(0,5,'Subject Appearing',0,1,'C');				
		$pdf->SetFont('Times','B',8);
		$pdf->Cell(7,4,"Sl. ","LTR",0,"C");
		$pdf->Cell(10,4,"Sub.","LTR",0,"C");
		$pdf->Cell(75,4,"Subject Title","LTR",0,"C");
		$pdf->Cell(14,4,"QP","LTR",0,"C");
		$pdf->Cell(45,4,"Date and Time","LTR",0,"C");
		$pdf->Cell(20,4,"Answer","LTR",0,"C");			
		$pdf->Cell(20,4,"Invigilator","LTR",1,"C");
		
		$pdf->Cell(7,4,"No. ","BLR",0,"C");
		$pdf->Cell(10,4,"Code","BLR",0,"C");
		$pdf->Cell(75,4,"","BLR",0,"C");
		$pdf->Cell(14,4,"Code","BLR",0,"C");
		$pdf->Cell(45,4,"","BLR",0,"C");
		$pdf->Cell(20,4,"Book No.","BLR",0,"C");			
		$pdf->Cell(20,4,"Signature","BLR",1,"C");
		$pdf->SetFont('Times','',9);	
			
			$header = array("Sl. No", "Sub.", "Subject Title", "QP.","Date and Time","Answer","Signature");
			// Headers and widths
	
			$w = array(7,10, 75,14,45,20,20);
		
			$pdf->SetFont('Times','',8);
			// Mark start coords

			$x = $pdf->GetX();
			$y = $pdf->GetY();


			$sub_arr=$reg_v[SUBCODE];

			$subj_arr=explode("~",$sub_arr);
			$sl_no=1;

			foreach($subj_arr as $ek)
			{
				$explode_arr=explode("->",$ek);

				//var_dump($explode_arr);

				$y1 = $pdf->GetY();
				$X1 = $pdf->GetX();
				$pdf->SetXY($X1+17,$y1);
				$pdf->MultiCell($w[2],4, $explode_arr[2], 'LRB',1);	
				$y2 = $pdf->GetY();
				$yH = $y2 - $y1;

				$pdf->SetXY($x + $w[2]-75, $pdf->GetY() - $yH);

				$pdf->Cell($w[0], $yH, $sl_no, 'LRB',0,'C');
				$pdf->Cell($w[1], $yH, $explode_arr[1], 'LRB',0,'C');	
				$X3 = $pdf->GetX();
				$Y3 = $pdf->GetY();
				$sub_short=$explode_arr[6];
				$pdf->SetXY($X3+75,$Y3);
				$pdf->Cell($w[3], $yH, $sub_short, 'LRB', 0, 'C');
				$X4 = $pdf->GetX();
				$Y4 = $pdf->GetY();
				$pdf->SetXY($X3+89,$Y3);
				$pdf->Cell($w[4], $yH, $explode_arr[5], 'LRB', 0, 'C');
				$pdf->SetXY($X3+134,$Y3);
				$pdf->Cell($w[5], $yH,'', 'LRB', 0, 'C');
				$pdf->SetXY($X3+154,$Y3);
				$pdf->Cell($w[6], $yH,'', 'LRB', 0, 'C');
				$pdf->Ln();

				$sl_no++;
			}

			$pdf->Ln(3);
			$YA = $pdf->GetY();
			$pdf->Ln(3);
			$pdf->Rect(10,$YA,191,35);
			$pdf->SetFont('Times','',9);		 
			$pdf->Cell(25,5,'Note : 1. Candidate is advised to check the Register no., QP code and OMR QP series before answering.','0',1,'L');
			$pdf->Cell(25,5,'           2. Supervisor should verify the Register no. and QP code before signing.','0',1,'L');
			$pdf->Cell(25,5,'           3. Before answering, please read the instructions given in the Answer Booklet.','0',1,'L');
			$pdf->Cell(62,5,'           4. Time table printed in the Hall Ticket is ','0',0,'L');  
			
			$pdf->SetFont('Times','B',9);	$pdf->Cell(14,5,' Tentative ',0,0,'L');$pdf->SetFont('Times','',9);	$pdf->Cell(25,5,' and is given for the',0,0,'L');
			$pdf->SetFont('Times','B',9);	$pdf->Cell(29,5,' information purpose',0,0,'L');$pdf->SetFont('Times','',9);$pdf->Cell(20,5,' only.',0,1,'L');				
			
			$pdf->Cell(25,5,'                 Please verify the Final Time Table available at your Centre or Visit Web site www.kuvempu.ac.in','0',1,'L');
			//$pdf->Cell(25,5,'           5. Exam Centre Details will be available at www.logisys.net.in/kus','0',1,'L'); 			
						$pdf->SetFont('Times','BU',9);
			$pdf->Cell(10,6,'',0,0,'L');
			
	
			//For all the non-semester and semester students of colleges belongs to Chitradurga and Davanagere district, the Exam center will be at SAHYADRI ARTS & COMMERCE COLLEGE, SHIVAMOGGA.
			$pdf->Ln(3);
			
			
			$pdf->SetFont('Times','',9);	
			$pdf->Ln(10);
			$img_x=($pdf->getX()+140);;
			$img_y=$pdf->getY()-5;
			$img_path=$aobj_context->main_src."/img/controler_sign.jpg";
			if(file_exists($img_path)) 
				$pdf->Image($img_path,$img_x,$img_y,40);
			//$pdf->Cell(90,5,'Student Signature	','0',0,'L');
			//$pdf->Cell(36,5,'Controller of Examinations','0',1,'L');
			$pdf->Ln(4);
			$pdf->Cell(140,5,'','0',0,'L');
			IF($class_obj->std_FUNIVCODE==='021')
				$pdf->Cell(36,6,'Controller of Examinations','0',1,'L');
			ELSE
			$pdf->Cell(36,6,'Registrar (Evaluation)','0',1,'L');
			
			$pdf->Ln(10);
			$pdf->Cell(110,5,'Student Signature	','0',0,'L');
			// $pdf->Cell(36,5,'I certify that this candidate is eligible to appear for the','0',0,'L');			
			$pdf->Ln(4);
			// $pdf->Cell(36,5,'                                                                                                                                           current examination as per the details mentioned above','0',1,'L');			
			$pdf->Ln(10); 
			// $pdf->Cell(36,5,'                                                                                                                                           Principal / Coordinator Signature with seal','0',1,'L');			
			$date=date("F j, Y, g:i a");  
			$pdf->Cell(140,5,"Date: ",'0',0,'L');
			$pdf->Ln(6);
			$pdf->SetFont('Times','',7);
			$pdf->MultiCell(191,5,'Visit www.kuvempu.ac.in > Pariksha Mitra for various online services regarding - Exam Application Form / Results / NCL Cancellation / Name Correction of the Marks Card / In Processing Certificate / Consolidation of Marks Card / Official Transcript / Duplicate Marks Card / Geniuses of Marks Card / Provisional Pass Certificate / Degree Certificate.',1,'L'); 

			//$pdf->Ln(7);
			//$pdf->Cell(140,5,'','0',0,'L');
			//$pdf->Cell(36,5,'','0',1,'L');
			//$pdf->Ln(1);
			//var_dump(count($class_obj->std_arr));
			if($page_cnt!=count($class_obj->std_arr))
			{
				$pdf->AddPage();
				$pdf->Rect(5,10,200,280);
			}
			

		//	var_dump($aobj_context->main_src."halltickets/HT_".$FUNIVCODE."_".$reg_v['FREGNO']);
				
			$pdf->Output($aobj_context->main_src."halltickets/HT_".$FUNIVCODE."_".$reg_v['FREGNO'].".pdf","F");
		
	
		} 
		
		
	
}
function NbLines($w,$txt,$pdf)
{
    //Computes the number of lines a MultiCell of width w will take
    $cw=&$pdf->CurrentFont['cw'];
    if($w==0)
        $w=$pdf->w-$pdf->rMargin-$pdf->x;
    $wmax=($w-2*$pdf->cMargin)*1000/$pdf->FontSize;
    $s=str_replace("\r",'',$txt);
    $nb=strlen($s);
    if($nb>0 and $s[$nb-1]=="\n")
        $nb--;
    $sep=-1;
    $i=0;
    $j=0;
    $l=0;
    $nl=1;
    while($i<$nb){
        $c=$s[$i];
        if($c=="\n"){
            $i++;
            $sep=-1;
            $j=$i;
            $l=0;
            $nl++;
            continue;
        }
        if($c==' ')
            $sep=$i;
        $l+=$cw[$c];
        if($l>$wmax)
		{
            if($sep==-1){
                if($i==$j)
                    $i++;
            } else
                $i=$sep+1;
            $sep=-1;
            $j=$i;
            $l=0;
            $nl++;
        } 
		else
            $i++;
    }
    return $nl;
 }
?>