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


Current Path : /var/www/html/nitte/Report_details/
Upload File :
Current File : /var/www/html/nitte/Report_details/report_practical_marks_details09072016.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);
class practical_marks_detail_report extends FPDF
 {
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']; 
			//echo $this->degree_name;die();
			$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->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)";	
 				//die();
			$this->pdf=  new FPDF();
			$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_time=$ob_dt[dt];
		}

function Header()
{
		  $page_header_college ="select concat(FTOWN,', ',FUNIVADD1) as address,FUNIVNAME as college_name ,
								pdf_logo_path as pdf_logo_path from control ";
		 //echo $page_header_college;die();
		$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->pdf_logo_path = $this->aobj_context->main_src."/".$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 FEXAMDATE as exam_date,FEXAMNAME from degree 
							where FDEGREE='{$this->degree}'
							and FEXAMNO='{$this->exam}'";
			$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->pdf->SetFont('Times','B',14);	
				$this->pdf->Cell(190,4,$this->coll_name,0,1,'C'); 
				$this->pdf->SetFont('Times','',8);	
				$this->pdf->Cell(180,4,$this->address,0,0,'C'); 
				$this->pdf->SetFont('Times','B',12);	
				$this->pdf->Cell(-20,4,"Page {$this->pdf->PageNo()}/{nb}",0,1,'C'); 
				$this->pdf->Ln(2);
				$this->pdf->SetFont('Times','B',11);
				$this->pdf->Cell(200,4,"College : ".$this->collcode." ".$this->col_name,0,1,'C');
				$this->pdf->Ln(2);	$this->pdf->SetFont('Times','B',12);	
				$this->pdf->Cell(190,6,"Degree : "." ".$this->degree." - ".$this->degree_name .", Exam : {$this->FEXAMNAME} - ".$this->exam_date,0,1,'C');
				$this->pdf->Ln(2);
				$this->pdf->Cell(190,6,"Subject : "." ".$this->subject." - ".$this->sub_name."(".$this->fs_sub_name .")",0,1,'C');
				$this->pdf->Ln(2);
				$this->pdf->SetFont('Times','BU',12);
				$this->pdf->Cell(190,6,'Practical / Record Marks List'.$this->freeze_status,0,1,'C');
			if(file_exists($this->pdf_logo_path)) 
			 {
			  $this->pdf->Image($this->pdf_logo_path,5,7,20);	 
			 
			}			$this->pdf->SetFont('Times','B',12);					
		$this->pdf->Ln(06); 	  
}	

	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()
	{
	
		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);
			 
			$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' ";	
			$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=0,0,''))) as FMARKS, 
						  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 subject 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<>''
						group by stu.FREGNO,sub.FCSUBCODE  order by IFNULL(mak.FBATCH, ''),stu.FREGNO";
						 
				$this->lobj_get_practical_records = $this->aobj_context->mobj_db->GetAll($get_practical_records);
		 //	echo $get_practical_records;die();
				$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];
				 $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 subject 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<>''
						group by sub.FCSUBCODE  order by IFNULL(mak.FBATCH, ''),stu.FREGNO";
						
				$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];
				}
				//print_r($this->sal_details_arr);die();
				$get_viva_details=" select  FVVCODE from  practical_master where 
								FDEGREE='{$this->degree}'
							and FEXAMNO='{$this->exam}' and FPRCODE='{$FCSUBCODE}' ";
				$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 subject 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 != '' 
						group by stu.FREGNO,sub.FCSUBCODE  order by IFNULL(mak.FBATCH, ''),stu.FREGNO";
						 //echo $get_viva_records;die();//and mak.FMARKS11<>-1    and mak.FMARKS11<>''
				$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(10,12);
				$this->pdf->AddPage();
				// Here Form Header
					$this->_intital_x_pos=$this->pdf->GetX();
				$this->pdf->SetX($this->_intital_x_pos+30);
				$this->pdf->Cell(15,5,'',"LRT",0,'C');
				$this->pdf->Cell(30,5,'',"LRT",0,'C');
				
				$this->pdf->Cell(50,5,'Practical',"LRT",1,'C');
				$this->get_x_pos=$this->pdf->GetX();
				$this->get_y_pos=$this->pdf->GetY();
				$this->pdf->SetX($this->_intital_x_pos+30);
				$this->pdf->Cell(15,5,'Sl No.',"LRB",0,'C');
				$this->pdf->Cell(30,5,'Reg No',"LRB",0,'C');
				$this->pdf->Cell(15,5,'Mark',"1",0,'C');
				$this->pdf->Cell(35,5,'Remarks',"1",1,'C');
				
				if(!empty($this->viva_marks_arr))
				{
				$this->pdf->SetXY($this->get_x_pos+125,$this->get_y_pos-5);
				$this->pdf->Cell(50,5,'Record',"LRT",1,'C');
				$this->pdf->SetXY($this->get_x_pos+125,$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','','9');
				if($fp_cnt>0)
				{
				$this->lobj_get_practical_records=null;
				$this->pdf->Ln(10);
				$this->pdf->SetFont('Arial','B',12);
				$this->pdf->Cell(0,6,'This Report Print is Freezed',"",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==35)
					{
				
					$this->pdf->AddPage();
					$lin1=1;
					
					}
				$this->pdf->SetX($this->_intital_x_pos+30);
				$this->pdf->Cell(15,5,$sl,"1",0,'C');
				$this->pdf->Cell(30,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(floatval($pr_marks));
				$cell_val=empty($cell_val)?0:$cell_val;
				$this->pdf->Cell(35,5,$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+125,$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(6);
				$this->pdf->SetFont('Arial','',8);  
				 $this->pdf->SetX($this->_intital_x_pos+30);
					$this->pdf->Cell(50,3,"Date & Time:{$pdf->date_1}",'0',0,'L');
					$this->pdf->Cell(50,3,"Total Present: {$this->page_present_count}",'0',0,'L');
					$this->pdf->Cell(50,3,"Total Absent: {$this->page_absent_count}",'0',0,'L');
						$this->pdf->Ln(9);
						 $this->pdf->SetX($this->_intital_x_pos+30);
					$this->pdf->Cell(50,3,'Signature of the Chief Suptdt.','0',0,'L');
					$this->pdf->Cell(100,3,'Signature of the Examiner','0',1,'R');
					$this->pdf->Ln(5);					 
					$this->pdf->Ln(3); */
					
			$this->pdf->Ln(10);
			$this->pdf->SetFont('Arial','',9);
			$this->pdf->Cell(35,6,'',"",0,'C');
			$this->pdf->Cell(30,6,'Examiner - 01',"",0,'C');
			$this->pdf->Cell(30,6,'Examiner - 02',"",0,'C');
			$this->pdf->Cell(30,6,'Examiner - 03',"",0,'C');
			$this->pdf->Cell(30,6,'Examiner - 04',"",1,'C');
			$this->pdf->Cell(8,6,'',"",0,'C');
			$this->pdf->Cell(25,6,'Name',"",0,'L');
			$this->pdf->Cell(3,6,':',"",1,'C');	

			$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);    
	//echo $this->FCSUBCODE;die();
	$this->SetFont('Arial','I',8);  
		//$this->date_time=CConfig::GetSystemDate($this->aobj_context);
		// 	$this->pdf->Cell(90,3,'Printed Date & Time: '.$this->date_time,'0',0,'L');
	//$this->Cell(0,3,'Absent On This Page : '.$this->page_absent_count,'0',1,'C');	
	//$this->Cell(0,3,' Total Absent : '.$this->ii_details_arr[$this->FCSUBCODE],'0',1,'C');
	}	

 

function SendOutput()
		{
			$this->pdf->Output("Practical_Mark_List_report{$this->report_id}.pdf","D");
		}
}
		
function GeneratePracticalMarksReports($aobj_context)
{
$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();
}
?>