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


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

<?php

	function GenerateSubjectWiseStudentList($aobj_context)
	{	
		session_start();
		$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
		$college_code = $_SESSION['collcode']; 

		$degree_code = $aobj_context->mobj_data["degree_code"]; 
		$sub_degree_code = $aobj_context->mobj_data["sub_degree_code"]; 
		$subwise_start = $aobj_context->mobj_data["subwise_start"]; 
		$subwise_end = $aobj_context->mobj_data["subwise_end"]; 
		$sub_cond="";
		$sub_cond=" and canddet.fsubcode>='{$subwise_start}' and canddet.fsubcode<='{$subwise_end}'";
		
		$exam_no = $aobj_context->mobj_data["exam_code"]; 

		$lateral_entry = $aobj_context->mobj_data["lateral_entry"]; 
		$to_degree = $aobj_context->mobj_data["to_degree"]; 
		$exam_no=empty($exam_no)?"A":$exam_no;
		$degree_cond=" and canddet.fdegree >= '{$degree_code}' and canddet.fdegree <= '{$degree_code}' ";
		if(!empty($to_degree))
		{
			$degree_cond=" and  canddet.fdegree >= '{$degree_code}' and canddet.fdegree <= '{$to_degree}' ";
		}
		
		$main_src_obj=(explode("/",$_SERVER["REQUEST_URI"]));
		$main_src=$main_src_obj[1];
		$pdf_writer_class=$aobj_context->main_src."/maya-pdf/fpdf.php";
		$tarkaheader=$aobj_context->main_src."/Report_details/tarkaheader.php";
		$root_pdf_file_download=$aobj_context->main_src."/Report_details/output/report_admission_list.pdf";

		$p_count =1;

		include($pdf_writer_class);		
			$pdf= new FPDF();

		$pdf->SetFont('Times','',10);
		$pdf->SetMargins(14,17);		
		$pdf->AliasNbPages();	
		$sub_degree_cond="";
		
		if(!empty($sub_degree_code))
		{
			$sub_degree_cond = " and s.FSUBDEGREE='{$sub_degree_code}'"; 
			
			$page_header_sub_degree = " select concat('[',FDEGREE,'] - ', FDESCPN) as sub_degree_name, FADYEAR  
										from degree where FDEGREE = '{$sub_degree_code}' and FEXAMNO='{$exam_no}' ";
									
			$lobj_page_header_sub_degree = $aobj_context->mobj_db->GetRow($page_header_sub_degree);
		}
	
		$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,', ',FEXAMNAME) as Degree_name, FADYEAR  
								from degree where FDEGREE = '{$degree_code}' and FEXAMNO='{$exam_no}' ";
		$lobj_page_header_degree = $aobj_context->mobj_db->GetRow($page_header_degree);
		
		$pdf->Degree_name = $lobj_page_header_degree['Degree_name'];
		
		$pdf->AdmissionYear = $lobj_page_header_degree['FADYEAR']; 
		

		$pdf->aobj_context =$aobj_context ;
		$pdf->WhichReport = 'SubjectWiseStudent';
		$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->sub_degree_code = $lobj_page_header_sub_degree['sub_degree_name'];
		

		$get_subject_data = " Select canddet.fdegree,degree.fexamdate as fddate, subject.fcsubcode as fsubcode , 
							concat(subject.fsubname,' ', subject.fssubname) as fsubname,
							subject.fsubshort as fsubshort, date_format(subject.fdoe,'%d/%m/%Y')   as fdoe, subject.fsession as fsession ,
							GROUP_CONCAT(candsum.fregno order by candsum.fregno) as data_set,
							subject.fqpcode as fqpcode
							from candsum, canddet, degree, subject
							where candsum.fdegree = canddet.fdegree
							and candsum.fcollcode = canddet.fcollcode
							and candsum.fregno = canddet.fregno
							and canddet.fdegree = degree.fdegree
							and canddet.fexamno = degree.fexamno
							and candsum.fyear = degree.fmeyear
							and candsum.fexamtype = degree.fmeexamtyp
							and canddet.fdegree = subject.fdegree
							and canddet.fexamno = subject.fexamno
							and canddet.fsubcode = subject.fsubcode 
							and candsum.fcollcode = '{$college_code}' 
							{$degree_cond}
							{$sub_cond}
							and canddet.fexamno = '{$exam_no}'
							and ifnull(candsum.ftotalfee,0) > 0 and ifnull(canddet.fpassmth,'') =''
							and ifnull(subject.fintass,'F') = 'F' and ifnull(canddet.fpresent,'') = 'P'
							group by  canddet.fdegree,subject.fcsubcode 
							order by subject.fexamno, subject.ftheory desc,subject.fdoe,
							canddet.fsubcode,canddet.fdegree, candsum.fregno";
							
											
		$aobj_context->mobj_db->execute("SET @@session.group_concat_max_len=1000000");
		
		$lobj_subject_data = $aobj_context->mobj_db->GetAll($get_subject_data);	
		
		  
		$pdf->fddate=$lobj_subject_data[0][fddate];
		
		$pdf->AddPage();	
		
		$pdf->SetFont('Times','',10);
		
		foreach($lobj_subject_data as $key => $value)
		{	
			$fdegree = $value['fdegree'];
			$page_header_degree = "select concat('[',FDEGREE,'] - ', FDESCPN,', ',FEXAMNAME) as Degree_name, FADYEAR  
									from degree where FDEGREE = '{$fdegree}' and FEXAMNO='{$exam_no}' ";
			$lobj_page_header_degree = $aobj_context->mobj_db->GetRow($page_header_degree);

			$pdf->Degree_name = $lobj_page_header_degree['Degree_name'];
			$pdf->AdmissionYear = $lobj_page_header_degree['FADYEAR'];

			$fsubcode = $value['fsubcode'];
			$fqpcode = $value['fqpcode'];
			$fsession = $value['fsession'];
			$data_set = $value['data_set'];
			$fsubname = $value['fsubname'];
			$fdoe = $value['fdoe'];
			$fsubshort = $value['fsubshort'];	
			$pdf->SetFont('Times','',12);	
			$pdf->Cell(0,6,'DEGREE :' .$pdf->Degree_name,0,1,'C'); 											 									
			$pdf->Cell(0,6,'SUBJECT :' .$fsubcode .'-'.$fsubname." [{$fsubshort}]",0,1,'C'); 											 									
			$pdf->Cell(0,5,'Date and Session  : '.$fdoe .' '.$fsession .', ' .'QP Code :' .$fqpcode,0,1,'C'); 
			$data_arr=(explode(",",$data_set));
			$pdf->Ln(5);
			$count=0;
		
			$data_set_count =count($data_arr);
			for($i=0;$i<$data_set_count;$i++)
			{
				if($count==6)
				{
					$pdf->Ln(5);
					$count=0;	
				}
				$pdf->SetFont('Times','',12);
				$pdf->Cell(30,5,$data_arr[$i],1,0,'C'); 
				$count++;
			}
			
			$pdf->Ln(6);
			$pdf->Cell(0,5,'Total Student :'.$data_set_count,0,1,'L');
			$pdf->Ln(10);
	
		}
	$pdf->Output("SubjectWiseStudentList.pdf","D");
}
?>