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


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

<?php
function genrteCieAttndEligblityPdfReport($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"];  
    $date = $aobj_context->mobj_data["date"];
    $sem = $aobj_context->mobj_data["sem"];

    if($degree=="All"){
        $degcond="";
    }else{
        $degcond="AND m.fdegree in ($degre)";
    }

    $array = explode(", ", $degree);
    $quotedArray = array_map(function($value) {
        return "'" . $value . "'";
    }, $array);
    $degre = implode(",", $quotedArray);
    if($degree=="All"){
        $degcond="";
    }else{
        $degcond="AND m.fdegree in ($degre)";
    }
	$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";

    include($pdf_writer_class);		
	$pdf= new FPDF();
    
    if ($pdf === null) {
        // Handle error, maybe log it or display an error message
        die("Failed to initialize PDF object");
    }
	//$pdf->$title='20000 Leagues Under the Seas';
	$pdf->SetFont('Times','',9);
	$pdf->SetMargins(12,10,12,10);		
	$pdf->AliasNbPages();	

	$page_header_university = "select c.FUNIVNAME,c.FTOWN,concat(d.fcollname,', ',d.ftown) as fcollname, date_format(now(),'%d/%m/%Y') as date from control c,college d where d.fcollcode='{$college_code}'";
	$lobj_page_header_university = $aobj_context->mobj_db->GetRow($page_header_university);
	
	
	$pdf->aobj_context =$aobj_context ;
	$pdf->WhichReport = 'genrteCieAttndEligblityPdfReport';
	$pdf->FUNIVNAME = $lobj_page_header_university['FUNIVNAME'];
	$pdf->FTOWN = $lobj_page_header_university['FTOWN'];
	$pdf->college_name = $lobj_page_header_university['fcollname'];
    $pdf->semester = $sem;


	$pdf->date_1 = $lobj_page_header_university['date'];

    $get_subject_data="SELECT d.fexamname,d.fexamdate,m.fdegree,d.fdescpn,m.fregno,st.fname,s.fsubcode,s.fsubshort,s.fsubname, m.fmarks,
                        IF(((m.fmarks/s.fvalmax)*100) <50,'NE','') AS 'CIENE',
                        CEILING(a.fper),IF(CEILING(a.fper) < 75,'NE','') AS 'ATTNE' 
                        FROM marks m INNER JOIN attend a ON m.fcollcode = a.fcollcode
                        AND m.fdegree = a.fdegree AND m.fexamno = a.fexamno AND m.fregno = a.fregno
                        AND LEFT(m.fsubcode,4) = LEFT(a.fsubcode,4)
                        INNER JOIN student st ON m.fregno = st.fregno AND m.fcollcode = st.fcollcode 
                        AND m.fdegree = st.fdegree
                        INNER JOIN subject s ON m.fdegree = s.fdegree AND m.fexamno = s.fexamno 
                        AND m.fsubcode = s.fcsubcode
                        inner join degree d on m.fdegree=d.fdegree and m.fexamno=d.fexamno
                        WHERE ( ((m.fmarks/s.fvalmax)*100) <50 OR  CEILING(ifnull(a.fper,0)) < 75) $degcond
                         AND m.fexamno='{$sem}' 
                        GROUP BY m.fregno,s.fsubcode
                        ORDER BY m.fdegree,m.fregno,s.fsubcode";

	$aobj_context->mobj_db->execute("SET @@session.group_concat_max_len=1000000");
  
	$res = $aobj_context->mobj_db->GetAll($get_subject_data);
    
    $examdate=$res[0]['fexamdate'];
    $semister=$res[0]['fexamname'];
    $pdf->frm_date = $examdate;
    $pdf->semester = $semister;


 
	$pdf->AddPage("L");	
	$pdf->SetFont('Times','B',9);

    $i = 1;
    $oldDegree = $res[0]['fdegree'];
    $newDegree = "";
	$oldregno = $res[0]['fregno'];
    $newregno = "";
    $pdf->Cell(9,5,'Sl. No.','1',0,'C');
    $pdf->Cell(22,5,'USN','1',0,'C');
    $pdf->Cell(50,5,'Student Name','1',0,'C');
    $pdf->Cell(15,5,'Sub Code ','1',0,'C');
    $pdf->Cell(18,5,'Course Code','1',0,'C');
    $pdf->Cell(87,5,'Subject Name','1',0,'C');
    $pdf->Cell(10,5,'Marks','1',0,'C');
    $pdf->Cell(15,5,'CIE Elig.?','1',0,'C');
    $pdf->Cell(12,5,'ATT%','1',0,'C');
    $pdf->Cell(15,5,'ATT.Elig.?','1',0,'C');
    $pdf->Cell(30,5,'Remarks','1',1,'C');
    $pdf->SetFont('Times','',8);
    
    // $pdf->Cell(284,5,$res[0]['fdegree']." - ".$res[0]['fdescpn'],1,1,'L');

    for($z=0; $z<count($res); $z++){
        // var_dump($pdf->GetY());
        $yAxisPosition = 190;
        if($pdf->GetY() > $yAxisPosition)
        {
            $border='LRB';
            $pdf->AddPage("L");
            $pdf->SetFont('Times','B',9);
            $pdf->Cell(9,5,'Sl. No.','1',0,'C');
            $pdf->Cell(22,5,'USN','1',0,'C');
            $pdf->Cell(50,5,'Student Name','1',0,'C');
            $pdf->Cell(15,5,'Sub Code ','1',0,'C');
            $pdf->Cell(18,5,'Course Code','1',0,'C');
            $pdf->Cell(87,5,'Subject Name','1',0,'C');
            $pdf->Cell(10,5,'Marks','1',0,'C');
            $pdf->Cell(15,5,'CIE Elig.?','1',0,'C');
            $pdf->Cell(12,5,'ATT%','1',0,'C');
            $pdf->Cell(15,5,'ATT.Elig.?','1',0,'C');
            $pdf->Cell(30,5,'Remarks','1',1,'C');
            $pdf->SetFont('Times','',8);
        }
        if($oldDegree !== $newDegree){
            $pdf->SetFont('Times','B',9); 
            $pdf->Cell(283,5,$res[$z]['fdegree']." - ".$res[$z]['fdescpn'],1,1,'L');
            $pdf->SetFont('Times','',8);

        }
        if($oldregno !== $newregno){
            $cond = 'LRT';
            $name = $res[$z]['fname'];
            $regno = $res[$z]['fregno'];
            $slno = $i;
            $i++;  
        }else{
            $cond = 'LR';
            $name = "";
            $regno = "";
            $slno = "";
        }
        
        $pdf->Cell(9,5,$slno,$cond,0,'C');
        $pdf->Cell(22,5,$regno,$cond,0,'C');
        $pdf->Cell(50, 5,$name, $cond, 0, 'L'); 
        $pdf->Cell(15,5,$res[$z]['fsubcode'],1,0,'C');
        $pdf->Cell(18,5,$res[$z]['fsubshort'],1,0,'C');
        $pdf->Cell(87,5,$res[$z]['fsubname'],1,0,'L');
        $pdf->Cell(10,5,$res[$z]['fmarks'],1,0,'C');
        $remarks = "";
        if ($res[$z]['CIENE'] === "NE" && $res[$z]['ATTNE'] === "NE") {
            $remarks = "CIE & Att. Not Eligible";
        } elseif ($res[$z]['CIENE'] === "NE") {
            $remarks = "CIE Not Eligible";
        } elseif ($res[$z]['ATTNE'] === "NE") {
            $remarks = "Att. Not Eligible";
        }
        $pdf->Cell(15,5,$res[$z]['CIENE'],1,0,'C');
        $pdf->Cell(12,5,$res[$z]['CEILING(a.fper)'],1,0,'C');
        $pdf->Cell(15,5,$res[$z]['ATTNE'],1,0,'C');
        $pdf->SetFont('Times','',8); 
        $pdf->Cell(30,5,$remarks,1,1,'C');
        $pdf->SetFont('Times','',8); 

        $newregno = $res[$z + 1]['fregno'];
        $oldregno = $res[$z]['fregno'];
        $newDegree = $res[$z + 1]['fdegree'];
        $oldDegree = $res[$z]['fdegree'];
    }	
    $pdf->Output("CieAttendanceEligibilityReport.pdf","I");
}  

?>