Sub GetAppMenu
Dim j As HttpJob
Dim Resultado As List
j.Initialize("appmenu", Me)
j.download2("http://" & Globals.ServerIP & "/app/test.php", _
Array As String ("username", Globals.usuarioapp,"action", "appmenu"))
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Dim res As String
res = J.GetString
Dim JParser As JSONParser
Dim resMap As Map
JParser.Initialize(res)
Globals.SQL1.ExecNonQuery("DELETE FROM menu")
Resultado = JParser.NextArray 'returns a list with maps
For i = 0 To Resultado.Size - 1
resMap= Resultado.Get(i)
Log(resMap.Get("title"))
Log(resMap.Get("ordering"))
Globals.FillMenu(resMap.Get("id"), resMap.Get("title"), resMap.Get("ordering"), resMap.Get("tipo"), resMap.Get("icon"), resMap.Get("con_html"), _
resMap.Get("fac_url"), resMap.Get("twi_url"), resMap.Get("lin_url"), resMap.Get("web_url"), _
resMap.Get("web_emb"), resMap.Get("ema_address"), resMap.Get("ema_subject"), resMap.Get("ema_template"), _
resMap.Get("for_name"),resMap.Get("num_phone"))
Next
FillDrawer
End If
End Sub