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


Current Path : /var/www/oasis/Report_details/
Upload File :
Current File : /var/www/oasis/Report_details/subjRegReport.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);
include_once("stringspliter.php");
require_once("/var/www/html/aws/aws-autoloader.php");
use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;

ini_set('max_execution_time', 300);
ini_set("memory_limit","500M");

// $pdf_writer_class =$main_src."/maya-pdf/fpdf.php";
// require_once($pdf_writer_class);
	
class ra_invigilators_dairy  extends TCPDF
{
	function DefaultConstructor($aobj_context)
	{
		session_start();
		$this->aobj_context=$aobj_context;
		$this->pdf=  new TCPDF();
		$this->pdf=$this;
        $this->collcode=$_SESSION['collcode'];
		$this->funivcode=$_SESSION['FUNIVCODE'];
		$this->degree=trim($this->aobj_context->mobj_data["degree"]);
		$this->degexam=trim($this->aobj_context->mobj_data["degexam"]);
		$this->section=trim($this->aobj_context->mobj_data["section"]);
		$this->ip=$_SERVER["REMOTE_ADDR"];
		$get_date="select now() as now_date";
		$obj=$this->aobj_context->mobj_db->GetRow($get_date);
		$this->current_date=$obj['now_date'];		
		$this->type=trim($this->aobj_context->mobj_data["type"]);
	
		$this->headeractive = true;
		$this->startPageGroup();
	}
 
	function Header()
	{
		$img_logo_path=$this->aobj_context->main_src.'/'.$this->aobj_context->mobj_data["db"].'/'.$this->pdf_logo_path;
		$this->pdf->Image($img_logo_path,25,5,37,15);

		if($this->funivcode == '052' || $this->funivcode == '021'){
			$this->pdf->SetFont('Times','B',9);
			$this->pdf->Cell(0,8,"JSS MAHAVIDYAPEETHA",0,1,'C');
		}
		$this->pdf->SetFont('Times','B',15);
		$this->pdf->cell(0,3,$this->FUNIVNAME."","0",1,"C");
		$this->pdf->SetFont('Times','B',8);
		$this->pdf->cell(0,6, $this->s_state,"0",1,"C");
	
		$this->pdf->SetFont('Times','B',12);
		$this->pdf->cell(0,6, $this->degree_details,"0",1,"C");
		$this->pdf->SetFont('Times','B',12);

		$this->pdf->Cell(0,7,"Subject Registration","0",1,"C");
		$this->pdf->Cell(0,5,$this->degree_name,"0",1,"C");
		$this->pdf->Cell(0,5,"Section: ".$this->section,"0",1,"C");

         
	}	
	
	function Footer()
	{
		$this->SetY(-15);
		$this->pdf->SetFont('Times','B',8);
		$this->Cell(0,6,'Printed   : IP Address : '.$this->ip." Date ".$this->current_date,'0',0,'L');
		$this->Cell(0, 6,'Page ' .$this->PageNo().'', 0, 1, 'R');
	}
	
	function formcolldata()
	{
        
		
		$get_coll_name="select FUNIVNAME as 'FUNIVNAME',FUNIVCODE,
						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'];
		$this->funivcode=$lobj_get_coll_name['FUNIVCODE'];

		$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->FCOLLCODE = $obj_student['FCOLLCODE'];
		$this->degree_details  = " College : {$this->college_details}";

		$get_data="SELECT d.fdegree,d.fdescpn,d.fexamname,d.fexamdate
				from degree d
				where d.fdegree='{$this->degree}'
				and d.fexamno = '{$this->degexam}'";					
		$degdata=$this->aobj_context->mobj_db->GetRow($get_data); 
		$this->degree_name = $degdata['fdegree'].' - '.$degdata['fdescpn'].' '.$degdata['fexamname'].' '.$degdata['fexamdate'];
       		

	 }
	 
