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


Current Path : /var/www/oasis/Report_details/
Upload File :
Current File : /var/www/oasis/Report_details/college_pending_markslist.php

<?php
function Generatecollegeiamarkspendingreport($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"]; */
	session_start();
	$college_code = $_SESSION['collcode'];
	$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);

	$get_data="SELECT c.FCOLLCODE,
			CONCAT(c.FCOLLCODE, ' - ', c.FCOLLNAME,', ',c.FTOWN) AS FCOLLNAME FROM college c
			where c.FCOLLCODE='{$_SESSION['collcode']}'";
		 
	$obj_student=$aobj_context->mobj_db->GetRow($get_data); 
	// var_dump($obj_student['FCOLLNAME']);
	
	// 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(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 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 = '{$college_code}'
		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";
		
	}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,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 = '{$college_code}'
		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 ";
	}


	$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;
	
	foreach($lobj_get_student_data as $key => $value)
	{		
		$linewidth = 205;
		$lleftmargin = 6;
		$lrightmargin = 8;	
		if($first)
		{
			$pdf->AddPage();
			
			$pdf->SetFont('Courier','B',9);	
			$Count_subject=1;
			$DUP_FCSUBCODE='';
			$pdf->Cell(0,4,$obj_student['FCOLLNAME'],0,1,'C');
		//	$lreprange1 = "    College Range      : ".$coll_from." - ".$coll_to;
			$lreprange2 = "Degree Range       : ".$degree_code_from;
			$lreprange3 = "Exam Range         : ".$Examno_from;
			$lreprange4 = "Register No. Range : ".$reg_from." - ".$reg_to;
			$pdf->Cell(0,4,$lreprange1,0,1,'C');
			$pdf->Cell(0,4,$lreprange2,0,1,'C');
			$pdf->Cell(0,4,$lreprange3,0,1,'C');
			$pdf->Cell(0,4,$lreprange4,0,1,'C');
		
			
			$lhead1=" Sl.    Subject    Subject                                            Total   I.A";
			$lhead2=" No.    Code       Name                                               Count   Pending ";
			
			$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(200,5,$lhead1,"0",1,'L');
			$pdf->Cell(200,5,$lhead2,"0",1,'L');
			$pdf->SetFont('Courier','',9);
			$new_y=$pdf->GetY();
			$pdf->Line($lleftmargin,$new_y, $linewidth,$new_y); 
			$pdf->Line($lleftmargin,$new_y+.5, $linewidth,$new_y+.5);
		}
		
		// $line1 = substr(str_repeat(' ', 4).$count,-10);	
		$line1 = substr($count.str_repeat(' ', 20),0,7);		
		$line1.= " ".substr($value['fsubcode'].str_repeat(' ', 20),0,10);
		$line1.= " ".substr($value['fsubname'].str_repeat(' ', 45),0,51);
		$line1.= " ".substr($value['ftotcnt'].str_repeat(' ', 5),0,7);
		$line1.= " ".substr($value['fpend'].str_repeat(' ', 8),0,8);
		$count++;
		$pdf->Cell(200,5,$line1,"0",1,'L');
		$first = false;
		if($count%45==0)
		{	
			$first = true;
			$new_y=$pdf->GetY();
			$pdf->Line($lleftmargin,$new_y, $linewidth,$new_y); 
			$pdf->Line($lleftmargin,$new_y+.5, $linewidth,$new_y+.5);	
		}
	}
	$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","I");
}
?>