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


Current Path : /var/www/html/nitte/Report_details/
Upload File :
Current File : /var/www/html/nitte/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)
	{
		$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 ";
	}else
	{
		$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, canddet cd, candsum cs, subject s 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 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 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";

	}
	$pdf->SetFont('Times','B',14);	
	$pdf->aobj_context =$aobj_context;
	$pdf->WhichReport = 'iamarks_pending';
	$pdf->FUNIVNAME = $lobj_page_header_university[FUNIVNAME];
	$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;
	
	foreach($lobj_get_student_data as $key => $value)
	{			
			if($first)
			{
				$pdf->AddPage();
				$pdf->Ln(5);
				$pdf->SetFont('Courier','',9);	
				$Count_subject=1;
				$DUP_FCSUBCODE='';

				//$count=1;
				$lhead1=" Sl. Coll. Degree Examno   Subject        Subject                                    Total   I.A";
				$lhead2=" No. Code                  Code           Name                                       Count   Pending ";
				$pdf->Cell(200,5,$lhead1,"1",0,'L');
				$pdf->Cell(200,5,$lhead2,"1",1,'L');
			}
	
			$line1=substr(str_repeat(' ', 3).$count,-3);
			$line1.=" ".substr($value['fcollcode'].str_repeat(' ', 8),0,8);
			$line1.=" ".substr($value['fdegree'].str_repeat(' ', 8),0,8);
			$line1.=" ".substr($value['fexamno'].str_repeat(' ', 8),0,8);
			$line1.=" ".substr($value['fsubcode'].str_repeat(' ', 10),0,10);
			$line1.=" ".substr($value['fsubname'].str_repeat(' ', 45),0,45);
			$line1.=" ".substr($value['ftotcnt'].str_repeat(' ', 5),0,5);
			$line1.=" ".substr($value['fpend'].str_repeat(' ', 8),0,8);
			$count++;
			$pdf->Cell(200,5,$line1,"1",1,'T');
			$first = false;
			if($count%40==0)
			{	
				
				$first = true;
				
			}
	}			
	$pdf->Output("report_me_student_list.pdf","D");
}
?>