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


Current Path : /var/www/oasis/Report_details_old/
Upload File :
Current File : /var/www/oasis/Report_details_old/student_count.php

<?php

function Generatestudentcount($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'); 
	
	$qp_code_from = trim($aobj_context->mobj_data["degree_code_from"]);
	$qp_code_to = trim($aobj_context->mobj_data["degree_code_to"]);
	
	$cntr_from = trim($aobj_context->mobj_data["cntr_from"]);
	$cntr_to = trim($aobj_context->mobj_data["cntr_to"]);
	
	$centcode = trim($aobj_context->mobj_data["studcount"]);
	

	$query = "select {$centcode} as fcollcode,concat(c.fcollname,' - ',c.ftown) as fcollname,
	fdegree,count(distinct fregno) as studcount from candsum m,college c where  {$centcode} = c.fcollcode and {$centcode}  between '{$cntr_from}' and '{$cntr_to}'
	and IFNULL(FRECPTDATE,'') <> '' and fdegree between '{$qp_code_from}' and '{$qp_code_to}'
	group by {$centcode},fdegree";
	$results = $aobj_context->mobj_db->GetAll($query);
//	var_dump($query);die();
	/* ELSE
	{
		$GET_DATA ="SELECT  {$CENTCODE} AS CENTER_CODE ,DATE_FORMAT(S.FDOE,'%D/%M/%Y') AS DATE_OF_EXAM, IF(IFNULL(S.FSESSION,'')<>'',
		IF(S.FSESSION = R.FREASONCD,R.FDESCPN,S.FSESSION),S.FSESSION) AS SESSION,S.FQPCODE AS QP_CODE, 
		CONCAT(S.FSUBNAME, ' ', S.FSSUBNAME) AS SUBJECT_NAME, COUNT(C.FSUBCODE) AS CAPACITY FROM DEGREE D 
		INNER JOIN SUBJECT S ON D.FDEGREE = S.FDEGREE AND D.FEXAMNO = S.FEXAMNO 
		INNER JOIN CANDDET C ON S.FDEGREE = C.FDEGREE AND S.FEXAMNO = C.FEXAMNO AND S.FSUBCODE = C.FSUBCODE 
		INNER JOIN CANDSUM M ON C.FREGNO = M.FREGNO LEFT JOIN REASON R ON R.FREASONCD = S.FSESSION
		WHERE IFNULL(FRECPTDATE,'0000-00-00') <> '0000-00-00' AND C.FPRESENT = 'P' 
		AND IFNULL(C.FPASSMTH,'') = '' AND IFNULL(M.FTOTALFEE,'') > 0
		AND S.FDOE BETWEEN DATE_FORMAT(STR_TO_DATE('{$DATE_FROM}', '%D/%M/%Y'),'%Y-%M-%D')  
		AND DATE_FORMAT(STR_TO_DATE('{$DATE_TO}', '%D/%M/%Y'),'%Y-%M-%D')
		AND {$CENTCODE} BETWEEN '{$CNTR_FROM}' AND '{$CNTR_TO}' AND S.FQPCODE BETWEEN '{$QP_CODE_FROM}'
		AND '{$QP_CODE_TO}' GROUP BY {$CENTCODE},S.FQPCODE ORDER BY S.FQPCODE,{$CENTCODE}";
				
	}
	//VAR_DUMP($GET_DATA);DIE();
	$LOBJ_GET_DATA = $AOBJ_CONTEXT->MOBJ_DB->GETALL($GET_DATA); */
	
	$arrW =0;
	$subjRow ='';
		
	if(!empty($results))
	{
		$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>";
		if($centcode == 'm.FCNTRCODE')
			$e_data.="<td style = 'text-align:center;font-weight: bold;row-height:40px;' >Center code</td>";
		else if($centcode == 'm.FCOLLCODE')
			$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >College code</td>";
		$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >College Name</td>";
		$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Degree</td>";
		$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Count</td>";		
		$e_data.="</tr>";							
		$k=0;
		$id=0;
		$m=0;

		$counter_degree = 1;
		foreach($results as $key=>$value)
		{
			if($k%2==0)
			{
				$class='tbl_row';
				$inp_class='tbl_row_input';
			}
			else
			{
				$input_class='tbl_row1'; 
				$inp_class='tbl_row1_input';
			}  
			
			$e_data.="<tr>";	
			$e_data.="<td style = 'text-align:left;' >{$counter_degree}</td>";				
			$e_data.="<td style = 'text-align:center;' >{$value['fcollcode']}</td>";
			$e_data.="<td style = 'text-align:left;' >{$value['fcollname']}</td>";
			$e_data.="<td style = 'text-align:center;' >{$value['fdegree']}</td>";
			$e_data.="<td style = 'text-align:right;' >{$value['studcount']}</td>";	
			$e_data.="</tr>";
			$k++;
			$id++;
			$m++;
			$counter_degree++;
		}
		$e_data.="</table>";
		//var_dump($e_data);die();
		$arr['total_count']= $m;						
		$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=enrolledreport.xls"); 
	echo $e_data;
}

?>