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 : 18.116.52.29


Current Path : /var/www/oasis/Report_details/
Upload File :
Current File : /var/www/oasis/Report_details/report_practical_marks_details.php

<?php

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

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

class practical_marks_detail_report extends TCPDF
{
	public $aobj_context;
	public $college_name;	
	public $town;	
	public $address;	
	public $Degree_name;	

	function Default_construstor($aobj_context)
	{
		require_once($aobj_context->main_src.'src/format.php');
		$this->aobj_context=$aobj_context;
		$this->collcode=$_SESSION['collcode'];
		include($this->pdf_writer_class);		
		session_start();
		$this->report_id = $aobj_context->mobj_data["report_id"];
		
		$this->degree = $aobj_context->mobj_data['degree']; 
		$this->degree_name = $aobj_context->mobj_data['degree_name']; 
		
		$this->exam = $aobj_context->mobj_data['exam'];
		$this->subject   = $aobj_context->mobj_data["sub"];  
		
		$this->sub_name   = $aobj_context->mobj_data["sub_name"];
	
		$this->from_qp_code =  $aobj_context->mobj_data["from_qp_code"] ; 
		$this->to_qp_code=  $aobj_context->mobj_data["to_qp_code"] ;
		$this->batch_no=  $aobj_context->mobj_data["batch_no"] ;
		$this->date_value =  $aobj_context->mobj_data["date_value"] ;
		$this->time_value =  $aobj_context->mobj_data["time"] ;
		$this->batch_no=str_pad($this->batch_no, 2, "0", STR_PAD_LEFT);
		$this->fs_sub_name=  $aobj_context->mobj_data["fs_sub_name"] ;
		
		$this->freeze_status=" (VERIFICATION PENDING)";	
		$this->pdf=  new TCPDF();
		$this->pdf=$this;	
		$this->GetSubjectLoops();
		$getnumword=$aobj_context->main_src."/src/getnumword.php";
		include($getnumword);
		$get_date_time="SELECT DATE_FORMAT(now(),'%d-%b-%Y %H:%m %r') as dt";
		$ob_dt = $this->aobj_context->mobj_db->GetRow($get_date_time); 
		$this->date_timef=$ob_dt['dt'];
	}

