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


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

<?php
function GenerateValTeacherReport($aobj_context)
{
	session_start();
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	
	$college_code = $_SESSION['collcode'];
	$funivcode = $_SESSION['FUNIVCODE'];

	$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"];
    
    $teach_from = $aobj_context->mobj_data["teach_from"];
	$teach_to   = $aobj_context->mobj_data["teach_to"];
    $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(15, 15);
	$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 Val';
	$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'];


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

	//$pdf->AddPage();	
	$pdf->SetFont('Times', '', 10);

	$get_data = "select FTEACHCODE,FTEACHNAME,FDEGNDESC,FGENDER,FQUAL,FSCALE,
	DATE_FORMAT(FDOB,'%d/%m/%Y') as FDOB,FEMAIL,FMOBILE,FPHONE,FPANNO,
	ifnull(FSTATUS,'Pending') as FSTATUS,DATE_FORMAT(now(),'%d/%m/%Y') as FDATE,
	DATE_FORMAT(FLOGDATE,'%d/%m/%Y') as FLOGDATE, 
	FADDR1,FADDR2,FADDR3,FADDR4,
	concat(TIMESTAMPDIFF( YEAR, FDOA, now()), ' Yr., ', TIMESTAMPDIFF( MONTH, FDOA, now()) % 12, ' Mon.') as FEXP,
	FFULLTIME,FPERMANENT,ifnull(FPHOTO,'-') as FPHOTO,FREMARKS,
	DATE_FORMAT(FDOA,'%d/%m/%Y') as doj,
	t.FIFSCCODE,t.FACCNO,t.FAADHARNO
	from masteach t inner join masdegn des on des.FDEGNCODE=t.FDEGNCODE
    where t.FCOLLCODE='{$college_code}' and ifnull(FSTATUS,'') <> 'retired'
    and t.fteachcode between '{$teach_from}' and '{$teach_to}'";
	// var_dump($get_data);
	
	$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(15, 15);
		$FTEACHCODE = $apv['FTEACHCODE'];
		$FTEACHNAME = $apv['FTEACHNAME'];
		$FDEGNDESC = $apv['FDEGNDESC'];
		$FFULLTIME = $apv['FFULLTIME'];
		$FPERMANENT = $apv['FPERMANENT'];
		$FEXP = $apv['FEXP'];
		$FIFSCCODE = $apv['FIFSCCODE'];
		$FACCNO = $apv['FACCNO'];
		$FAADHARNO = $apv['FAADHARNO'];
		$FMOBILE = $apv['FMOBILE'];
		$FPHONE = $apv['FPHONE'];
		$FPANNO = $apv['FPANNO'];
		$FEMAIL = $apv['FEMAIL'];
		$FQUAL = $apv['FQUAL'];
		$FGENDER = $apv['FGENDER'];
		$FSTATUS = $apv['FSTATUS'];
		$FREMARKS = $apv['FREMARKS'];
		$FDATE = $apv['FDATE'];
		$logdate = $apv['FLOGDATE'];
		$FDOB = $apv['FDOB'];
		$doj = $apv['doj'];

		$FSCALE = $apv['FSCALE'];

		$add1 = $apv['FADDR1'];
		$add2 = $apv['FADDR2'];
		$add3 = $apv['FADDR3'];
		$add4 = $apv['FADDR4'];

		$pdf->SetFont('Times', '', 10);
		$height_y = $height;
		$pdf->SetFont('Times', 'B', 15);

        $teachcode = $FTEACHCODE;
        
        $pdf->SetFont('Times', '', '14');
        $pdf->MultiCell(180,"7", 'I hereby depute the below mentioned teacher for valuation purpose at '.$pdf->FUNIVNAME.' with effect from ............................', '0', 'L');
        $pdf->ln(2);
        $pdf->SetFont('Times', 'B', 15);
        $pdf->Cell(0, "6", "Teacher Id : " . $teachcode, '0', 1, 'L');

		$pdf->SetFont('Times', 'B', 10);
		$pdf->Cell(0, "6", "Personal Details", '1', 1, 'L');
		$pdf->SetFont('Times', '', 10);
		$pdf->Cell(30, "6", "Teacher Name: ", '1', 0, 'L');
		$pdf->Cell(150, "6", $FTEACHNAME, '1', 1, 'L');
		$pdf->SetFont('Times', 'B', 10);

		$pdf->SetFont('Times', '', 10);
		$pdf->Cell(30, "6", "Gender: ", '1', 0, 'L');
		$pdf->Cell(45, "6", $FGENDER, '1', 0, 'L');
		$pdf->Cell(30, "6", "Date of Birth: ", '1', 0, 'L');
		$pdf->Cell(45, "6", $FDOB, '1', 0, 'L');
		$pdf->Cell(30, "6", "", 'R', 1, 'L');

		$pdf->Cell(30, "6", "Mobile No.: ", '1', 0, 'L');
		$pdf->Cell(45, "6", $FMOBILE, '1', 0, 'L');
		$pdf->Cell(30, "6", "Phone No.: ", '1', 0, 'L');
		$pdf->Cell(45, "6", $FPHONE, '1', 0, 'L');
		$pdf->Cell(30, "6", "Affix Photo", 'R', 1, 'C');

		$pdf->Cell(30, "6", "Email ID: ", '1', 0, 'L');
		$pdf->Cell(120, "6", $FEMAIL, '1', 0, 'L');
		$pdf->Cell(30, "6", "Here", 'R', 1, 'C');

		$pdf->Cell(30, "5", "Address: ", 'LRT', 0, 'L');
		$pdf->Cell(120, "5", $add1, 'LRT', 0, 'L');
		$pdf->Cell(30, "5", "", 'LR', 1, 'L');

		$pdf->Cell(30, "5", "", 'LR', 0, 'L');
		$pdf->Cell(120, "5", $add2, 'LR', 0, 'L');
		$pdf->Cell(30, "5", "", 'LR', 1, 'L');

		$pdf->Cell(30, "5", "", 'LR', 0, 'L');
		$pdf->Cell(120, "5", $add3, 'LR', 0, 'L');
		$pdf->Cell(30, "5", "", 'LR', 1, 'L');

		$pdf->Cell(30, "5", "", 'LRB', 0, 'L');
		$pdf->Cell(120, "5", $add4, 'LRB', 0, 'L');
		$pdf->Cell(30, "5", "", 'LRB', 1, 'L');

		//$photo_path = $apv['FPHOTO'];
		$photo_path = $aobj_context->main_src.'/'.$aobj_context->mobj_data["db"].'/'.$apv['FPHOTO'];
		// var_dump($photo_path);
		if($apv['FPHOTO'] != '-')
		{
			if (!empty($photo_path) && file_exists($photo_path)) {
				$pdf->Image($photo_path, 166, 85, 28, 30);
			}
		}
		//$pdf->Cell(148,6,$pdf->Image($photo_path,170,45,23,20),'1','1','L');
		$pdf->ln(2);

		$pdf->SetFont('Times', 'B', 10);
		$pdf->Cell(0, "6", "Academic Details", '1', 1, 'L');
		$pdf->SetFont('Times', '', 10);

		$pdf->Cell(30, "6", "Designation: ", '1', 0, 'L');
		$pdf->Cell(0, "6", $FDEGNDESC, '1', 1, 'L');

		$pdf->Cell(30, "6", "Salary Scale: ", '1', 0, 'L');
		$pdf->Cell(60, "6", $FSCALE, '1', 0, 'L');
		$pdf->Cell(30, "6", "Full Time: ", '1', 0, 'L');
		$pdf->Cell(60, "6", $FFULLTIME, '1', 1, 'L');

		$pdf->Cell(30, "6", "Joining Date: ", '1', 0, 'L');
		$pdf->Cell(60, "6", $doj, '1', 0, 'L');
		$pdf->Cell(30, "6", "Experience: ", '1', 0, 'L');
		$pdf->Cell(60, "6", $FEXP, '1', 1, 'L');

		$pdf->Cell(30, "6", "Qualification: ", '1', 0, 'L');
		$pdf->Cell(0, "6", $FQUAL, '1', 1, 'L');

		$pdf->Cell(30, "6", "Working Status: ", '1', 0, 'L');
		$pdf->Cell(60, "6", $FSTATUS, '1', 0, 'L');
		$pdf->Cell(30, "6", "Updated on: ", '1', 0, 'L');
		$pdf->Cell(60, "6", $logdate, '1', 1, 'L');

		$pdf->Cell(30, "6", "Remarks: ", '1', 0, 'L');
		$pdf->Cell(0, "6", $FREMARKS, '1', 1, 'L');
		$pdf->ln(2);

		$query = "select m.fexamno, m.fboard, t.fqpcode, m.fsubname, fdegreerange as fdegrees 
		from teachsub t inner join masqp m
		on t.fqpcode = m.fqpcode where t.fteachcode = '{$teachcode}'
		order by m.fboard, m.fexamno, t.fqpcode";
		$result = $aobj_context->mobj_db->GetAll($query);

		// $query = "select t.fqpcode as fsubname
		// 	from teachsub t where t.fteachcode = '{$teachcode}'
		// 	order by t.fqpcode";
		// $result = $aobj_context->mobj_db->GetAll($query);


		if (count($result) > 0) {
			$pdf->SetFont('Times', 'B', 10);
			$pdf->Cell(0, "6", "Valuation Details:", '1', 1, 'L');
			$pdf->Cell(15, "6", "Sl. No.", '1', 0, 'C');
			$pdf->Cell(20, "6", "Board", '1', 0, 'C');
			$pdf->Cell(20, "6", "QP Code", '1', 0, 'C');
			$pdf->Cell(125, "6", "Subject Name", '1', 1, 'C');
			$i = 1;
			$pdf->SetFont('Times', '', 10);
			foreach ($result as $k => $v) {
				$pdf->Cell(15, "6", $i, '1', 0, 'C');
				$pdf->Cell(20, "6", $v['fboard'], '1', 0, 'C');
				$pdf->Cell(20, "6", $v['fqpcode'], '1', 0, 'C');
				$pdf->Cell(125, "6", $v['fsubname'], '1', 1, 'L');
				$i++;
			}
		}

		$pdf->ln(2);

		$pdf->SetFont('Times', 'B', 10);
		$pdf->Cell(0, "6", "Bank Details", '1', 1, 'L');
		$pdf->SetFont('Times', '', 10);
		$pdf->Cell(30, "6", "Account No: ", '1', 0, 'L');
		$pdf->Cell(60, "6", $FACCNO, '1', 0, 'L');
		$pdf->Cell(30, "6", "IFSC Code: ", '1', 0, 'L');
		$pdf->Cell(60, "6", $FIFSCCODE, '1', 1, 'L');

		$pdf->Cell(30, "6", "PAN No.: ", '1', 0, 'L');
		$pdf->Cell(150, "6", $FPANNO, '1', 1, 'L');
		$pdf->ln(15);

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

		$pdf->Cell(30, "6", "Date: " . $FDATE, '0', 0, 'L');
		$pdf->Cell(150, "4", "Principal Signature with Seal", '0', 1, 'R');
	}
	$pdf->Output("teachers_checklist.pdf", "I");
}
function WriteHeaders($pdf)
{
	$pdf->SetFont('Times', 'B', 10);
	$pdf->Cell(120, 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 = "";
	$qp = "";
	$sqad = "";
	$cheif_sup = "";
	$cust = "";
	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(120, 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');
	}
}