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


Current Path : /var/www/html/studentportal_wait/src_old/
Upload File :
Current File : /var/www/html/studentportal_wait/src_old/iamarks.php

<?php

include("database.php");

include("commandb.php");

//session_start();
$UNIVCODE  = $_SESSION['UNIVCODE'];

/*$query = "INSERT INTO menulog(funivcode,fdate,fia)
VALUES('{$UNIVCODE}',date_format(now(),'%Y-%m-%d'),1)
ON DUPLICATE KEY UPDATE fia = if(ifnull(fia,'') = '', 1,fia+1)";
$results = mysqli_query($conndb,$query);

$strUserLogQuery = "insert into userlog 
	(funivcode, fregno, fmobileno, fipadd, FREASONCODE, FDESCPN)
	values ('{$_SESSION['UNIVCODE']}', '{$_SESSION['REGNO']}', 
	'{$_SESSION['MOBILE']}', '{$_SERVER['REMOTE_ADDR']}', 
	'IAMN', 'IAMN - {$_SESSION['REGNO']} Viewed IA Marks')";
$result = mysqli_query($conndb, $strUserLogQuery);*/


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

$query = "select DATE_FORMAT(NOW(),'%Y-%m-%d') as presentdate, 
DATE_ADD(collexam.fiato, INTERVAL 80 DAY) AS FROMDATE, 
DATE_FORMAT(collexam.fiato, '%Y-%m-%d') as lastdate,  
DATE_FORMAT(DATE_SUB(collexam.fiato, INTERVAL 3 DAY), '%d/%m/%Y')  as bforelaste from collexam 
where fcollcode = '{$_SESSION['COLLCODE']}' 
and fdegree = '{$_SESSION['DEGREE']}'  
and DATE_FORMAT(NOW(),'%Y-%m-%d') between DATE_ADD(collexam.fiato,INTERVAL 1 DAY)
AND DATE_ADD(collexam.fiato,INTERVAL 80 DAY)";
// var_dump($query);
$result = mysqli_query($conn,$query);

$count = mysqli_num_rows($result);

if($count > 0)
{
	$cnd = "";
	if($UNIVCODE == '041' || $UNIVCODE == '042' || $UNIVCODE == '023')
		$cnd = "and mr.fdegree not like 'bed%' and mr.fdegree not like 'm%'";

	$query = "select mr.fregno, st.fname, dg.fexamname, 
	concat(dg.fexamdate, ' Examination') as fexamdate,mr.fexamno, 
	concat(mr.fdegree,' - ',dg.fdescpn) as fdegree, mr.fcollcode, su.fcsubcode, 
	concat(su.fsubname,' - ',su.fssubname) as fsubname, 
	ifnull(su.fvalmax,'') as fvalmax, su.fsubshort, su.fshortname, 
	if(ifnull(mr.fmarks,'') = '-2','Ab.',mr.fmarks) as fmarks 
	from marks mr inner join degree dg on mr.fdegree = dg.fdegree 
	and mr.fexamno = dg.fexamno
	inner join subject su on mr.fdegree = su.fdegree and mr.fexamno = su.fexamno 
	and mr.fsubcode = su.fcsubcode
	inner join student st on mr.fcollcode = st.fcollcode and mr.fdegree = st.fdegree
	and mr.fregno =st.fregno
	where mr.fregno = '{$regno}' and ifnull(mr.fmarks,'') <> '-1' {$cnd}
	order by fcsubcode";

	// var_dump($query);
	// die();
	$result = mysqli_query($conn,$query);
	$count = @mysqli_num_rows($result);

	if($count > 0)
	{
		$i = 0;
		while($row = mysqli_fetch_assoc($result))
		{
			$fname = $row['fname'];
			$fdegree = $row['fdegree'];
			$fexamdate = $row['fexamdate'];
			$fexamname = $row['fexamname'];
			$fregno = $row['fregno'];
			$fcsubcode[$i] = $row['fcsubcode'];
			//$fshortname[$i] = $row['fshortname'];
			$fsubname[$i] = $row['fsubname'];
			$fvalmax[$i] = $row['fvalmax']; 
			$fmarks[$i] = $row['fmarks'];
			$i++;

		}

		$app['error_code']  = 1;
		$app['fcsubcode']   = $fcsubcode;
		$app['fsubname']    = $fsubname;
		$app['fvalmax']     = $fvalmax;
		$app['fmarks']      = $fmarks;
		$app['fname']       = $fname;
		$app['fdegree']     = $fdegree;
		$app['fexamname']   = $fexamname;
		$app['fexamdate']   = $fexamdate;
		$app['fregno']      = $fregno;
		mysqli_close($conn);
		mysqli_close($conndb);
		echo json_encode($app);
	}else
	{
		$app['data'] = "IA MARKS NOT AVAILABLE";
		$app['error_code'] = 0;
		mysqli_close($conn);
		mysqli_close($conndb);
		echo json_encode($app);
	}
}
else
{
	$row = mysqli_fetch_assoc($result);
	$app['data'] = "IA MARKS NOT AVAILABLE";
	$app['error_code'] = 0;
	mysqli_close($conn);
	mysqli_close($conndb);
	echo json_encode($app);
}

?>