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


Current Path : /var/www/html/rcub/Report_details/
Upload File :
Current File : /var/www/html/rcub/Report_details/report_bacth_preparation_dairy.php

<?php
$main_src = substr($_SERVER['SCRIPT_FILENAME'], 0, strlen($_SERVER['SCRIPT_FILENAME']) - 7);
$pdf_writer_class = $main_src . "/tarka_pdf/fpdf.php";
require_once($pdf_writer_class);

class ra_batchpreparation_dairy  extends FPDF
{

    function DefaultConstructor($aobj_context)
    {
        session_start();

        $this->aobj_context = $aobj_context;
        $this->pdf =  new FPDF();
        $this->pdf = $this;
        $this->College_Code = $_SESSION['collcode'];
        //$this->qp_code=trim($this->aobj_context->mobj_data["qp_code"]);
        $this->degree_code = trim($this->aobj_context->mobj_data["degree_code"]);
        $this->examno = trim($this->aobj_context->mobj_data["examno"]);
        $this->subject = trim($this->aobj_context->mobj_data["subject"]);
        $this->batch_range_to = trim($this->aobj_context->mobj_data["batch_range_to"]);
        $this->batch_range_from = trim($this->aobj_context->mobj_data["batch_range_from"]);

        $this->room_range_from = str_pad($this->room_range_from, 3, "0", STR_PAD_LEFT);
        $this->room_range_to = str_pad($this->room_range_to, 3, "0", STR_PAD_LEFT);

        $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->mobj_db->GetRow($get_date);
        $this->current_date = $obj[now_date];
    }



    function Header()
    {
        $img_path = $this->aobj_context->main_src . $this->photo_path;
        if (!empty($this->photo_path) && file_exists($img_path)) {
            $this->pdf->Image($img_path, 166, 50, 50);
        }
        if (!empty($this->pdf_logo_path)) {
            $img_logo_path = $this->aobj_context->main_src . $this->pdf_logo_path;
            $this->pdf->Image($img_logo_path, 10, 10, 20);
        }

        $this->pdf->SetFont('Times', 'B', 15);
        $this->pdf->cell(180, 3, $this->FUNIVNAME . "", "0", 1, "C");
        $this->pdf->SetFont('Times', 'B', 8);
        $this->pdf->cell(180, 6, $this->s_state, "0", 1, "C");
        $this->pdf->SetFont('Times', 'B', 12);
        $this->pdf->cell(180, 6, "Centre : $this->college_details ", "0", 1, "C");
        $this->pdf->SetFont('Times', 'B', 12);
        $this->pdf->Cell(180, 6, "BATCH PREPARATION DAIRY", "0", 1, "C");
        $this->pdf->SetFont('Times', 'B', 11);
        $this->pdf->Cell(180, 6, " {$this->FEXAMDATE} EXAMINATION", "0", 1, "C");
        $this->pdf->SetFont('Times', 'B', 12);
        $this->pdf->Cell(180, 6, " {$this->sub_details}", "0", 1, "C");

        $this->pdf->Cell(180, 6, " {$this->exam_date}", "0", 1, "C");
        $this->pdf->Ln(1);
        $this->pdf->SetFont('Times', '', 12);
        $empty_cell_width = 12;
        $this->pdf->cell($empty_cell_width, 7, "", " ", 0, "C");
        $this->pdf->SetFont('Times', 'B', 14);
        $this->pdf->Cell(180, 7, "Room No. :   {$this->hall_no}", "0", 1, "L");

        $this->pdf->SetFont('Times', 'B', 12);

        $this->pdf->cell($empty_cell_width, 7, "", " ", 0, "C");
        $this->pdf->cell(15, 7, "Sl. No.", "1", 0, "C");
        $this->pdf->cell(20, 7, "Reg. No.", "1", 0, "C");
        $this->pdf->cell(80, 7, "Name", "1", 0, "C");
        $this->pdf->cell(28, 7, "Ans. Book No.", "1", 0, "C");
        $this->pdf->cell(28, 7, "Signature", "1", 1, "C");
    }

    function Footer()
    {
        $this->SetY(-15);
        $this->pdf->SetFont('Times', 'B', 9);
        $new_y = $this->pdf->GetY();
        $this->pdf->Line(5, $new_y, 203, $new_y);
        $this->Cell(140, 6, 'Printed - IP Address : ' . $this->ip . ", Date " . date('d/m/Y h:i:s A'), '0', 0, 'L');
        $this->Cell(50, 6, 'Page ' . $this->PageNo() . ' of {nb}', 0, 1, 'R');
    }

