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


Current Path : /var/www/html/cnv/dud/src/
Upload File :
Current File : /var/www/html/cnv/dud/src/auto-complete.php

<?php
function getAutoCompleteEmpCodeOld($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$emp_code = $aobj_context->mobj_data["part"];

$get_emp_code_id="select table_name,field_id1
from module_meta_columns where module_name='Employee'";
$lobj_get_emp_code_id = $aobj_context->mobj_db->GetRow($get_emp_code_id);

$emp_code_field=$lobj_get_emp_code_id['field_id1'];
$emp_table_name=$lobj_get_emp_code_id['table_name'];

$lstr_qry = "SELECT internal_code,{$emp_code_field} as value
from {$emp_table_name} where {$emp_code_field} like '%{$emp_code}%' ";
$lobj_rs = $aobj_context->mobj_db->GetAll($lstr_qry);
if(!empty($lobj_rs))
echo json_encode($lobj_rs);
}
function getAutoCompleteEmpCode($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$emp_code = $aobj_context->mobj_data["q"];

$get_emp_code_id="select table_name,field_id1
from module_meta_columns where module_name='Employee'";
$lobj_get_emp_code_id = $aobj_context->mobj_db->GetRow($get_emp_code_id);

$emp_code_field=$lobj_get_emp_code_id['field_id1'];
$emp_table_name=$lobj_get_emp_code_id['table_name'];

$lstr_qry = "SELECT internal_code,{$emp_code_field} as value
from {$emp_table_name} where {$emp_code_field} like '%{$emp_code}%' ";
$lobj_rs = $aobj_context->mobj_db->GetAll($lstr_qry);
if(!empty($lobj_rs))
foreach ($lobj_rs as $key=>$value) {
	 {
		echo $value['value']."|".$value['value']."\n";
	}
}
}
function getAutoCompleteEmpNameold($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$emp_name = $aobj_context->mobj_data["q"];

$get_emp_name_id="select table_name,field_id2
from module_meta_columns where module_name='Employee'";
$lobj_get_emp_code_id = $aobj_context->mobj_db->GetRow($get_emp_name_id);

$emp_name_field=$lobj_get_emp_code_id['field_id2'];
$emp_table_name=$lobj_get_emp_code_id['table_name'];

$lstr_qry = "SELECT internal_code,{$emp_name_field} as value
from {$emp_table_name} where {$emp_name_field} like '%{$emp_name}%' ";
 
$lobj_rs = $aobj_context->mobj_db->GetAll($lstr_qry);
if(!empty($lobj_rs))
echo json_encode($lobj_rs);
}
function getAutoCompleteEmpName($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$emp_name = $aobj_context->mobj_data["q"];

$get_emp_name_id="select table_name,field_id2
from module_meta_columns where module_name='Employee'";
$lobj_get_emp_code_id = $aobj_context->mobj_db->GetRow($get_emp_name_id);

$emp_name_field=$lobj_get_emp_code_id['field_id2'];
$emp_table_name=$lobj_get_emp_code_id['table_name'];

$lstr_qry = "SELECT internal_code,{$emp_name_field} as value
from {$emp_table_name} where {$emp_name_field} like '%{$emp_name}%' ";
 
$lobj_rs = $aobj_context->mobj_db->GetAll($lstr_qry);
if(!empty($lobj_rs))


foreach ($lobj_rs as $key=>$value) {
	 {
		echo $value['value']."|".$value['value']."\n";
	}
}


}
function showAutoCompleteEmployeeName($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$emp_code = $aobj_context->mobj_data["emp_code"];
$get_emp_name_id="select table_name,field_id2,field_id1
from module_meta_columns where module_name='Employee'";
$lobj_get_emp_code_id = $aobj_context->mobj_db->GetRow($get_emp_name_id);

$emp_name_field=$lobj_get_emp_code_id['field_id2'];
$emp_code_field=$lobj_get_emp_code_id['field_id1'];
$emp_table_name=$lobj_get_emp_code_id['table_name'];

$lstr_qry = "SELECT internal_code,{$emp_name_field} as value
from {$emp_table_name} where {$emp_code_field} like '%{$emp_code}%' ";
$lobj_rs = $aobj_context->mobj_db->GetRow($lstr_qry);
if($lobj_rs)
				    {
				        $rdata = "Inserted Successfully.";
				        print_r($aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,0,"success"));
				        //return $rdata;
				     }
				    else
				    {
				        $rdata = "Insertion Failed.";
				        print_r($aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,-1,"Failure"));  
						//return $rdata;			
				    }  	
}
function showAutoCompleteEmployeeCode($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$emp_name = $aobj_context->mobj_data["emp_name"];
$get_emp_name_id="select table_name,field_id2,field_id1
from module_meta_columns where module_name='Employee'";
$lobj_get_emp_code_id = $aobj_context->mobj_db->GetRow($get_emp_name_id);

$emp_name_field=$lobj_get_emp_code_id['field_id2'];
$emp_code_field=$lobj_get_emp_code_id['field_id1'];
$emp_table_name=$lobj_get_emp_code_id['table_name'];

$lstr_qry = "SELECT internal_code,{$emp_code_field} as value
from {$emp_table_name} where {$emp_name_field} like '%{$emp_name}%' ";
$lobj_rs = $aobj_context->mobj_db->GetRow($lstr_qry);
if($lobj_rs)
				    {
				        $rdata = "Inserted Successfully.";
				        print_r($aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,0,"success"));
				        //return $rdata;
				     }
				    else
				    {
				        $rdata = "Insertion Failed.";
				        print_r($aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,-1,"Failure"));  
						//return $rdata;			
				    }  	
}

?>