/*
* Cepat Sembuh v1.0
* Copyright 2016 Cepat Sembuh
*/

// Firebase go online whenever the application is open
document.addEventListener("deviceready", function () {
    Firebase.goOnline();
});

// Not available faskes
$('#not-available').on('click', function() {
	alert("Faskes is not available")
})

// Get no antrian function
function getNoAntri(tipe, username, name) {
  var faskesRef = new Firebase("https://cepatsembuh.firebaseio.com/" + tipe + "/faskes/" + username + '/antrian');
  console.log('Url :' + "https://cepatsembuh.firebaseio.com/" + tipe + "/faskes/" + username + '/antrian');
	alert('Fitur ini membutuhkan internet untuk mengambil data');
  faskesRef.on("value", function(snapshot) {
    alert('No antrian: ' + snapshot.val());
    var data = snapshot.val().antrian;
    var plus = 1;
    var glee = data + plus
    console.log('Updating data.. ');
    username.set({
      antrian: glee,
      nama: name
    });
  });
}

@@ -367,17 +367,19 @@
  name) %7B
+  
 %0A
-
   var fa
@@ -747,21 +747,230 @@
 l());%0A  
-  var
+%7D);%0A%7D%0A%0Afunction updateData(tipe, username, name) %7B%0A  var faskesRef = new Firebase(%22https://cepatsembuh.firebaseio.com/%22 + tipe + %22/faskes/%22 + username + '/antrian');%0A  faskesRef.on(%22value%22, function(snapshot) %7B%0A   
  data = 
@@ -997,20 +997,16 @@
 an;%0A    
-var 
 plus = 1
@@ -1011,20 +1011,16 @@
  1;%0A    
-var 
 glee = d
@@ -1071,24 +1071,29 @@
 ');%0A    
-username
+kelapa_gading
 .set(%7B%0A 
@@ -1137,16 +1137,15 @@
     %7D);%0A
+
   %7D)
-;
 %0A%7D%0A

Write a function to update data