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


Current Path : /proc/thread-self/root/var/www/misc/public_html/ovms/src/
Upload File :
Current File : //proc/thread-self/root/var/www/misc/public_html/ovms/src/admqpsubj.php

<?php

function admvalidateqpsubj($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$qpcode	 = $aobj_context->mobj_data['qpcode'];
	
	$query1 = "select fqpcode from masqp where fqpcode = '{$qpcode}' ";
	$rst1 = $aobj_context->mobj_db->GetRow($query1);
	
	if($rst1)
	{
		$succ_msg = "Board Code Already Exist"; 
		echo $aobj_context->mobj_output->ToJSONEnvelope($succ_msg,0,"Success");
		return true;
		
	}else
	{
		$succ_msg = ""; 
		echo $aobj_context->mobj_output->ToJSONEnvelope($succ_msg,-1,"Success");
		return true;
		
	}
	
}

function admsaveqpsubj($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$qpcode	     = $aobj_context->mobj_data['qpcode'];
	$subjname 	 = $aobj_context->mobj_data['subjname'];
	$subjsubname = $aobj_context->mobj_data['subjsubname'];
	$board		 = $aobj_context->mobj_data['board'];
	$pattern 	 = $aobj_context->mobj_data['pattern'];
	$examdate	 = $aobj_context->mobj_data['examdate'];
	$examtime	 = $aobj_context->mobj_data['examtime'];
	
	$query1 = "select fqpcode from masqp where fqpcode = '{$qpcode}' ";
	$rst1 = $aobj_context->mobj_db->GetRow($query1);
	
	if($rst1)
	{
		$query2 = "update masqp set fpatcode = '{$pattern}',fexamdate = '{$examdate}',
		fexamtime = '{$examtime}',fsubname = '{$subjname}',fssubname = '{$subjsubname}',fboard = '{$board}' 
		where fqpcode = '{$qpcode}'";
		$rst2 = $aobj_context->mobj_db->Execute($query2);
	}else
	{
		$query3 = "insert into masqp(fqpcode,fpatcode,fexamdate,fexamtime,fsubname,fssubname,fboard) 
		values('{$qpcode}','{$pattern}','{$examdate}','{$examtime}','{$subjname}','{$subjsubname}','{$board}')";
		$rst3 = $aobj_context->mobj_db->Execute($query3);
	}
	
	if($rst3 || $rst2)
	{
		$succ_msg = "Updated successfully"; 
		echo $aobj_context->mobj_output->ToJSONEnvelope($succ_msg,0,"Success");
		return true;
	}
	else
	{
		$succ_msg = "Updation Faild"; 
		echo $aobj_context->mobj_output->ToJSONEnvelope($query3,-1,"Failure");
		return true;
	}
	
}

function admeditqpsubj($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$qpcode = $aobj_context->mobj_data['id'];
	
	$query = "select * from masqp where fqpcode = '{$qpcode}' ";
	$results = $aobj_context->mobj_db->GetRow($query);
	
	
	if($results)
	{
		$succ_msg = "Updated successfully"; 
		echo $aobj_context->mobj_output->ToJSONEnvelope($results,0,"Success");
		return true;
	}
	else
	{
		$error_msg = "Updation Faild"; 
		echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"Failure");
		return true;
	}
}


?>