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


Current Path : /var/www/html/univadmin/
Upload File :
Current File : /var/www/html/univadmin/tdvsQpPatranTest.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("report_hall_ticket.php");

class MYPDF extends TCPDF
{
  
    public function Footer()
    {
        $this->SetY(-15);
        $this->SetFont('helvetica', 'I', 8);
        // var_dump();
        if($this->CurOrientation == 'P')
        {
            $this->Cell(0, 10, 'IP : ' . $_SERVER["REMOTE_ADDR"], 0, 0, 'L');
            $this->Cell(0, 10, 'Date : ' . date("d-m-Y h:i:s A"), 0, 1, 'R');
            //$this->Cell(60, 10, 'Page ' . $this->getPageNumGroupAlias() . '/' . $this->getPageGroupAlias(), 0, 1, 'R');
        }
        else {
            $this->Cell(90, 10, 'IP : ' . $_SERVER["REMOTE_ADDR"], 0, 0, 'L');
            $this->Cell(90, 10, 'Date : ' . date("d-m-Y h:i:s A"), 0, 1, 'R');
            
        }
    }
}


class MarksListReport extends MYPDF
{
    function formcolldata()
    {
        $get_coll_name = "select FUNIVCODE, FUNIVNAME as 'FUNIVNAME',
		FUNIVADD1 as 'state', pdf_logo_path,
		ifnull(FEXAMAPPREQ,'F') as FEXAMAPPREQ 
		From control";
        $lobj_get_coll_name = $this->aobj_context->pobj_db->GetRow($get_coll_name);
        $this->FUNIVCODE = $lobj_get_coll_name['FUNIVCODE'];
        $this->FUNIVNAME = $lobj_get_coll_name['FUNIVNAME'];
        $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'];
        $this->FEXAMAPPREQ = $lobj_get_coll_name['FEXAMAPPREQ'];
        $folder = $this->aobj_context->pdb['ffolder'];
        $this->url = "http://universitysolutions.in/{$folder}/";
    }

    public function Footer()
    {
       
        $pdf->SetY(-10);
        $pdf->SetFont('helvetica', 'I', 8);
       
        $pdf->Cell(60, 10, 'IP : ' . $_SERVER["REMOTE_ADDR"], 0, 0, 'L');
        $pdf->Cell(60, 10, 'Date : ' . date("d-m-Y h:i:s A"), 0, 1, 'C');
       
    }

    function DefaultConstructor($aobj_context)
    {
        $this->aobj_context = $aobj_context;
        $this->pdf = new MYPDF();
        $this->doc_no = trim($this->aobj_context->mobj_data["doc_no"]);
        $this->ip = $_SERVER["REMOTE_ADDR"];
        $get_date = "select date_add(date_add(now(),INTERVAL 13 hour),interval 30 minute) as now_date";
        $obj = $this->aobj_context->pobj_db->GetRow($get_date);
    }

