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


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

<?php
$main_src = substr($_SERVER['SCRIPT_FILENAME'], 0, strlen($_SERVER['SCRIPT_FILENAME']) - 7);
$pdf_writer_class = $main_src . "/tcpdf/tcpdf.php";
require_once $pdf_writer_class;
// ini_set('memory_limit','900M');
// ini_set('max_execution_time',0);


class MYPDF extends TCPDF
{
    public function Header()
    {
        // get the current page break margin
        $bMargin = $this->getBreakMargin();
        // get current auto-page-break mode
        $auto_page_break = $this->AutoPageBreak;
        // disable auto-page-break
        $this->SetAutoPageBreak(false, 0);
        $this->SetTitle("IA Marks");
        // set bacground image
        $this->SetFillColor(248, 248, 255);
        $db=$this->aobj_context->mobj_data["db"];
        
        $img_path = $this->aobj_context->main_src .$db.'/'. $this->aobj_context->pdf_logo_path;
        // var_dump($img_path);
        
        if (file_exists($img_path)) {
            $this->Image($img_path, 30, 6, 20, 20);
        }

        // var_dump($this->aobj_context->FUNIVNAME);
        $this->SetFont('Times', 'B', 13);
        $this->SetY(5);
        $this->Cell(0, 7, $this->aobj_context->FUNIVNAME, 0, 1, 'C');
        //state
        $this->SetFont('Times', '', 11);
        $this->Cell(0, 4, $this->aobj_context->s_state, 0, 1, 'C');

        $this->SetFont('Times', 'B', 12);
        $this->Ln(1);
        $cur_year = date("Y");
        $this->Cell(0, 7, ' IA Marks', '0', 1, 'C');//Applicatoin
        $this->SetFont('Times', 'B', 12);        
        $this->Cell(0, 7, '_______________________________________________________________________________________', '0', 1, 'C');
        $this->Cell(0, 7, 'Phone', '0', 0, 'L');
        $this->Cell(0, 7, 'Date', '0', 1, 'R');
        $this->SetAutoPageBreak($auto_page_break, $bMargin);
        // set the starting point for the page content
    }

    public function Footer()
    {
        $this->SetY(-15);
        $this->SetFont('helvetica', 'I', 8);
        // var_dump();
        if($this->CurOrientation == 'P')
        {
            $this->Cell(60, 10, 'IP : ' . $_SERVER["REMOTE_ADDR"], 0, 0, 'L');
            $this->Cell(60, 10, 'Date : ' . date("d-m-Y h:i:s A"), 0, 0, 'C');
            $this->Cell(60, 10, 'Page ' . $this->getPageNumGroupAlias() . '/' . $this->getPageGroupAlias(), 0, 1, 'R');
        }
        else {
            $this->Cell(90, 10, 'IP : ' . $_SERVER["REMOTE_ADDR"], 0, 0, 'L');
            $this->Cell(90, 10, 'Date : ' . date("d-m-Y h:i:s A"), 0, 0, 'C');
            $this->Cell(90, 10, 'Page ' . $this->getPageNumGroupAlias() . '/' . $this->getPageGroupAlias(), 0, 1, 'R');
        }
    }
}



class ReprtObject
{

    public function DefaultConstructor($aobj_context)
    {
        $this->aobj_context = $aobj_context;
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);

        $this->ip = $_SERVER["REMOTE_ADDR"];
        $get_date = "select DATE_FORMAT(now(), '%d/%m/%Y') as now_date";
        $obj = $this->aobj_context->mobj_db->GetRow($get_date);
        $this->reportType = $aobj_context->mobj_data["rtype"];

        $get_coll_name = "select FUNIVNAME as 'FUNIVNAME',FUNIVCODE,
		FUNIVADD1 as 'state', pdf_logo_path,
		ifnull(FEXAMAPPREQ,'F') as FEXAMAPPREQ From control";
        $lobj_get_coll_name = $this->aobj_context->mobj_db->GetRow($get_coll_name);
// var_dump($lobj_get_coll_name);
        $aobj_context->FUNIVNAME = $lobj_get_coll_name['FUNIVNAME'];
        $aobj_context->s_state = $lobj_get_coll_name['state'];
        $aobj_context->pdf_logo_path = $lobj_get_coll_name['pdf_logo_path'];
        $aobj_context->FUNIVCODE = $lobj_get_coll_name['FUNIVCODE'];

