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


Current Path : /proc/thread-self/root/var/www/html/pget/admin-src/
Upload File :
Current File : //proc/thread-self/root/var/www/html/pget/admin-src/meritlist.php

<?php
function loaddegree($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
	//var_dump($_SESSION['fusertype']);

	if($_SESSION['USERNAME'] == NULL || $_SESSION['USERNAME'] == '')
	{
		$arr = "Please login";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error"); 
		return;
	}
	
	$query = "select * from entmasuser where fusername = '{$_SESSION['USERNAME']}'";
	$res = $aobj_context->mobj_db->GetRow($query);
	$fdegree = $res['fdegree'];
	//var_dump($query);
	$cond = "";
	if($_SESSION['fusertype'] == 'user')
	{
		$cnd = "where INSTR ('{$fdegree}', concat(fdegree,'*'))";
	}else
	{
		$cnd = "";
	}

	$query1 = "select fdegree, fdescpn from entdeg {$cnd} order by forder";
  	$result1 = $aobj_context->mobj_db->GetAll($query1);
  
	if(count($result1) > 0)
	{	
		echo $aobj_context->mobj_output->ToJSONEnvelope($result1,0,"success"); 
	}	
	else
	{	
		$arr = "Some Failure as occured";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error"); 
	}
}

function UpdMeritList($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
	$degree = stripslashes($aobj_context->mobj_data["degree"]);

	if($_SESSION['USERNAME'] == NULL || $_SESSION['USERNAME'] == '')
	{
		$arr = "Please login";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error"); 
		return;
	}


	$query = "select count(*) as cnt from entoptdeg d
	inner join entstudadm s on d.fappno = s.fappno
	where d.fdegree = '{$degree}' 
	and ifnull(fpaystatus,'') = 'success'
	and ifnull(s.ffreez,'') <> 'T'
	and (ifnull(d.fstatus,'') = ''
	or ifnull(d.fmerittype,'') = '')";
	$res = $aobj_context->mobj_db->GetRow($query);
	
	if($res['cnt']>0)
	{
		$arr = "All applications are not verified.";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error"); 
		return;
	}
	$query = "update entoptdeg set frank = NULL where fdegree = '{$degree}'";
	$res = $aobj_context->mobj_db->Execute($query);

	$query = "select fmeritopt from entdeg where fdegree = '{$degree}'";
	$res = $aobj_context->mobj_db->GetRow($query);
	$fmeritopt = $res['fmeritopt'];

	if($fmeritopt == 'T')
	{
		$order = "order by d.fmerittype,d.foptper desc,d.ftotper desc,s.fdob desc";
	}
	else
	{
		$order = "order by d.fmerittype,d.ftotper desc,d.foptper desc,s.fdob desc";
	}
	
	$query = "select d.fappno,d.fdegree,d.ftotper, d.fmerittype from entoptdeg d
	inner join entstudadm s on d.fappno = s.fappno
	where d.fdegree = '{$degree}' 
	and ifnull(fpaystatus,'') = 'success'
	and ifnull(d.fstatus,'') = 'Approved'
	and ifnull(s.ffreez,'') <> 'T'
	and ifnull(d.fmerittype,'') <> ''
	{$order}";
	
	$res = $aobj_context->mobj_db->GetAll($query);
	$i=001;
	$o = $res[0]['fmerittype'];
	$n = "";
	foreach($res as $value)
	{
		$n = $value['fmerittype'];
		if($o != $n) {
			$i = 001;
			$o = $value['fmerittype'];	
		}
		$updquery = "update entoptdeg set frank = '{$i}',
		frankdate = now()
		where fappno = '{$value['fappno']}'
		and fdegree = '{$value['fdegree']}'";
		$rst1 = $aobj_context->mobj_db->Execute($updquery);
		$i++;
	}

	if($rst1)
	{
		$arr = "Generated Successfully.";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
		return;
	}else{
		$arr = "Some Failure as occured";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error"); 
		return;
	}
}