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


Current Path : /proc/thread-self/root/var/www/html/mcu/Report_details_stop/
Upload File :
Current File : //proc/thread-self/root/var/www/html/mcu/Report_details_stop/roomallotmantsummary.php

<?php
function Generateroomallotmantsummary($aobj_context)
{	
	session_start();
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
    $college_code = $_SESSION['collcode']; 
	$FUNIVCODE = $_SESSION['FUNIVCODE'];
	//echo $college_code; 
 
	$frm_date = $aobj_context->mobj_data["frm_date"]; 
	$session = $aobj_context->mobj_data["session"]; 

	$main_src_obj=(explode("/",$_SERVER["REQUEST_URI"]));
	$main_src=$main_src_obj[1];
	$pdf_writer_class=$aobj_context->main_src."/maya-pdf/fpdf.php";
	$tarkaheader=$aobj_context->main_src."/Report_details/tarkaheader.php";
	$root_pdf_file_download=$aobj_context->main_src."/Report_details/output/report_admission_list.pdf";
// global varibales
	$p_count =1;
// end global varibales	
	include($pdf_writer_class);		
	$pdf= new FPDF();
	//$pdf->$title='20000 Leagues Under the Seas';
	$pdf->SetFont('Times','',10);
	$pdf->SetMargins(43,9.5);		
	$pdf->AliasNbPages();	
	$sub_degree_cond="";

	$page_header_university = "select c.FUNIVNAME,c.FTOWN,concat(d.fcollname,', ',d.ftown) as fcollname, date_format(now(),'%d/%m/%Y') as date from control c,college d where d.fcollcode='{$college_code}'";
	$lobj_page_header_university = $aobj_context->mobj_db->GetRow($page_header_university);
	
	
	$pdf->aobj_context =$aobj_context ;
	$pdf->WhichReport = 'roomallotmentsummary';
	$pdf->FUNIVNAME = $lobj_page_header_university['FUNIVNAME'];
	$pdf->FTOWN = $lobj_page_header_university['FTOWN'];
	$pdf->college_name = $lobj_page_header_university['fcollname'];
	$pdf->frm_date = $frm_date;
	$pdf->session = $session;
	$pdf->date_1 = $lobj_page_header_university['date'];

	if($session== 'both')
	{
		$sectionvalue = "";
	}
	else 
	{
		$sectionvalue = "and s.fsession like '{$session}'";
	}	

	/*$get_subject_data = "select cd.fdegree,cd.fexamno,cd.fcollcode,s.FQPCODE as qpcode,
						cd.fsubcode,mr.froomname as roomname,mr.fcapacity,
						COUNT(cd.fhallno) as fcount
						from canddet cd, masroom mr, subject s  
						where mr.froomno = cd.fhallno and cd.fdegree = s.fdegree and cd.fexamno = s.fexamno 
						and s.FSUBCODE = cd.FSUBCODE and ifnull(fqpcode,'') <> '' and ifnull(cd.fpresent,'') = 'P' and mr.fcollcode='{$college_code}'
						{$sectionvalue} and s.fdoe = date_format(STR_TO_DATE('{$frm_date}', '%d/%m/%Y'),'%Y-%m-%d')
						group by cd.fhallno,s.fqpcode order by cd.fhallno, s.fqpcode"; */

	$get_subject_data = "select mr.fcollcode,s.FQPCODE as qpcode,mr.froomno,mr.froomname as roomname,mr.fcapacity,
						COUNT(cd.fhallno) as fcount
						from canddet cd, masroom mr, subject s ,candsum cs 
						where cs.fcntrcode=mr.fcollcode and mr.fcollcode='{$college_code}' and
						mr.froomno = cd.fhallno and cd.fdegree = s.fdegree and cd.fexamno = s.fexamno 
						and mr.fcollcode=cs.fcntrcode and cd.fdegree=cs.fdegree and cd.fcollcode=cs.fcollcode and cd.fregno=cs.fregno
						and s.FSUBCODE = cd.FSUBCODE and ifnull(fqpcode,'') <> '' and ifnull(cd.fpresent,'') = 'P' 
						{$sectionvalue} and s.fdoe = date_format(STR_TO_DATE('{$frm_date}', '%d/%m/%Y'),'%Y-%m-%d')
						group by mr.fcollcode,cd.fhallno,s.fqpcode order by cd.fhallno, s.fqpcode";

	//var_dump($get_subject_data);
	$aobj_context->mobj_db->execute("SET @@session.group_concat_max_len=1000000");
	$lobj_subject_data = $aobj_context->mobj_db->GetAll($get_subject_data);	
 	//var_dump($get_subject_data);
	  //print_r($get_subject_data); die();
	$pdf->fddate=$lobj_subject_data[0][fddate];
		$pdf->AddPage();	
	//$pdf->Ln();
	$pdf->SetFont('Times','B',10);
	$i = 1;
	$oldromm = "";
	$newromm = "";
			$pdf->Cell(15,5,'Sl. No.','1',0,'C');
			$pdf->Cell(45,5,'Room Name','1',0,'C');
			$pdf->Cell(25,5,'Room Capacity','1',0,'C');
			$pdf->Cell(30,5,'QP Code Alloted','1',0,'C');
			$pdf->Cell(25,5,'Student Count','1',1,'C');
			$pdf->SetFont('Times','',10);
	foreach($lobj_subject_data as $key => $value)
	{	

		if($pdf->GetY() > 270)
		{
			$pdf->AddPage();
			$pdf->Cell(15,5,'Sl. No.','1',0,'C');
			$pdf->Cell(45,5,'Room Name','1',0,'C');
			$pdf->Cell(25,5,'Room Capacity','1',0,'C');
			$pdf->Cell(30,5,'QP Code Alloted','1',0,'C');
			$pdf->Cell(25,5,'Student Count','1',1,'C');
			$pdf->SetFont('Times','',10);
		}
		
		$newromm = $value['froomno'];
		if($oldromm != $newromm)
		{
			$oldromm = $value['froomno'];
			$pdf->Cell(15,5,$i,'LRT',0,'C');
			$pdf->Cell(45,5,$value['roomname'],'LRT',0,'L');
			$pdf->Cell(25,5,$value['fcapacity'],'LRT',0,'C');
			$pdf->Cell(30,5,$value['qpcode'],'LRT',0,'C');
			$pdf->Cell(25,5,$value['fcount'],'LTR',1,'R');
			$i++;
		}
		else
		{
			$pdf->Cell(15,5,'','LR',0,'C');
			$pdf->Cell(45,5,'','LR',0,'L');
			$pdf->Cell(25,5,'','LR',0,'C');
			$pdf->Cell(30,5,$value['qpcode'],'LR',0,'C');
			$pdf->Cell(25,5,$value['fcount'],'LR',1,'R');
		}
		
	}
	$pdf->Cell(140,5,'','T',1,'C');
	$pdf->Output("Roomsummay.pdf","D");
} 
?>