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 : 18.227.0.21


Current Path : /var/www/html/suk_discontinued/Report_details/
Upload File :
Current File : /var/www/html/suk_discontinued/Report_details/report_iamarks_pending.php

<?php
function Generateiamarkspendingreport($aobj_context)
{	
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  

	$coll_from = $aobj_context->mobj_data["coll_from"];
	$coll_to = $aobj_context->mobj_data["coll_to"];
	$degree_code_from = $aobj_context->mobj_data["degree_code_from"];
	$degree_code_to = $aobj_context->mobj_data["degree_code_to"];
	$Examno_from = $aobj_context->mobj_data["Examno_from"];
	$Examno_to = $aobj_context->mobj_data["Examno_to"];
	$reg_from = $aobj_context->mobj_data["reg_from"];
	$reg_to = $aobj_context->mobj_data["reg_to"];

	$iapennding = $aobj_context->mobj_data["iapennding"]; 
	$FCODEorSHRTNAME = $aobj_context->mobj_data["search_field"];	
	$Reglist_start = substr("00000000".$aobj_context->mobj_data["subwise_start"],-8); 
	$Reglist_end = substr("zzzzzzzz".$aobj_context->mobj_data["subwise_end"],-8); 
	
	$main_src_obj=(explode("/",$_SERVER["REQUEST_URI"]));
	$main_src=$main_src_obj[1];
	$pdf_writer_class=$aobj_context->main_src."/maya-pdf/fpdf.php";
	$root_pdf_file_download=$aobj_context->main_src."/Report_details/output/report_me_student_list.pdf";
	$page_header_university = "select FUNIVNAME,FTOWN, date_format(now(),'%d/%m/%Y') as date from control";
	$lobj_page_header_university = $aobj_context->mobj_db->GetRow($page_header_university);
	
	// global varibales
	$p_count =1;
// end global varibales	
	include($pdf_writer_class);		
	$pdf= new FPDF();
	//$pdf->$title='20000 Leagues Under the Seas';
	//$pdf->selectFont('./fonts/Helvetica.afm');
	$pdf->SetFont('Times','',10);
	$pdf->SetMargins(6,13);		
	$pdf->AliasNbPages();	

// query for the page header
	if($iapennding === true)
	{	//var_dump($iapennding);
		$query = " select mk.fcollcode, mk.fdegree, mk.fexamno, mk.fsubcode, 
		 concat(s.fsubname, ', ', s.fssubname) as fsubname,count(mk.fregno) as ftotcnt, sum(case when ifnull(mk.fmarks,-1) = -1 then 1 else 0 end) as fpend  from marks mk,subject s
		 where  mk.fdegree = s.fdegree and mk.fexamno = s.fexamno and mk.`FSUBCODE` = s.`FCSUBCODE`
		 and s.fintass = 'T' and s.fretain = 'T'
		 and s.FTHEORY='T' AND s.FINTASS='T' AND IFNULL(s.FRETAIN,'F')='T'
		 and mk.fcollcode between '{$coll_from}' and '{$coll_to}'
		 and mk.fdegree between '{$degree_code_from}' and '{$degree_code_to}' 
		 and mk.fexamno between '{$Examno_from}' and '{$Examno_to}'  and mk.fregno between '{$reg_from}' and '{$reg_to}'  
		 group by mk.fcollcode, mk.fdegree, mk.fexamno, mk.fsubcode, s.fsubname, s.fssubname ";
		 //var_dump($query);
		
	}else
	{
		$update = "SET SESSION group_concat_max_len = 1000000";
		$aobj_context->mobj_db->Execute($update);
		$query = "select concat(mk.fcollcode,' - ',c.fcollname) as fcollcode,concat(mk.fdegree,' - ',d.FDESCPN) as fdegree, CONCAT(mk.fexamno,' - ',d.fexamname) AS fexamno, mk.fsubcode, GROUP_CONCAT(if(mk.fmarks=-1,mk.fregno,'')) as Regno,
		concat(s.fsubname, ', ', s.fssubname) as fsubname,
		count(cs.fregno) as ftotcnt, sum(case when ifnull(mk.fmarks,-1) = -1 then 1 else 0 end) as fpend 
		from marks mk, canddet cd, candsum cs, subject s,degree d,college c 
		where mk.fdegree = s.fdegree and mk.fexamno = s.fexamno 
		and mk.fsubcode = s.fcsubcode and mk.fdegree = cd.fdegree and mk.fexamno = cd.fexamno 
		and d.fdegree = cs.fdegree and d.fexamno = s.fexamno
		and c.fcollcode = cs.fcollcode
		and mk.fregno = cd.fregno and cd.fdegree = s.fdegree and cd.fexamno = s.fexamno and cd.fsubcode = s.fsubcode 
		and cd.fdegree = cs.fdegree and cd.fregno = cs.fregno 
		and ifnull(cd.fpassmth,'') = '' and s.fintass = 'T' and s.fretain = 'T'
		and s.FTHEORY='T' AND s.FINTASS='T' AND IFNULL(s.FRETAIN,'F')='T'
		and mk.fcollcode between '{$coll_from}' and '{$coll_to}'
		and cs.frecptdate is not null and cs.ftotalfee > '0' and cd.fpresent = 'P' and ifnull(cd.FPASSMTH,'') = ''
		and mk.fdegree between '{$degree_code_from}' and '{$degree_code_to}' 
		and mk.fexamno between '{$Examno_from}' and '{$Examno_to}'  and mk.fregno between '{$reg_from}' and '{$reg_to}'  
		group by mk.fcollcode, mk.fdegree, mk.fexamno, mk.fsubcode, s.fsubname, s.fssubname 
		having sum(case when ifnull(mk.fmarks,-1) = -1 then 1 else 0 end) > 0 
		order by mk.fcollcode, mk.fdegree, mk.fexamno, mk.fsubcode";
		//var_dump($query);
	
	}
	$pdf->SetFont('Times','B',14);	
	$pdf->aobj_context =$aobj_context;
	$pdf->WhichReport = 'iamarks_pending';
	$pdf->FUNIVNAME = $lobj_page_header_university[FUNIVNAME];
	$pdf->coll_from = $coll_from;
	$pdf->coll_to = $coll_to;
	$pdf->deg_from = $degree_code_from;
	$pdf->deg_to = $degree_code_to;
	$pdf->Examno_from = $Examno_from;
	$pdf->Examno_to = $Examno_to;
	$pdf->reg_from = $reg_from;
	$pdf->reg_to = $reg_to;
	$pdf->FTOWN = $lobj_page_header_university[FTOWN]; //$
	$pdf->date_1 = $lobj_page_header_university['date'];

	$pdf->SetFont('Times','B',9);	 		  
	$lobj_get_student_data = $aobj_context->mobj_db->GetAll($query);
	//$first = true;
	$count=1;
	$pdf->AddPage();
	foreach($lobj_get_student_data as $key => $value)
	{		
		$linewidth = 205;
		$lleftmargin = 6;
		$lrightmargin = 8;
		//$pdf->AddPage();
		$new_y=$pdf->GetY();
		if($new_y>=265)
		{	
			$pdf->AddPage();
		}
		
		$count++;
		$pdf->ln(4);
		
		$new_y=$pdf->GetY();
		$pdf->Line($lleftmargin,$new_y, $linewidth,$new_y); 
		$pdf->Line($lleftmargin,$new_y+.5, $linewidth,$new_y+.5);
		$pdf->SetFont('Courier','B',9);
		$pdf->Cell(30,5,'',0,0,'L');
		$pdf->Cell(150,5,'College :'.$value['fcollcode'],0,1,'C');
		$pdf->Cell(30,5,'',0,0,'L');
		$pdf->Cell(150,5,'Degree :'.$value['fdegree'].'	     Semester: '.$value['fexamno'],0,1,'C');
		$pdf->Cell(30,5,'',0,0,'L');
		$pdf->Cell(150,5,'Subject: '.$value['fsubcode'].' - '.$value['fsubname'],0,1,'L');		
		$new_y=$pdf->GetY();
		$pdf->Line($lleftmargin,$new_y, $linewidth,$new_y); 
		$pdf->Line($lleftmargin,$new_y+.5, $linewidth,$new_y+.5);
		$pdf->ln(4);
		$pdf->SetFont('Courier','',9);
		$j=1;
		$pdf->Cell(18,4,'',0,0,'C');
		if($value['fpend']>0)
		{
			$Regno=explode(',',$value['Regno']);
			for($i=0;$i<=count($Regno);$i++)
			{
				if($Regno[$i]!=''){
					$pdf->Cell(25,4,$Regno[$i],0,0,'C');
					if($j>=6)
					{
						$new_y=$pdf->GetY();
						if($new_y>=265)
						{	
							$pdf->AddPage();
							$pdf->ln(4);
							
							$new_y=$pdf->GetY();
							$pdf->SetFont('Courier','',9);
							$pdf->Line($lleftmargin,$new_y, $linewidth,$new_y); 
							$pdf->Line($lleftmargin,$new_y+.5, $linewidth,$new_y+.5);
							$pdf->SetFont('Courier','B',9);
							$pdf->Cell(30,5,'',0,0,'L');
							$pdf->Cell(150,5,'College :'.$value['fcollcode'],0,1,'C');
							$pdf->Cell(30,5,'',0,0,'L');
							$pdf->Cell(150,5,'Degree :'.$value['fdegree'].'	     Semester: '.$value['fexamno'],0,1,'C');
							$pdf->Cell(30,5,'',0,0,'L');
							$pdf->Cell(150,5,'Subject: '.$value['fsubcode'].' - '.$value['fsubname'],0,1,'L');		
							$new_y=$pdf->GetY();
							$pdf->Line($lleftmargin,$new_y, $linewidth,$new_y); 
							$pdf->Line($lleftmargin,$new_y+.5, $linewidth,$new_y+.5);
							$pdf->SetFont('Courier','',9);
						}	
						$pdf->ln(4);
						$pdf->Cell(18,4,'',0,0,'C');
						$j=0;
					}
					$j++;
				}
			}
		}
		$pdf->ln(4);
		$new_y=$pdf->GetY();
		$pdf->Line($lleftmargin,$new_y, $linewidth,$new_y);
		$pdf->Line($lleftmargin,$new_y+.5, $linewidth,$new_y+.5);
		$pdf->SetFont('Courier','B',9);
		$pdf->ln(3);
		$pdf->Cell(18,4,'',0,0,'C');
		$pdf->Cell(150,4,'IA Marks required for '.$value['fpend'].' students',0,0,'L');
		$pdf->ln(3);
	}
	$pdf->ln(3);
	$new_y=$pdf->GetY();
	$pdf->Line($lleftmargin,$new_y, $linewidth,$new_y); 
	$pdf->Line($lleftmargin,$new_y+.5, $linewidth,$new_y+.5);	
			
	$pdf->Output("report_me_student_list.pdf","D");
}
?>