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


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

<?php
function generateSubjecADCLReport($aobj_context)
{	
	session_start();
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
    $college_code = $_SESSION['collcode']; 
	$degree_code = $aobj_context->mobj_data["degree_code"]; 
	$exam_code_start = $aobj_context->mobj_data["exam_code_start"]; 
	$exam_code_end = $aobj_context->mobj_data["exam_code_end"]; 
	$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_admission_list.pdf";
// global varibales
	$p_count =1;
// end global varibales	
	include($pdf_writer_class);		
	$pdf= new FPDF();	
	$pdf->SetFont('Times','',10);
	$pdf->SetMargins(33,15);		
	$pdf->AliasNbPages();	

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

// 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 distinct concat('[',degree.FDEGREE,'] - ', degree.FDESCPN) as Degree_name, 
							concat(' (  ',degree.FEXAMNAME,'  ) ') as Exam, degree.FADYEAR  
							from degree, subject where degree.fdegree = subject.fdegree and degree.fexamno = subject.fexamno
							and degree.FDEGREE = '{$degree_code}' and 
							degree.FEXAMNO >= '{$exam_code_start}' and degree.FEXAMNO<='{$exam_code_end}'";
	$lobj_page_header_degree = $aobj_context->mobj_db->GetAll($page_header_degree);
	$pdf->aobj_context =$aobj_context ;
	$pdf->WhichReport = 'SUBJECT_ADCL';
	$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'];
	
//end header		
	$pdf->AddPage();		
	$pdf->SetFont('Times','',10);
	
	$get_subject_data= " select if(FMANDATORY='T',concat('* ',FSUBCODE),concat('  ',FSUBCODE)) as FSUBCODE, 
						FEXAMNO, FSUBNAME  , FSUBSHORT
						 from {$subjecttmp} where FDEGREE='{$degree_code}' and
						FEXAMNO>='{$exam_code_start}' and FEXAMNO<='{$exam_code_end}'
						 and ifnull(FDELETED,'F')='F' group by FSUBCODE	
					  "; 				  
					  //echo $get_subject_data;die();
	$lobj_get_subject_data = $aobj_context->mobj_db->GetAll($get_subject_data);	
	//var_dump($lobj_get_subject_data); die();
	$Count_subject=1;
	$chk_sem = $lobj_get_subject_data[0]['FEXAMNO'];
	foreach($lobj_get_subject_data as $key => $value)
	{	  	  	    
		if($chk_sem == $value['FEXAMNO'])	
		{
		}
		else
		{
			$nxt++;
			$pdf->Exam = $lobj_page_header_degree['Exam'];			
			$chk_sem = $value['FEXAMNO'];
			//$pdf->college_name = $lobj_page_header_college[$nxt]['college_name'];
			$pdf->Degree_name = $lobj_page_header_degree[$nxt]['Degree_name'];
			$pdf->Exam = $lobj_page_header_degree[$nxt]['Exam'];
			$pdf->AddPage();
			
		}	
		
			$pdf->Cell(12,6,$Count_subject++,'1',0,'C');
			$pdf->Cell(20,6,$value['FSUBCODE'],'1',0,'L');
			$pdf->Cell(80,6,$value['FSUBNAME'],'1',0,'L');
			$pdf->Cell(20,6,$value['FSUBSHORT'],'1',1,'C');			
	
	}
	
	$pdf->Output("report_admission_list.pdf","D");
}
?>