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


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

<?php
function generateDegreeReport($aobj_context)
{	
	session_start();
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
    $college_code = $_SESSION['collcode']; 
	$degree_types = $aobj_context->mobj_data["degree_types"]; 
	$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".$_SESSION['user_id']."_".$report_id.".pdf";
// global varibales
	$p_count =1;
// end global varibales	
//echo $pdf_writer_class; 
	include($pdf_writer_class);		
	$pdf= new FPDF();	
	$pdf->SetFont('Times','',10);
	$pdf->SetMargins(15,8);		
	$pdf->AliasNbPages();	

// query for the page header	
	 $page_header_university = "select FUNIVNAME,FUNIVADD1,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_footer_date = "select DATE_FORMAT(NOW(),'%d/%m/%Y %h:%i %p') as now_date ";
	$lobj_page_footer_date = $aobj_context->mobj_db->GetRow($page_footer_date);
	$pdf->date_time = $lobj_page_footer_date['now_date'];
	
	$pdf->aobj_context =$aobj_context ;
	$pdf->WhichReport = 'Degree';
	$pdf->FUNIVNAME = $lobj_page_header_university[FUNIVNAME];
	$pdf->FTOWN = $lobj_page_header_university[FTOWN];
	$pdf->FUNIVADD1 = $lobj_page_header_university[FUNIVADD1];
	$pdf->date_1 = $lobj_page_header_university['date'];
	$pdf->college_name = $lobj_page_header_college['college_name'];
	$pdf->DEGREETYPES=$degree_types;
	$pdf->AddPage();PrintFooter($pdf);
	$pdf->Ln();
	$pdf->SetFont('Times','',10);
	
	if($degree_types =='Selected only')
	{
		$get_data= " select distinct c.FDEGREE as 'Degree', d.FDESCPN as 'Description' from colldeg c inner join  degree d 
					on c.FDEGREE = d.FDEGREE and c.FCOLLCODE='{$college_code}' 
					and c.FDELETED='F'";
		$fwidth='140';
	}
	else
	{
		$get_data="select distinct d.FDEGREE as 'Degree', d.FDESCPN as 'Description',IF(IFNULL(c.FDEGREE,'F')='F','','Selected') as 'Status' from colldeg c   right join degree d 
					on c.FDEGREE = d.FDEGREE and c.FCOLLCODE='{$college_code}' 
					and c.FDELETED='F'";
		$fwidth='160';
	}
	$lobj_details = $aobj_context->mobj_db->GetAll($get_data);
	
	$header_row=(array_keys($lobj_details[0]));	
	$pdf->SetDash(1, .3); //5mm on, 5mm off
	$pdf->Line(10, 33, 200, 33);
	//$pdf->Line(10, 33.5, 200, 33.5);
	foreach($header_row as $key1 => $value1)
	{	
		if($value1 == 'Description')
			$width='120';	
		else if($value1 == 'Degree')
			$width='20';	
		else 
			$width = '20';
			
		$pdf->SetFont('Times','B',10);
		$pdf->Cell($width,6,$value1,'0','0','L');
	}
	 //5mm on, 5mm off

	$pdf->SetDash(1, .3);
	$pdf->Line(10,38, 200,38);
	//$pdf->Line(10,38.5, 200,38.5);
	$pdf->Ln();	  
	$adm_ln_counter =0;
	foreach($lobj_details as $key => $value)
	{
	
		if($adm_ln_counter > 35)
		{
			$new_y=$pdf->GetY();
			$pdf->SetDash(1, .3);
			$pdf->Line(10,$new_y, 200,$new_y);
			$pdf->AddPage();PrintFooter($pdf);
			$pdf->Ln(4);
			$pdf->SetDash(1, .3); //5mm on, 5mm off
			$pdf->Line(10, 33, 200, 33);
			$pdf->Line(10, 33.5, 200, 33.5);
			foreach($header_row as $key1 => $value1)
			{	
				if($value1 == 'Description')
					$width='120';	
				else if($value1 == 'Degree')
					$width='20';	
				else 
					$width = '20';
					
				$pdf->SetFont('Times','B',10);
				$pdf->Cell($width,6,$value1,'0','0','L');
			}
			$new_y=$pdf->GetY();
			$pdf->SetDash(1, .3); //5mm on, 5mm off
			$pdf->Line(10, 38, 200, 38);
			$pdf->Line(10, 38.5, 200, 38.5);
			
			$pdf->Ln();
			$adm_ln_counter=0;
		}
	   foreach($value as $key2 => $value2)
	    {		  	    
		 if($key2 == 'Description')
		{
			$align = "L";
			$width='120';
		}	
		else if($key2 == 'Degree')
		{
			$align = "L";
			$width='20';
		}	
		else if($key2 == 'Status')
		{
			$width='20';
			$align = "L";
		}	
		$pdf->SetFont('Times','',10);	
		$pdf->Cell($width,6,$value2,'','0',"{$align}");
		}
		
		 $pdf->Ln();
		++$adm_ln_counter;
	}	
		$new_y=$pdf->GetY();
		$pdf->SetDash(1, .3);
		$pdf->Line(10,$new_y, 200,$new_y);

	$pdf->Output("degree_lists.pdf","I");	 
	 
}

function PrintFooter($pdf)
{
		$new_x=$pdf->GetX();
		$new_y=$pdf->GetY();
		$ip=$_SERVER["REMOTE_ADDR"];
		$pdf->SetY(-20);
		$pdf->SetFont('Times','',8);
		$new_yl=$pdf->GetY();
		$pdf->SetDash(1, .3);
		$pdf->Line(10,$new_yl, 200,$new_yl);
		$pdf->Line(10,$new_yl+.5, 200,$new_yl+.5);
		$pdf->Ln(2);
		$pdf->Cell(140,4,'Printed   : IP Address : '.$ip.", Date : ".$pdf->date_time,'0',0,'L');
		$pdf->SetXY($new_x,$new_y); 
}
?>