Sub btnSimpan_Click
'Ambil variabel
Dim vUsername, vNoAgenda, vLongitude, vLatitude, vStatusSurvey As String
ExecuteRemoteQuery("IF EXISTS(SELECT no_agenda FROM tb_survey WHERE no_agenda = '" & vNoAgenda & "')", SURVEY_INSERT)
End Sub
Sub ExecuteRemoteQuery(Query As String, JobName As String)
Dim job As HttpJob
job.Initialize(JobName, Me)
job.PostString(SESSION_IP_PHP_SERVER, Query)
End Sub
Sub JobDone(Job As HttpJob)
ProgressDialogHide
If Job.Success Then
Dim res As String
res = Job.GetString
Dim parser As JSONParser
Dim id1, id2 As String
parser.Initialize(res)
Select Job.JobName
Case SURVEY_INSERT
.....
id1=m.Get("pid")
ExecuteRemoteQuery("IF EXISTS(SELECT pid FROM tb_survey WHERE pid= '" & id1 & "')", DATA_PEMOHON1)
Case DATA_PEMOHON1
id2=m.Get("pid")
ExecuteRemoteQuery("IF EXISTS(SELECT no_agenda FROM tb_survey WHERE pid= '" & id2 & "')", DATA_PEMOHON2)
.....
Case DATA_PEMOHON2
.....
End Select
Else
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub