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.222.98.91
<?php
function getreasoncd($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
$query = "select ifnull(freasoncd,'') as freasoncd,ifnull(fdescpn,'') as fdescpn,
ifnull(fdeleted,'F') as fdeleted, ifnull(fshortname,'') as fshortname
from reason where ifnull(fdeleted,'') <> 'T' order by freasoncd";
$result = $aobj_context->pobj_db->GetAll($query);
// var_dump($result);
if($result)
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
else
{
$arr['msg'] = 'No Boards details found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function saveReasonMaster($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$req = $aobj_context->req_body['data'];
$univcode = $aobj_context->mobj_data['univcode'];
$values = "";
foreach( $req as $k => $v )
{ //fshortname
$values .= "('{$v['freasoncd']}', '{$v['fdescpn']}', '{$v['fdeleted']}', '{$v['fshortname']}'),";
}
$values = rtrim($values, ',');
$query = "insert into reason (freasoncd,fdescpn,fdeleted,fshortname) values {$values}
ON DUPLICATE KEY UPDATE
fdescpn = values(fdescpn), fdeleted = values(fdeleted), fshortname = values(fshortname)";
// $query = "insert into reason (FREASONCD,FDESCPN,FDELETED) values {$values}";
$result = $aobj_context->pobj_db->Execute($query);
// var_dump($query);
// die();
if($result){
$arr['msg'] = "Updation was Successfull";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}else{
$arr['msg'] = "Updation was not successfull, please try later";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
?>
|