	function writepdf($aobj_context){

        
		$pdf=$this->pdf;
		$cnd = "and stu.fsection = '{$this->section}'";
		
		if($this->section == 'All')
		{
			$cnd = "";
		}
		if($this->funivcode == '097')
		{
			$query1="select ifnull(mak.ffmob,'') as ffmob,
			ifnull(mak.fmmob,'') as fmmob,

			stu.FREGNO,stu.FNAME,d.ftotsub,group_concat(DISTINCT sub.fsubshort order by sub.fsubcode) as fsubcode
			FROM student stu inner join regcandsum mak ON stu.fdegree = mak.fdegree 
			and stu.FREGNO=mak.FREGNO and mak.Fdegree='{$this->degree}' 
			and mak.ffreshexam='{$this->degexam}' and mak.FCOLLCODE='{$this->collcode}'
			inner join degree d on d.FDEGREE =mak.FDEGREE 
			and  d.Fexamno=mak.Fexamno 
			inner join regcanddet cd on mak.fregno = cd.fregno and mak.fdegree = cd.fdegree 
			and mak.fcollcode = cd.fcollcode and mak.ffreshexam = cd.fexamno
			inner join subject sub on cd.fdegree = sub.fdegree and cd.fexamno = sub.fexamno and cd.fsubcode = sub.fsubcode
			WHERE stu.FREGNO != ''  
			and ifnull(mak.ffmob,'') <> ''
			and mak.ffreshexam='{$this->degexam}'
			{$cnd}
			group by mak.fregno
			order by stu.FREGNO"; 
		}else
		{
			$query1="select stu.FREGNO, stu.FNAME,d.ftotsub,group_concat(DISTINCT sub.fsubshort order by sub.fsubcode) as fsubcode
			FROM student stu inner join regcandsum mak ON stu.fdegree = mak.fdegree 
			and stu.FREGNO=mak.FREGNO and mak.Fdegree='{$this->degree}' 
			and mak.ffreshexam='{$this->degexam}' and mak.FCOLLCODE='{$this->collcode}'
			inner join degree d on d.FDEGREE =mak.FDEGREE 
			and  d.Fexamno=mak.Fexamno 
			inner join regcanddet cd on mak.fregno = cd.fregno and mak.fdegree = cd.fdegree 
			and mak.fcollcode = cd.fcollcode and mak.ffreshexam = cd.fexamno
			inner join subject sub on cd.fdegree = sub.fdegree and cd.fexamno = sub.fexamno and cd.fsubcode = sub.fsubcode
			WHERE stu.FREGNO != ''  
			and mak.ffreshexam='{$this->degexam}'
			{$cnd}
			group by mak.fregno
			order by stu.FREGNO"; 
		}

		// var_dump($query1);die();
		// and d.FMEYEAR=mak.FYEAR 
		// and d.FMEEXAMTYP=mak.FEXAMTYPE
		$results1=$aobj_context->mobj_db->GetAll($query1);
		
		$ftotsub = $results1[0]['ftotsub'];
		
		$pdf->SetMargins(10,40,5,20);

        $pdf->startPageGroup();
        $pdf->AddPage("L","A3");
		$pdf->ln(5);
     
        $pdf->SetFont('Times','',12);	
		$this->pdf->cell(12,10, "Sl. No.","1",0,"C");
		$this->pdf->cell(25,10, "USN","1",0,"C");
		$this->pdf->cell(75,10, "Name","1",0,"C");
		for($i=1; $i<= $ftotsub; $i++){
			$this->pdf->cell(22,10,'Subject'.' - '.$i,"1",0,"C");
		}

		if($this->funivcode == '097')
		{
			$this->pdf->cell(25,10, "Father MOB","1",0,"C");
			$this->pdf->cell(25,10, "Mother MOB","1",0,"C");
		}

		$this->pdf->cell(22,10, "Reciept No.","1",0,"C");
		
		$this->pdf->cell(27,10, "Signature","1",0,"C");
		$this->pdf->cell(1,10,'',0,1,"C");
		$pdf->SetFont('Times','',12);	
		$k = 1;

		foreach($results1 as $value)
		{
			$fregno = $value['FREGNO'];
			$ffmob = $value['ffmob'];
			$fmmob = $value['fmmob'];
			$fname  = $value['FNAME'];
			$subdet  = $value['ftotsub'];
			$subjarry = $value['fsubcode'];

			$sub = explode(',',$subjarry);
			
			$pdf->SetFont('Times','',10);
			$this->pdf->cell(12,7, $k,"1",0,"C");
			$this->pdf->cell(25,7,$fregno,"1",0,"C");
			$this->pdf->cell(75,7,$fname,"1",0,"L");
			for($i=0; $i< $subdet; $i++){
				$this->pdf->cell(22,7,$sub[$i],"1",0,"C");	
			}

			if($this->funivcode == '097')
			{
				$this->pdf->cell(25,10, $fmmob,"1",0,"C");
				$this->pdf->cell(25,10, $ffmob,"1",0,"C");
				
			}

			$this->pdf->cell(22,7,"","1",0,"C");
			$this->pdf->cell(27,7,"","1",1,"C");
			// $this->pdf->cell(1,2,'',0,1,"C");

			$pdf->SetFont('Times','',12);
			if($this->pdf->GetY()>250)
			{
				$pdf->startPageGroup();
				$pdf->AddPage("L","A3");
				$pdf->ln(5);

				$pdf->SetFont('Times','',12);	
				$this->pdf->cell(12,10, "Sl.No.","1",0,"C");
				$this->pdf->cell(25,10, "USN","1",0,"C");
				$this->pdf->cell(75,10, "Name","1",0,"C");
				for($i=1; $i<= $ftotsub; $i++){
					$this->pdf->cell(22,10,'Subject'.' - '.$i,"1",0,"C");		
				}	

				if($this->funivcode == '097')
				{
					$this->pdf->cell(25,10, "Father MOB","1",0,"C");
					$this->pdf->cell(25,10, "Mother MOB","1",0,"C");
				}
				$this->pdf->cell(22,10,"Reciept No.","1",0,"C");
				$this->pdf->cell(27,10,"Signature","1",0,"C");	
				$this->pdf->cell(1,10,'',0,1,"C");
				
			}
			$k++;
		}
		
	}
	 
	function SendOutput()
	{
		$this->pdf->Output("Subject Registration.pdf","I");
	}

}

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

	$degree = trim($aobj_context->mobj_data["degree"]);
	$degexam = trim($aobj_context->mobj_data["degexam"]);
	$section = trim($aobj_context->mobj_data["section"]);
	$collcode = $_SESSION['collcode'];
// die();
	$class_obj=new ra_invigilators_dairy();
    $class_obj->DefaultConstructor($aobj_context);
	$class_obj->formcolldata();
	$class_obj->writepdf($aobj_context);
	$class_obj->SendOutput();
}



?>