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


Current Path : /var/www/oasis/Report_details/
Upload File :
Current File : /var/www/oasis/Report_details/Generatecollegeiamarkspendingreportdetailed.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);
include_once("stringspliter.php");
	
class report_ra_qp_wise_student_count  extends FPDF
{
		 
	function DefaultConstructor($aobj_context)
	{
		session_start();
		$this->aobj_context=$aobj_context;
		$this->pdf=  new FPDF();
        $this->pdf=$this;
        $this->ttd_degree = $this->aobj_context->mobj_data["degree_code_from"];
		$this->ttd_examno = $this->aobj_context->mobj_data["Examno_from"];
		$this->ttd_sub_from = $this->aobj_context->mobj_data["sub_from"];
		$this->ttd_sub_to = $this->aobj_context->mobj_data["sub_to"];
		
		$this->alldeg = $this->aobj_context->mobj_data["alldeg"];
		// var_dump($this->ttd_sub_from);
		
		$this->ip=$_SERVER["REMOTE_ADDR"];
		$get_date="select date_format(now(),'%d/%m/%Y %H:%i:%s') now_date";
		$obj=$this->aobj_context->mobj_db->GetRow($get_date);
		$this->current_date=$obj['now_date'];	
		$this->collcode=$_SESSION['collcode'];	
	}
	 
	function Header()
	{
		session_start();
		$FUNIVCODE = $_SESSION['FUNIVCODE'];
		
		$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->aobj_context->mobj_data["db"].'/'.$this->pdf_logo_path;
			$this->pdf->Image($img_logo_path,10,10,23,22);
		}
		$img_path2 = $this->aobj_context->main_src."/img/logo2.jpg";
		if(file_exists($img_path2))
		{
			$this->pdf->Image($img_path2,170,6,23,23);
		}
		
		$this->pdf->SetFont('Times','B',12);
		$this->pdf->cell(180,3,$this->FUNIVNAME."","0",1,"C");
		$this->pdf->SetFont('Times','B',7);
		$this->pdf->cell(180,7, $this->s_state,"0",1,"C");
		$this->pdf->SetFont('Times','B',9);
		$this->pdf->cell(180,5, $this->college_details,"0",'1',"C");
		$this->pdf->SetFont('Times','UB',10);
		$this->pdf->Cell(180,5,"Student Wise IA Pending","0",1,"C");

		$get_data="SELECT * FROM degree WHERE fdegree  = '{$this->ttd_degree}' and fexamno = '{$this->ttd_examno}'";
		 
		$obj_deg=$this->aobj_context->mobj_db->GetRow($get_data); 
		// var_dump($get_data);
		// var_dump($obj_deg['FDESCPN']);
		

		$this->pdf->SetFont('Times','',10);
		$this->pdf->Cell(180,5,"Degree - ".$this->ttd_degree."-".$obj_deg['FDESCPN']." (".$obj_deg['FEXAMDATE'].")","0",1,"C");
		$this->pdf->SetFont('Times','',10);
		$this->pdf->Cell(180,5,"Exam No. - ".$obj_deg['FEXAMNAME'],"0",1,"C");
		
