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.137.170.38
<?php
function getMenuItemsFinance($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$query="select fmenucode, fmenuname as title, ffunction as url,
fmainmenu from masmenu where factive ='T' and fismainmenu='T'";
$result = $aobj_context->pobj_db->GetAll($query);
$arr=[];
foreach($result as $val){
$menuItems=[];
$menucode = $val['fmenucode'];
$obj['title'] = $val['title'];
$obj['url'] = $val['url'];
$submenu = array();
$qry = "select fmenucode, fmenuname as title, ffunction as url, factive, fmainmenu from masmenu
where factive ='T' and fissubmenu='T' and fmainmenu='{$menucode}'";
$res = $aobj_context->pobj_db->GetAll($qry);
foreach($res as $value){
if($menucode == $value['fmainmenu']){
$sub['title']=$value['title'];
$sub['url']=$value['url'];
array_push($submenu, $sub);
}
}
$obj['submenu'] = $submenu;
array_push($arr, $obj);
}
if($result){
$menu['menu'] = $arr;
echo $aobj_context->mobj_output->ToJSONEnvelope($menu,0,"success");
}else{
$arr['msg'] = 'Failed to load';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
?>
|