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


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

<?php
function Genarentsectionwiselist($aobj_context)
{	
	session_start();
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
    $college_code = $_SESSION['collcode'];
	$FUNIVCODE = $_SESSION['FUNIVCODE'];
	$degree = $aobj_context->mobj_data['degree']; 
	$degreename = $aobj_context->mobj_data['degreename']; 
	$exam_no = $aobj_context->mobj_data['exam_no']; 
	$exam_name = $aobj_context->mobj_data['exam_name']; 
	$sectionfrom   = $aobj_context->mobj_data["sectionfrom"]; 
	$sectionto   = $aobj_context->mobj_data["sectionto"];	
	$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";
	$p_count =1;
	include($pdf_writer_class);		
	$pdf= new FPDF();
	
	$pdf->SetFont('Times','',10);		
	$pdf->AliasNbPages();	
	
	$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 ,' Examination ',FEXAMDATE,')') as Exam ,FADYEAR
							from degree where FDEGREE = '{$degree_code}' and FEXAMNO='{$exam_code}'";

	$lobj_page_header_degree = $aobj_context->mobj_db->GetRow($page_header_degree);

	$page_header_REGROLL = "select FREGROLL, fsnglent from control";
		$lobj_page_header_REGROLL = $aobj_context->mobj_db->GetRow($page_header_REGROLL);
		
	 
	$pdf->aobj_context =$aobj_context ;
	$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['Degree_name'];
	$pdf->Exam = $lobj_page_header_degree['Exam'];
	$pdf->AdmissionYear = $lobj_page_header_degree['FADYEAR'];
	$pdf->REGROLL=$lobj_page_header_REGROLL['FREGROLL'];
	$fsnglent=$lobj_page_header_REGROLL['fsnglent'];
	$pdf->RFROM=strtoupper(substr($sublist_start,-4));
	$pdf->RTO=strtoupper(substr($sublist_end,-4));
					
	$get_records = "SELECT GROUP_CONCAT(DISTINCT m.fregno,'->',s.fname,'->',s.fsection  ORDER BY m.FREGNO SEPARATOR '~') AS fsection  FROM student s, marks m 
					WHERE s.fdegree = m.fdegree AND s.fregno = m.fregno AND m.fcollcode = '{$college_code}' AND m.fdegree ='{$degree}'
					AND m.fexamno='{$exam_no}' AND IFNULL(m.fsubcode,'') <> '' AND IFNULL(s.fsection,'') <> '' 
					AND s.fsection BETWEEN '{$sectionfrom}' AND '{$sectionto}'  
					GROUP BY s.`FSECTION` ORDER BY s.fsection, m.fregno ";
	$lobj_get_subject_data = $aobj_context->mobj_db->GetAll($get_records);
	
	$sl_no=1;
	$k=0;
	$n=0;
	$oldsub="";
	$newsub="";
	$fbatchold  = "";
		
	foreach($lobj_get_subject_data as $key => $value)
	{	
		$fsection = explode("~",$value['fsection']);
		$j = 1;
		$first = true;
		foreach($fsection as $key => $fsectionvalue)
		{	
			$fsectionvalue = explode('->',$fsectionvalue );
			if($first)
			{
				$pdf->SetMargins(28,3);
				$pdf->AddPage();
				$pdf->SetMargins(28,3);
				$pdf->SetFont('Times','B',11);
				$pdf->Rect(5,4,200,280);
				/* $pdf->Cell(150,6,"Degree : "." ".$degree." - ".$degreename ,0,1,'C');											
				$pdf->Cell(150,6,'Exam :  '.$exam_name,0,1,'C'); */ 
				$pdf->Cell(0,5,'Section wise Student List','0',1,'C');
				$line1 =" ".substr("Degree : ".$degree.'-'.$degreename.str_repeat(' ', 80),0,-80);		
				$line1.=" ".substr('   Exam :  '.$degree.'-'.$degreename.str_repeat(' ', 25),0,25);	
				$pdf->SetFont('Times','',10);
				$pdf->Cell(165,6,$line1,0,1,'C');
				$pdf->SetFont('Times','BU',11);
				$pdf->Ln(2);
				$x = $pdf->GetX();
				$pdf->SetX($x+25);
				$pdf->Cell(150,5,"Section: ".$fsectionvalue[2],'0',1,'L');
				$pdf->Ln(1);
				$pdf->SetX($x+25);
				$pdf->SetFont('Times','B',10);
				$pdf->Cell(12,5,'Sl. No.','1',0,'C');
				$pdf->Cell(25,5,'Register No.','1',0,'C');
				$pdf->Cell(80,5,'Name','1',1,'C');
				$first=false;
			}
			$pdf->SetFont('Times','',10);
			$pdf->SetX($x+25);			
			$pdf->Cell(12,5,$j,'1',0,'C');
			$pdf->Cell(25,5,$fsectionvalue[0],'1',0,'C');
			$pdf->Cell(80,5,$fsectionvalue[1],'1',1,'L');
			$j++;
			
			if($pdf->GetY() > 250)
			{
				$new_y=$pdf->GetY();				
				$first=true;
			}
		}
		
	}
	$pdf->Ln(5);

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