		$this->pdf->Ln(2);
		$this->pdf->SetFont('Times','',13);
		
	}
	
	function Footer()
	{
		 
		
		$this->SetY(-15);
		$this->SetX(10);
		$this->pdf->SetFont('Times','B',8);
		$this->Cell(140,6,'Printed   : IP Address : '.$this->ip." Date ".$this->current_date,'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->collcode}'";
		 
		$obj_student=$this->aobj_context->mobj_db->GetRow($get_data); 

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

		$this->degree_details=" College : {$this->FCOLLNAME}";		

	}

	function GetFullQry()
	{		
        
        if($this->ttd_examno == ''){
            $this->ttd_examno = '%';
        }
    
        $ttd_degree = $this->ttd_degree;
		$ttd_examno = $this->ttd_examno;
		// var_dump($this->ttd_sub_from);
    
        $query = "SELECT fdeggrp AS fdeggrp,mk.fdegree AS fdegree, mk.fexamno AS fexamno, mk.fcollcode AS fcollcode, mk.fregno AS fregno, st.fname AS fname,
				GROUP_CONCAT(DISTINCT mk.fsubcode ORDER BY mk.fsubcode SEPARATOR ' | ') AS fsubcode
				FROM marks mk
				INNER JOIN student st ON mk.fregno = st.fregno
				INNER JOIN candsum cs ON mk.fdegree = cs.fdegree 
				AND mk.fexamno = cs.ffreshexam AND mk.fregno = cs.fregno AND ftotalfee>0 
				LEFT JOIN subject sb ON sb.fdegree = mk.fdegree AND sb.fcsubcode = mk.fsubcode
				LEFT JOIN degree dg ON mk.fdegree = dg.fdegree AND mk.fexamno = dg.fexamno 
				WHERE fmarks = -1
				AND mk.fcollcode = '{$_SESSION['collcode']}' AND mk.fdegree = '{$ttd_degree}' AND mk.fexamno = '{$ttd_examno}'
				AND mk.fsubcode BETWEEN '{$this->ttd_sub_from}' AND '{$this->ttd_sub_to}'
				GROUP BY fdeggrp,mk.fdegree, mk.fexamno, mk.fcollcode, mk.fregno
				ORDER BY fdeggrp,mk.fdegree, mk.fexamno, mk.fcollcode, mk.fregno, mk.fsubcode";
        // var_dump($query);
        $this->lobj_get_data = $this->aobj_context->mobj_db->GetAll($query);
        // var_dump($this->lobj_get_data);
        // die();
		
		
	}
	
	function formData()
	{

		$this->pdf->SetMargins(10,12,10);		
		$this->pdf->AddPage();
		$empty_cell_width=2;
		$sl_no=1;
		$k2 = 1;
		$first = true;
		foreach($this->lobj_get_data as $dk => $dv)
		{
			if($k2 > 29)
			{
				$this->pdf->AddPage();
				$k2 = 1;
			}
			
			if($first == true || $k2 == 1)
			{
				$this->pdf->SetFont('Times','B',10);
				$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
				$this->pdf->cell(12,7, "Sl. No.","1",0,"C");
				$this->pdf->cell(30,7, "Reg. No.","1",0,"C");
				$this->pdf->cell(65,7, "Student Name","1",0,"C");				
				$this->pdf->cell(80,7, "Sub. Code","1",1,"C");
				$this->pdf->SetFont('Times','',9);
				$first = false;
			}
			
			$subname = trim($dv['FSSUBNAME']);
			$subnamearr = str_splitf($subname,50);
			
			$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
			$this->pdf->cell(12,7, $sl_no,"LRT",0,"C");
			$this->pdf->cell(30,7, $dv['fregno'],"LRT",0,"C");
			$this->pdf->cell(65,7, $dv['fname'],"LRT",0,"L");			
			$this->pdf->SetFont('Times','',9);
			// $this->pdf->cell(90,7, $dv['fsubcode'],"LRT",1,"L");
			// $this->pdf->SetX($x + 25);
			$this->pdf->MultiCell(80, 7, $dv['fsubcode'],1, "L");			
			if($k2 == 29)
			{	
				$this->pdf->cell($empty_cell_width,7, "","",0,"C");
				$this->pdf->cell(190,1, "","T",0,"C");
			}
			if($subnamearr[1] != '')
			{
				$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
				$this->pdf->cell(12,4,'',"LRB",0,"C");
				$this->pdf->cell(30,4,'',"LRB",0,"C");
				$this->pdf->cell(65,4,'',"LRB",0,"L");				
				$this->pdf->SetFont('Times','',9);
				$this->pdf->cell(80,4,'',"LRB",1,"L");
				if($k2 == 30)
				{	
					$this->pdf->cell($empty_cell_width,7, "","",0,"C");
					$this->pdf->cell(190,1, "","T",0,"C");
				}	
			}
			$sl_no++;
			$k2++;
		}
		$this->pdf->cell($empty_cell_width,7, "","",0,"C");
		$this->pdf->cell(190,1, "","T",1,"C");
	}
			 
	function SendOutput()
	{
		$this->pdf->Output("Student wise IA pending.pdf","I");
	}
	
}

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

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

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

?>