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


Current Path : /proc/thread-self/root/var/www/html/gcg/adm/admin/src/
Upload File :
Current File : //proc/thread-self/root/var/www/html/gcg/adm/admin/src/examapp.php

<?php

include ("database.php");

$query = "SELECT s.fname as StudentName,s.fdegree,s.fcollcode,s.fexamno, d.fdescpn Degree,c.fcollname College,s.fcaste as Category,s.fregno RegNo from student s inner join degree d on s.fdegree = d.fdegree and s.fexamno = d.fexamno inner join college c on s.fcollcode = c.fcollcode where fregno = '{$_SESSION[REGNO]}'";

$result = mysqli_query($conn,$query);
$count = mysqli_num_rows($result);
if($count > 0)
{
	$row = mysqli_fetch_assoc($result);
	$sub_summary_query = "select distinct cd.fexamno, dg.fexamname, dg.ftotsub, cs.ffreshexam from canddet cd inner join degree dg on cd.fdegree = dg.fdegree and cd.fexamno = dg.fexamno inner join candsum cs on cs.fdegree = cd.fdegree and cs.fcollcode = cd.fcollcode and cs.fregno = cd.fregno where cd.FREGNO='{$_SESSION[REGNO]}' order by cd.fexamno";
	$result = mysqli_query($conn,$sub_summary_query);
	$count = mysqli_num_rows($result);
	$i = 0;
	while($sem = mysqli_fetch_assoc($result)){
		$sub_sum[$i] = $sem;
		$row['subject_'.$sem['fexamno']] =  getSubjectDetl($row['fdegree'],$row['fcollcode'],$sem['fexamno'],$conn,$sem['ftotsub'],$row['Category'], $sem['ffreshexam']);
		$i++;
	}
	$row['sub_summary'] = $sub_sum;
	$row['status'] = 'success';
	echo json_encode($row);
}
else
{
	$data = array("status"=>"failure");
	echo json_encode($data);
}


function getSubjectDetl($degree,$collcode,$FEXAMNO,$conn,$totsub,$category,$FFRESHEXAM)
{
	$lquery="select c.FSUBCODE,s.FSUBNAME,
	ifnull(c.FPASSMTH,'') as FPASSMTH,
	s.FQPCODE AS FQPCODE,c.FEXAMTYPE,
	ifnull(c.FPRESENT,'N') as FPRESENT,
	if(c.FINSERTED='','F',c.FINSERTED) as FINSERTED,
	ifnull(c.fthpr,'') as fthpr 
	from canddet c 
	inner join subject s on s.FDEGREE=c.FDEGREE
	and s.fexamno = c.fexamno and s.FSUBCODE=c.FSUBCODE 
	where c.FDEGREE='{$degree}' and c.FCOLLCODE='{$collcode}' and 
	c.FEXAMNO='{$FEXAMNO}'  and
	c.FREGNO='{$_SESSION[REGNO]}' group by c.FSUBCODE order by 
	c.fsubcode, s.fqpcode desc";
	$i = 0;
	$result = mysqli_query($conn,$lquery);
	while($row = mysqli_fetch_assoc($result))
	{
		$sub[$i] = $row;
		$i++;
	}
	$income_type = 'Normal Fee';
	$fee_detl_query = "SELECT  FHEADCODE,FFEE,
	IF('{$FFRESHEXAM}'='{$FEXAMNO}',FFEE,FREPFEE) AS O_FFEE,
	IF('{$FFRESHEXAM}'='{$FEXAMNO}',FPRFEE,FREPPRFEE) AS FPRFEE, 
	if('{$FFRESHEXAM}'='{$FEXAMNO}',FFEE,FMAXFEE) as FMAXFEE
	FROM admfeestr a
	WHERE FDEGREE='{$degree}'
	AND FEXAMNO='{$FEXAMNO}'
	AND FCOMBCODE='EXAM'
	AND FCATCODE='{$category}'
	and FCONSTYPE='{$income_type}' 
	and ifnull(FADMFEESDATE,'') <> '' and ifnull(FADMFEEEDATE,'') <> ''
	and DATE_FORMAT(NOW(),'%Y-%m-%d') 
	BETWEEN DATE_FORMAT(FADMFEESDATE,'%Y-%m-%d') 
	AND DATE_FORMAT(FADMFEEEDATE,'%Y-%m-%d')				
	and IF(IFNULL(FREGRANGE,'') = '', '1=1', 1=1 
	and (INSTR(FREGRANGE,(CONCAT(SUBSTR('{$_SESSION[REGNO]}',1,3),'*'))) > 0 
	or INSTR(FREGRANGE,(CONCAT(SUBSTR('{$_SESSION[REGNO]}',1,4),'*'))) > 0
	or INSTR(FREGRANGE,(CONCAT(SUBSTR('{$_SESSION[REGNO]}',1,5),'*'))) > 0))
	and IF(IFNULL(FCOLLRANGE,'') = '', '1=1', 
	1=1 and INSTR(FCOLLRANGE,(CONCAT('{$collcode}','*'))) <= 0)
	order by FHEADCODE";
	//var_dump($fee_detl_query);
	$result = mysqli_query($conn,$fee_detl_query);
	while($row = mysqli_fetch_assoc($result))
	{
		$fee[$i] = $row;
		$i++;
	}
	$sub['fees'] = $fee;
	return $sub;

}