        $this->current_date = $obj['now_date'];
        $deggrp = $this->aobj_context->mobj_data["fdeggrp"];

        $aobj_context->dateFrom = $aobj_context->mobj_data['dateFrom'];
        $aobj_context->dateTo   = $aobj_context->mobj_data['dateTo'];
        $aobj_context->qpcodeFrom   = $aobj_context->mobj_data['qpcodeFrom'];
        $aobj_context->qpcodeTo =  $aobj_context->mobj_data['qpcodeTo'];
        $aobj_context->regnoFrom = $aobj_context->mobj_data['regnoFrom'];
        $aobj_context->regnoTo = $aobj_context->mobj_data['regnoTo'];
        $aobj_context->correctionType = $aobj_context->mobj_data['correctionType'];

        $get_coll_name = "select fdeggrp,fdescpn,fexamdate as fexamdate 
        from deggrp where fdeggrp = '{$deggrp}'";
        $lobj_get_degree = $this->aobj_context->mobj_db->GetRow($get_coll_name);
        // var_dump($lobj_get_degree);
        
        $aobj_context->deggrp = $lobj_get_degree['fdeggrp'];
        $aobj_context->fexamdate = $lobj_get_degree['fexamdate'];
        $aobj_context->fdescpn = $lobj_get_degree['fdescpn'];

        $this->pdf = new MYPDF('P');
        $this->pdf->aobj_context = $aobj_context;
    }

    public function Header($pdf)
    {
        $pdf->SetFont('Times', 'B', 10);
        $pdf->Cell(165, 4, "PROGRESS REPORT", "", 1, "C");  
        
    }

    public function Report($data,$pdata)
    {
        
        $pdf = $this->pdf;

        $pdf->SetMargins(20, 43);
        $pdf->startPageGroup();
       $pdf->AddPage("P");

       


       $this->Header($pdf);
       $pdf->ln(3);
       
        $pdf->SetFont('Times', '', 10);

        $pdf->Cell(20, 4, "To,", "", 1, "L");
        $pdf->Cell(20, 4, $pdata['ffatname'],"", 1, "L");  
        $pdf->ln(5);
        $pdf->Cell(20, 4, "Dear Parent,","", 1, "L");  
        $pdf->Cell(20, 4, "The progress report of your ward Miss/Mr ".$pdata['fname']."-".$pdata['fregno']." studying in ".$pdata['fexamname'],"", 1, "L"); 
        $pdf->Cell(20, 4, "is as shown below:","", 1, "L");  
        $pdf->ln(5);
        $table2 = '<style>
        td {
            border: 0.5px solid black;
        }
        .lable {
            
        }
     </style>
    <table>
    <tr>
            <center><td width="30" style="font-weight: bold; text-align: center;" class="lable">Sl. No.</td></center>
            <center><td width="190" style="font-weight: bold; text-align: center;" class="lable">Subjects</td></center>
            <center><td width="200" style="font-weight: bold; text-align: center;" class="lable">Marks</td></center>
            <center><td width="40" style="font-weight: bold; text-align: center;" class="lable">Classes Held</td></center>
            <center><td width="40" style="font-weight: bold; text-align: center;" class="lable">Classes Attend</td></center>            
    </tr>';
    

        $slno = 1;
        for ($i=0; $i < count($data); $i++) { 
            $a = explode("*",$data[$i]{'fssubname'});
            $table2 .= '<tr>
            <td width="30" style="text-align: center;" class="lable">'.$slno.'</td>
            <td width="190" style="text-align: center;" class="lable">'.$data[$i]['fsubname'].'</td>
            <td width="200">'; 
            
            for ($j=0; $j < count($a); $j++) {
                $b = explode("|",$a[$j]);
                if($b[1] == "-"){
                    $marks = 0;
                }else{
                    $marks = $b[1];
                }
                $table2.= '<span>'.$b[0]."<br>".$marks.'</span>'; 
            }

            $table2 .= '</td>';
            $table2 .= '<td width="40" style="text-align: center;" class="lable">'.$data[$i]['conducted'].'</td>';
            $table2 .= '<td width="40" style="text-align: center;" class="lable">'.$data[$i]['attended'].'</td>';
            $table2 .= '</tr>'; 
            $slno++;
        }
    $table2 .= '</table>';

// var_dump($table2);

    $pdf->SetX(11);
	$pdf->writeHTML($table2, true, true, true, true, '');


    $pdf->Cell(10, 4, "Please Note:","", 1, "L");  

    $str = "I)   The above attendance is as on : 13/Aug/2022
II)  As per the university norms students are expected to maintain atleast 85% attendance in each subject.
III) '*' indicates poor marks, 'AB' absent for the tests, #' attendance less than 85%,'!' attendance less than 75%.
IV)  Please instruct your ward to improve her/his performance, You can track the performance of your ward by 
visiting our website nmamit.nitte.edu.in Goto LIFE@NMAMIT then Parent login under Student info.
Username as mobile number given by you during admission time, and Password as USN of the ward.
V)  For any further queries, please contact the coordinator.



