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


Current Path : /proc/thread-self/root/var/www/html/admission/src/
Upload File :
Current File : //proc/thread-self/root/var/www/html/admission/src/uMenu_new.php

<?php

function uniclareGetMenusNew($aobj_context)
{
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    
    $univcode = $aobj_context->mobj_data['univcode'];
    $version = $aobj_context->mobj_data['version'];
    $mobileno = $aobj_context->mobj_data['mobileno'];
    $appos = $aobj_context->mobj_data['platform'];
    $usertype = $aobj_context->mobj_data['usertype'];

	if($univcode == '')
	{
		$arr['msg'] = 'Invalid Params';
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
		return;
    }
    
    $update_query = "update masuser set fappver = '{$version}', FAPPLASTLOGIN = now() where fmobileno = '{$mobileno}'";
    $result = $aobj_context->mobj_db->Execute($update_query);

    $menu_query = "select fid, fmenuid, ficon,fcolor, fdispname, forder,fismainmenu,fsubmenu,fmainmenu
    from menu_schema
    where fmodtype = 'App'
    and funivcode = '{$univcode}' and factive = 'T'
    order by fismainmenu desc,forder";
    
	$result = $aobj_context->mobj_db->GetAll($menu_query);
    
    $arr = array();
	if(count($result) > 0)
	{
        foreach($result as $value)
        {
            if($value['fismainmenu'] == 'T')
            {
                $arr[$value['fid']]['submenu'] = array();
                $arr[$value['fid']]['fmenuid'] = $value['fid'];
                $arr[$value['fid']]['fbordercolor'] = $value['fcolor'];                
                $arr[$value['fid']]['ficon'] = $value['ficon'];
                $arr[$value['fid']]['fdispname'] = $value['fdispname'];
                $arr[$value['fid']]['forder'] = $value['forder'];
            }else
            {
                $val['fid'] = $value['fid'];
                $val['ficon'] = $value['ficon'];
                $val['fbordercolor'] = $value['fcolor'];
                $val['fdispname'] = $value['fdispname'];
                $val['forder'] = $value['forder'];
                array_push($arr[$value['fmainmenu']]['submenu'], $val); 
            }
        }

        $res = array();
        $i=0;
        foreach($arr as $value)
        {
            $res[$i] = $value;
            $i++;
        }
       
		echo $aobj_context->mobj_output->ToJSONEnvelope($res,0,"success"); 
	}
	else
	{
		$arr['msg'] = 'Invalid Register No.';
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
	}

}