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.218.108.8
<?php
function csaveUserType($aobj_context){
$userType = $aobj_context->mobj_data["user"];
$desc = $aobj_context->mobj_data["desc"];
$collcode = $aobj_context->mobj_data["collcode"];
$univcode = $aobj_context->mobj_data["univcode"];
if($userType !=''){
$query="INSERT INTO col_usertype (fcollcode, fusertype, fdescpn)
VALUES ('{$collcode}', '{$userType}', '{$desc}')
ON DUPLICATE KEY UPDATE
fdescpn = VALUES(fdescpn)";
$result = $aobj_context->mobj_db->Execute($query);
}
if($result){
$arr['msg'] = "Successfully Inserted";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}else{
$arr['msg'] = "Something Went Wrong";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}
function cviewUserType($aobj_context){
$collcode = $aobj_context->mobj_data["collcode"];
$univcode = $aobj_context->mobj_data["univcode"];
$query="select *from col_usertype where fcollcode='{$collcode}'";
$result = $aobj_context->mobj_db->GetAll($query);
if($result){
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
return;
}else{
$arr['msg'] = "Something Went Wrong";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}
function cdeleteUserType($aobj_context){
$collcode = $aobj_context->mobj_data["collcode"];
$usertype = $aobj_context->mobj_data["usertype"];
$query="delete from col_usertype where fusertype='{$usertype}' and fcollcode='{$collcode}'";
$result = $aobj_context->mobj_db->Execute($query);
if($result){
$arr['msg']="Successfully Deleted";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}else{
$arr['msg'] = "Something Went Wrong";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}
?>
|