if($_POST['ajax'] == "pageloadData") { //Handle Insurance Card picture if(strlen($insPhoto) == 0){ $practiceid = $patientInfo['practiceid']; $patientid = $chart_number; $insuranceid = $patientInfo['insuranceid']; //Get Insurance Card image from EMR (API call) $insPhoto = getInsuranceImage($practiceid, $patientid, $insuranceid); } $pageDataLoaded = 1; $responseObj = [ 'success' => True, 'status' => 200, 'vars' => 'true', 'errorCode' => '0']; echo json_encode($responseObj); exit; } function pageLoadOperations() { // ajax call $.ajax({ type: 'post', async : false, data: {ajax: 'pageloadData'}, beforeSend: function() { //pre-loader-show document.getElementById('pla').innerHTML = 'Preparing Patient Info
(please wait)'; document.getElementById('pla').style.display = 'inline'; }, success: function(responseObj){ document.getElementById('pla').style.display = 'none'; var myVar = $.parseJSON(responseObj); if (myVar.errorCode == '0') { document.getElementById('uma').style.display = 'inline'; document.getElementById('uma').innerHTML = 'Page Data Loaded !'; $('#uma').delay(3000).hide(0); }else { document.getElementById('uma').style.display = 'inline'; document.getElementById('uma').innerHTML = 'System Error!'; $('#uma').delay(2000).hide(0); } } }); // ajax call }