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


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

<?php

$main_src=substr($_SERVER['SCRIPT_FILENAME'],0,strlen($_SERVER['SCRIPT_FILENAME'])-7);
$pdf_writer_class =$main_src."/tarka_pdf_latest/fpdf.php";
require_once($pdf_writer_class);
ini_set('max_execution_time', 0); 
class GenerateFeeSummaryReport  extends FPDF
 {
    function DefaultConstructor($aobj_context)
    {
    include_once($aobj_context->main_src."/src/format.php");
    $this->aobj_context=$aobj_context;
    $this->pdf=  new FPDF();
    $this->pdf=$this;
    session_start();
    $this->collcode = $_SESSION['collcode'];
    $this->ip=$_SERVER["REMOTE_ADDR"];
    
    $this->degree = $aobj_context->mobj_data["degree"]; 
    $this->sem = $aobj_context->mobj_data["sem"];
    $this->section=$aobj_context->mobj_data["section"];
    $this->fromdate=$aobj_context->mobj_data["fromdate"];
    $this->todate=$aobj_context->mobj_data["todate"];
    
    $date=date_create($this->fromdate);
    $this->pdf= new FPDF();
    $this->pdf=$this;
     $this->formatdatefrom= date_format($date,"d/m/Y");

     $datetwo=date_create($this->todate);
    $this->pdf= new FPDF();
    $this->pdf=$this;
     $this->formatdateto= date_format($datetwo,"d/m/Y");
 

    $get_date= "SELECT NOW() AS now_date, CONCAT('[',fcollcode,'] ', fcollname,', ',FTOWN) AS college_name,
    dg.fexamdate AS fresexamdate, d.fdescpn, deg.fexamname FROM college c, deggrp d,degree deg, degexam dg WHERE
    deg.fdeggrp=d.fdeggrp  AND deg.fdegree = dg.fdegree AND deg.fexamno = dg.fexamno AND 
     dg.fyear = '{$this->year}'  AND deg.fdeggrp = '{$this->deggrp}'";

    $obj=$aobj_context->mobj_db->GetRow($get_date);
    // var_dump($get_date);die();
    $this->current_date = $obj['now_date'];
    $this->college_name = $obj['college_name'];
    $this->fresexamdate = $obj['fresexamdate'];
    $this->fdescpn      = $obj['fdescpn'];
    $this->fexamname    = $obj['fexamname'];
    $this->first    = true;

    $query="SELECT DISTINCT fexamname, fdescpn FROM degree WHERE fexamno='{$this->sem}' AND fdegree='{$this->degree}'";
    $sem=$aobj_context->mobj_db->GetRow($query);
    $this->fullsemname = $sem['fexamname'];
    $this->descript = $sem['fdescpn'];

  
   }
  
    function Header(){
        
        $img_path=$this->aobj_context->main_src."/".$this->aobj_context->mobj_data["db"]."/".$this->pdf_logo_path;
     
        if(!empty($this->pdf_logo_path) && file_exists($img_path)) 
        {			
            $this->pdf->Image($img_path,15,10,25);
        }
        if($this->funivcode=="052"){
            $this->pdf->SetFont('Times','B',9);
            $this->pdf->cell(0,7,""."JSS MAHAVIDYAPEETHA","0",1,"C");
        }
        $this->pdf->SetFont('Times','B',14);
        $this->pdf->cell(0,7,"".$this->FUNIVNAME,"0",1,"C");
        // $this->pdf->SetFont('Times','B',14);
        // $this->pdf->cell(0,7,"". $this->collname,"0",0,"C");
        $this->pdf->SetFont('Times','',10);
        $this->pdf->cell(0,4, $this->s_state ."-". $this->town,"0",0,"C");
        $this->pdf->SetFont('Times','',10);	
        $this->pdf->Cell(-20,4,"",0,1,'C');
        $this->pdf->SetFont('Times','B',12);
        $this->pdf->cell(0,7,"College: ".$this->collname,"0",1,"C");
        $this->pdf->SetFont('Times','B',10);
        $this->pdf->cell(0,7,"Degree: ".$this->degree."  -  " .$this->descript,"0",1,"C");
        $this->pdf->Ln(5);
        $this->pdf->SetFont('Times','B',11);
        $this->pdf->cell(0,10,"Section: ".$this->section,"0",0,"L");
        $this->pdf->cell(0,10,"From (".$this->formatdatefrom.") To (".$this->formatdateto.")" ,"0",1,"R");
        $this->pdf->SetFont('Times','B',10);
        $this->pdf->cell(0,2,"( Parents are requested to sign the acknowledgement and return it by post to: Proctor-".$this->FUNIVNAME.", ".$this->town .")","0",1,"L");
    }		

    function Footer(){
        $this->SetY(-15);
        $this->pdf->SetFont('Times','B',8);
        $new_y=$this->pdf->GetY();
        $this->pdf->Ln(2);
        $this->Cell(140,6,'Printed: IP Address : '.$this->ip." Date ".$this->current_date,'0',0,'L');
        $this->pdf->SetFont('Times','B',10);
        
    }
           
    function formcolldata()
    {
        $get_coll_name="  SELECT FUNIVNAME AS 'FUNIVNAME',funivcode,
        FUNIVADD1 AS 'state', pdf_logo_path FROM control";
        $lobj_get_coll_name=$this->aobj_context->mobj_db->GetRow($get_coll_name);
        $this->FUNIVNAME=$lobj_get_coll_name['FUNIVNAME'];
        $this->funivcode=$lobj_get_coll_name['funivcode'];
        $this->s_state=$lobj_get_coll_name['state'];
        $this->f_year=$lobj_get_coll_name['f_year'];
        $this->pdf_logo_path=$lobj_get_coll_name['pdf_logo_path'];

        $getcollname="SELECT fcollname, ftown FROM college WHERE fcollcode='{$this->collcode}'";
        $get_coll_name=$this->aobj_context->mobj_db->GetRow($getcollname);
        $this->collname=$get_coll_name['fcollname'];
        $this->town=$get_coll_name['ftown'];
    }    
    function formdata($aobj_context, $regno){  
    //     $query = "SELECT DISTINCT a.fregno,m.ftotal, a.fname, a.fsubname, GROUP_CONCAT(a.fsubshort,'*',a.cond,'*',a.fpresent ORDER BY a.fsubshort SEPARATOR '|') AS subdet FROM 
    //             (SELECT DISTINCT a.fregno,st.fname,a.fdegree,su.fsubshort,su.fsubname,a.fsubcode,SUM(a.fnoclass) AS cond, 
    // SUM(IF(a.fpresent = 'P',a.fnoclass,0)) 
    //             AS fpresent FROM attend_det a INNER JOIN student st ON a.fregno = st.fregno INNER JOIN degree d ON d.fdegree=st.fdegree 
    //             AND d.fexamno=st.FEXAMNO INNER JOIN subject su ON su.fdegree = a.fdegree AND su.fexamno = a.fexamno AND su.fcsubcode = a.fsubcode 
    //             WHERE a.fdegree = '{$this->degree}' AND DATE_FORMAT(a.fdate,'%Y-%m-%d') BETWEEN '{$this->fromdate}' AND '{$this->todate}' AND st.FSECTION='{$this->section}' AND a.fexamno = '{$this->sem}' 
    //             and a.fregno='{$regno}'
    //             GROUP BY a.fregno,a.fsubcode ORDER BY a.fregno) a 
    //             INNER JOIN marksint m ON  m.fdegree=a.fdegree AND m.fregno=a.fregno  GROUP BY a.fregno,a.fsubcode";
     $query="SELECT DISTINCT a.fregno,m.ftotal,a.fdegree,a.fsubcode, a.fname, a.fsubname, GROUP_CONCAT(DISTINCT a.fsubshort,'*',a.cond,'*',a.fpresent ORDER BY a.fsubshort 
                SEPARATOR '|')
                    AS subdet FROM (SELECT DISTINCT a.fregno,st.fname,a.fdegree,su.fsubshort,su.fsubname,a.fsubcode,SUM(a.fnoclass) AS cond, 
                    SUM(IF(a.fpresent = 'P',a.fnoclass,0)) 
                    AS fpresent FROM attend_det a 
                    INNER JOIN student st ON a.fregno = st.fregno 
                    INNER JOIN degree d ON d.fdegree=st.fdegree AND d.fexamno=st.FEXAMNO 
                    INNER JOIN subject su ON su.fdegree = a.fdegree AND su.fexamno = a.fexamno AND su.fcsubcode = a.fsubcode 
                    WHERE a.fdegree = '{$this->degree}' AND DATE_FORMAT(a.fdate,'%Y-%m-%d') BETWEEN '{$this->fromdate}' AND '{$this->todate}' AND st.FSECTION='{$this->section}'
                    AND a.fexamno = '{$this->sem}' AND a.fregno='{$regno}' GROUP BY a.fregno,a.fsubcode ORDER BY a.fregno) a 
                        LEFT JOIN marksint m ON LEFT(m.fsubcode, 4) = LEFT(a.fsubcode, 4) AND m.fregno=a.fregno  GROUP BY a.fregno,a.fsubcode";

         $res = $aobj_context->mobj_db->GetAll($query);
         $i=0;
     
        $this->pdf->AddPage();    
        $this->pdf->Ln(3);
        $this->pdf->SetFont('Times','',12);
        $this->pdf->cell(0,6,"Name of the Student :  ".$res[$i]['fname']."","0",0,"L");
        $this->pdf->cell(0,6," Mobile No. :  ","0",1,"R");
       
        $this->pdf->Ln(1);
        $this->pdf->SetFont('Times','',12);
        $this->pdf->cell(0,6,"Semester :  ".$this->fullsemname,'0',0,"L");
        $this->pdf->cell(0,6,"Name & Address of the Parent :  ","0",1,"R");
        $this->pdf->SetFont('Times','',12);
        $this->pdf->SetFont('Times','',12);
        $this->pdf->cell(0,6,"USN :  ".$res[$i]['fregno'],"0",1,"L");
        
        $this->pdf->SetFont('Times','',12);
        $this->pdf->cell(0,6,"BRANCH :  ".$this->degree,"0",1,"L");
        $this->pdf->SetFont('Times','',12);
    
        $this->pdf->Ln(4);
        
        $this->pdf->SetFont('Times','B',10);
    
        $this->pdf->Cell(8,6,"Sl.","LRT",0,'C');
        $this->pdf->Cell(20,6,"Course.","LRT",0,"C");
        $this->pdf->Cell(100,6,"Course ","LRT",0,"C");
        $this->pdf->Cell(13,6,"Classes","LRT",0,"C");
        $this->pdf->Cell(15,6,"Classes ","LRT",0,"C"); 
        $this->pdf->Cell(20,6,"Int. Marks","LRT",0,"C") ; 
        $this->pdf->Cell(20,6,"Remarks","LRT",1,"C") ; 

        $this->pdf->Cell(8,6,"NO. ","LRB",0,"C");
        $this->pdf->Cell(20,6,"Code","LRB",0,"C");
        $this->pdf->Cell(100,6,"Name","LRB",0,"C"); 
        $this->pdf->Cell(13,6,"Held","LRB",0,"C");
        $this->pdf->Cell(15,6,"Attended","LRB",0,"C");
        $this->pdf->Cell(20,6,"(Max. 50)","LRB",0,"C");
        $this->pdf->Cell(20,6," ","LRB",1,"C" );
        
       $this->pdf->SetFont('Times','',10);
   
                 foreach ($res as $value) {
                   $split=explode("*",$value['subdet']);
                   $code = $split[0];
                   $held = $split[1];
                   $att = $split[2];
                   $marks=$value['ftotal'];
                   if($marks == null){
                    $conn="";
                   }elseif($marks == -2){
                    $conn="Ab";
                   }else{
                    $conn=$marks;
                   }
                    $this->pdf->Cell(8,6,$i+1,"LRB",0,"C");
                    $this->pdf->Cell(20,6,$code,"LRB",0,"C");
                    $this->pdf->Cell(100,6,$value['fsubname'],"LRB",0,"L"); 
                    $this->pdf->Cell(13,6,$held,"LRB",0,"C");
                    $this->pdf->Cell(15,6,$att,"LRB",0,"C");
                    $this->pdf->Cell(20,6,$conn,"LRB",0,"C");
                    $this->pdf->Cell(20,6," ","LRB",1,"C" );
                    $i++;
                 } 
                 $this->pdf->Ln(4);
                 $this->pdf->SetFont('Times','B',12);   
                 $this->pdf->cell(0,5,"Summary: ","0",1,"L"); 
                 $this->pdf->Ln(2);
                 $this->pdf->SetFont('Times','',11);
                $this->pdf->Cell(166,10,"1. Your ward is regular in attending the CLASSES","LRT",0,'L');
                $this->pdf->Cell(29,5,"","LRT",1,"C");
                $this->pdf->Cell(166,5,"","LRB",0,'L');
                $this->pdf->Cell(29,5,"","LRB",1,"C");
                 $this->pdf->SetFont('Times','',11);

                 $this->pdf->SetFont('Times','',11);
                 $this->pdf->Cell(166,5,"2. You are requested to advice your ward to attend the classes REGULARLY.In this connection","LRT",0,'L');
                 $this->pdf->Cell(29,5,"","LRT",1,"C");

                 $this->pdf->Cell(166,5,"     kindly make it convenient to meet the Proctor","LRB",0,"L");
                 $this->pdf->Cell(29,5,"","LRB",1,"C");
                 $this->pdf->SetFont('Times','',11);

                 $this->pdf->SetFont('Times','',11);
                 $this->pdf->Cell(166,5,"3. Your ward was advised by the academic counselor to attend the classes regularly in the","LRT",0,'L');
                 $this->pdf->Cell(29,5,"","LRT",1,"C");

                 $this->pdf->Cell(166,5,"    subject in which  he/she has shortage of attendance","LRB",0,"L");
                 $this->pdf->Cell(29,5,"","LRB",1,"C");
                 $this->pdf->SetFont('Times','',11);
                 
                 $this->pdf->SetFont('Times','',11);
                
                 $this->pdf->Cell(166,10,"4. Performance of Internals        ","LRT",0,'L');
                 $this->pdf->Cell(29,5,"","LRT",1,"C");

                 $this->pdf->Cell(166,5,"","LRB",0,'L');
                 $this->pdf->Cell(29,5,"","LRB",1,"C");
                  $this->pdf->SetFont('Times','',11);
                
                 $this->pdf->Ln(8);
                 $this->pdf->SetFont('Times','B',12);   
                 $this->pdf->cell(0,5,"Proctor- Signature                                                                              
                     HOD","0",1,"L");
                $this->pdf->cell(0,1,"____________________________________________________________________________________________","0",1,"L");
                $this->pdf->Ln(4);
                $this->pdf->SetFont('Times','U',12);
                $this->pdf->cell(0,8,"ACKNOWLEDGEMENT ","0",1,"C");  
                $this->pdf->Ln(2);
              
                $this->pdf->Ln(2);
                $this->pdf->SetFont('Times','',12);
                $this->pdf->cell(0,5,"I hereby acknowledge the receipt of the progress report for the period from " .$this->formatdatefrom.  " to " .$this->formatdateto. " of  ","0",1,"L"); 
                $this->pdf->cell(0,5,"my ward  ".$value['fname']."  bearing USN -" .$value['fregno']. ". I have noted the remarks made","0",1,"L"); 
                $this->pdf->cell(0,5,"by your Institutions and advice my ward appropriately.","0",1,"L"); 
                $this->pdf->Ln(5);
                $this->pdf->SetFont('Times','',12);
                $this->pdf->cell(0,5,"Date:","0",0,"L"); 
                $this->pdf->cell(0,5,"Signature & Name of the parent             ","0",0,"R"); 
                $this->pdf->Ln(5);
                $this->pdf->SetFont('Times','',12);
                $this->pdf->cell(0,5,"Place: ","0",1,"L"); 
    }
  
    function SendOutput(){
        $this->pdf->Output("ProgDegreeWise_Report.pdf","I");
    } 
 
}
function progDegwiseReport($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $class_obj=new GenerateFeeSummaryReport();
    $class_obj->AliasNbPages();
    $class_obj->DefaultConstructor($aobj_context);
    $class_obj->Header();
    $class_obj->formcolldata();

    $degree = $aobj_context->mobj_data["degree"]; 
    $sem = $aobj_context->mobj_data["sem"];
    $section=$aobj_context->mobj_data["section"];
    $fromdate=$aobj_context->mobj_data["fromdate"];
    $todate=$aobj_context->mobj_data["todate"];

    $query = "SELECT DISTINCT a.fregno FROM attend_det a INNER JOIN student st ON a.fregno = st.fregno  WHERE a.fdegree ='{$degree}' AND
              st.FSECTION='{$section}' AND a.fexamno = '{$sem}'";
    $res = $aobj_context->mobj_db->GetAll($query);

    foreach($res as $val){
        $class_obj->formdata($aobj_context, $val['fregno']);    
    }
    $class_obj->SendOutput();
}
?>