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


Current Path : /proc/thread-self/root/var/www/html/stph/Report_details/
Upload File :
Current File : //proc/thread-self/root/var/www/html/stph/Report_details/appfeedetails25022017.php

<?php

function Generateappfeedetails($aobj_context)
{
	session_start();
	$collcode=$_SESSION['collcode'];
	
	ini_set('memory_limit','300M');
	ini_set('max_execution_time',3300);
	
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$filename = 'university_qpcount.csv';
	$f = fopen('php://output', 'w'); 
	
	$coll_from = trim($aobj_context->mobj_data["coll_from"]);
	$coll_to=trim($aobj_context->mobj_data["coll_to"]);

	$deg_from = trim($aobj_context->mobj_data["deg_from"]);
	$deg_to = trim($aobj_context->mobj_data["deg_to"]);

	$exam_from=trim($aobj_context->mobj_data["exam_from"]);
	$exam_to=trim($aobj_context->mobj_data["exam_to"]);

	$cat_from = trim($aobj_context->mobj_data["cat_from"]);
	$cat_to = trim($aobj_context->mobj_data["cat_to"]); 
	
	$reg_from = trim($aobj_context->mobj_data["reg_from"]);
	$reg_to = trim($aobj_context->mobj_data["reg_to"]);
	
	$lowfee = trim($aobj_context->mobj_data["lowfee"]);
	

	$reporttype = "";
		if($owfee == 'T')
		{
			$reporttype = " and ac.FFEETYPE =  'Low Income' and FCATEGORY in('ST','SC')"; 
		}else
		{
			$reporttype = "";
		}
			
		/* $get_data ="select GROUP_CONCAT(ac.fregno,'->',s.fname,'->',ac.FCATEGORY,'->',ac.appno,'->',ac.ftotalfee,'->',ac.frecptdate order by ac.fregno) as app,
					ac.fdegree,ac.fcollcode,SUM(ac.ftotalfee) as amount,ac.fexamno
					from appcandsum ac,student s
					where s.fregno = ac.fregno and s.fdegree = ac.fdegree 
					and ac.fcollcode = s.fcollcode
					and IFNULL(ac.frecptdate,'0000-00-00') <> '0000-00-00' 
					and IFNULL(ac.ftotalfee,'') <> '' 
					and ac.fcollcode between '{$coll_from}' and '{$coll_to}'
					and ac.fregno between '{$reg_from}' and '{$reg_to}'
					and ac.fdegree between '{$deg_from}' and '{$deg_to}' 
					and ac.fexamno between '{$exam_from}' and '{$exam_to}' 
					and ac.FCATEGORY between '{$cat_from}' and '{$cat_to}'
					{$reporttype} and FPAYMENTCONFIRM = 'success'
					group by ac.fcollcode,ac.fdegree,ac.fexamno
					order by ac.fcollcode,ac.fdegree,ac.fexamno,ac.fregno"; */
					
					
				$get_data = "SELECT GROUP_CONCAT(fregno,'->',FCATEGORY,'->',appno,'->',ftotalfee,'->',fackdate  ORDER BY fregno separator '~' ) AS app,
					SUM(ftotalfee) AS amount,fdegree,fcollcode  
					FROM `appcandsum` 
					WHERE IFNULL(FACKDATE,'0000-00-00') <> '0000-00-00' 
					and  IFNULL(ftotalfee,'') > 0 AND FPAYMENTCONFIRM = 'success'
					and fcollcode between '{$coll_from}' and '{$coll_to}'
					and fregno between '{$reg_from}' and '{$reg_to}'
					and fdegree between '{$deg_from}' and '{$deg_to}' 
					and fexamno between '{$exam_from}' and '{$exam_to}' 
					and FCATEGORY between '{$cat_from}' and '{$cat_to}'
					group by fcollcode,fdegree
					order by fcollcode,fdegree,fexamno,fregno limit 10000
					";

	//var_dump($get_data);die();
	$lobj_get_data = $aobj_context->mobj_db->GetAll($get_data);
	//var_dump($lobj_get_data);die();
	$arrW =0;
	$subjRow ='';
	
	if(!empty($lobj_get_data))
	{
		$query = "select concat(FUNIVNAME,' - ',FTOWN) as univname from control";
		$result = $aobj_context->mobj_db->GetRow($query);
		$e_data.="<table cellspacing='0' cellpadding='1' border='1' width = ''>";
			$e_data.="<th colspan='6' >{$result['univname']}";
			$e_data.="</th></table>"; 
			
		foreach($lobj_get_data as $dk => $dv)
		{
			$sl_no=1;
			$k2 = 1;
			$first = true;
			$degreenew = '';
			$degreeold = '';
			$collnew = '';
			$collold = '';
			
			$counter_degree = '1';
			$degreenew = $dv['fdegree'];
			$collnew = $dv['fcollcode'];
			$examno = $dv['fexamno']; 
			
			$query = "select distinct concat(fdegree,' - ',fdescpn) as degree from degree where fdegree = '{$degreenew}'";
			$result = $aobj_context->mobj_db->GetRow($query);
			
			$degree_detials = $result['degree'];
			//var_dump($query);die();
			//$exam_detials = $result['exam'];
			
			$query ="SELECT CONCAT(c.FCOLLCODE, ' - ', c.FCOLLNAME,', ',c.FTOWN) AS FCOLLNAME FROM college c
			where c.FCOLLCODE='{$collnew}'";
			$obj_student =$aobj_context->mobj_db->GetRow($query);
			$college_details = $obj_student['FCOLLNAME'];
			
			$e_data.="<table cellspacing='0' cellpadding='1' border='1' width = ''>";
			$e_data.="<th colspan='6' >{$college_details}";
			$e_data.="</th></table>";
			$e_data.="<table cellspacing='0' cellpadding='1' border='1' width = ''>";
			$e_data.="<th colspan='6' >{$degree_detials}";
			$e_data.="</th></table>";
			/* $e_data.="<table cellspacing='0' cellpadding='1' border='1' width = ''>";
			$e_data.="<th colspan='6' >{$exam_detials}";
			$e_data.="</th></table>"; */

			$e_data.="<table cellspacing='0' cellpadding='1' border='1' width = ''>";
			$e_data.="<tr>";
			$e_data.="<td style = 'text-align:center;font-weight: bold;row-height:40px;' >Sl. No.</td>";
			$e_data.="<td style = 'text-align:center;font-weight: bold;row-height:40px;' >Reg. No.</td>";
			//$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Name</td>";
			$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;'>Category</td>";
			$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;'>App. No.</td>";
			$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Amount</td>";
			$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Date</td>";	
			$e_data.="</tr>";							
			$k=0;
			$id=0;
			$m=0;
			$filename = '';
			$data = explode('~',$dv['app']);
			for($i=0;$i<count($data);$i++)
			{
				
				$feedet = explode('->',$data[$i]);
				if($feedet[4] != NULL)
				{
					$e_data.="<tr>";	
					$e_data.="<td style = 'text-align:center;' >{$counter_degree}</td>";				
					$e_data.="<td style = 'text-align:center;' >{$feedet[0]}</td>";
					//$e_data.="<td style = 'text-align:center;' >{$feedet[1]}</td>";
					$e_data.="<td style = 'text-align:left;' >{$feedet[1]}</td>";
					$e_data.="<td style = 'text-align:center;' >{$feedet[2]}</td>";
					$e_data.="<td style = 'text-align:left;' >{$feedet[3]}</td>";
					$e_data.="<td style = 'text-align:right;' >{$feedet[4]}</td>";	
					$e_data.="</tr>";
					$counter_degree++;
				}
			}
			
			$e_data.="<tr>";	
			$e_data.="<td style = 'text-align:center;font-size:	17px;' ><b>Total Amount</b></td>";				
			$e_data.="<td style = 'text-align:center;' ><b>{$dv['amount']}</b></td>";	
			$e_data.="</tr>";
			$e_data.="<tr>";	
			
			$e_data.="</tr>";
			$e_data.="</table>";
			
		}
		$arr['html']=$e_data;
		$arr['error']=0;
	}
	else
	{
		$arr['html'] = '<p> No record found </p>';
	}	
	
	header("Content-Type:application/xls");
	header("Content-Disposition: attachment; filename=feedetails.xls"); 
	echo $e_data;
}

?>