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


Current Path : /proc/thread-self/root/var/www/oasis/src/
Upload File :
Current File : //proc/thread-self/root/var/www/oasis/src/absentAndMalReportPdf.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->degexam = $aobj_context->mobj_data["degexam"];
		$this->yearmode = $aobj_context->mobj_data["yearmode"];
        $this->deggrp=$aobj_context->mobj_data["deggrp"];
        $this->fromdate=$aobj_context->mobj_data["fromdaterange"];
        $this->todate=$aobj_context->mobj_data["todaterange"];
		$yearmode = explode("*",$this->yearmode);
		$this->year = $yearmode[0];
		$this->examtye = $yearmode[1];


		
		$get_date= "select NOW()  as now_date,
		CONCAT('[',fcollcode,'] ', fcollname,', ',FTOWN) as college_name,
		dg.fexamdate as fresexamdate, d.fdescpn, d.fexamname from college c, degree d, degexam dg 
		where fcollcode = '{$this->collcode}' and d.fdegree = '{$this->degree}'
		and d.fdegree = dg.fdegree and d.fexamno = dg.fexamno 
		and d.fexamno = '{$this->degexam}'
		and dg.fyear = '{$this->year}'
		and dg.fexamtype = '{$this->examtye}'";

        // var_dump($get_date);
        // die();
        
		$obj=$aobj_context->mobj_db->GetRow($get_date);

		$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;
	   }
	  
	    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,10,10,35);
            }
            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','',8);
            $this->pdf->cell(0,4, $this->s_state,"0",0,"C");
            $this->pdf->SetFont('Times','',10);	
            $this->pdf->Cell(-20,4,"Page {$this->pdf->PageNo()}/{nb}",0,1,'C');
            $this->pdf->SetFont('Times','B',10);
            $this->pdf->cell(0,7,"College: ".$this->college_name,"0",1,"C");
            $this->pdf->cell(0,7,"RESULT SHEET - ".$this->fresexamdate ." EXAMINATION ","0",1,"C");
            $this->pdf->cell(0,7,$this->fexamname." - ".$this->fdescpn,"0",1,"C");

            
           
        }		

        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');
        }
	           
        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'];
        }    
        function formdata(){    
        //     $query="SELECT a.fregno,a.fdoe, a.flogdate, d.fdegree, s.fsubcode, s.fqpcode, s.fsubname 
        //     FROM subject s 
        //     INNER JOIN absent a ON  a.fqpcode=s.fqpcode 
        //     INNER JOIN degree d ON s.fdegree= d.fdegree 
        //     INNER JOIN deggrp deg ON d.fdeggrp=deg.fdeggrp
        //    WHERE deg.fdeggrp='{$this->deggrp}' AND deg.fyear='{$this->year}' 
        //    AND deg.fexamtype='{$this->examtye}'AND fabstype='qpa'  
        //    GROUP BY fregno"; 

        $query="SELECT a.fregno,a.fdoe, r.FDESCPN, d.fdegree, s.fsubcode, s.fqpcode, s.fsubname  
        FROM absent a 
        INNER JOIN subject s ON  a.fqpcode=s.fqpcode 
        inner join student st on a.fregno = st.fregno
        inner join degree d on st.fdegree = d.fdegree and s.fexamno = d.fexamno
        left join reason r on a.FSESSION = r.FREASONCD
        where a.fdoe BETWEEN '{$this->fromdate}' AND '{$this->todate}' AND
         d.fdeggrp = '{$this->deggrp}'
        and a.fyear = '{$this->year}' and a.fexamtype = '{$this->examtye}'
        group by a.fregno,s.fqpcode";

            var_dump($query);
            die();
 
        $result=$this->aobj_context->mobj_db->GetAll($query);

            // var_dump($result);
            // die();
 
            $this->pdf->AddPage();    
            $this->pdf->Ln(5);
           
            // $this->pdf->SetFont('Times','B',10);
          
            $this->pdf->SetFont('Times','B',10);
        
            $this->pdf->Cell(15,6,"Sl.","LRT",0,'C');
            $this->pdf->Cell(32,6,"USN","LRT",0,"C");
            $this->pdf->Cell(32,6,"BRANCH & ","LRT",0,"C");
            $this->pdf->Cell(30,6,"SUBJECT","LRT",0,"C");
            $this->pdf->Cell(85,6,"SUBJECT TITLE","LRT",1,"C");    
           
            $this->pdf->Cell(15,6,"NO. ","LRB",0,"C");
            $this->pdf->Cell(32,6,"","LRB",0,"C");
            $this->pdf->Cell(32,6,"SECTION","LRB",0,"C"); 
            $this->pdf->Cell(30,6,"CODE ","LRB",0,"C");
            $this->pdf->Cell(85,6," ","LRB",1,"C" );
          
           $this->pdf->SetFont('Times','',10);

        
           $i = 1;
            foreach($result as $results){
              if($i % 12==0){

                $this->pdf->AddPage(); 
                // $this->pdf->Ln(5);   
                $this->pdf->SetFont('Times','B',10);
            
                $this->pdf->Cell(15,6,"Sl.","LRT",0,'C');
            $this->pdf->Cell(32,6,"USN","LRT",0,"C");
            $this->pdf->Cell(32,6,"BRANCH & ","LRT",0,"C");              
            $this->pdf->Cell(30,6,"SUBJECT","LRT",0,"C");
            $this->pdf->Cell(85,6,"SUBJECT TITLE","LRT",1,"C"); 

            $this->pdf->Cell(15,6,"NO. ","LRB",0,"C");
            $this->pdf->Cell(32,6,"","LRB",0,"C");
            $this->pdf->Cell(32,6,"SECTION","LRB",0,"C"); 
            $this->pdf->Cell(30,6,"CODE ","LRB",0,"C");
            $this->pdf->Cell(85,6," ","LRB",1,"C" );
                
                
               
                $this->pdf->SetFont('Times','',10);
              }
              
             
              $this->pdf->Cell(0.1,6,$results['fdoe'],"1",0,"L");
             $this->pdf->Cell(193.9,6,$results['FDESCPN'],"1",1,"R");
                $this->pdf->Cell(15,6,$i,"1",0,"L");
                $this->pdf->Cell(32,6,$results['fregno'],"1",0,"L"); 
                $this->pdf->Cell(32,6,$results['fdegree'],"1",0,"L"); 
              
                $this->pdf->Cell(30,6,$results['fsubcode'],"1",0,"L");
                $this->pdf->Cell(85,6,$results['fsubname'],"1",1,"L");
              
               
               
               
                $i++;
                $this->pdf->Ln();

            }
    	}

        function SendOutput(){
            $this->pdf->Output("semesterWiseResultReport.pdf","I");
        } 
     
    }
    function absentAndMalReport($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();
        $class_obj->formdata();
        $class_obj->SendOutput();
    }
?>