// JavaScript Document function process01() { var v_method=""; if($('#method-0').prop("checked")) { v_method=$('#method-0').prop("value") } else if($('#method-1').prop("checked")) { v_method=$('#method-1').prop("value") } v_frmID= $('#frmID').val() ; v_frmVal= $('#id_frmVal').val() ; v_accID =$('#id_accID').val() ; v_accPIN =$('#id_accPIN').val() ; v_amount =$('#id_amount').val() ; dataVal={"frmID" : v_frmID , "frmVal" : v_frmVal, "method" : v_method, "accID" : v_accID , "accPIN" : v_accPIN , "amount" : v_amount }; $.post("updateTopUpMain.php", { dataSet : dataVal }, function(data1, status){ if(status=="success") { data= jQuery.parseJSON(data1); if(data.resp=="insert") { loadContainerPending(); refreshIntervalId = setInterval( process01, 3000); } else if(data.resp=="pending") { if(refreshIntervalId == "NONE") { loadContainerPending(); refreshIntervalId = setInterval( process01, 3000); } } else if(data.resp=="processed" && data.final=="success") { loadContainerInvalidDetails(); $('#msgContainer').html('Proceeding'); document.getElementById('id_depForm1').submit(); clearInterval(refreshIntervalId); refreshIntervalId = "NONE"; } else if(data.resp=="processed" && data.final=="failure") { loadContainerInvalidDetails(); clearInterval(refreshIntervalId); refreshIntervalId = "NONE"; $('#msgContainer').html('Invalid Account ID / Account PIN.
Please re-input Account ID/Account PIN and submit'); document.getElementById('id_accID').focus(); document.getElementById('lbl_accID').style.color="blue"; document.getElementById('lbl_accPIN').style.color="blue"; document.getElementById('id_accID').style.border="1px solid red"; document.getElementById('id_accPIN').style.border="1px solid red"; } } else { alert("Please check internet connection"); } }); } function loadContainerPending() { document.getElementById('rowForm').style.visibility="hidden"; document.getElementById('rowForm').style.width="0px"; document.getElementById('rowForm').style.height="0px"; document.getElementById('rowForm').style.overflow="hidden"; document.getElementById('loadingForm').style.visibility="visible"; document.getElementById('loadingForm').style.width="auto"; document.getElementById('loadingForm').style.height="auto"; document.getElementById('loadingForm').style.overflow="auto"; } function loadContainerInvalidDetails() { document.getElementById('loadingForm').style.visibility="hidden"; document.getElementById('loadingForm').style.width="0px"; document.getElementById('loadingForm').style.height="0px"; document.getElementById('loadingForm').style.overflow="hidden"; document.getElementById('rowForm').style.visibility="visible"; document.getElementById('rowForm').style.width="auto"; document.getElementById('rowForm').style.height="auto"; document.getElementById('rowForm').style.overflow="auto"; } var refreshIntervalId = setInterval( process01, 3000); clearInterval(refreshIntervalId);