    function WriteHallTicket($doc_no)
    {
        $this->tempcode = trim($this->aobj_context->mobj_data["tempcode"]);
        var_dump($this->tempcode);
        
        $get_data = "select t.fqpcode, t.fbatchno, t.fvalno, mq.fsubname, mq.fdeggrp, 
        mq.fexamdate, t.fteachcode, t1.fteachname,
        t.frevcode, t2.fteachname as frevname, mq.fsmaxmarks, 
        date_format(date(t.fdate), '%d/%m/%Y') as flogdate, 
        TIME_FORMAT(fsysdate, '%h:%i:%s %p') as flogtime from tdvs_tabsum t 
        left join tdvs_masqp mq on t.fqpcode = mq.fqpcode 
        left join tdvs_deggrp dg on mq.fdeggrp = dg.fdeggrp 
        left join tdvs_masteach t1 on t.fteachcode = t1.fteachcode
        left join tdvs_masteach t2 on t.frevcode = t2.fteachcode
        where t.fbatchno = '{$doc_no}'
        group by t.fqpcode";
        $obj_get_data = $this->aobj_context->pobj_db->GetRow($get_data);

        $pdf = $this->pdf;
        if($obj_get_data['fvalno'] == 'R' || $obj_get_data['fvalno'] == 'D')
            $pdf->SetMargins(25, 10);
        $pdf->AddPage("P");
        $page_cnt = 1;


        $name = "";

        if($obj_get_data['fvalno'] == 'R')
            $name = "Revaluation";
        else if($obj_get_data['fvalno'] == 'D')    
            $name = "Deveation";

        $pdf->SetLineWidth(0.01);
        $pdf->SetFont('Times', 'B', 14);
        
        $img_path=$this->url."/img/logo.jpg";
        $univ_logo = file_get_contents($img_path);
        if($univ_logo != "") 
        {
            if($obj_get_data['fvalno'] == 'R' || $obj_get_data['fvalno'] == 'D')
                $pdf->Image('@'.$univ_logo,25,10,25,20);
            else    
                $pdf->Image('@'.$univ_logo,15,10,25,20);    
        }    

        $pdf->Cell(175, 4, $this->FUNIVNAME, 0, 1, 'C');
        $pdf->SetFont('Times', '', 9);
        $pdf->Cell(175, 4, $this->s_state, '0', 1, 'C');
    
        $pdf->SetFont('Times', 'B', 12);
        $pdf->Ln(2);
        $pdf->Cell(175, 5, $name.' Marks List for '.$obj_get_data['fexamdate'] . ' Examination', '0', 1, 'C');
        $pdf->SetFont('Times', '', 12);
        $pdf->Ln(6);

        $pdf->SetFont('Times', 'B', 11);
        $pdf->Cell(20, 6, 'QP. Code', 0, 0, 'L');
        $pdf->Cell(6, 6, ' :  ', 0, 0, 'L');
        $pdf->SetFont('Times', '', 11);
        $pdf->Cell(40, 6, '' . $obj_get_data['fqpcode'], 0, 0, 'L');

        $pdf->SetFont('Times', 'B', 11);
        $pdf->Cell(25, 6, 'Subject', 0, 0, 'L');
        $pdf->Cell(6, 6, ' :  ', 0, 0, 'L');
        $pdf->SetFont('Times', '', 11);
        $pdf->Cell(120, 6, '' . $obj_get_data['fsubname'], 0, 1, 'L');

        $pdf->SetFont('Times', 'B', 11);
        $pdf->Cell(20, 6, 'Batch. No.', 0, 0, 'L');
        $pdf->Cell(6, 6, ' :  ', 0, 0, 'L');
        $pdf->SetFont('Times', '', 11);
        $pdf->Cell(40, 6, '' . $obj_get_data['fbatchno'], 0, 0, 'L');

        $pdf->SetFont('Times', 'B', 11);
        $pdf->Cell(25, 6, 'Valuation No.', 0, 0, 'L');
        $pdf->Cell(6, 6, ' :  ', 0, 0, 'L');
        $pdf->SetFont('Times', '', 11);
        if($obj_get_data['fvalno'] == 'R' || $obj_get_data['fvalno'] == 'D')
            $pdf->Cell(22, 6, '' . $obj_get_data['fvalno'], 0, 0, 'L');
        else
            $pdf->Cell(15, 6, '' . $obj_get_data['fvalno'], 0, 0, 'L');
        $pdf->SetFont('Times', 'B', 11);
        $pdf->Cell(25, 6, 'Max. Marks', 0, 0, 'L');
        $pdf->Cell(6, 6, ' :  ', 0, 0, 'L');
        $pdf->SetFont('Times', '', 11);
        $pdf->Cell(120, 6, '' . $obj_get_data['fsmaxmarks'], 0, 1, 'L');

        $pdf->Ln(2);

        $w = "186";

        $romanarray = array("A" => "I", "B" => "II", "C" => "III", "D" => "IV", "E" => "V", "F" => "VI", "G" => "VII", "H" => "VIII", "I" => "IX", "I" => "X");

        $query = "select fregcode, fdummyno as fslno, ifnull(FNREGCODE,'') as fnregcode,
        if(fsysmarks = -1, '',fsysmarks) as fvmarks, 
        if(ifnull(frevstatus,'') = 'FINAL', 
        if(fsysmarksv = -1, '',fsysmarksv), '') as frmarks from tdvs_tabsum 
        where fqpcode = '{$obj_get_data['fqpcode']}' 
        and fbatchno = '{$obj_get_data['fbatchno']}' 
        and ifnull(fstatus,'') = 'FINAL'";
        
        $result = $this->aobj_context->pobj_db->GetAll($query);
        $valno = $obj_get_data['fvalno'];
        if($valno == 'R' || $valno == 'D')
        {

            $pdf->SetFont('Times', 'B', 11);
            $pdf->Cell(10, 5, "Sl.", "LRT", 0, "C");
            $pdf->Cell(20, 5, "Ab. ID", "LRT", 0, "C");
            $pdf->Cell(60, 5, "Code Number", "LRT", 0, "C");
            //$pdf->Cell(30, 5, "New Reg. Code", "LRT", 0, "C");
            $pdf->Cell(65, 5, "Marks Awarded", "LTR", 1, "C");
            // $pdf->Cell(30, 5, "Remarks", "LTR", 1, "C");
            $pdf->Cell(10, 5, "No.", "LRB", 0, "C");
            $pdf->Cell(20, 5, "", "LRB", 0, "C");
            $pdf->Cell(60, 5, "", "LRB", 0, "C");
            //$pdf->Cell(30, 5, "", "LRB", 0, "C");
            $pdf->Cell(15, 5, "In Fig", "LTRB", 0, "C");
            $pdf->Cell(50, 5, "In Words", "LTRB", 1, "C");
            // $pdf->Cell(15, 5, "In Fig", "LTRB", 0, "C");
            // $pdf->Cell(40, 5, "In Words", "LTRB", 1, "C");

        }else
        {
            $pdf->SetFont('Times', 'B', 11);
            $pdf->Cell(10, 5, "Sl.", "LRT", 0, "C");
            $pdf->Cell(20, 5, "Ab. ID", "LRT", 0, "C");
            $pdf->Cell(30, 5, "Reg. Code", "LRT", 0, "C");
            $pdf->Cell(65, 5, "Marks Awarded by Examiner", "LTR", 0, "C");
            $pdf->Cell(65, 5, "Marks Awarded by Reviewer", "LTR", 1, "C");
            // $pdf->Cell(30, 5, "Remarks", "LTR", 1, "C");
            $pdf->Cell(10, 5, "No.", "LRB", 0, "C");
            $pdf->Cell(20, 5, "", "LRB", 0, "C");
            $pdf->Cell(30, 5, "", "LRB", 0, "C");
            $pdf->Cell(15, 5, "In Fig", "LTRB", 0, "C");
            $pdf->Cell(50, 5, "In Words", "LTRB", 0, "C");
            $pdf->Cell(15, 5, "In Fig", "LTRB", 0, "C");
            $pdf->Cell(50, 5, "In Words", "LTRB", 1, "C");
        }
        // $pdf->Cell(30, 5, "", "LRB", 1, "C");
        $pdf->SetFont('Times', '', 11);

        $slno = 1;
        foreach ($result as $mk) {
            // var_dump($mk);

            if($valno == 'R')
            {

                $pdf->Cell(10, 6, $slno, "LTRB", 0, "C");
                $pdf->Cell(20, 6, $mk['fslno'], "LTRB", 0, "C");
                $pdf->Cell(30, 6, $mk['fregcode'], "LTRB", 0, "C");
                $pdf->Cell(30, 6, $mk['fnregcode'], "LTRB", 0, "C");
                $pdf->Cell(15, 6, (int) $mk['fvmarks'], "LTRB", 0, "C");
                $pdf->Cell(50, 6, $mk['fvmarks'] >= 0 ? strtoupper($this->getIndianCurrency($mk['fvmarks'])) : "", "LTRB", 1, "L");
                // $pdf->Cell(15, 6, $mk['frmarks'] === "" ?  $mk['frmarks'] : (int)$mk['frmarks'] , "LTRB", 0, "C");
                // $pdf->Cell(40, 6, $mk['frmarks'] >= 0 ? strtoupper($this->getIndianCurrency($mk['frmarks'])) :"", "LTRB", 1, "L");

            }else
            {
                $pdf->Cell(10, 6, $slno, "LTRB", 0, "C");
                $pdf->Cell(20, 6, $mk['fslno'], "LTRB", 0, "C");
                $pdf->Cell(60, 6, $mk['fregcode'], "LTRB", 0, "C");
                $pdf->Cell(15, 6, (int) $mk['fvmarks'], "LTRB", 0, "C");
                $pdf->Cell(50, 6, $mk['fvmarks'] >= 0 ? strtoupper($this->getIndianCurrency($mk['fvmarks'])) : "", "LTRB", 1, "L");
                // $pdf->Cell(15, 6, $mk['frmarks'] === "" ?  $mk['frmarks'] : (int)$mk['frmarks'] , "LTRB", 0, "C");
                // $pdf->Cell(50, 6, $mk['frmarks'] >= 0 ? strtoupper($this->getIndianCurrency($mk['frmarks'])) :"", "LTRB", 1, "L");

            }
            
            // $pdf->Cell(30, 6, "", "LTRB", 1, "C");
            $slno++;
        }

        $pdf->Ln(7);
        $pdf->Cell(0, 6, 'Above marks are verified and found to be correct.', 0, 1, 'L');
        $pdf->Ln(2);

        if($valno == 'R' || $valno == 'D')
        {

            $pdf->SetFont('Times', 'BU', 11);
            $pdf->Cell(100, 6, 'Examiner', 0, 1, 'L');

            $pdf->SetFont('Times', 'B', 11);
            $pdf->Cell(20, 6, 'Code', 0, 0, 'L');
            $pdf->Cell(3, 6, ' :  ', 0, 0, 'L');
            $pdf->SetFont('Times', '', 11);
            $pdf->Cell(77, 6, '' . $obj_get_data['fteachcode'], 0, 1, 'L');

          

            $pdf->SetFont('Times', 'B', 11);
            $pdf->Cell(20, 6, 'Name', 0, 0, 'L');
            $pdf->Cell(3, 6, ' :  ', 0, 0, 'L');
            $pdf->SetFont('Times', '', 11);
            $pdf->Cell(77, 6, '' . $obj_get_data['fteachname'], 0, 1, 'L');

         

            $pdf->SetFont('Times', 'B', 11);
            $pdf->Cell(20, 6, 'Sign', 0, 0, 'L');
            $pdf->Cell(3, 6, ' :  ', 0, 0, 'L');
            $pdf->SetFont('Times', '', 11);
            $pdf->Cell(77, 6, '', 0, 1, 'L');

         

            $pdf->Ln(4);

            $pdf->SetFont('Times', 'B', 11);
            $pdf->Cell(20, 6, 'Date', 0, 0, 'L');
            $pdf->Cell(3, 6, ' :  ', 0, 0, 'L');
            $pdf->SetFont('Times', '', 11);
            $pdf->Cell(77, 6, $obj_get_data['flogdate'], 0, 0, 'L');

            $pdf->SetFont('Times', 'B', 11);
            $pdf->Cell(20, 6, '', 0, 0, 'L');
            $pdf->Cell(3, 6, '  ', 0, 0, 'L');
            $pdf->SetFont('Times', '', 11);
            $pdf->Cell(80, 6, "", 0, 1, 'L');

            $pdf->SetFont('Times', 'B', 11);
            $pdf->Cell(20, 6, 'Time', 0, 0, 'L');
            $pdf->Cell(3, 6, ' :  ', 0, 0, 'L');
            $pdf->SetFont('Times', '', 11);
            $pdf->Cell(77, 6, $obj_get_data['flogtime'], 0, 1, 'L');

        }else
        {
            $pdf->SetFont('Times', 'BU', 11);
            $pdf->Cell(100, 6, 'Examiner', 0, 0, 'L');
            $pdf->Cell(100, 6, 'Reviewer / Moderator / Chairman', 0, 1, 'L');

            $pdf->SetFont('Times', 'B', 11);
            $pdf->Cell(20, 6, 'Code', 0, 0, 'L');
            $pdf->Cell(3, 6, ' :  ', 0, 0, 'L');
            $pdf->SetFont('Times', '', 11);
            $pdf->Cell(77, 6, '' . $obj_get_data['fteachcode'], 0, 0, 'L');

            $pdf->SetFont('Times', 'B', 11);
            $pdf->Cell(20, 6, 'Code', 0, 0, 'L');
            $pdf->Cell(3, 6, ' :  ', 0, 0, 'L');
            $pdf->SetFont('Times', '', 11);
            $pdf->Cell(80, 6, '' . $obj_get_data['frevcode'], 0, 1, 'L');

            $pdf->SetFont('Times', 'B', 11);
            $pdf->Cell(20, 6, 'Name', 0, 0, 'L');
            $pdf->Cell(3, 6, ' :  ', 0, 0, 'L');
            $pdf->SetFont('Times', '', 11);
            $pdf->Cell(77, 6, '' . $obj_get_data['fteachname'], 0, 0, 'L');

            $pdf->SetFont('Times', 'B', 11);
            $pdf->Cell(20, 6, 'Name', 0, 0, 'L');
            $pdf->Cell(3, 6, ' :  ', 0, 0, 'L');
            $pdf->SetFont('Times', '', 11);
            $pdf->Cell(80, 6, '' . $obj_get_data['frevname'], 0, 1, 'L');

            $pdf->SetFont('Times', 'B', 11);
            $pdf->Cell(20, 6, 'Sign', 0, 0, 'L');
            $pdf->Cell(3, 6, ' :  ', 0, 0, 'L');
            $pdf->SetFont('Times', '', 11);
            $pdf->Cell(77, 6, '', 0, 0, 'L');

            $pdf->SetFont('Times', 'B', 11);
            $pdf->Cell(20, 6, 'Sign', 0, 0, 'L');
            $pdf->Cell(3, 6, ' :  ', 0, 0, 'L');
            $pdf->SetFont('Times', '', 11);
            $pdf->Cell(80, 6, '', 0, 1, 'L');

            $pdf->Ln(4);

            $pdf->SetFont('Times', 'B', 11);
            $pdf->Cell(20, 6, 'Date', 0, 0, 'L');
            $pdf->Cell(3, 6, ' :  ', 0, 0, 'L');
            $pdf->SetFont('Times', '', 11);
            $pdf->Cell(77, 6, $obj_get_data['flogdate'], 0, 0, 'L');

            $pdf->SetFont('Times', 'B', 11);
            $pdf->Cell(20, 6, '', 0, 0, 'L');
            $pdf->Cell(3, 6, '  ', 0, 0, 'L');
            $pdf->SetFont('Times', '', 11);
            $pdf->Cell(80, 6, "", 0, 1, 'L');

            $pdf->SetFont('Times', 'B', 11);
            $pdf->Cell(20, 6, 'Time', 0, 0, 'L');
            $pdf->Cell(3, 6, ' :  ', 0, 0, 'L');
            $pdf->SetFont('Times', '', 11);
            $pdf->Cell(77, 6, $obj_get_data['flogtime'], 0, 1, 'L');
        }
        // $pdf->SetFont('Times', 'B', 11);
        // $pdf->Cell(20, 6, 'Check No.', 0, 0, 'L');
        // $pdf->Cell(3, 6, ' :  ', 0, 0, 'L');
        // $pdf->SetFont('Times', '', 11);
        // $pdf->Cell(80, 6, "", 0, 1, 'L');

       

    
    }
    function getIndianCurrency($number)
    {
        if($number == ""){
            return "";
        }
        $hyphen      = ' ';
        $conjunction = ' and ';
        $separator   = ', ';
        $negative    = 'negative ';
        $decimal     = ' point ';
        $dictionary  = array(
            0                   => 'zero',
            1                   => 'one',
            2                   => 'two',
            3                   => 'three',
            4                   => 'four',
            5                   => 'five',
            6                   => 'six',
            7                   => 'seven',
            8                   => 'eight',
            9                   => 'nine',
            10                  => 'ten',
            11                  => 'eleven',
            12                  => 'twelve',
            13                  => 'thirteen',
            14                  => 'fourteen',
            15                  => 'fifteen',
            16                  => 'sixteen',
            17                  => 'seventeen',
            18                  => 'eighteen',
            19                  => 'nineteen',
            20                  => 'twenty',
            30                  => 'thirty',
            40                  => 'fourty',
            50                  => 'fifty',
            60                  => 'sixty',
            70                  => 'seventy',
            80                  => 'eighty',
            90                  => 'ninety',
            100                 => 'hundred',
            1000                => 'thousand',
            100000             => 'lakh',
            10000000          => 'crore'
        );
        $number = (int)$number;
        if (!is_numeric($number)) {
            return false;
        }

        if (($number >= 0 && (int) $number < 0) || (int) $number < 0 - PHP_INT_MAX) {
            // overflow
            trigger_error(
                'convert_number_to_words only accepts numbers between -' . PHP_INT_MAX . ' and ' . PHP_INT_MAX,
                E_USER_WARNING
            );
            return false;
        }

        if ($number < 0) {
            return $negative . convert_number_to_words(abs($number));
        }

        $string = $fraction = null;

        if (strpos($number, '.') !== false) {
            list($number, $fraction) = explode('.', $number);
        }

        switch (true) {
            case $number < 21:
                $string = $dictionary[$number];
                break;
            case $number < 100:
                $tens   = ((int) ($number / 10)) * 10;
                $units  = $number % 10;
                $string = $dictionary[$tens];
                if ($units) {
                    $string .= $hyphen . $dictionary[$units];
                }
                break;
            case $number < 1000:
                $hundreds  = $number / 100;
                $remainder = $number % 100;
                $string = $dictionary[$hundreds] . ' ' . $dictionary[100];
                if ($remainder) {
                    $string .= $conjunction . convert_number_to_words($remainder);
                }
                break;
            case $number < 100000:
                $thousands   = ((int) ($number / 1000));
                $remainder = $number % 1000;

                $thousands = convert_number_to_words($thousands);

                $string .= $thousands . ' ' . $dictionary[1000];
                if ($remainder) {
                    $string .= $separator . convert_number_to_words($remainder);
                }
                break;
            case $number < 10000000:
                $lakhs   = ((int) ($number / 100000));
                $remainder = $number % 100000;

                $lakhs = convert_number_to_words($lakhs);

                $string = $lakhs . ' ' . $dictionary[100000];
                if ($remainder) {
                    $string .= $separator . convert_number_to_words($remainder);
                }
                break;
            case $number < 1000000000:
                $crores   = ((int) ($number / 10000000));
                $remainder = $number % 10000000;

                $crores = convert_number_to_words($crores);

                $string = $crores . ' ' . $dictionary[10000000];
                if ($remainder) {
                    $string .= $separator . convert_number_to_words($remainder);
                }
                break;
            default:
                $baseUnit = pow(1000, floor(log($number, 1000)));
                $numBaseUnits = (int) ($number / $baseUnit);
                $remainder = $number % $baseUnit;
                try
                {
                $string = convert_number_to_words($numBaseUnits) . ' ' . $dictionary[$baseUnit];
                }catch(Exception $e)
                {
                    return "Value too large";
                }
                if ($remainder) {
                    $string .= $remainder < 100 ? $conjunction : $separator;
                    $string .= convert_number_to_words($remainder);
                }
                break;
        }

        if (null !== $fraction && is_numeric($fraction)) {
            $string .= $decimal;
            $words = array();
            foreach (str_split((string) $fraction) as $number) {
                $words[] = $dictionary[$number];
            }
            $string .= implode(' ', $words);
        }

        return $string;
    }

