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


Current Path : /var/www/oasis/Report_details/
Upload File :
Current File : /var/www/oasis/Report_details/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->reporttype = $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"];
        
        $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");
        // var_dump($this->formatdateto);
        // die();
        
        $yerqur = "select fyear,fexamtype from deggrp where fdeggrp = '{$this->deggrp}'";
        $yearmode=$aobj_context->mobj_db->GetRow($yerqur);

		// $yearmode = explode("*",$this->yearmode);
		$this->year = $yearmode['fyear'];
		$this->examtye = $yearmode['fexamtype'];


		
		// $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}'";

        $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}'";
//  AND dg.fexamtype = '{$this->examtye}'
		$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;

      
	   }
	  
	    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");
               
            }
            // var_dump($this->reporttype);die();
            if($this->reporttype == 'QpA'){
                $reportname = "Absent Report";
            }else{
                $reportname = "Malpractice Report";
            }
            $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,$reportname,"0",1,"C");
            $this->pdf->cell(0,7,"From (".$this->formatdatefrom.") To (".$this->formatdateto.") - " .$this->fdescpn,"0",1,"C");

            // . " - ".$this->fresexamdate 
           
        }		

        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'];

           
        }    
        function formdata(){    
        // $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 s.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";

        if($_SESSION['FUNIVCODE'] == '052'){
            $cond = "";
        }else{
            $cond = "AND a.fyear = '{$this->year}' 
                    AND a.fexamtype = '{$this->examtye}'";
        }

             $query="SELECT a.fregno,a.fdoe, r.FDESCPN, d.fdegree, s.fsubcode,
                    s.fqpcode, s.fsubname, st.fsection
                    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 d.fexamno = 'A'
                    LEFT JOIN reason r ON s.FSESSION = r.FREASONCD 
                    WHERE a.fdoe BETWEEN '{$this->fromdate}' AND '{$this->todate}' 
                    AND d.fdeggrp = '{$this->deggrp}' {$cond}  and a.FABSTYPE = '{$this->reporttype}'
                    GROUP BY a.fregno,s.fqpcode
                    order by fdoe desc,fregno,fdegree";
       
    //    var_dump($query);die();
        $result=$this->aobj_context->mobj_db->GetAll($query);

       $newqpcode=$result[0]['fqpcode'];
 
            $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(30,6,"USN","LRT",0,"C");
            $this->pdf->Cell(32,6,"BRANCH & ","LRT",0,"C");
            $this->pdf->Cell(30,6,"QP","LRT",0,"C");
            $this->pdf->Cell(87,6,"SUBJECT TITLE","LRT",1,"C");    
           
            $this->pdf->Cell(15,6,"NO. ","LRB",0,"C");
            $this->pdf->Cell(30,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(87,6," ","LRB",1,"C" );
          
           $this->pdf->SetFont('Times','',10);

        
           $i = 1;
   
    
            foreach($result as $results){
              if($i % 10==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(30,6,"USN","LRT",0,"C");
            $this->pdf->Cell(32,6,"BRANCH & ","LRT",0,"C");              
            $this->pdf->Cell(30,6,"QP","LRT",0,"C");
            $this->pdf->Cell(87,6,"SUBJECT TITLE","LRT",1,"C"); 

            $this->pdf->Cell(15,6,"NO. ","LRB",0,"C");
            $this->pdf->Cell(30,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(87,6," ","LRB",1,"C" );
                
                
               
                $this->pdf->SetFont('Times','',10);
              }


              
              $split =str_split($results['fsubname'],35);
             
           
            $this->pdf= new FPDF();
		    $this->pdf=$this;
            $this->first_word = $split[0];
       
            
            $this->second_word=$split[1];
         
           $date=date_create($results['fdoe']);
            $this->pdf= new FPDF();
		    $this->pdf=$this;
             $this->formatdate= date_format($date,"d/m/Y");

      if($this->second_word==""){
        $cond='1'; 
      }else{
        $cond='TRL';
      }
            if($i==1){
                $this->pdf->Cell(0.1,6,$this->formatdate,"1",0,"L");
                $this->pdf->Cell(193.9,6,$results['FDESCPN'],"1",1,"R");
            }

            if($newqpcode != $results['fqpcode']){
                $newqpcode = $results['fqpcode'];        
                $this->pdf->Ln();
                $i=1;
                $this->pdf->Cell(0.1,6,$this->formatdate,"1",0,"L");
                $this->pdf->Cell(193.9,6,$results['FDESCPN'],"1",1,"R");
                
            }
           $this->pdf->Cell(15,6,$i,$cond,0,"L");
           $this->pdf->Cell(30,6,$results['fregno'],$cond,0,"L"); 
           $this->pdf->Cell(32,6,$results['fdegree'] ." - ". $results['fsection'],$cond,0,"L"); 
         
           $this->pdf->Cell(30,6,$results['fqpcode'],$cond,0,"L");
           $this->pdf->Cell(87,6,$this->first_word,$cond,1,"L");
           
          if($this->second_word!=""){
            
           $this->pdf->Cell(15,6,"","BLR",0,"L");
           $this->pdf->Cell(30,6,"","BLR",0,"L");
           $this->pdf->Cell(32,6,"","BLR",0,"L"); 
           $this->pdf->Cell(30,6,"","BLR",0,"L");
        
           $this->pdf->Cell(87,6,$this->second_word,"BLR",1,"L" );
         
        }    
        // $this->pdf->Ln();
            $i++; 
              
        }
            $this->pdf->SetFont('Times','B',10);
            $this->pdf->Ln(30);
            $this->Cell(180,2,'Controller of Examination','0',0,'R');
    	}

        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();
    }
?>