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


Current Path : /proc/thread-self/root/var/www/oasis/Report_details/
Upload File :
Current File : //proc/thread-self/root/var/www/oasis/Report_details/report_batch_wise_details.php

<?php

$main_src=substr($_SERVER['SCRIPT_FILENAME'],0,strlen($_SERVER['SCRIPT_FILENAME'])-7);
$pdf_writer_class =$main_src."/tarka_pdf_latest/fpdf.php";	
require_once($pdf_writer_class);
class batch_wise_detail_report extends FPDF
 {
	public $aobj_context;
	public $college_name;	
	public $town;	
	public $address;	
	public $Degree_name;	

function Default_construstor($aobj_context)
		{
			 require_once($aobj_context->main_src.'src/format.php');
			$this->aobj_context=$aobj_context;
			$this->collcode=$_SESSION['collcode'];
			include($this->pdf_writer_class);		
			session_start();
			$this->report_id = $aobj_context->mobj_data["report_id"];
			// var_dump($this->report_id);DIE();
			$this->degree = $aobj_context->mobj_data['degree']; 
			// $this->degree_name = $aobj_context->mobj_data['degree_name']; 
			//echo $this->degree_name;die();
			$this->exam = $aobj_context->mobj_data['exam'];
			//var_dump($aobj_context); 
			$this->subject   = $aobj_context->mobj_data["sub"];
			//var_dump($aobj_context->mobj_data["sub"]);   
			$this->sub_name   = $aobj_context->mobj_data["sub_name"];
			//var_dump($this->sub_name);
			$this->from_batch=  $aobj_context->mobj_data["from_batch"] ; 
			$this->to_batch=  $aobj_context->mobj_data["to_batch"] ; 
			$this->fs_sub_name=  $aobj_context->mobj_data["fs_sub_name"] ; 

			$this->pdf=  new FPDF();
			$this->pdf=$this;	
			$get_date_time="SELECT DATE_FORMAT(now(),'%d-%b-%Y %H:%m %r') as dt";
			$ob_dt = $this->aobj_context->mobj_db->GetRow($get_date_time); 
			$this->date_time=$ob_dt['dt'];
		}

function Header()
{
		$FUNIVCODE = $_SESSION['FUNIVCODE'];
		  $page_header_college ="select concat(FTOWN,', ',FUNIVADD1) as address,FUNIVNAME as college_name ,
								pdf_logo_path as pdf_logo_path,
								ifnull(fdegas,'Degree') as fdegas,
								ifnull(fcollas,'College') as fcollas,
								ifnull(fsubas,'Subject') as fsubas,
								ifnull(FREGROLL,'Reg. No.') as FREGROLL 
								from control ";
		 //echo $page_header_college;die();
		$lobj_page_header_college = $this->aobj_context->mobj_db->GetRow($page_header_college); 
		$this->coll_name = $lobj_page_header_college['college_name']; 
		$this->address = $lobj_page_header_college['address']; 

		$this->fdegas = $lobj_page_header_college['fdegas'];
		$this->fcollas = $lobj_page_header_college['fcollas'];
		$this->fsubas = $lobj_page_header_college['fsubas'];
		$this->FREGROLL = $lobj_page_header_college['FREGROLL']; 

		$this->pdf_logo_path = $this->aobj_context->main_src.'/'.$_REQUEST['db']."/".$lobj_page_header_college['pdf_logo_path']; 
		$get_college_name="select concat(FCOLLNAME,', ',FTOWN) as col_name from college where FCOLLCODE='{$this->collcode}'";
			$this->lobj_get_college_name = $this->aobj_context->mobj_db->GetRow($get_college_name);
			 
			$this->col_name=$this->lobj_get_college_name['col_name'];
			
			$get_exam_date="select FEXAMDATE as exam_date,FEXAMNAME,fdescpn from degree where FDEGREE='{$this->degree}' and fexamno = '{$this->exam}'";
			$this->lobj_get_exam_date = $this->aobj_context->mobj_db->GetRow($get_exam_date);
			$this->exam_date=$this->lobj_get_exam_date['exam_date'];
			$this->FEXAMNAME=$this->lobj_get_exam_date['FEXAMNAME'];
			$this->degree_name=$this->lobj_get_exam_date['fdescpn'];
			
			$query = "select fsubname,FSSUBNAME,fsubshort from subject  where fcsubcode = '{$this->subject}' and fdegree = '{$this->degree}' and fexamno = '{$this->exam}'";
			
			$this->results = $this->aobj_context->mobj_db->GetRow($query);

			$img_logo_path=$this->aobj_context->main_src. '/'.$this->aobj_context->mobj_data["db"]."/img/report_uni_logo.jpg";
			
				$this->fs_sub_name = $this->results['FSSUBNAME'];
				$this->sub_name = $this->results['fsubname'];
				// only for jssstu
				$this->fsubshort = $this->results['fsubshort'];
				if($FUNIVCODE == '052' || $FUNIVCODE == '055')
				{
					$subject = $this->fsubshort;
				}else{
					$subject = $this->subject;
				}

				if($FUNIVCODE == '052')
				{
					$this->pdf->SetFont('Times','B',9);
					$this->pdf->Cell(0,5,"JSS MAHAVIDYAPEETHA",0,1,'C'); 
				}
				
				if($FUNIVCODE == '055')
				{	$this->pdf->Image($img_logo_path,30,2,140,20);
					$this->pdf->Ln(15);
				}else
				{

					$this->pdf->SetFont('Times','B',14);	
					$this->pdf->Cell(0,4,$this->coll_name,0,1,'C'); 
					$this->pdf->SetFont('Times','',8);	
					$this->pdf->Cell(0,4,$this->address,0,0,'C'); 
					$this->pdf->SetFont('Times','B',12);	
					$this->pdf->Cell(0,4,"Page {$this->pdf->PageNo()}/{nb}",0,1,'R'); 
					$this->pdf->Ln(2);
					$this->pdf->SetFont('Times','B',11);
					$this->pdf->Cell(0,4,$this->fcollas." : ".$this->collcode." ".$this->col_name,0,1,'C');
				}

				$this->pdf->Ln(1);
				$this->pdf->SetFont('Times','',11);
				
				$this->pdf->Cell(0,6,'   '.$this->fdegas." : ".$this->degree." - ".$this->degree_name ,0,1,'C');
				$this->pdf->Cell(0,6," Exam : {$this->FEXAMNAME} - ".$this->exam_date ,0,1,'C');

				$this->pdf->Ln(1);

				$this->pdf->Cell(0,6,$this->fsubas." : "." ".$subject." - ".$this->sub_name ."(". $this->fs_sub_name.")",0,1,'C');
				$this->pdf->Ln(1);
				$this->pdf->SetFont('Times','BU',12);
				$this->pdf->Cell(0,6,' Batchwise Student List',0,1,'C');
			 
			if(file_exists($this->pdf_logo_path)) 
			 {
				if($FUNIVCODE == '052')
					$this->pdf->Image($this->pdf_logo_path,5,5,37,15);
				else if($FUNIVCODE == '055')
				{

				}
				else
			  		$this->pdf->Image($this->pdf_logo_path,5,7,20);	
			 
			}							
	 
}	

	function GenerateBatchSetupDetails()
	{			 
				
		
	}
	function GetQuery()
	{
				$get_records = "select lpad(mak.FBATCH,2,'0') as FBATCH_NO ,sub.FSUBNAME,group_concat( distinct stu.FREGNO order by stu.FREGNO) AS FBATCH,
				sub.FCSUBCODE,FSUBNAME,FSSUBNAME,
				count( distinct stu.FREGNO) as batch_cnt
				FROM student stu inner join marks_pr mak ON stu.FREGNO=mak.FREGNO 
				and mak.Fdegree='{$this->degree}' and mak.Fexamno='{$this->exam}' and mak.FCOLLCODE='{$this->collcode}'
				inner join subject sub on sub.FCSUBCODE = mak.FSUBCODE 
				and sub.FCSUBCODE='{$this->subject}'
				and mak.FBATCH>='{$this->from_batch}' and mak.FBATCH<='{$this->to_batch}' 
				and sub.FDEGREE='{$this->degree}' and sub.FEXAMNO='{$this->exam}'
					
				WHERE stu.FREGNO != ''  and IFNULL(mak.FBATCH, '0')>0 
				group by mak.FBATCH order by  lpad(mak.FBATCH,2,'0')  ";
		//var_dump($get_records); 
		//die();
		$this->aobj_context->mobj_db->execute("SET @@session.group_concat_max_len=10000");
		$this->lobj_get_records = $this->aobj_context->mobj_db->GetAll($get_records);
	 
			$this->pdf->SetMargins(10,5);
			$this->pdf->AddPage();	
			$this->pdf->Rect(4,03,200,280);
			foreach($this->lobj_get_records as $k=>$v)
			{
				$FBATCH_NO=$v['FBATCH_NO'];
				
				$batch_cnt=$v['batch_cnt'];
				$FBATCH=$v['FBATCH'];
				$this->subject=$v['FCSUBCODE'];
				$this->sub_name=$v['FSUBNAME'];
				$this->fs_sub_name=$v['FSSUBNAME'];
				$FBATCH_arr=(explode(",",$FBATCH));	
				$get_exam_time="select date_format(FEXAMDATE,'%d/%m/%Y') as exam_dt,FEXAMTIME as exam_time,froomname  
				from practical_entry_freeze
								where FCOLLCODE='{$this->collcode}' and FDEGREE='{$this->degree}' and	FEXAM='{$this->exam}'
								and FBATCH={$FBATCH_NO} and FCSUBCODE='{$this->subject}'";
								//var_dump($get_exam_time);
							//	echo $get_exam_time;die();
				$this->lobj_get_exam_time = $this->aobj_context->mobj_db->GetRow($get_exam_time);
				$exam_dt = $this->lobj_get_exam_time['exam_dt'];
				$exam_time = $this->lobj_get_exam_time['exam_time'];
				$froomname = $this->lobj_get_exam_time['froomname'];
				
				
				$count=0;			
				$this->pdf->SetFont('Times','B',10);
				$this->pdf->Ln(7);	
				
				$this->pdf->SetFont('Times','B',12);
				
				if($this->pdf->GetY() > 220)
					$this->pdf->AddPage();

				if($froomname != '')
					$this->pdf->Cell(0,8,"Room Name: $froomname",0,1,'C');

					

				$this->pdf->SetFont('Times','B',10);
				$this->pdf->Cell(0,8,"Batch ".$FBATCH_NO." (No. of Students : {$batch_cnt})   Date : {$exam_dt}    Time : {$exam_time}  ",0,1,'L'); 
				$this->pdf->SetFont('Times','',10);
				$data_set_count =count($FBATCH_arr);
				for($i=0;$i<$data_set_count;$i++)
				{				
					if($count==5)
					{
						$this->pdf->Ln(6);
						$count=0;	
					}
					$this->pdf->Cell(34,6,$FBATCH_arr[$i],1,0,'C'); 
					//$this->pdf->Cell(30,4,$FBATCH_NO,1,0,'C'); 
					$count++;
				}
			}
			
			$this->pdf->Ln(10);
	}

   	function Footer()
	{
		$this->pdf->SetFont('Arial','',8);  
		$this->pdf->setY(-20);
		$this->pdf->Cell(90,3,'Printed Date & Time: '.$this->date_time,'0',0,'L');
	}
 
	function SendOutput()
	{
		$this->pdf->Output("Batch_wise_List_report{$this->report_id}.pdf","I");
	}
}
		
function GenerateBatchSetupDetails($aobj_context)
{
//var_dump($aobj_context);
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
//var_dump($aobj_context);
$class_obj=new batch_wise_detail_report(); 
$class_obj->AliasNbPages();
$class_obj->Default_construstor($aobj_context); 

$class_obj->GetQuery();
 
//$class_obj->GenerateBatchSetupDetails();
$class_obj->SendOutput();
}
?>