	function Header()
	{
		session_start();
		$FUNIVCODE = $_SESSION['FUNIVCODE'];
		$page_header_college ="select FUNIVADD1 as address,FUNIVNAME as college_name ,
								pdf_logo_path as pdf_logo_path,
								ifnull(fdegas,'Degree') as fdegas,
								ifnull(fcollas,'College') as fcollas,
								ifnull(fsubas,'Subject') as fsubas,
								ifnull(FREGROLL,'Reg. No.') as FREGROLL 
								from control ";
		
		$lobj_page_header_college = $this->aobj_context->mobj_db->GetRow($page_header_college); 
		$this->coll_name = $lobj_page_header_college['college_name']; 
		$this->address = $lobj_page_header_college['address']; 

		$this->fdegas = $lobj_page_header_college['fdegas'];
		$this->fcollas = $lobj_page_header_college['fcollas'];
		$this->fsubas = $lobj_page_header_college['fsubas'];
		$this->FREGROLL = $lobj_page_header_college['FREGROLL'];

		$this->pdf_logo_path = $this->aobj_context->main_src."/".$_REQUEST['db']."/".$lobj_page_header_college['pdf_logo_path']; 
		$get_college_name="select  concat(FCOLLNAME,', ',FTOWN) as col_name from college where FCOLLCODE='{$this->collcode}'";
		$this->lobj_get_college_name = $this->aobj_context->mobj_db->GetRow($get_college_name);
		$this->col_name=$this->lobj_get_college_name['col_name'];
			
		$get_exam_date="select upper(FEXAMDATE) as exam_date,FEXAMNAME,FDESCPN from degree 
						where FDEGREE='{$this->degree}'
						and FEXAMNO='{$this->exam}'";
						//var_dump("get_exam_date".$get_exam_date);
		$this->lobj_get_exam_date = $this->aobj_context->mobj_db->GetRow($get_exam_date);
		$this->exam_date=$this->lobj_get_exam_date['exam_date'];
		$this->FEXAMNAME=$this->lobj_get_exam_date['FEXAMNAME'];
		$this->degree_name=$this->lobj_get_exam_date['FDESCPN'];
				
		$query = "select FEXAMDATE,FEXAMTIME,
		left(if(ifnull(m1.fteachcode,'') = '',ifnull(fexaminer1,''),m1.fteachname),20) as fexaminer1,
		if(ifnull(m2.fteachcode,'') = '',ifnull(fexaminer2,''),m2.fteachname) as fexaminer2,
		if(ifnull(m3.fteachcode,'') = '',ifnull(fexaminer3,''),m3.fteachname) as fexaminer3,
		if(ifnull(m4.fteachcode,'') = '',ifnull(fexaminer4,''),m4.fteachname) as fexaminer4,
		left(if(ifnull(m5.fteachcode,'') = '',ifnull(fexaminer5,''),m5.fteachname),20) as fexaminer5,
		if(ifnull(m6.fteachcode,'') = '',ifnull(fexaminer6,''),m6.fteachname) as fexaminer6
		from practical_entry_freeze p
		left join masteach m1 on m1.fteachcode = fexaminer1
		left join masteach m2 on m2.fteachcode = fexaminer2
		left join masteach m3 on m3.fteachcode = fexaminer3
		left join masteach m4 on m4.fteachcode = fexaminer4
		left join masteach m5 on m5.fteachcode = fexaminer5
		left join masteach m6 on m6.fteachcode = fexaminer6
		where p.fcollcode= '{$this->collcode}' 
		and p.fdegree = '{$this->degree}' and p.fexam = '{$this->exam}' 
		and p.fbatch = '{$this->batch_no}' 
		and p.fcsubcode = '{$this->subject}'";
		//var_dump("Freezed verification :".$query);
		$this->result = $this->aobj_context->mobj_db->GetRow($query);

		$qry="select FSUBNAME,FSSUBNAME from subject where fdegree='{$this->degree}' and fexamno = '{$this->exam}' and fcsubcode='{$this->subject}'";
		$this->res = $this->aobj_context->mobj_db->GetRow($qry);
		
		
		$this->date_value = date_format(date_create($this->result['FEXAMDATE']),'d/m/Y');
		$this->time_value = $this->result['FEXAMTIME'];
		
		$img_logo_path=$this->aobj_context->main_src. '/'.$this->aobj_context->mobj_data["db"]."/img/report_uni_logo.jpg";
		
		$this->fexaminer1 = $this->result['fexaminer1'];
		$this->fexaminer2 = $this->result['fexaminer2'];
		$this->fexaminer3 = $this->result['fexaminer3'];
		$this->fexaminer4 = $this->result['fexaminer4'];
		$this->fexaminer5 = $this->result['fexaminer5'];
		$this->fexaminer6 = $this->result['fexaminer6'];

		// examiner table
		$this->table1 = "";
		$this->table1 = '<style>
		td {
			border: 0.5px solid black;
		}
		.lable {
			font-weight: bold;
		}
		</style>
		<table cellspacing="0" cellpadding = "2">';
		$this->table1 .='<tr nobr="true" >
		<td width="30" height="20px" style = "text-align:center;font-weight: bold;"  >#</td>
		<td width="200" height="20px" style = "text-align:center;font-weight: bold;" >Examiner Name</td>
		<td width="150" height="20px" style = "text-align:center;font-weight: bold;">College / Institution</td>
		<td width="90" height="20px" style = "text-align:center;font-weight: bold;">Signature</td>
		<td width="70" height="20px" style = "text-align:center;font-weight: bold;">Date  </td>
		</tr>';

		$this->table1 .='<tr nobr="true" >
		<td width="30" height="20px" style = "text-align:center;">1</td>
		<td width="200" height="20px" style = "text-align:left;" >'.$this->fexaminer1.'</td>
		<td width="150" height="20px" style = "text-align:center;"></td>
		<td width="90" height="20px" style = "text-align:center;"></td>
		<td width="70" height="20px" style = "text-align:center;"></td>
		</tr>';

		$this->table1 .='<tr nobr="true" >
		<td width="30" height="20px" style = "text-align:center;">2 </td>
		<td width="200" height="20px" style = "text-align:left;" >'.$this->fexaminer2.'</td>
		<td width="150" height="20px" style = "text-align:center;"></td>
		<td width="90" height="20px" style = "text-align:center;"></td>
		<td width="70" height="20px" style = "text-align:center;"></td>
		</tr>';

		if($this->fexaminer3 != '')
		{
			$this->table1 .='<tr nobr="true" >
			<td width="30" height="20px" style = "text-align:center;">3 </td>
			<td width="200" height="20px" style = "text-align:left;" >'.$this->fexaminer3.'</td>
			<td width="150" height="20px" style = "text-align:center;"></td>
			<td width="90" height="20px" style = "text-align:center;"></td>
			<td width="70" height="20px" style = "text-align:center;"></td>
			</tr>';
		}

		if($this->fexaminer4 != '')
		{
			$this->table1 .='<tr nobr="true" >
			<td width="30" height="20px" style = "text-align:center;">4 </td>
			<td width="200" height="20px" style = "text-align:left;" >'.$this->fexaminer4.'</td>
			<td width="150" height="20px" style = "text-align:center;"></td>
			<td width="90" height="20px" style = "text-align:center;"></td>
			<td width="70" height="20px" style = "text-align:center;"></td>
			</tr>';
		}

		if($this->fexaminer5 != '')
		{
			$this->table1 .='<tr nobr="true" >
			<td width="30" height="20px" style = "text-align:center;">5 </td>
			<td width="200" height="20px" style = "text-align:left;" >'.$this->fexaminer5.'</td>
			<td width="150" height="20px" style = "text-align:center;"></td>
			<td width="90" height="20px" style = "text-align:center;"></td>
			<td width="70" height="20px" style = "text-align:center;"></td>
			</tr>';
		}

		if($this->fexaminer6 != '')
		{
			$this->table1 .='<tr nobr="true" >
			<td width="30" height="20px" style = "text-align:center;">6 </td>
			<td width="200" height="20px" style = "text-align:left;" >'.$this->fexaminer6.'</td>
			<td width="150" height="20px" style = "text-align:center;"></td>
			<td width="90" height="20px" style = "text-align:center;"></td>
			<td width="70" height="20px" style = "text-align:center;"></td>
			</tr>';
		}

		$this->table1 .= '</table>';

		

		$this->pdf->Ln(5);
		// $this->pdf->SetY(10);
		if($FUNIVCODE == '049')	
		{	
			if(file_exists($this->pdf_logo_path)) 
			{
				$this->pdf->Image($this->pdf_logo_path,65,5,70,18);
			}	
			$this->pdf->SetY(15);
			// $this->pdf->Ln(10);

		}else if($FUNIVCODE == '055')
		{
			$this->pdf->Image($img_logo_path,30,2,140,20);
			$this->pdf->Ln(15);	
		}
		else
		{

			if(file_exists($this->pdf_logo_path)) 
			{
				if($FUNIVCODE == '052')
					$this->pdf->Image($this->pdf_logo_path,5,5,37,15);
				else
					$this->pdf->Image($this->pdf_logo_path,7,7,20);	 
			}
			
			$img_path2 = $this->aobj_context->main_src."/img/logo2.jpg";

			if(file_exists($img_path2))
			{
				$this->pdf->Image($img_path2,170,6,23,23);
			}

			if($FUNIVCODE == '052')
			{
				$this->pdf->SetFont('Times','B',9);
				$this->pdf->Cell(0,4,"JSS MAHAVIDYAPEETHA",0,1,'C'); 
			}

			$this->pdf->SetFont('Times','B',14);	
			$this->pdf->Cell(180,4,$this->coll_name,0,1,'C'); 
			$this->pdf->SetFont('Times','',11);	
			$this->pdf->Cell(180,4,$this->address,0,0,'C'); 

		}

		if($FUNIVCODE != '055')
		{
			$this->pdf->SetFont('Times','B',12);	
			//$this->pdf->Cell(0,4,"Page {$this->pdf->PageNo()}/{nb}",0,1,'R'); 
			$this->pdf->Ln(5);
			$this->pdf->SetFont('Times','B',12);
			$this->pdf->Cell(180,4,$this->fcollas.": [".$this->collcode."] ".$this->col_name,0,1,'C');
		}
		// $this->pdf->SetY(15);

		$get_viva_details=" select FVVCODE from  practical_master where 
								FDEGREE = '{$this->degree}'
								and FEXAMNO = '{$this->exam}' and FPRCODE = '{$FCSUBCODE}'";
			//					var_dump("get_viva_details : ".$get_viva_details);
			$lobj_get_viva_details = $this->aobj_context->mobj_db->GetRow($get_viva_details);
			$FVVCODE = $lobj_get_viva_details['FVVCODE'];

		
		$this->pdf->SetFont('Times','B',12);

		$deg = "Degree: ";				
		if($FUNIVCODE == '049')
			$deg = "Program: ";
		
		//$this->pdf->Cell(180,6,$deg." ".$this->degree." - ".$this->degree_name .", Exam : {$this->FEXAMNAME} - ".$this->exam_date,0,1,'C');
		$this->pdf->Cell(180,6,$this->FEXAMNAME." - ".$this->exam_date." EXAMINATION",0,1,'C');
		$this->pdf->Cell(180,6,$this->fdegas.": [".$this->degree."] ".$this->degree_name ,0,1,'C');
		// $this->pdf->Cell(180,6,"{$this->FEXAMNAME}",0,1,'C');
		
		$sub = "Subject: ";				
			if($FUNIVCODE == '049')
				$sub = "Course: ";
		
		//$this->pdf->Cell(180,6,$this->fsubas." : ".$this->subject." - ".$this->sub_name."(".$this->fs_sub_name .")",0,1,'C');
		$this->pdf->Cell(190,6,$this->fsubas.": "."[".$this->subject."] ".$this->fsubshort." - ".$this->sub_name,0,1,'C');
		$this->pdf->SetFont('Times','B',12);
		if($FUNIVCODE == '029' || $FUNIVCODE == '020' || $FUNIVCODE == '021' || $FUNIVCODE == '040') 
			$this->pdf->Cell(180,6,'Practical / Viva Marks List'.$this->freeze_status,0,1,'C');
		else
			$this->pdf->Cell(180,6,'Practical / Record Marks List'.$this->freeze_status,0,1,'C');
		$this->pdf->Ln(2); 	  
		$this->pdf->SetFont('Times','B',12);
		$this->pdf->Cell(60,6,'Batch No.: '.$this->batch_no,1,0,'C');
		$this->pdf->Cell(60,6,'Exam Date: '.$this->date_value,1,0,'C');
		$this->pdf->Cell(70,6,'Time: '.$this->time_value,1,1,'C');
		//$this->pdf->Cell(180,6,'Batch No. : '.$this->batch_no,0,1,'C');
			  
		$this->pdf->SetFont('Times','B',12);					
	}	

