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


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/dudseatallot.php

<?php
function getstudfee($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
	$hdegree = stripslashes($aobj_context->mobj_data["hdegree"]);
	$seattype = stripslashes($aobj_context->mobj_data["seattype"]);
	$studfrom = stripslashes($aobj_context->mobj_data["studfrom"]);
	$catcode = stripslashes($aobj_context->mobj_data["catcode"]);
	$funiv = stripslashes($aobj_context->mobj_data["funiv"]);


	$query1 = "select if('{$seattype}' = 'MERIT SEATS', ffee,if('{$funiv}' = 'DUD',fmaxfee,fprfee)) as fee,'T' as feeedit 
	from admfeestr where fdegree = '{$hdegree}' 
	and fcombcode = 'PGET'
	and fcatcode = '{$catcode}' and fconstype = '{$studfrom}'";
  	$result1 = $aobj_context->mobj_db->GetRow($query1);
  	//var_dump($query1);
	if($result1)
	{	
		echo $aobj_context->mobj_output->ToJSONEnvelope($result1,0,"success"); 
	}	
	else
	{	
		$arr = "Fee Not Defined. Contact Admin";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error"); 
	}
}

function loadDudStuddet($aobj_context){
  
	$json = new Services_JSON();
	$regno = stripslashes($aobj_context->mobj_data["regno"]);
	
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$cnd = "";
	if($_SESSION['fusertype'] != 'adm')
		$cnd = "and d.fdegree = '{$_SESSION['USERNAME']}'";
 
	

	$query1 = "select s.fappno, s.fname, s.fcategory,
	funiv,d.fdegree,concat(d.fdegree,' - ',fdescpn) as degname
	from entstudadm s 
		inner join entoptdeg d on s.fappno = d.fappno
		inner join entdeg dg on d.fdegree = dg.fdegree
		where ifnull(FPAYSTATUS,'') = 'success'
		and d.fregno = '{$regno}'";		
  	$result1 = $aobj_context->mobj_db->GetRow($query1);
  // var_dump($result1);
	if($result1)
	{	
		$degcode = $result1['fdegree'];
		$fappno = $result1['fappno'];

		$query = "select * from entseatallot where fappno = '{$fappno}'";
		$result3 = $aobj_context->mobj_db->GetRow($query);

		if($result3)
		{
			$arr = "For This Candidated Alredy Seat Alloted. Degree: ".$result3['fdegree'];
			echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error");
			return;
		}


		$query2 = "select cd.fcollcode, c.fcollname from entcolldeg cd 
		inner join entcoll c on cd.fcollcode = c.fcollcode
		where cd.fdegree = '{$degcode}'
		order by c.fcollname";
		$result2 = $aobj_context->mobj_db->GetAll($query2);
		
		$arr['studdet'] = $result1; 
		$arr['colldet'] = $result2; 

		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
		return;
	}	
	else
	{	
		$arr = "Invalid Register No.";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error"); 
	}


}



function SaveDudSeatAllot($aobj_context){
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);

	$hdegree = stripslashes($aobj_context->mobj_data["hdegree"]);
	$seattype = stripslashes($aobj_context->mobj_data["seattype"]);
	$studfrom = stripslashes($aobj_context->mobj_data["studfrom"]);
	$catcode = stripslashes($aobj_context->mobj_data["catcode"]);
	$regno = stripslashes($aobj_context->mobj_data["regno"]);
	$appno = stripslashes($aobj_context->mobj_data["appno"]);
	$amount = stripslashes($aobj_context->mobj_data["amount"]);
	$pamount = stripslashes($aobj_context->mobj_data["pamount"]);
	$college = stripslashes($aobj_context->mobj_data["college"]);

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

	$user = $_SESSION['USERNAME'];

	
	$query2 = "INSERT INTO entseatallot (fappno, fdegree, fcollcode, famount,fpamount, fquota, fcatcode,fstudfrom,fregno, fusr, fentdate)
	VALUES
	('{$appno}', '{$hdegree}', '{$college}', '{$amount}','{$pamount}','{$seattype}','{$catcode}','{$studfrom}','{$regno}','{$user}', now())";
	
	$rst2 = $aobj_context->mobj_db->Execute($query2);
	
	if($rst2)
	{	
		$success_msg= "Updated Successfully";
		echo $aobj_context->mobj_output->ToJSONEnvelope($success_msg,0,"success"); 
	}	
	else
	{	
		$error_msg = "Some Failure as occured";
		echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"error"); 
	}
}