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


Current Path : /var/www/html/ibm/
Upload File :
Current File : /var/www/html/ibm/dudCovid19Cert.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;
// ini_set('memory_limit','900M');
// ini_set('max_execution_time',0);

class MYPDF extends TCPDF
{
    public function Header()
    {
        // get the current page break margin
        $bMargin = $this->getBreakMargin();
        // get current auto-page-break mode
        $auto_page_break = $this->AutoPageBreak;
        // disable auto-page-break
        $this->SetAutoPageBreak(false, 0);
    
        // set bacground image
        $this->SetFillColor(248, 248, 255);
        

        $this->SetFont('Times', 'B', 13);
        $this->SetY(5);
        $this->Cell(0, 4, $this->aobj_context->FUNIVNAME, 0, 1, 'C');
        //state
        $this->SetFont('Times', '', 11);
        $this->Cell(0, 4, $this->aobj_context->s_state, 0, 1, 'C');

        $this->SetFont('Times', 'BU', 12);
        $this->Ln(1);

        $cur_year = date("Y");
       
        // restore auto-page-break status
        $this->SetAutoPageBreak($auto_page_break, $bMargin);
        // set the starting point for the page content
    }

    public function Footer()
    {
        
    }
}

class ReprtObject
{

    public function DefaultConstructor($aobj_context)
    {
        $this->aobj_context = $aobj_context;
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);

        $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"];

       
        $this->pdf = new MYPDF('L');
        $this->pdf->aobj_context = $aobj_context;
    }

    public function Report($data)
    {
        $pdf = $this->pdf;

        $pdf->SetMargins(20, 36);
        $pdf->startPageGroup();
        $pdf->AddPage("L");

        $pdf->SetFont('Times', '', 10);

        $oldCode = "";
        $newCode = "";
        $sl_no = 1;
        $first = true;
        $j = 0;
        // var_dump($exattendancelist);
        //$style6 = array('width' => 10, 'cap' => 'butt', 'join' => 'miter', 'dash' => '1', 'color' => array(0, 0, 0));
        $pdf->Rect(8, 5,285, 195, 'D');
        
        $pdf->Image('img/023_logo_covid19.png', 20, 7, 250, 50);
        $pdf->Image('img/023_logo_covid19_1.png', 80, 55, 140, 35);
       
        $str = 'This is to certify that '.$data['fname'].' of '.$data['fcollege'].' Has participated in the online <span style = "color: rgb(202, 25, 25);"><b>"COVID -19 Pandemic General Awareness Activity"</b></span>
        organized by the Internal Quality Assurance Cell (IQAC) of Davangere University, Shivagangotri, Davangere, Karnataka.<br><b>Certificate ID : </b>'.$data['fappno'];
        $pdf->SetFont('Times', 'I', 20);
        $pdf->writeHTMLCell(240,60,45,90,$str,0,1);
       // $pdf->Ln(1);
       //$pdf->cell('80','1',"Certificate ID : ".$data['fappno'],0,1,'L');
        $pdf->Ln(18);
        $pdf->Image('img/023_VC.jpeg', 220, 137, 40, 30);
        $pdf->Image('img/023_RR.jpeg', 130, 142, 40, 30);
        $pdf->Image('img/023_IQ.png', 30, 140, 40, 30);
        $pdf->cell('0','7','Dr. Gayathri Devaraj               Dr. Basavaraja Banakara               Dr. Sharanappa V. Halse','0','1','L');
        $pdf->cell('0','7','   Director IQAC                                      Registrar                           Hon’ble Vice Chancellor','0','1','L');

        $pdf->SetAlpha(0.1);
        
        $pdf->Image('img/023_logo.jpg', 90, 50, 125, 125, '', '', '', false, 100);
        $pdf->SetAlpha();


       
        // restore full opacity
   

        // foreach ($data as $key => $value) {

        //     $newCode = $value['fdegree'];

        //     if ($newCode != $oldCode) {
        //         $sl_no = 1;
        //         if ($pdf->getY() > 160) 
        //             $pdf->AddPage("L");
        //         $first = false;
        //         $pdf->SetFont('Times', 'B', 12);
        //         $pdf->Ln(4);
        //         $j++;
        //         $pdf->cell(267, 6, $j. '. ' . $value['fdegree'] . ' - ' . $value['fdescpn'], 1, 1, "C");
                
                
        //         $pdf->SetFont('Times', '', 10);
        //     }

        //     if ($pdf->getY() > 180) {
        //         $pdf->AddPage("L");
        //         $pdf->SetFont('Times', 'B', 12);
        //         $pdf->cell(267, 8, $j. '. ' . $value['fdegree'] . ' - ' . $value['fdescpn'], 1, 1, "C");
               
        //         $pdf->SetFont('Times', '', 10);
        //     }
            
        //     $pdf->Cell(10, 6, $sl_no, "1", 0, "C");
        //     $pdf->Cell(25, 6, $value['fexamname'], "1", 0, "C");
        //     $pdf->Cell(15, 6, $value['ftotsub'], "1", 0, "C");
        //     $pdf->Cell(20, 6, $value['fadyearmode'], "1", 0, "C");
        //     $pdf->Cell(20, 6, $value['fmeyearmode'], "1", 0, "C");
        //     $pdf->Cell(60, 6, $value['fexamdate'], "1", 0, "L");
        //     $pdf->Cell(15, 6, $value['fresultscheme'], "1", 0, "C");
        //     $pdf->Cell(20, 6, $value['fresyearmode'], "1", 0, "C");
        //     $pdf->Cell(25, 6, $value['fresultdate'], "1", 0, "C");
        //     $pdf->Cell(57, 6, $value['fresexamdate'], "1", 1, "L");
            

        //     $oldCode = $newCode;
        //     $sl_no++;
        // }
    }

    public function SendOutput()
    {
        // ob_end_clean();
        $this->pdf->Output("Certificate_{$data['fappno']}.pdf", "I");
    }
}

function dudCovid19Cert($aobj_context)
{
    $univcode = $aobj_context->mobj_data["univcode"];  

    $appno = $aobj_context->mobj_data["appno"];
//    var_dump($appno);

    $query = "select * from qztran where fappno = '{$appno}'";
  
    $result = $aobj_context->pobj_db->GetRow($query);
    $class_obj = new ReprtObject();
    $class_obj->univcode = $univcode;
    $class_obj->DefaultConstructor($aobj_context);

    // If No data found Generate Blank Report
    if (count($result) > 0) {
        $class_obj->Report($result);
    }

    $class_obj->SendOutput();

}