Skip to content

Commit

Permalink
Main Activity Attendance
Browse files Browse the repository at this point in the history
#2
- models User.java and Employee.java expanded by geo lati and longi its
location by login and logout
  • Loading branch information
eurosecom committed Sep 3, 2017
1 parent bb73d70 commit 300ca19
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/com/eusecom/attendance/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
24 changes: 24 additions & 0 deletions app/src/main/java/com/eusecom/attendance/models/Employee.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 ) {
Expand All @@ -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
Expand Down Expand Up @@ -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<String, Object> toMap() {
HashMap<String, Object> result = new HashMap<>();
Expand All @@ -140,6 +162,8 @@ public Map<String, Object> toMap() {
result.put("usatw", usatw);
result.put("keyf", keyf);
result.put("admin", admin);
result.put("lati", lati);
result.put("longi", longi);

return result;
}
Expand Down
24 changes: 24 additions & 0 deletions app/src/main/java/com/eusecom/attendance/models/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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) {
Expand All @@ -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() {
Expand All @@ -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() {
Expand Down

0 comments on commit 300ca19

Please sign in to comment.