Skip to content

Commit

Permalink
Approve Activity
Browse files Browse the repository at this point in the history
#12
- set aprv=1 approved / aprv=2 refused in firebase absences childs
  • Loading branch information
eurosecom committed Apr 9, 2017
1 parent db56f7d commit f0436e0
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,19 @@ public void onClick(View v) {

private void approveFBPost(String postkey, int anodaj, Attendance model) {

//set appr at firebase child
String apprx="1";
if( anodaj == 1) {
apprx="1";
}else{
apprx="2";
}

mDatabase.child("absences").child(postkey).child("aprv").setValue(apprx);
mDatabase.child("user-absences").child(model.usid).child(postkey).child("aprv").setValue(apprx);
mDatabase.child("company-absences").child(model.usico).child(postkey).child("aprv").setValue(apprx);

//send notifycation
//Toast.makeText(getActivity(), "Set approved=1", Toast.LENGTH_LONG).show();
String Notititle = SettingsActivity.getUsname(getActivity()) + " " + model.dmxa + " " + model.dmna;
long timestampod = Long.parseLong(model.daod) * 1000L;
Expand Down

0 comments on commit f0436e0

Please sign in to comment.