	function GetSubjectLoops()
	{			 
		$get_loops =" select FCSUBCODE,concat(FSUBNAME) as sub_name from subject
		where  FDEGREE='{$this->degree}'
		and FEXAMNO='{$this->exam}'
		and FCSUBCODE>='{$this->from_qp_code}' and FCSUBCODE<='{$this->to_qp_code}'";
		$this->lobj_get_loops = $this->aobj_context->mobj_db->GetAll($get_loops);
	}
	
	function GetQuery()
	{
		session_start();
		$FUNIVCODE = $_SESSION['FUNIVCODE'];

		$canddettmp = "canddet";
		$candsumttmp = "candsum"; 
		$degreetmp = "degree";
		$subjecttmp = "subject";

		// var_dump($subjecttmp);die();
	
		foreach($this->lobj_get_loops as $sk=>$sv)
		{
			$pdf->page_present_count=0;
			$pdf->total_absent_count=0;
			$pdf->total_absent_count=0;
			$FCSUBCODE=$sv['FCSUBCODE'];
		
			$get_frezed_data = " select count(*) as f_cnt from practical_entry_freeze
							where FCOLLCODE='{$this->collcode}'
							and FDEGREE='{$this->degree}' and 
							FEXAM='{$this->exam}' and 
							FCSUBCODE='{$FCSUBCODE}'  and 
							lpad(FBATCH,2,'0')='{$this->batch_no}' and FFREEZED='T' ";	
			
			$obj_get_frezed_data = $this->aobj_context->mobj_db->GetRow($get_frezed_data);
			//var_dump("get_frezed_data : ".$get_frezed_data);	
			$this->freeze_status=" (VERIFICATION PENDING)";	
			if($obj_get_frezed_data[f_cnt]>0)
			{
				$this->freeze_status=" (Verified)";	
			}
			
			$get_p_frezed_data=" select count(*) as fp_cnt from practical_entry_freeze
							where FCOLLCODE='{$this->collcode}'
							and FDEGREE='{$this->degree}' and 
							FEXAM='{$this->exam}' and 
							FCSUBCODE='{$FCSUBCODE}'  and 
							lpad(FBATCH,2,'0')='{$this->batch_no}' and ifnull(PRINTFREEZED,'F')='T' ";
			//				var_dump("get_p_frezed_data".$get_p_frezed_data);	
			$obj_get_frezed_data = $this->aobj_context->mobj_db->GetRow($get_p_frezed_data);
			$fp_cnt=$obj_get_frezed_data['fp_cnt'];
			
			$sub_name=$sv['sub_name'];
			$this->lobj_get_practical_records=array();	
			$this->lobj_get_viva_records=array()	;
			$this->viva_marks_arr=array();
			$this->ii_details_arr=array();
								
			$get_practical_records = "select sub.FCSUBCODE,sub.FSUBNAME,stu.FREGNO, stu.FNAME, 
			if(mak.FMARKS11>0,right(concat('000',mak.FMARKS11),3),
			if(mak.FMARKS11=-2,'ABSENT', if(mak.FMARKS11=-3, 'MP', if(mak.FMARKS11=0,0,'')))) as FMARKS, 
			ifnull(fsubshort,'') as fsubshort,
			IFNULL(mak.FBATCH, '') AS FBATCH,FSUBNAME,FSSUBNAME
			FROM student stu inner join marks_pr mak ON stu.FREGNO=mak.FREGNO 
			and mak.Fdegree='{$this->degree}' and mak.Fexamno='{$this->exam}' and mak.FCOLLCODE='{$this->collcode}'
			inner join {$subjecttmp} sub on sub.FCSUBCODE = mak.FSUBCODE 
			and sub.FCSUBCODE='{$FCSUBCODE}' and lpad(mak.FBATCH,2,'0')='{$this->batch_no}'
			and sub.FDEGREE='{$this->degree}' and sub.FEXAMNO='{$this->exam}'					 
			WHERE stu.FREGNO != ''    and mak.FMARKS11<>-1    #and mak.FMARKS11<>''
			and ifnull(stu.fdeleted,'') <> 'T'
			group by stu.FREGNO,sub.FCSUBCODE  order by IFNULL(mak.FBATCH, ''),stu.FREGNO";
			// var_dump("get_practical_records : ".$get_practical_records);die();
			$this->lobj_get_practical_records = $this->aobj_context->mobj_db->GetAll($get_practical_records);
			$this->sub_code=$this->lobj_get_practical_records[0]['FCSUBCODE'];
			$this->sub_name=$this->lobj_get_practical_records[0]['FSUBNAME'];
			$this->fs_sub_name=$this->lobj_get_practical_records[0]['FSSUBNAME'];
			$this->fsubshort = $this->lobj_get_practical_records[0]['fsubshort'];

			$count_practical_records = "select FCSUBCODE,count(distinct(stu.FREGNO)) as cnt
			FROM student stu inner join marks_pr mak ON stu.FREGNO=mak.FREGNO 
			and mak.Fdegree='{$this->degree}' and mak.Fexamno='{$this->exam}' and mak.FCOLLCODE='{$this->collcode}'
			inner join {$subjecttmp} sub on sub.FCSUBCODE = mak.FSUBCODE 
			and sub.FCSUBCODE='{$FCSUBCODE}'  and lpad(mak.FBATCH,2,'0')='{$this->batch_no}'
			and sub.FDEGREE='{$this->degree}' and sub.FEXAMNO='{$this->exam}'					 
			WHERE stu.FREGNO != ''    and mak.FMARKS11=-2   and mak.FMARKS11<>''
			and ifnull(stu.fdeleted,'') <> 'T'
			group by sub.FCSUBCODE  order by IFNULL(mak.FBATCH, ''),stu.FREGNO";
			//			var_dump("count_practical_records : ".$count_practical_records);
			$this->lobj_count_practical_records = $this->aobj_context->mobj_db->GetAll($count_practical_records);
			foreach($this->lobj_count_practical_records as $k=>$v)
			{
				$this->ii_details_arr[$v['FCSUBCODE']]=$v['cnt'];
			}
				
			$get_viva_details=" select FVVCODE from  practical_master where 
								FDEGREE = '{$this->degree}'
								and FEXAMNO = '{$this->exam}' and FPRCODE = '{$FCSUBCODE}'";
			//					var_dump("get_viva_details : ".$get_viva_details);
			$lobj_get_viva_details = $this->aobj_context->mobj_db->GetRow($get_viva_details);
			$FVVCODE = $lobj_get_viva_details['FVVCODE'];
			
			if(!empty($FVVCODE))
			{
				$get_viva_records = "select sub.FCSUBCODE,sub.FSUBNAME,stu.FREGNO, stu.FNAME, 
				if(mak.FMARKS11>=0,right(concat('000',mak.FMARKS11),3),if(mak.FMARKS11=-2,'ABSENT','')) as FMARKS, 
				IFNULL(mak.FBATCH, '') AS FBATCH
				FROM student stu inner join marks_pr mak ON stu.FREGNO=mak.FREGNO 
				and mak.Fdegree='{$this->degree}' and mak.Fexamno='{$this->exam}' and mak.FCOLLCODE='{$this->collcode}'
				inner join {$subjecttmp} sub on sub.FCSUBCODE = mak.FSUBCODE 
				and sub.FCSUBCODE='{$FVVCODE}' and lpad(mak.FBATCH,2,'0')='{$this->batch_no}'
				and sub.FDEGREE='{$this->degree}' and sub.FEXAMNO='{$this->exam}'					 
				WHERE stu.FREGNO != '' 
				and ifnull(stu.fdeleted,'') <> 'T'
				group by stu.FREGNO,sub.FCSUBCODE  order by IFNULL(mak.FBATCH, ''),stu.FREGNO";

			
				$this->lobj_get_viva_records = $this->aobj_context->mobj_db->GetAll($get_viva_records);	
			
				foreach($this->lobj_get_viva_records as $vk=>$vv)
				{
					$this->viva_marks_arr[$vv['FREGNO']]=$vv['FMARKS'];
					
				}
			}

			$this->header_subject=$FCSUBCODE;
			$this->header_sub_name=$sub_name;
			//$this->pdf->SetMargins(11,5);
			$this->pdf->SetFont('Times','B',12);
			$this->pdf->SetMargins(10, 55);
			$this->pdf->AddPage();
			// $this->pdf->Rect(4,03,200,280);
			$this->pdf->SetMargins(10, 55);
			$this->_intital_x_pos=$this->pdf->GetX();
			$this->pdf->ln(4);
			$this->pdf->SetX($this->_intital_x_pos);
			$this->pdf->Cell(10,5,'Sl.',"LRT",0,'C');
			$this->pdf->Cell(45,5,'Student',"LRT",0,'C');
			
			$this->pdf->Cell(50,5,$this->res['FSSUBNAME'],"LRT",1,'C');
			$this->get_x_pos = $this->pdf->GetX();
			$this->get_y_pos = $this->pdf->GetY();
			
			$this->pdf->SetX($this->_intital_x_pos);
			$this->pdf->Cell(10,5,'No.',"LRB",0,'C');
			$this->pdf->Cell(45,5,$this->FREGROLL,"LRB",0,'C');
			$this->pdf->Cell(15,5,'Mark',"1",0,'C');
			$this->pdf->Cell(35,5,'Remarks',"1",1,'C');
			
			$query="select fssubname from subject
								where FDEGREE = '{$this->degree}'
								and fexamno = '{$this->exam}'
								and fcsubcode = '{$FVVCODE}'";
						$res = $this->aobj_context->mobj_db->GetRow($query);
						$fssubname = $res['fssubname'];

			if(!empty($this->viva_marks_arr))
			{	
				$this->pdf->SetXY($this->get_x_pos+119,$this->get_y_pos-5);
				
				if($FUNIVCODE == '029' || $FUNIVCODE == '020' || $FUNIVCODE == '021' || $FUNIVCODE == '040')
				{
					$this->pdf->Cell(50,5,$fssubname,"LRT",1,'C');
				}else
				{
					$this->pdf->Cell(50,5,$fssubname,"LRT",1,'C');
				}
				
				$this->pdf->SetXY($this->get_x_pos+119,$this->get_y_pos);
				$this->pdf->Cell(15,5,'Mark',"1",0,'C');
				$this->pdf->Cell(35,5,'Remarks',"1",1,'C');	
		
			}
			$sl=1;
			$lin1=1;$this->pdf->SetFont('Times','','12');
			if($fp_cnt>0)
			{
				$this->lobj_get_practical_records=null;
				$this->pdf->Ln(10);
				$this->pdf->SetFont('Times','B',12);
				$this->pdf->Cell(0,5,'Printing is Freezed / Disabled',"",1,'C');
			}
			
			foreach($this->lobj_get_practical_records as $pk=>$pv)
			{
				$this->FCSUBCODE=$pv['FCSUBCODE'];

				$FREGNO=$pv['FREGNO'];
				$FNAME=$pv['FNAME'];
				$pr_marks=$pv['FMARKS'];
				
				if($lin1>30)
				{
					$this->pdf->Ln(2);
					$this->pdf->writeHTML($this->table1, true, true, false, false, 'L');
					$this->pdf->AddPage();
					$lin1=1;
				}

				$this->pdf->SetX($this->_intital_x_pos);
				$this->pdf->Cell(10,5,$sl,"1",0,'C');
				$this->pdf->Cell(45,5,$FREGNO,"1",0,'C');
				
				if($pr_marks=='ABSENT')
				{
					$this->page_absent_count++;
					$this->pdf->Cell(15,5,'AB','1 ',0,'C');				
					$this->pdf->Cell(35,5,$pr_marks,'1',1,'L');				
				}
				else
				{
					$this->pdf->Cell(15,5,$pr_marks,"1",0,'C');
					$cell_val=GetNumToSeperateWord($pr_marks);
					$cell_val=empty($cell_val)?0:$cell_val;
					$this->pdf->Cell(35,5,$pr_marks == "MP" ? "MAL PRACTICE" : $cell_val,"1",1,'L');
					$this->page_present_count++;
				}
				
				$get_x_pos1 = $this->pdf->GetX();
				$get_y_pos1 = $this->pdf->GetY();
				
				if(!empty($this->viva_marks_arr))
				{
					$viva_marks=$this->viva_marks_arr[$FREGNO];
					$this->pdf->SetXY($get_x_pos1+119,$get_y_pos1-5);
					if($viva_marks=='ABSENT')
					{
						$this->pdf->Cell(15,5,'AB','1',0,'C');				
						$this->pdf->Cell(35,5,$viva_marks,'1',1,'L');				
					}
					else
					{
						$this->pdf->Cell(15,5,$viva_marks,"1",0,'C');
						$this->pdf->Cell(35,5,GetNumToSeperateWord(floatval($viva_marks)),"1",1,'L');	
					}

				}
				$sl++;$lin1++;
					
			}
		}
	
		$this->pdf->Ln(2);
		$this->pdf->SetFont('Times','',8);
		$this->pdf->Cell(35,5,'',"",0,'C');
		$this->pdf->SetX(10);
		$this->pdf->SetFont('Times','',11);
		$this->pdf->writeHTML($this->table1, true, true, false, false, 'L');

		// if($FUNIVCODE == '049')
		// {

		// 	$this->pdf->Cell(40,6,'Examiner - 01',"",0,'C');
		// 	$this->pdf->Cell(40,6,'Examiner - 02',"",1,'C');
			

		// }else
		// {
		// 	$this->pdf->Cell(30,6,'Examiner - 01',"",0,'L');
		// 	$this->pdf->Cell(30,6,'Examiner - 02',"",0,'L');
		// 	if($this->fexaminer3 != '')
		// 		$this->pdf->Cell(30,6,'Examiner - 03',"",0,'L');
		// 	if($this->fexaminer4 != '')	
		// 		$this->pdf->Cell(30,6,'Examiner - 04',"",0,'L');
		// 	if($this->fexaminer5 != '')	
		// 		$this->pdf->Cell(30,6,'Examiner - 05',"",0,'L');

		// 	$this->pdf->Cell(1,6,'',"",1,'L');

		// }
		
		
		// $this->pdf->Cell(8,6,'',"",0,'C');
		// $this->pdf->Cell(25,6,'Name',"",0,'L');
		// $this->pdf->Cell(3,6,':',"",0,'C');	


		// if($FUNIVCODE == '049')
		// {
		// 	$this->pdf->Cell(40,6,$this->fexaminer1,"",0,'C');
		// 	$this->pdf->Cell(40,6,$this->fexaminer2,"",1,'C');
			
		// }else
		// {
		// 	$this->pdf->Cell(30,6,$this->fexaminer1,"",0,'L');
		// 	$this->pdf->Cell(30,6,$this->fexaminer2,"",0,'L');
		
		// 	$this->pdf->Cell(30,6,$this->fexaminer3,"",0,'L');
		// 	$this->pdf->Cell(30,6,$this->fexaminer4,"",0,'L');
		// 	$this->pdf->Cell(30,6,$this->fexaminer5,"",1,'L');

		// }

		// $this->pdf->Cell(8,6,'',"",0,'C');
		// $this->pdf->Cell(25,6,'College / Degn.',"",0,'L');
		// $this->pdf->Cell(3,6,':',"",1,'C');

		// $this->pdf->Cell(8,6,'',"",0,'C');
		// $this->pdf->Cell(25,6,'Signature',"",0,'L');
		// $this->pdf->Cell(3,6,':',"",1,'C');

		// $this->pdf->Cell(8,6,'',"",0,'C');
		// $this->pdf->Cell(25,6,'Date & Time',"",0,'L');
		// $this->pdf->Cell(3,6,':',"",0,'C');		
		// $this->pdf->Cell(50,3,$pdf->date_time,'0',1,'L');	
	}
   	function Footer()
	{
			//$this->SetY(-20);    
			//$this->SetFont('Times','I',8); 
			$this->ip=$_SERVER["REMOTE_ADDR"];	
			$this->pdf->SetFont('Times','',8);  
			$this->pdf->setY(-20);
		 	//$this->pdf->Cell(90,3,'Printed Date & Time: '.$this->date_timef,'0',0,'L');
			$this->pdf->Cell(140,6,'Printed   : IP Address : '.$this->ip." Date ".$this->date_timef,'0',0,'L');		
	}	

	function SendOutput()
	{
		$this->pdf->Output("Practical_Mark_List{$this->report_id}.pdf","I");
	}
}
		
function GeneratePracticalMarksReports($aobj_context)
{
	// var_dump("sdkhsdksd");die();
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$class_obj=new practical_marks_detail_report(); 
	//$class_obj->AliasNbPages();
	$class_obj->Default_construstor($aobj_context); 
	$class_obj->GetQuery();
	$class_obj->SendOutput();
}
?>