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


Current Path : /var/www/html/demo/studentportal/src/
Upload File :
Current File : /var/www/html/demo/studentportal/src/attendance.php

<?php

include("database.php");

$regno  = $_SESSION['REGNO'];
$screen = $_POST['screen'];

$count = 1;

if($count > 0)
{

	$query = "select distinct st.fregno, st.fname, ad.fcollcode,
	cl.fcollname, ad.fdegree, 
	de.fdescpn as degree, ad.fexamno, de.fexamname, 
	concat(de.fexamdate, ' Examination') as fexamdate, ad.fsubcode, su.fsubname, 
	concat(su.fsubshort, '-' , su.fshortname) as fsubshort,
	ifnull(ad.ftotc,0) as ftotc, ifnull(ad.ftota,0) as ftota, ifnull(ad.fper,0) as fper
	from studattend ad 
	inner join college cl
	on ad.fcollcode = cl.fcollcode
	inner join degree de 
	on ad.fdegree = de.fdegree 
	and ad.fexamno = de.fexamno
	inner join subject su
	on ad.fdegree = su.fdegree
	and ad.fexamno = su.fexamno
	and ad.fsubcode = su.fcsubcode
	inner join student st
	on ad.fdegree = st.fdegree
	and ad.fcollcode = st.fcollcode 
	and ad.fregno = st.fregno
	where ad.fregno = '{$regno}'
	order by ad.fsubcode";

	$result = mysqli_query($conn,$query);
	$count = mysqli_num_rows($result);
	if($count > 0)
	{
		$i = 0;
		while($row = mysqli_fetch_assoc($result))
		{
			$info['strRegno'] = $row['fregno'];
			$info['strName'] = $row['fname'];
			$info['strDegree'] = $row['degree'];
			$info['strSemester'] = $row['fexamname'];
			$info['strExam'] = $row['fexamdate'];
			$examdate = $row['fexamdate'];
			$subject[$i] = $row['fsubname'];
			$subshort[$i] = $row['fsubshort'];
			$percent[$i] = $row['fper']; 
			$subcode[$i] = $row['fsubcode'];
			$conducted[$i] = $row['ftotc'];
			$attended[$i] = $row['ftota'];
			$i++;
		}

		$app['rgPerinfo'] = $info;  
		$app['subject'] = $subject;
		$app['subshort'] = $subshort;
		$app['conducted'] = $conducted;
		$app['attended'] = $attended;
		$app['subcode'] = $subcode;
		$app['percent'] = $percent;
		$app['status'] = 'success';
		echo json_encode($app);
	}
	else
	{
		$app['status'] = 'error';
		echo json_encode($app);
	}
}
else
{
	$app['status'] = 'dateError';
	echo json_encode($app);
}

?>