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


Current Path : /proc/thread-self/root/var/www/html/mum/src/
Upload File :
Current File : //proc/thread-self/root/var/www/html/mum/src/changeMobile.php

<?php

function getoldmobileno($aobj_context)
{
	session_start();
	$oldmobileno     = trim($aobj_context->mobj_data["oldmobileno"]); 
	$fcollcode   = $_SESSION['collcode'];
	$log_name    = $_SESSION['usr'];

	$query = "select fdegree, fname from studadm where fcontact_no = '{$oldmobileno}'";
	$result =  $aobj_context->mobj_db->GetRow($query);

	if(count($result) > 0) {
		$arr = "Admission Entry is done for Mobile No. Cannot change";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure"); 
		return;
	}

	$query = "select fname, fcollcode, fdegree, fmobileno, ifnull(femail,'') as femail 
	from collstud
	where fmobileno = '{$oldmobileno}' and fcollcode = '{$fcollcode}'";
	$sresult =  $aobj_context->mobj_db->GetRow($query);

	if($sresult)
	{
		echo $aobj_context->mobj_output->ToJSONEnvelope($sresult,0,"success"); 
		return;
	}
	else
	{
		
		$arr = "No Records Found For Given Mobile Number.";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure"); 
		return;
	}

}

function savestudentmobno($aobj_context)
{
	
	$oldmobileno = trim($aobj_context->mobj_data["oldmobileno"]); 
	$femail      = trim($aobj_context->mobj_data["femail"]); 
	$fname       = trim($aobj_context->mobj_data["fname"]); 
	$fmobileno   = trim($aobj_context->mobj_data["fmobileno"]); 
	$fcollcode   = $_SESSION['collcode'];
	$log_name    = $_SESSION['usr'];

	$query1 = "insert into collstudchange(FOLDMOBILENO,FMOBILENO,FNAME,FOLDNAME,FEMAIL,FOLDEMAIL,FUNIVCODE,FUPDATEUSER) 
		select fmobileno,'{$fmobileno}','{$fname}',fname,'{$femail}', femail, '041', '{$log_name}' from 
		collstud where fmobileno = '{$oldmobileno}' 
		and fcollcode = '{$fcollcode}'";
	$sresult1 = $aobj_context->mobj_db->Execute($query1);
	
	if($sresult1)
	{	
		$query = "update collstud set fmobileno = '{$fmobileno}', 
				fname = '{$fname}', femail = '{$femail}', FUPDTIME = NOW(), 
				FUPDATEUSER = '{$log_name}'
				where fmobileno = '{$oldmobileno}' and fcollcode = '{$fcollcode}'";

		$sresult = $aobj_context->mobj_db->Execute($query);

		$query2 = "update studadm set fcontact_no = '{$fmobileno}' 
		where  fcontact_no = '{$oldmobileno}' and fcollcode = '{$fcollcode}'";
		$sresult2 = $aobj_context->mobj_db->Execute($query2);

	}	
	

	if($sresult)
	{
		$arr = "Updated Successfuly";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
		return;
	}
	else
	{
		$arr = "Updation Failure";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure"); 
		return;
	}

}

?>