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


Current Path : /var/www/oasis/Report_details_old/
Upload File :
Current File : /var/www/oasis/Report_details_old/photo_report.php

<?php
function generateAllStudentPhotosreport($aobj_context)
{	
	session_start();
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
    $college_code = $_SESSION['collcode'];
	$FUNIVCODE = $_SESSION['FUNIVCODE'];
	
	// $degree_from = trim($aobj_context->mobj_data["degree_from"]);
	$deg_code = trim($aobj_context->mobj_data["deg_code"]);
	$Reg_from = trim($aobj_context->mobj_data["Reg_from"]);
	$Reg_to = trim($aobj_context->mobj_data["Reg_to"]);
	// var_dump($deg_code);
	
	$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=$aobj_context->main_src."/Report_details/output/report_general_list.pdf";
	$getnumword=$aobj_context->main_src."/src/getnumword.php";
	include($getnumword);
	// global varibales
	$p_count =1;
	// end global varibales
	//echo getnumber_to_word("001"); die();
	include($pdf_writer_class);		
	$pdf= new FPDF();
	
	$pdf->SetFont('Times','',10);
	$pdf->SetMargins(20,13);		
	$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);

	$pdf->aobj_context =$aobj_context ;
	// $pdf->WhichReport = 'STUDENT_PHOTOLIST';

	$get_college_name="select  concat(FCOLLNAME,', ',FTOWN) as col_name from college where FCOLLCODE='{$college_code}'";
	$college_name = $aobj_context->mobj_db->GetRow($get_college_name);
	$col_name=$college_name['col_name'];

	$pdf->FUNIVNAME = $lobj_page_header_university['FUNIVNAME'];
	$pdf->FTOWN = $lobj_page_header_university['FTOWN'];
	$pdf->college_name = $college_name['col_name'];

/* 	$query = "select fdegree,fregno,fname,fcaste,fsex,fphotopath,concat(fregno,'.jpg')as fhphotopath from student 
			  where fdegree between '{$degree_from}' and '{$degree_to}' and 
			  fcollcode between '{$college_from}' and '{$college_to}' and ifnull(fdeleted,'') <> 'T' order by fdegree,fregno,fcollcode";
		   */


		$query = "  select distinct CONCAT(student.fdegree,' - ',FDESCPN) as fdegree,fregno,fname,fcaste,fsex,fphotopath from student,degree 
where student.fdegree = '{$deg_code}' and student.`FDEGREE` =  degree.`FDEGREE` and fregno between '{$Reg_from}' and '{$Reg_to}'
and fcollcode = '{$college_code}' order by fdegree,fregno,fcollcode";
	
	  
	$lobj_get_subject_data = $aobj_context->mobj_db->GetAll($query);
	
	$get_date_time="SELECT DATE_FORMAT(now(),'%d-%b-%Y %H:%m %r') as dt";
	$ob_dt = $aobj_context->mobj_db->GetRow($get_date_time); 
	$date_timef=$ob_dt['dt'];
	
	$first=true;
	$sl_no=1;
	$k=0;
	$n=0;
	$pdf->SetFont('Times','',10);
	$olddeg ="";
	$newdeg ="";
	$fbatchold  = "";
		
	//$pdf->Rect(5,09,200,280);
	$j = 1;
	
	foreach($lobj_get_subject_data as $key => $value)
	{	
		
		$newdeg = $value['fdegree'];
		if($newdeg != $olddeg)
		{	$pdf->AddPage();
			$pdf->SetMargins(20,13);
			$pdf->SetFont('Times','B',10);
			$pdf->Cell(175,5,'Student Photo List','0',1,'C');
			$pdf->Cell(175,5,'Degree : '.$newdeg,'0',1,'C');
			$olddeg = $newdeg;
			$j=1;
		}	
		$fbatchnew = $value['fbatch'];
		if($pdf->GetY() > 260)
		{
			$pdf->AddPage();
			//$pdf->SetMargins(20,15);
			$pdf->Cell(175,5,'Student Photo List','0',1,'C');
			$pdf->Cell(175,5,$newdeg,'0',1,'C');
			$pdf->SetFont('Times','B',10);
			$pdf->Cell(10,7,'Sl. No.','1',0,'C');
			$pdf->Cell(30,7,'Register No.','1',0,'C');
			$pdf->Cell(55,7,'Name','1',0,'C');
			$pdf->Cell(20,7,'Caste','1',0,'C');
			$pdf->Cell(20,7,'Gender','1',0,'C');
			$pdf->Cell(35,7,'Photo','1',1,'C');
			//$pdf->SetMargins(28.35,17);	
			//$pdf->Rect(5,09,200,280);
		}
		if($first)
		{
			$pdf->SetFont('Times','B',10);
			$pdf->Cell(10,7,'Sl. No.','1',0,'c');
			$pdf->Cell(30,7,'Register No.','1',0,'c');
			$pdf->Cell(55,7,'Name','1',0,'c');
			$pdf->Cell(20,7,'Caste','1',0,'C');
			$pdf->Cell(20,7,'Gender','1',0,'C');
			$pdf->Cell(35,7,'Photo','1',1,'C');
			$first = false;
		}
		$pdf->SetFont('Times','',10);
		$i = 33;
		$x = $pdf->GetX();
		$y = $pdf->GetY();
		$pdf->Cell(10,30,$j,'1',0,'C');
		$pdf->Cell(30,30,$value['fregno'],'1',0,'C');
		$pdf->Cell(55,30,$value['fname'],'1',0,'L');
		$pdf->Cell(20,30,$value['fcaste'],'1',0,'L');
		$pdf->Cell(20,30,$value['fsex'],'1',0,'L');
		$pdf->Cell(35,30,'','1',1,'L');
		
		$full_photo_path=trim($aobj_context->main_src.$value['fphotopath']);
		// var_dump($full_photo_path);
		if(file_exists($full_photo_path) && !empty($value['fphotopath']))
		{
			// var_dump($full_photo_path);
			$pdf->Image($full_photo_path,160,$y+2,25,25);				
		}
		else
		{
			$pdf->Image($aobj_context->main_src."/img/nophotoborder.jpg",160,$y+2,25,25);				
		}
		// $pdf->Image($full_photo_path,160,$y+2,25,25);
		$j++;
		$i= $i+10;
		
	}
	$pdf->Ln(5);

	$pdf->Output("report_top_sheet.pdf","D");
	
}
?>