SIGNATURE OF COORDINATOR                                                SIGNATURE OF PRINCIPAL";
            
                $pdf->SetFont('Times','',10);
                $pdf->MultiCell(170,4,$str,'C');


    }

    public function SendOutput()
    {
        // ob_end_clean();
        $this->pdf->Output("IA_Marks.pdf", "I");
    }
}

function iaMarksReportPDF($aobj_context)
{
    
    $regno = $aobj_context->mobj_data["regno"];
     $college = $_SESSION['collcode'];

     $qry = "select FDEGREE from student 
     where FREGNO = '{$regno}'";
 
     $res=$aobj_context->mobj_db->GetRow($qry);
 
     $query ="select a.fregno,a.fsubcode,a.fsubname,b.fssubname,a.conducted,
     a.attended 
     from (select a.fregno, a.fsubcode, s.fsubname, sum(a.fnoclass) as conducted, 
 sum(if(a.fpresent = 'A','0',a.fnoclass)) as attended
 from attend_det a 
 inner join subject s on a.fexamno = s.fexamno and a.fdegree = s.fdegree 
 and a.fsubcode = s.fcsubcode
 where a.fregno='{$regno}'
 group by a.fsubcode) a
 inner join 
 (select m.fregno, ifnull(m.fsubcode,'') as fsubcode,ifnull(s.fsubname,'') as fsubname, 			    		GROUP_CONCAT(s.fssubname,'|',if(ifnull(m.fmarks,'-1.00') = '-1.00','-',m.fmarks) 
 ORDER BY s.fssubname ASC SEPARATOR '*') as fssubname from marks m 
 inner join subject s on s.fcsubcode = m.fsubcode
 where m.fregno = '{$regno}' and s.fdegree = '{$res['FDEGREE']}' and fintass = 'T' group by s.fsubcode) b 
 on a.fregno = b.fregno 
 and left(a.fsubcode,4) = left(b.fsubcode,4)";
 
           
         $lobj_get_data = $aobj_context->mobj_db->GetAll($query);

        //  var_dump($lobj_get_data);
        //  die();


         $qry = "select ifnull(s.FREGNO,'') as fregno,ifnull(s.FNAME,'') as fname,ifnull(s.FFATNAME,'') as ffatname,
         ifnull(s.FMOTNAME,'') as fmotname,
         ifnull(s.FCURRADD1,'') as fcurradd1,ifnull(s.FCURRADD2,'') as fcurradd2,ifnull(s.FCURRADD3,'') as fcurradd3,
         ifnull(s.FCURRADD4,'') as fcurradd4,ifnull(s.FPERMADD1,'') as fpermadd1,ifnull(s.FPERMADD2,'') as fpermadd2,
         ifnull(s.FPERMADD3,'') as fpermadd3,ifnull(s.FPERMADD4,'') as fpermadd4,ifnull(s.FDEGREE,'') as fdegree,
         ifnull(s.FEXAMNO,'') as fexamno,ifnull(s.FCOLLCODE,'') as fcollcode,
         ifnull(d.fdescpn,'') as fdescpn,ifnull(d.fexamname,'') as fexamname
         from student s
         inner join degree d on d.fdegree = s.fdegree and d.fexamno = s.fexamno
         where s.fregno = '{$regno}'";

         $pdata = $aobj_context->mobj_db->GetRow($qry);
  
    $class_obj = new ReprtObject();
    $class_obj->univcode = $univcode;
    $class_obj->DefaultConstructor($aobj_context);

    
    if (count($lobj_get_data) > 0) {
        $class_obj->Report($lobj_get_data,$pdata);
    }
    $class_obj->SendOutput();
    

        
}

?>