    function SendOutput()
    {
        $this->pdf->Output("tdvsQpPatranTest.pdf", "I");
    }
}

function tdvsQpPatranTest($aobj_context)
{
    $aobj_context->pobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $univcode = $aobj_context->mobj_data["univcode"];
    $tempcode = $aobj_context->mobj_data["tempcode"];
   
    $class_obj = new MarksListReport();
    $class_obj->DefaultConstructor($aobj_context);
    $class_obj->formcolldata();


    if($fqpcode == 'all')
    {
        $query  = "select distinct t.fbatchno from tdvs_tabsum t 
        inner join tdvs_masqp mq on t.fqpcode = mq.fqpcode 
        where mq.fboard = '{$fboard}' and mq.fdeggrp = '{$fdegreegrp}'
        and t.fvalno = '{$fvalno}' and t.fteachcode between '{$teachrngfrm}' and '{$teachrngto}'
        and ifnull(FSTATUS,'') = 'FINAL'";
    }else{
        $query  = "select distinct t.fbatchno from tdvs_tabsum t 
        inner join tdvs_masqp mq on t.fqpcode = mq.fqpcode 
        where mq.fboard = '{$fboard}' and mq.fdeggrp = '{$fdegreegrp}'
        and t.fvalno = '{$fvalno}' and t.fqpcode = '{$fqpcode}'
        and t.fteachcode between '{$teachrngfrm}' and '{$teachrngto}'
        and ifnull(FSTATUS,'') = 'FINAL'";
    }

    $result = $aobj_context->pobj_db->GetAll($query);   

    foreach($result as $val)
    {
        $class_obj->WriteHallTicket($val['fbatchno']);
    }
    
    $class_obj->SendOutput();
}