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


Current Path : /var/www/html/univadmin/Reports/
Upload File :
Current File : /var/www/html/univadmin/Reports/getIaMarksReport.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)
    {
        $this->fnotifid = $this->aobj_context->mobj_data["fnotifid"];

        $query = "select fnotifname, date_format(fnotifdate,'%d/%m/%Y') as fnotifdate, 
        fdeggrp, fdegree, fprogcode,fnotifno,
        fexamno,if(ifnull(fstatus,'F') = 'F','Draft','')as fstatus
        from notifsum where fnotifid ='{$this->fnotifid}'";

        $this->result = $this->aobj_context->pobj_db->GetRow($query);

        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("Date Notification 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)) {
            if($this->aobj_context->FUNIVCODE == '030')
                $this->Image($img_path, 5,5,50,20);
            else
                $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->Cell(0, 1, "", 'T', 1, 'L');
        $this->SetFont('Times', 'B', 9);
        $this->Cell(0, 2, "Ref: ".$this->result['fnotifno'], 0, 0, 'L');
        $this->Cell(0, 2, 'Date : ' .$this->result['fnotifdate'], 0, 1, 'R');
        $this->Cell(0, 6, $this->result['fnotifname'], 0, 1, 'C');
        $this->Ln(1);
        $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->fnotifid = $aobj_context->mobj_data["fnotifid"];
        $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 d.fdegree,d.fexamno,d.fdeggrp,
        d.fyear,d.fexamtype
        from notifdet d where fnotifid = '{$this->fnotifid}'";
        $res = $this->aobj_context->pobj_db->GetAll($query);
        // var_dump($query);die();
        foreach($res as $val)
        {
            $fdegree = $val['fdegree'];
            $fexamno = $val['fexamno'];
            $fdeggrp = $val['fdeggrp'];
            $fyear = $val['fyear'];
            $fexamtype = $val['fexamtype'];

            // $query = "select fdeggrp,fyear,fexamtype from deggrp where fdeggrp = '{$fdeggrp}'";
            // $res1 = $this->aobj_context->pobj_db->GetRow($query);
            // $fyear = $res1['fyear'];
            // $fexamtype = $res1['fexamtype'];

            $query = "select h.fheadname,h.fid, s.fnotifname, 
            date_format(s.fnotifdate,'%d/%m/%Y') as fnotifdate, 
            ifnull(d.fremarks,'') as remarks,d.fdegree,
            date_format(d.fstartdate, '%d/%m/%Y') as frmdate,  
            if(ifnull(d.fenddate,'') = '','', date_format(d.fenddate, '%d/%m/%Y')) as todate,
            dg.fdescpn,dg.fexamname,s.fnotifno,
            ifnull(dg.fsignpath,'coe1.jpeg') as fsignpath
            from notifdet d inner join notifsum s on s.fnotifid = d.fnotifid 
            inner join notifhead h on h.fid = d.fheadid 
            inner join degree dg on dg.fdegree = d.fdegree and dg.fexamno = d.fexamno
            where s.fnotifid='{$this->fnotifid}'
            and d.fdegree = '{$fdegree}' and d.fexamno = '{$fexamno}'
            and date_format(d.fstartdate, '%d/%m/%Y') <> '00/00/0000'";
            
            $result1 = $this->aobj_context->pobj_db->GetAll($query);

            $pdf = $this->pdf;
            $pdf->AddPage("P");
            $pdf->SetFont('Times', 'B', 11);
            $pdf->SetY(45);
            $fnotifno = $result1[0]['fnotifno'];
            $fdescpn = $result1[0]['fdescpn'];
            $fexamname = $result1[0]['fexamname'];
            $fnotifname = $result1[0]['fnotifname'];
            $fnotifdate = $result1[0]['fnotifdate'];
            $this->aobj_context->fsignpath = $result1[0]['fsignpath'];
            $pdf->Ln(5);
            $pdf->SetFont('Times', 'B', 10);
            $pdf->Cell(0, 6, "Programme: ".$fdegree.' - '.$fdescpn ,0, 1, 'L');
            $pdf->Cell(0, 6, "Sem / Year: ".$fexamname ,0, 1, 'L');
            
            $pdf->Ln(5);

            $table1 = '<style>
            td,th {
                border: 0.5px solid black;
            }
            .lable {
                font-weight: bold;
            }
            </style>
            <table cellpadding="3" cellspacing="0">
            <thead>
            <tr nobr="true">
                <th width="35" style="text-align: center;"><b>Sl. No.</b></th>
                <th width="350" style="text-align: center;"><b>Description</b></th>
                <th width="150" style="text-align: center;"><b>Dates</b></th> 
            </tr>
            </thead>
            <tbody>
            ';
            $i = 1;
            $pdf->SetFont('Times', '', 10);
            foreach($result1 as $val)
            {
                $str1 = "";
                $str2 = "";
                
                if($val['remarks'] != '')
                {
                    $str1 = "<br>".$val['remarks'];
                }

                if($val['todate'] != '')
                {
                    $str2 = " - ".$val['todate'];
                }

                $fheadname = $val['fheadname'].$str1;
                $dates = $val['frmdate'].$str2;
                $table1 .= '<tr nobr="true">
                <td width="35" style="text-align: center;" >'.$i.'</td>
                <td width="350">'.$fheadname.'</td>
                <td width="150" style="text-align: center;" >'.$dates.'</td>
                </tr>';
                $i++;
            }
            $table1 .= '</tbody></table>';

            $pdf->writeHTML($table1, false, true, false, false, 'L');
            $grp = "t.fqpcode,m.fdate";
            if($this->aobj_context->FUNIVCODE == '030'){
                $pdf->Ln(5);
                $pdf->SetFont('Times', 'B', 10);
                $pdf->Cell(0, 6, "PROCEDURE FOR FILLING ONLINE APPLICATIONS",0, 1, 'C');
                $pdf->SetFont('Times', '', 10); 
                $pdf->Ln(2);
                $pdf->Cell(0, 6, "1.   The student needs to login to the University website (https://studentportal.universitysolutions.in) and fill in the ",0, 1, 'L');
                $pdf->Cell(0, 6, "    online Examination application form.",0, 1, 'L');
                $pdf->Cell(0, 6, "2.	The student should complete the examination application forms on or before the above mentioned dates.",0, 1, 'L');
                $pdf->Cell(0, 6, "3.	The Respective School Directors are requested to instruct the officials to make necessary arrangements to inform the",0, 1, 'L');
                $pdf->Cell(0, 6, "    candidates for filling the Examination Application Form.",0, 1, 'L');
                $pdf->Cell(0, 6, "4.	The Examination application forms are online and the fee payment must be remitted through the payment gateway only.",0, 1, 'L');
                $pdf->Cell(0, 6, "5.	Under any circumstances examination fee once paid cannot be refunded or adjusted. ",0, 1, 'L');
                $pdf->Cell(0, 6, "6.	The student registration and examination application form user manual is furnished below.",0, 1, 'L');
                $pdf->Cell(0, 6, "7.	Filling up of exam application does not automatically qualify the student for receipt of Hall ticket.",0, 1, 'L');
                $pdf->Cell(0, 6, "8.	Hall ticket is generated only if the student full fills minimum required attendance and other requirements of ",0, 1, 'L');
                $pdf->Cell(0, 6, "    University as per regulations.",0, 1, 'L');    
            }
            if($this->aobj_context->FUNIVCODE == '051')
                $grp = "s.fsubshort,m.fdate,s.fsubname";
                
            $query = "select t.fqpcode,
            concat(date_format(m.fdate,'%d/%m/%Y'),' ',r.FDESCPN) as dates,
            r.FDESCPN,if(s.fssubname = 'MCQ',s.fsubname,concat(s.fsubname,' - ',s.fssubname)) as fsubname,s.fsubshort 
            from timetable t inner join masdate m on t.fdatecodet = m.fdatecode
            and t.fdeggrp = m.fdeggrp and t.fyear = m.fyear and t.fexamtype = m.fexamtype
            inner join reason r on t.fsessiont = r.FREASONCD
            inner join subject s on t.fqpcode = s.fqpcode and s.fdegree = '{$fdegree}'
            and s.fexamno = '{$fexamno}' and ifnull(s.fqpcode,'') <> ''
            and ifnull(s.fparentsub,'') <> 'T'
            where t.fdeggrp = '{$fdeggrp}'
            and t.fyear = '{$fyear}'
            and t.fexamtype = '{$fexamtype}' 
            group by {$grp}
            order by m.fdate";
                // var_dump($query);die();
            $result2 = $this->aobj_context->pobj_db->GetAll($query);
            if($result2)
            {

                $pdf->Ln(2);
                $pdf->SetFont('Times', 'B', 10);
                $pdf->Cell(0, 6, "Theory Time Table",0, 1, 'C');
                // $pdf->Cell(30, 6, "QP Code",1, 0, 'C');
                $pdf->Cell(30, 6, "Course Code",1, 0, 'C');
                $pdf->Cell(106, 6, "Course Name",1, 0, 'C');
                $pdf->Cell(60, 6, "Date",1, 1, 'C');
                
               
                $pdf->SetFont('Times', '', 10);
                foreach($result2 as $val)
                {
                    
                    $nb1 = 0;
                    $nb1=max($nb1,$pdf->getNumLines($val['fsubname'],90));
                    $yH1 = 6*$nb1;
                    $x = $pdf->GetX();
                    $y = $pdf->GetY();
                    // $pdf->Cell(30, $yH1, $val['fqpcode'],1, 0, 'C');
                    $pdf->Cell(30, $yH1, $val['fsubshort'],1, 0, 'C');
                    if($this->aobj_context->FUNIVCODE == '030')
                        $pdf->MultiCell(106, $yH1,$val['fsubname']." - ".$val['fqpcode'],1, "L");
                    else
                        $pdf->MultiCell(106, $yH1,$val['fsubname'],1, "L");
                    $pdf->setXY($x+136,$y);
                    $pdf->Cell(60, $yH1, $val['dates'],1, 1, 'C');
                    $y1 = $pdf->getY();

                    if($y1 > 250)
                    {    
                        $pdf->AddPage("P");
                        $pdf->SetY(45);
                        $pdf->Ln(5);
                        $pdf->SetFont('Times', 'B', 10);
                        $pdf->Cell(0, 6, "Programme: ".$fdegree.' - '.$fdescpn ,0, 1, 'L');
                        $pdf->Cell(0, 6, "Sem / Year: ".$fexamname ,0, 1, 'L');
                        $pdf->Ln(5);

                        $pdf->SetFont('Times', 'B', 10);
                        // $pdf->Cell(30, 6, "QP Code",1, 0, 'C');
                        $pdf->Cell(30, 6, "Course Code",1, 0, 'C');
                        $pdf->Cell(76, 6, "Course Name",1, 0, 'C');
                        $pdf->Cell(60, 6, "Date",1, 1, 'C');
                        $pdf->SetFont('Times', '', 10);
                    }

                }   
            }
            $pdf->Ln(20);
                
            if($this->aobj_context->FUNIVCODE == '051')
                $dbname = "dypatil";
            if($this->aobj_context->FUNIVCODE == '030'){
                $dbname = "reva";
                $sign = '/var/www/html/'.$dbname.'/img/'.$this->aobj_context->fsignpath;
            }
            else
                $sign = '/var/www/oasis/'.$dbname.'/img/'.$this->aobj_context->fsignpath;
                $pdf->SetFont('helvetica', 'I', 8);
            if($this->CurOrientation == 'P')
            {
                if(file_exists($sign)) 
                    $pdf->Image($sign,155,265,40);

                $pdf->SetFont('Times', 'B', 11);    
                $pdf->Cell(0,4,"Controller of Examinations","",1,"R");
            }
            else {
                
                if(file_exists($sign)) 
                    $pdf->Image($sign, $pdf->GetX()+150, $pdf->GetY()-16, 33.78);

                $pdf->SetFont('Times', 'B', 11);    
                $pdf->Cell(0,6,"Controller of Examinations","",1,"R");
            }
            
        }
    
    }

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

function getIaMarksReport($aobj_context)
{
    $univcode = $aobj_context->mobj_data["univcode"];  
    $fnotifid = $aobj_context->mobj_data["fnotifid"];
    
    $query = "select ifnull(fnotifno,'') as fnotifno 
    from notifsum where fnotifid = '{$fnotifid}'";
    $res = $aobj_context->pobj_db->GetRow($query);
    
    if($res['fnotifno'] == '')
    {
        $query = "select ifnull(fnotifno,'') as fnotifno,fnotifnum 
        from control";
        $res1 = $aobj_context->pobj_db->GetRow($query);
        
        $code = $res1['fnotifnum'].str_pad($res1['fnotifno'],4,"0",STR_PAD_LEFT);

        $upd = "update notifsum set fnotifno = '{$code}'
        where fnotifid = '{$fnotifid}'";
        $res1 = $aobj_context->pobj_db->Execute($upd);

        $upd1 = "update control set fnotifno = fnotifno+1";
        $res2 = $aobj_context->pobj_db->Execute($upd1);

    }
    
    $class_obj = new ReprtObject();

    $class_obj->DefaultConstructor($aobj_context);

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

}