diff --git a/app/src/main/java/com/eusecom/attendance/MainActivity.java b/app/src/main/java/com/eusecom/attendance/MainActivity.java index 3bb1489..5c84be7 100644 --- a/app/src/main/java/com/eusecom/attendance/MainActivity.java +++ b/app/src/main/java/com/eusecom/attendance/MainActivity.java @@ -421,6 +421,8 @@ private void writeAttendance(String usico, String usid, String ume, String dmxa, } mDatabase.child("users").child(userIDX).child("usatw").setValue(usatwx); + mDatabase.child("users").child(userIDX).child("lati").setValue(gpslat); + mDatabase.child("users").child(userIDX).child("longi").setValue(gpslon); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); SharedPreferences.Editor editor = prefs.edit(); diff --git a/app/src/main/java/com/eusecom/attendance/models/Employee.java b/app/src/main/java/com/eusecom/attendance/models/Employee.java index 34e242b..bd57aa1 100644 --- a/app/src/main/java/com/eusecom/attendance/models/Employee.java +++ b/app/src/main/java/com/eusecom/attendance/models/Employee.java @@ -18,6 +18,8 @@ public class Employee { public String usatw; public String keyf; public String admin; + public String lati; + public String longi; public Employee() { // Default constructor required for calls to DataSnapshot.getValue(Employee.class) @@ -32,6 +34,8 @@ public Employee(String username, String email, String ustype, String usico, Stri this.usatw = usatw; this.keyf = "0"; this.admin = "0"; + this.lati = "0"; + this.longi = "0"; } public Employee(String username, String usosc ) { @@ -43,6 +47,8 @@ public Employee(String username, String usosc ) { this.usatw = "0"; this.keyf = "0"; this.admin = "0"; + this.lati = "0"; + this.longi = "0"; } @Exclude @@ -129,6 +135,22 @@ public String getKeyf() { return keyf; } + public String getLati() { + return lati; + } + + public void setLati(String lati) { + this.lati = lati; + } + + public String getLongi() { + return longi; + } + + public void setLongi(String longi) { + this.longi = longi; + } + @Exclude public Map toMap() { HashMap result = new HashMap<>(); @@ -140,6 +162,8 @@ public Map toMap() { result.put("usatw", usatw); result.put("keyf", keyf); result.put("admin", admin); + result.put("lati", lati); + result.put("longi", longi); return result; } diff --git a/app/src/main/java/com/eusecom/attendance/models/User.java b/app/src/main/java/com/eusecom/attendance/models/User.java index 5302566..1e0b3be 100644 --- a/app/src/main/java/com/eusecom/attendance/models/User.java +++ b/app/src/main/java/com/eusecom/attendance/models/User.java @@ -14,6 +14,8 @@ public class User { public String usatw; public String keyf; public String admin; + public String lati; + public String longi; public User() { // Default constructor required for calls to DataSnapshot.getValue(User.class) @@ -24,6 +26,8 @@ public User(String username, String email) { this.email = email; this.keyf = "0"; this.admin = "0"; + this.lati = "0"; + this.longi = "0"; } public User(String username, String email, String ustype, String usico, String usatw) { @@ -35,6 +39,8 @@ public User(String username, String email, String ustype, String usico, String u this.usatw = usatw; this.keyf = "0"; this.admin = "0"; + this.lati = "0"; + this.longi = "0"; } public String getAdmin() { @@ -54,6 +60,24 @@ public User(String username, String email, String ustype, String usico, String u this.usatw = usatw; this.keyf = "0"; this.admin = "0"; + this.lati = "0"; + this.longi = "0"; + } + + public String getLati() { + return lati; + } + + public void setLati(String lati) { + this.lati = lati; + } + + public String getLongi() { + return longi; + } + + public void setLongi(String longi) { + this.longi = longi; } public String getUstype() {