    function formcolldata()
    {
        $get_coll_name = "select FUNIVNAME as 'FUNIVNAME',
		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->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'];

        $get_data = "SELECT c.FCOLLCODE, CONCAT(c.FCOLLCODE, ' - ', c.FCOLLNAME,', ',c.FTOWN) 
		AS FCOLLNAME FROM college c where c.FCOLLCODE='{$this->College_Code}'";

        $obj_student = $this->aobj_context->mobj_db->GetRow($get_data);

        $this->college_details = $obj_student[FCOLLNAME];

        $this->degree_details = " College : {$this->FCOLLNAME}";
        $get_qp_details = "select FEXAMDATE,CONCAT(s.FSUBNAME,' ',s.FSSUBNAME) AS FSSUBNAME 
		from subject s 
		inner join degree d on d. FDEGREE=s.FDEGREE and d.fexamno = s.fexamno where s.FCSUBCODE='{$this->subject}' and d. FDEGREE = '{$this->degree_code}'";
        $obj_get_qp_details = $this->aobj_context->mobj_db->GetRow($get_qp_details);
        $FSSUBNAME = $obj_get_qp_details['FSSUBNAME'];
        $this->FEXAMDATE = $obj_get_qp_details['FEXAMDATE'];
        $this->sub_details = "Subject : {$this->subject} - {$FSSUBNAME} ";
    }

    function GetFullQry()
    {

        $get_data = " select distinct stu.FREGNO, stu.FNAME,  
		IFNULL(lpad(mak.FBATCH,2,'0'), '') AS FBATCH  
		FROM student stu inner join marks_pr mak ON stu.fdegree=mak.fdegree 
		and stu.FREGNO=mak.FREGNO   
		inner join subject sub on sub.FCSUBCODE = mak.FSUBCODE 
		and sub.FCSUBCODE='{$this->subject}'  
		and sub.FEXAMNO ='{$this->examno}'
		WHERE stu.FREGNO != '' and mak.FBATCH <> ''and mak.Fdegree = sub.FDEGREE 
		and mak.FBATCH between '{$this->batch_range_from}' and  '{$this->batch_range_to}'
		and sub.FEXAMNO  = mak.Fexamno and mak.Fdegree = sub.FDEGREE
		 and mak.FCOLLCODE='{$this->College_Code}'
		and mak.Fexamno='{$this->examno}' and sub.FDEGREE='{$this->degree_code}'
		group by stu.FREGNO  order by stu.FREGNO limit   1000";
        $this->lobj_get_data = $this->aobj_context->mobj_db->GetAll($get_data);
    }

    function WriteSlNoRow()
    {
    }
    function formData()
    {
        $this->pdf->SetMargins(12, 12);
        $empty_cell_width = 12;
        $this->pdf->SetFont('Times', 'B', 10);
        $this->pdf->cell($empty_cell_width, 7, "", " ", 0, "C");
        $cnt = 1;
        $this->pdf->AddPage();
        foreach ($this->lobj_get_data  as $ak => $av) {
            $this->pdf->SetFont('Times', '', 12);
            $this->pdf->cell($empty_cell_width, 7, "", " ", 0, "C");
            $this->pdf->cell(15, 6, $cnt, "1", 0, "C");
            $this->pdf->cell(20, 6, $av['FREGNO'], "1", 0, "C");
            $this->pdf->cell(80, 6, $av['FNAME'], "1", 0, "L");
            $this->pdf->cell(28, 6, "", "1", 0, "C");
            $this->pdf->cell(28, 6, "", "1", 1, "C");
            $cnt++;
            /* $this->pdf->Cell(1,7,"","0",1,"l");;
			$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
			$this->pdf->Cell(180,7,"End of Room No. {$hallk}, Total Students : {$t_s}","0",1,"L");
			$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
			$this->pdf->Cell(180,7,"Total no. of students present  : _________  Total no of students absent : _________","0",1,"L");
			$this->pdf->Ln(6);
			$this-> pdf->Cell(180,7,"Name & Signature of the Invigilator ","0",1,"R"); */
        }
    }

    function SendOutput()
    {
        $this->pdf->Output("BATCH PREPARATION DAIRY.pdf", "D");
    }
}

function GeneratebatchpreparationDairy($aobj_context)
{
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);

    $class_obj = new ra_batchpreparation_dairy();
    $class_obj->AliasNbPages();
    $class_obj->DefaultConstructor($aobj_context);

    $class_obj->GetFullQry();
    $class_obj->formcolldata();
    $class_obj->formData();

    $class_obj->SendOutput();
}