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


Current Path : /proc/thread-self/root/proc/thread-self/root/var/www/oasis/src/
Upload File :
Current File : //proc/thread-self/root/proc/thread-self/root/var/www/oasis/src/admissionHallTicket.php

<?php
function hallDegree($aobj_context){
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$collcode = $_SESSION['collcode'];
	$userID = $_SESSION['user_id'];
	$teachcode = $_SESSION['usr'];
	
	$query = "select * from s_sysdb where internal_code = '{$userID}'";
	$res = $aobj_context->mobj_db->GetRow($query);
	$user_type = $res['user_type'];							
	
	$join = "INNER JOIN usersub u ON d.fdegree = u.fdegree AND u.fuser = '{$userID}'"; 
	
    if($user_type =='40' || $user_type =='14')
		$join = "";

	if($_SESSION['fexamseparate'] == 'T')
	{
		$candsum = "examcandsum";
	}else
	{
		$candsum = "candsum";
	}	

	$query = "SELECT d.fdegree, d.fdescpn FROM degree d 
	INNER JOIN student c ON d.fdegree = c.fdegree
	{$join}
	WHERE c.fcollcode = '{$collcode}' GROUP BY d.fdegree ";
	
	$result = $aobj_context->mobj_db->GetAll($query);
	// var_dump($query,$result);
	// die();

		if($result){
			echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
		}else{
			$data = 'Fail to load degree';
			echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
		} 
}

function hallExam($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$degree_ = $aobj_context->mobj_data["degree"];
	
	if($_SESSION['fexamseparate'] == 'T')
	{
		$canddet = "examcanddet";
	}else
	{
		$canddet = "canddet";
	}	

	$query = "SELECT d.fexamname, d.fexamno 
	FROM degree d INNER JOIN $canddet c 
	ON d.fexamno = c.fexamno AND d.fdegree = c.fdegree
	WHERE c.fdegree = '{$degree_}' GROUP BY c.fexamno";
	// var_dump($query);
	// die();
	$result_sem = $aobj_context->mobj_db->GetAll($query);  

    if($result_sem){
		echo $aobj_context->mobj_output->ToJSONEnvelope($result_sem,0,"success"); 
	}else{
		$data = 'Fail to load semester';
		echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
	}  
}

function getAdmissionDegreeJsstu($aobj_context){
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$collcode = $_SESSION['collcode'];
	$userID = $_SESSION['user_id'];
	$teachcode = $_SESSION['usr'];
	
	$query = "select * from s_sysdb where internal_code = '{$userID}'";
	$res = $aobj_context->mobj_db->GetRow($query);
	$user_type = $res['user_type'];							
	
	$join = "INNER JOIN usersub u ON d.fdegree = u.fdegree AND u.fuser = '{$userID}'"; 
	
    if($user_type =='40' || $user_type =='14')
		$join = "";

	if($_SESSION['fexamseparate'] == 'T')
	{
		$candsum = "examcandsum";
	}else
	{
		$candsum = "candsum";
	}	

	$query = "SELECT d.fdegree, d.fdescpn FROM degree d INNER JOIN candsum c
	ON d.fdegree = c.fdegree {$join}
	WHERE c.fcollcode = '{$collcode}' GROUP BY d.fdegree";
	$result = $aobj_context->mobj_db->GetAll($query);

	$query = "SELECT distinct d.fexamdate, d.fyear,d.fexamtype 
	FROM degexam d INNER JOIN candsum c
	ON d.fdegree = c.fdegree and d.fyear = c.fyear 
	and d.fexamtype = c.fexamtype 
	WHERE c.fcollcode = '{$collcode}'
	GROUP BY d.fyear,d.fexamtype";
	$result1 = $aobj_context->mobj_db->GetAll($query);
	
	if($result){
		$data['degcode'] = $result;
		$data['exam'] = $result1;
		echo $aobj_context->mobj_output->ToJSONEnvelope($data,0,"success"); 
	}else{
		$data = 'Fail to load degree';
		echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
	} 
}

function getAdmissionDegeeJsstu($aobj_context){
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$collcode = $_SESSION['collcode'];
	$userID = $_SESSION['user_id'];
	$teachcode = $_SESSION['usr'];

	$exammonth = $aobj_context->mobj_data["exammonth"];
	$exammonth = explode('*',$exammonth);
	$year = $exammonth[0];
	$fexamtype = $exammonth[1];
	
	$query = "select * from s_sysdb where internal_code = '{$userID}'";
	$res = $aobj_context->mobj_db->GetRow($query);
	$user_type = $res['user_type'];							
	
	$join = "INNER JOIN usersub u ON d.fdegree = u.fdegree AND u.fuser = '{$userID}'"; 
	
    if($user_type =='40' || $user_type =='14')
		$join = "";

	if($_SESSION['fexamseparate'] == 'T')
	{
		$candsum = "examcandsum";
	}else
	{
		$candsum = "candsum";
	}	

	$query = "SELECT d.fdegree, d.fdescpn FROM degree d INNER JOIN candsum c
	ON d.fdegree = c.fdegree and c.fyear = '{$year}'
	and c.fexamtype = '{$fexamtype}'
	{$join}
	WHERE c.fcollcode = '{$collcode}' GROUP BY d.fdegree";
	$result = $aobj_context->mobj_db->GetAll($query);
	
	if($result){
		$data['degcode'] = $result;
		echo $aobj_context->mobj_output->ToJSONEnvelope($data,0,"success"); 
	}else{
		$data = 'Fail to load degree';
		echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
	} 
}

?>