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


Current Path : /var/www/oasis/Report_details/
Upload File :
Current File : /var/www/oasis/Report_details/attiacombinednew_sjbit.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");
	
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->degcode=trim($this->aobj_context->mobj_data["degcode"]);
		$this->sem=trim($this->aobj_context->mobj_data["sem"]);
		$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_path=$this->aobj_context->main_src."/sjbit/img/report_uni_logo.jpg";
		$this->Image($img_path,120,5,170,23);
		$this->pdf->Ln(30);
		$this->pdf->Cell(0,7,"FINAL CIE RESULT","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(140,6,'Entered  : IP Address : '.$this->ip_address." Date ".$this->created_date,'0',0,'L');
		$this->Cell(0,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');
		$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->FCOLLNAME}";

		$get_data="SELECT d.fdegree,d.fdescpn,d.fexamname,d.fexamdate
				from degree d
				where d.fdegree='{$this->degcode}'
				and d.fexamno = '{$this->sem}'";					
		$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;
		$query = "select distinct fsubshort from subject s
		inner join marks m on s.fdegree= m.fdegree
		and s.fexamno = m.fexamno
		and s.fcsubcode = m.fsubcode
		inner join student st on m.fregno = st.fregno
		and m.fdegree = st.fdegree
		where m.fdegree = '{$this->degcode}'
		and st.fsection ='{$this->section}'
		and m.fexamno = '{$this->sem}'
		and m.fcollcode = '{$this->collcode}'
		order by s.fsubcode";


		
		$subhead = $aobj_context->mobj_db->GetAll($query);

		$query = "select m.fregno,left(st.fname,25) as fname,
		ifnull(s.fattent,'') as fattent,
		group_concat(s.fvalmax, '|',ifnull(a.fper,'-'),'|',ifnull(m.fmarks,'-'),'|',s.fsubshort,'|',ifnull(s.fattent,'') order by s.fsubcode SEPARATOR '*' ) as subdet 
		from marks m 
		inner join attend a on m.fcollcode = a.fcollcode
		and m.fdegree = a.fdegree and m.fexamno = a.fexamno and m.fregno = a.fregno
		and left(m.fsubcode,4) = left(a.fsubcode,4)
		inner join student st on m.fregno = st.fregno and m.fcollcode = st.fcollcode
		and m.fdegree = st.fdegree
		inner join subject s on m.fdegree = s.fdegree 
		and m.fexamno = s.fexamno 
		and m.fsubcode = s.fcsubcode
		where m.fdegree = '{$this->degcode}'
		and st.fsection ='{$this->section}'
		and m.fexamno = '{$this->sem}'
		and m.fcollcode = '{$this->collcode}'
		group by m.fregno";
		
		$res = $aobj_context->mobj_db->GetAll($query);

		$subcount = 0;
		foreach($res as $val)
		{
			if(count(explode('*',$val['subdet'])) > $subcount){
				$subcount = count(explode('*',$val['subdet']));
			}
		}

		$explode = explode('*',$res['0']['subdet']);
        $pdf->SetMargins(5,40,5,20);

        $pdf->startPageGroup();
        $pdf->AddPage("L","A3");
		$pdf->ln(10);
   	
        $pdf->SetFont('Times','B',9);	
		$this->pdf->cell(10,6, "Sl.","LRT",0,"C");
		$this->pdf->cell(25,6, "USN","LRT",0,"C");
		$this->pdf->cell(50,6, "Name","LRT",0,"C");
		$subarryhead = []; 
		
			foreach($subhead as $val)
			{
				$sub = $val['fsubshort'];
				array_push($subarryhead,$sub);
				$this->pdf->cell(24,6,$sub,"LRT",0,"C");
			}
			$this->pdf->cell(25,6,'Student','LRT',1,"C");

			$this->pdf->cell(10,6, "No.","LRB",0,"C");
			$this->pdf->cell(25,6, "","LRB",0,"C");
			$this->pdf->cell(50,6, "","LRB",0,"C");

			foreach($subhead as $val)
			{
				$this->pdf->cell(8,6,'Att.',"1",0,"L");	
				$this->pdf->cell(8,6, "CIE","1",0,"C");
				$this->pdf->cell(8,6, "Eligi.","1",0,"C");
			}

			$this->pdf->cell(25,6,'Signature',"LRB",1,"C");
			$pdf->SetFont('Times','',9);	
			
			$k = 1;

		foreach($res as $value)
		{
			$fregno = $value['fregno'];
			$fname  = $value['fname'];
			$subdet  = $value['subdet'];
			$subarry = explode("*",$subdet);

			$pdf->SetFont('Times','',9);
			$this->pdf->cell(10,7, $k,"1",0,"C");
			$this->pdf->cell(25,7,$fregno,"1",0,"L");
			$pdf->SetFont('Times','',8);
			$this->pdf->cell(50,7,$fname,"1",0,"L");
			// $this->pdf->cell(1,6,'',0,1,"C");
			$pdf->SetFont('Times','',9);
			

			$subcnt = count($subarry);
			
			$z = 0;
			$h = 0;
			$a = 0;
			while($subcnt >$z)
			{	
				$subl = explode("|",$subarry[$z]);
			
				$maxmarks = $subl[0];
				
				$subshort = $subl[3];
				
				if($subshort == $subarryhead[$h])
				{

					$this->pdf->cell(8,7,$subl[1],"B",0,"C");	
					
					if($subl[2] == '-2')
						$this->pdf->cell(8,7,'AB',"B",0,"C");
					else 
						$this->pdf->cell(8,7,$subl[2],"B",0,"C");
					
					$ia = ceil(($subl[2]/$maxmarks)*100);

					$elg = '';
					$att = $subl[1];
					$pdf->SetFont('Times','',9);

					if($ia <50 || ($att <=75 && $att != '-') || $subl[2] == '-2')
					{	
						$pdf->SetFont('Times','',9);	
						$elg = 'NE';
					}

					$this->pdf->cell(8,7,$elg,"BR",0,"C");
					$pdf->SetFont('Times','',9);
					$z++;
				}else
				{
					$this->pdf->cell(8,7,'',"B",0,"C");
					$this->pdf->cell(8,7,'-',"B",0,"C");
					$this->pdf->cell(8,7,"","BR",0,"C");
				}
				$a++;
				$pdf->SetFont('Times','',9);
			
				//
				$h++;
			}
		
			//var_dump($fregno,$a,count($subhead));
			for($i = $a;$i<count($subhead);$i++)
			{
				
				$this->pdf->cell(8,7,'',"B",0,"C");
				$this->pdf->cell(8,7,'-',"B",0,"C");
				$this->pdf->cell(8,7,"","BR",0,"C");
			}
			
			
			$this->pdf->cell(25,7,'',1,1,"C");

			if($this->pdf->GetY()>250)
			{
				$pdf->startPageGroup();
				$pdf->AddPage("L","A3");
				$pdf->ln(10);

				$pdf->SetFont('Times','B',9);	
				$this->pdf->cell(10,6, "Sl.","LRT",0,"C");
				$this->pdf->cell(25,6, "USN","LRT",0,"C");
				$this->pdf->cell(50,6, "Name","LRT",0,"C");
				
		
				foreach($subhead as $val)
				{
					$sub = $val['fsubshort'];
					$this->pdf->cell(24,6,$sub,"LRT",0,"C");
				}

				$this->pdf->cell(25,6,'Student','LRT',1,"C");

				$this->pdf->cell(10,6, "No.","LRB",0,"C");
				$this->pdf->cell(25,6, "","LRB",0,"C");
				$this->pdf->cell(50,6, "","LRB",0,"C");

				foreach($subhead as $val)
				{
					$this->pdf->cell(8,6,'Att.',"1",0,"L");	
					$this->pdf->cell(8,6, "CIE","1",0,"C");
					$this->pdf->cell(8,6, "Eligi.","1",0,"C");
				}

				$this->pdf->cell(25,6,'Signature',"LRB",1,"C");
				$pdf->SetFont('Times','',9);	
			}

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

}

function attiacombinedReportnew_sjbit($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$degcode = trim($aobj_context->mobj_data["degcode"]);
	$sem = trim($aobj_context->mobj_data["sem"]);
	$section = trim($aobj_context->mobj_data["section"]);
	$collcode = $_SESSION['collcode'];

	$class_obj=new ra_invigilators_dairy();
    $class_obj->DefaultConstructor($aobj_context);
	$class_obj->formcolldata();
	$class_obj->writepdf($aobj_context);
	$class_obj->SendOutput();
}



?>