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


Current Path : /var/www/html/rcub/Report_details/
Upload File :
Current File : /var/www/html/rcub/Report_details/teacher_report_03.09.2018.php

<?php
function GenerateTeacherReport($aobj_context)
{	
	session_start();
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
    $college_code = $_SESSION['collcode']; 
	$from_dept = $aobj_context->mobj_data["from_dept"]; 	
	$to_dept = $aobj_context->mobj_data["to_dept"]; 
	$from_des = $aobj_context->mobj_data["from_des"]; 
	$to_des = $aobj_context->mobj_data["to_des"]; 
 
	$dept_cond="";
	$des_cond="";
	if($from_dept!='0' && $to_dept!="0")
	{
	$dept_cond=" and t.FDEPTCODE>='{$from_dept}' and t.FDEPTCODE<='{$from_dept}'";
	}
	
	if($from_des!='0' && $to_des!="0")
	{
	$des_cond=" and t.FDEGNCODE>='{$from_des}' and t.FDEGNCODE<='{$to_des}'";
	}
	
	$main_src_obj=(explode("/",$_SERVER["REQUEST_URI"]));
	$main_src=$main_src_obj[1];
	$pdf_writer_class=$aobj_context->main_src."/maya-pdf/fpdf.php";	
	//$root_pdf_file_download=$_SERVER["DOCUMENT_ROOT"]."/".$main_src."/Report_details/output/report_general_list.pdf";
	$p_count =1;
	include($pdf_writer_class);		
	$pdf= new FPDF();	
	$pdf->SetFont('Times','',10);
	$pdf->SetMargins(1,20);		
	$pdf->AliasNbPages();	

// query for the page header	
	$page_header_university = "select FUNIVNAME,FTOWN, date_format(now(),'%d/%m/%Y') as date from control";
	$lobj_page_header_university = $aobj_context->mobj_db->GetRow($page_header_university);
	
	$page_header_college ="select concat('[',FCOLLCODE,']  ',FCOLLNAME,', ',FTOWN) as college_name
							from college where FCOLLCODE='{$college_code}'";
	$lobj_page_header_college = $aobj_context->mobj_db->GetRow($page_header_college); 

	$page_header_degree = "select concat('[',FDEGREE,'] - ', FDESCPN) as Degree_name, 
							concat(' (  ',FEXAMNAME,'  ) ') as Exam, FADYEAR,FEXAMDATE  
							from degree where FDEGREE = '{$reval_degree_code}' and 
							FEXAMNO>='{$reval_from_Exam_no}' and FEXAMNO<='{$reval_to_Exam_no}'";
	$lobj_page_header_degree = $aobj_context->mobj_db->GetAll($page_header_degree);

	$pdf->aobj_context =$aobj_context ;
	$pdf->WhichReport = 'Teachers Report';
	$pdf->FUNIVNAME = $lobj_page_header_university[FUNIVNAME];
	$pdf->FTOWN = $lobj_page_header_university[FTOWN];
	$pdf->date_1 = $lobj_page_header_university['date'];
	$pdf->college_name = $lobj_page_header_college['college_name'];
	$pdf->Degree_name = $lobj_page_header_degree[0]['Degree_name'];
	$pdf->Exam = $lobj_page_header_degree[0]['Exam'];		
	$pdf->FEXAMDATE = $lobj_page_header_degree[0]['FEXAMDATE'];		
	//$pdf->AddPage();	
	$pdf->SetFont('Times','',10);	
	
	 
		/* $get_data="select FTEACHCODE,FTEACHNAME,FDEGNDESC, 
		CONCAT(FADDR1,' ',FADDR2,' ',FADDR3,' ',FADDR4) as address,
		d.FDEPTNAME,FFULLTIME,FPERMANENT,FEXP,
		DATE_FORMAT(FDOA,'%d/%m/%Y') as doj,
		s1.FDEPTNAME as s1,FUGPG1,FEXAMWORK1,
		s2.FDEPTNAME as s2,FUGPG2,FEXAMWORK2, 
		s3.FDEPTNAME as s3,FUGPG3,FEXAMWORK3
		from masteach t inner join masdept d on t.FDEPTCODE=d.FDEPTCODE
		inner join masdegn des on des.FDEGNCODE=t.FDEGNCODE
		left join masdept s1 on s1.FDEPTCODE=FSUBCODE1
		left join masdept s2 on s2.FDEPTCODE=FSUBCODE2
		left join masdept s3 on s3.FDEPTCODE=FSUBCODE3
		where t.FCOLLCODE='{$college_code}'
		"; teacher_photos/4335/5727_pairashi 001.jpg */
		$get_data="select  t.*,FTEACHCODE,FTEACHNAME,FDEGNDESC,FGENDER,FQUAL,DATE_FORMAT(FDOB,'%d/%m/%Y') as FDOB ,FEMAIL,FMOBILE,ifnull(FSTATUS,'Pending') as FSTATUS,DATE_FORMAT(now(),'%d/%m/%Y') as FDATE,
							DATE_FORMAT(FLOGDATE,'%d/%m/%Y') as FLOGDATE, 
							CONCAT(FADDR1,' ',FADDR2,' ',FADDR3,' ',FADDR4) as address,
							d.FDEPTNAME,FFULLTIME,FPERMANENT,FEXP,FPHOTO,
							DATE_FORMAT(FDOA,'%d/%m/%Y') as doj,
							s1.fsubname as s1,if(FUGPG1='No','',FUGPG1) as FUGPG1,FEXAMWORK1,
							s2.fsubname as s2,if(FUGPG2='No','',FUGPG2) as FUGPG2,FEXAMWORK2, 
							s3.fsubname as s3,if(FUGPG3='No','',FUGPG3) as FUGPG3,FEXAMWORK3,
							s4.fsubname as s4,if(FUGPG4='No','',FUGPG4) as FUGPG4,FEXAMWORK4,
							s5.fsubname as s5,if(FUGPG5='No','',FUGPG5) as FUGPG5,FEXAMWORK5,t.FIFSCCODE,t.FACCNO,t.FAADHARNO
							from masteach t inner join masdept d on t.FDEPTCODE=d.FDEPTCODE
							inner join masdegn des on des.FDEGNCODE=t.FDEGNCODE
							left join massub s1 on s1.fsubcode=FSUBCODE1
							left join massub s2 on s2.fsubcode=FSUBCODE2
							left join massub s3 on s3.fsubcode=FSUBCODE3
							left join massub s4 on s4.fsubcode=FSUBCODE4
							left join massub s5 on s5.fsubcode=FSUBCODE5
							where t.FCOLLCODE='{$college_code}' and ifnull(FSTATUS,'') <> 'retired' 
							";
		
		
		
		
		$lobj_get_data= $aobj_context->mobj_db->GetAll($get_data);
		 
		$i=0;
		$app_height=6;
		$width_x=160;
		$height=35;

		foreach($lobj_get_data as $apk=>$apv)
		{
		
			$pdf->AddPage();
			$pdf->SetMargins(1,20);
			$FTEACHCODE=$apv['FTEACHCODE'];
			$FTEACHNAME=$apv['FTEACHNAME'];
			$FDEGNDESC=$apv['FDEGNDESC'];
			$FDEPTNAME=$apv['FDEPTNAME'];
			$FFULLTIME=$apv['FFULLTIME'];
			$FPERMANENT=$apv['FPERMANENT'];
			$FEXP=$apv['FEXP'];
			$FIFSCCODE=$apv['FIFSCCODE'];
			$FACCNO=$apv['FACCNO'];
			$FAADHARNO=$apv['FAADHARNO'];
			$FMOBILE = $apv['FMOBILE'];
			$FEMAIL = $apv['FEMAIL'];
			$FQUAL = $apv['FQUAL'];
			$FGENDER = $apv['FGENDER'];
			$FSTATUS = $apv['FSTATUS'];
			$FDATE = $apv['FDATE'];
			$logdate = $apv['FLOGDATE'];			
			$FDOB=$apv['FDOB'];
			$doj=$apv['doj'];
			
			
			 $FSCALE=$apv['FSCALE'];
			/*$doj=$apv['doj']; */
			
			$s1=$apv['s1'];
			$FUGPG1=$apv['FUGPG1'];
			$FEXAMWORK1=$apv['FEXAMWORK1'];
			$s2=$apv['s2'];
			$FUGPG2=$apv['FUGPG2'];
			$FEXAMWORK2=$apv['FEXAMWORK2'];
			$s3=$apv['s3'];
			$FUGPG3=$apv['FUGPG3'];
			$FEXAMWORK3=$apv['FEXAMWORK3'];
			$address=$apv['address'];
			
			/* if($i%3==0)
			{
				$pdf->AddPage();	
				$width_x=160;
				$height=34;
			} */ 
				$pdf->SetFont('Times','',10);
				$height_y=$height; 
				$pdf->Cell(20,"6","",'0',0,'C');
				$pdf->Cell(25,"6","Teacher Code   ",'1',0,'L');
				$pdf->Cell(123,"6",$FTEACHCODE,'1',1,'L');
				//$pdf->Cell(25,"6","Status ",'1',0,'L');
				//$pdf->Cell(38,"6",$FSTATUS,'1',1,'L');
				
				
				$pdf->Cell(20,"6","",'0',0,'C');
				$pdf->Cell(25,"6","Teacher Name ",'1',0,'L');
				$pdf->Cell(123,"6",$FTEACHNAME,'1',1,'L');
				
				
				
				
				$pdf->Cell(20,"6","",'0',0,'C');
				$pdf->Cell(25,"6","Date of Birth",'1',0,'L');
				$pdf->Cell(60,"6",$FDOB,'1',0,'L');
				$pdf->Cell(25,"6","Gender",'1',0,'L');
				$pdf->Cell(38,"6",$FGENDER,'1',1,'L');
				
				$pdf->Cell(20,"6","",'0',0,'C');
				$pdf->Cell(25,"6","Email id",'1',0,'L');
				$pdf->Cell(60,"6",$FEMAIL,'1',0,'L');
				$pdf->Cell(25,"6","Mobile No.",'1',0,'L');
				$pdf->Cell(38,"6",$FMOBILE,'1',1,'L');
				
				$pdf->Cell(20,"6","",'0',0,'C');
				$pdf->Cell(25,"6","Address           ",'1',0,'L');
				$pdf->MultiCell(150,6, $address,'1','L');
				$photo_path=$apv[FPHOTO];
				if(!empty($photo_path) && file_exists($photo_path)) 
				{			
					$pdf->Image($photo_path,170,45,23,20);
				} 
				//$pdf->Cell(148,6,$pdf->Image($photo_path,170,45,23,20),'1','1','L');
				$pdf->ln(5);
				$pdf->SetFont('Times','',10);
				$pdf->Cell(20,"6","",'0',0,'C');
				$pdf->Cell(25,"6","Department      ",'1',0,'L');
				$pdf->Cell(60,"6",$FDEPTNAME,'1',0,'L');
				$pdf->Cell(25,"6","Designation      ",'1',0,'L');
				$pdf->Cell(65,"6",$FDEGNDESC,'1',1,'L');
				 
				$pdf->Cell(20,"6","",'0',0,'C');
				$pdf->Cell(25,"6","Full Time         ",'1',0,'L');
				$pdf->Cell(60,"6",$FFULLTIME,'1',0,'L');
				$pdf->Cell(25,"6","Permanent       ",'1',0,'L');
				$pdf->Cell(65,"6",$FPERMANENT,'1',1,'L');
				 
				$pdf->Cell(20,"6","",'0',0,'C');
				$pdf->Cell(25,"6","Date of Joining",'1',0,'L');
				$pdf->Cell(60,"6",$doj,'1',0,'L');
				$pdf->Cell(25,"6","Experience      ",'1',0,'L');
				$pdf->Cell(65,"6",$FEXP,'1',1,'L');
				
				$pdf->Cell(20,"6","",'0',0,'C');
				$pdf->Cell(25,"6","Qualification ",'1',0,'L');
				$pdf->Cell(60,"6",$FQUAL,'1',0,'L');
				$pdf->Cell(25,"6","Scale      ",'1',0,'L');
				$pdf->Cell(65,"6",$FSCALE,'1',1,'L');
				
				
				$pdf->Cell(20,"6","",'0',0,'C');
				$pdf->Cell(25,"6","Account No ",'1',0,'L');
				$pdf->Cell(60,"6",$FACCNO,'1',0,'L');
				$pdf->Cell(25,"6","IFSC Code      ",'1',0,'L');
				$pdf->Cell(65,"6",$FIFSCCODE,'1',1,'L');
				
				$pdf->Cell(20,"6","",'0',0,'C');
				$pdf->Cell(25,"6","Aadhaar No. ",'1',0,'L');
				$pdf->Cell(150,"6",$FAADHARNO,'1',1,'L');
				//$pdf->Cell(25,"6","Bank IFSC Code      ",'1',0,'L');
				//$pdf->Cell(65,"6",$FIFSCCODE,'1',1,'L');
			//$FAADHARNO=$apv['FAADHARNO'];
				/* $pdf->Cell(20,"6","",'0',0,'C');
				$pdf->Cell(25,"6","Address           ",'1',0,'L');
				$pdf->MultiCell(145,6, $address,'1','L'); */
				$pdf->ln(5); 
				
				
				
				$height=$height+75;
				
				$pdf->SetFont('Times','B',12);	
				$pdf->Cell(20,"6","",'0',0,'C');
				$pdf->Cell(25,"6","Specialisation ",'0',1,'L');
				$pdf->SetFont('Times','',10);
				WriteHeaders($pdf);
				WriteHeadersDetails($pdf,$s1,$FUGPG1,$FEXAMWORK1);
				WriteHeadersDetails($pdf,$s2,$FUGPG2,$FEXAMWORK2);
				WriteHeadersDetails($pdf,$s3,$FUGPG3,$FEXAMWORK3);
				WriteHeadersDetails($pdf,$s4,$FUGPG4,$FEXAMWORK4);
				WriteHeadersDetails($pdf,$s5,$FUGPG5,$FEXAMWORK5);
				 $pdf->ln(30);
				  $pdf->Cell(16.8,"6","",'0',0,'C');
				 
				$pdf->Cell(38,"6","Status : ".$FSTATUS,'0',1,'L');
				$pdf->Cell(16.8,"6","",'0',0,'C');
				$pdf->Cell(38,"6","Last Update : ".$logdate,'0',1,'L');
				 $pdf->Cell(20,"6","",'0',0,'C');
				$pdf->Cell(20,4,"Date : ".$FDATE,'0',0,'C');
				$pdf->Cell(150,4,"Signature of the Principal with Seal",'0',1,'R');
				 /* if($i%2==0)
				{
					$pdf->AddPage();
					$width_x=160;
					$height=34;
				}
				$i++; */
		} 
			/* $pdf->Ln(18);
			$pdf->Cell(20,4,"Date :",'0',0,'C');
			$pdf->Cell(170,4,"Signature of the Principal with Seal",'0',1,'R');
			$pdf->Cell(0,50,'IP Address : '.$_SERVER['REMOTE_ADDR'].",  Date ".$pdf->date_1,'0',1,'L'); */
	$pdf->Output("teachers_checklist.pdf","D");
	
}
function WriteHeaders($pdf)
{
	$pdf->SetFont('Times','B',10);
	$pdf->Cell(20,6,'','0',0,'L');
	$pdf->Cell(114.5,6,'Subject','1',0,'C');
	$pdf->Cell(20,6,'UG / PG','1',0,'C');
	$pdf->Cell(20,6,'Examiner','1',0,'C');
	$pdf->Cell(20,6,'QP Setter','1',1,'C');
	/* $pdf->Cell(20,6,'Squad','1',0,'L'); 
	$pdf->Cell(20,6,'Chief Sup.','1',0,'L'); 
	$pdf->Cell(20,6,'Custodian','1',1,'L');  */
	$pdf->SetFont('Times','',10);
 
}function WriteHeadersDetails($pdf,$s1,$FUGPG1,$FEXAMWORK1)
{
		$exp_arr=explode("|",$FEXAMWORK1);
		 $examinar="No";
		 $qp="No";
		 $sqad="No";
		 $cheif_sup="No";
		 $cust="No";
		 for($i=0;$i<=count($exp_arr);$i++)
		 {	
			$val=trim($exp_arr[$i]);
			if($val=="EXAMINER")
			 $examinar="Yes";
			else if($val=="QP SETTER")
			 $qp="Yes";
			else if($val=="SQUAD")
			 $sqad="Yes";
			else if($val=="CHIEF SUP")
			 $cheif_sup="Yes";
			else if($val=="CUSTODIAN")
			 $cust="Yes";		 
		 }
		// if($s1 !="")
		 //{	 
			$pdf->Cell(20,6,'','0',0,'L');
			$pdf->Cell(114.5,6,$s1,'1',0,'L');
			$pdf->Cell(20,6,$FUGPG1,'1',0,'C');
			$pdf->Cell(20,6,$examinar,'1',0,'C');
			$pdf->Cell(20,6,$qp,'1',1,'C');
			/* $pdf->Cell(20,6,$sqad,'1',0,'L'); 
			$pdf->Cell(20,6,$cheif_sup,'1',0,'L'); 
			$pdf->Cell(20,6,$cust,'1',1,'L'); */ 
		 //}	
}
?>