diff --git a/.idea/misc.xml b/.idea/misc.xml
index fbb6828..5d19981 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -37,7 +37,7 @@
-
+
diff --git a/app/app.iml b/app/app.iml
index a55e4b4..d9e8f82 100644
--- a/app/app.iml
+++ b/app/app.iml
@@ -12,12 +12,10 @@
+
-
- generateDebugAndroidTestSources
- generateDebugSources
-
+
@@ -65,10 +63,12 @@
+
-
+
+
@@ -76,13 +76,17 @@
+
+
+
+
+
-
+
-
@@ -99,8 +103,8 @@
-
+
diff --git a/app/src/main/java/com/delta/attendancemanager/AtAdapter.java b/app/src/main/java/com/delta/attendancemanager/AtAdapter.java
index ea5063d..f40d20b 100644
--- a/app/src/main/java/com/delta/attendancemanager/AtAdapter.java
+++ b/app/src/main/java/com/delta/attendancemanager/AtAdapter.java
@@ -122,6 +122,15 @@ public ArrayList getSubj() {
return subj;
}
+ public void refresh_delete_data(String subject, String datet){
+ Log.i("in AtAdapter","refresh delete data called");
+ if(subject==null|| subject.isEmpty()||datet.isEmpty())
+ return;
+ SQLiteDatabase db = athelper.getWritableDatabase();
+ //DELETE * FROM attendance WHERE subject = subject AND datetime = datet AND present = 0;
+ db.delete(Athelper.TABLE_NAME,Athelper.SUBJECT+ " =? AND "+Athelper.DATETIME+" =? AND "+Athelper.PRESENT+" == 0",new String[]{subject,datet});
+ }
+
public void delete_data(String subject,String datet){ //as of now no use
Log.i("in AtAdapter","delete data called");
if(subject==null|| subject.isEmpty()||datet.isEmpty())
diff --git a/app/src/main/java/com/delta/attendancemanager/AttendanceServerService.java b/app/src/main/java/com/delta/attendancemanager/AttendanceServerService.java
index 310ca7b..5f88068 100644
--- a/app/src/main/java/com/delta/attendancemanager/AttendanceServerService.java
+++ b/app/src/main/java/com/delta/attendancemanager/AttendanceServerService.java
@@ -164,6 +164,8 @@ private void handleAdd(){
String format = "yyyy-MM-dd HH:mm";
SimpleDateFormat sdf = new SimpleDateFormat(format);
Calendar now = Calendar.getInstance();
+ if(now.get(Calendar.HOUR_OF_DAY)>15)
+ now.add(Calendar.DAY_OF_MONTH,1);
for(int i=1;i<=8;i++){
Date date = new Date(now.get(Calendar.YEAR)-1900, now.get(Calendar.MONTH), now.get(Calendar.DAY_OF_MONTH),TTimings.hour[i], TTimings.min[i]); //1900+yyyy; TODO: check whther the normal date is working or change it to 1900+yyyy.
atAdapter.add_attendance(subjects[i], sdf.format(date), 0);
@@ -178,9 +180,11 @@ private void handledelete(){
String format = "yyyy-MM-dd HH:mm";
SimpleDateFormat sdf = new SimpleDateFormat(format);
Calendar now = Calendar.getInstance();
+ if(now.get(Calendar.HOUR_OF_DAY)>15)
+ now.add(Calendar.DAY_OF_MONTH,1);
for(int i=1;i<=8;i++){
Date date = new Date(now.get(Calendar.YEAR)-1900, now.get(Calendar.MONTH), now.get(Calendar.DAY_OF_MONTH),TTimings.hour[i], TTimings.min[i]); //1900+yyyy; TODO: check whther the normal date is working or change it to 1900+yyyy.
- atAdapter.delete_data(subjects[i], sdf.format(date));
+ atAdapter.refresh_delete_data(subjects[i], sdf.format(date));
}
}
diff --git a/app/src/main/java/com/delta/attendancemanager/CRhomesliderfragment.java b/app/src/main/java/com/delta/attendancemanager/CRhomesliderfragment.java
index 34ab384..39459dc 100644
--- a/app/src/main/java/com/delta/attendancemanager/CRhomesliderfragment.java
+++ b/app/src/main/java/com/delta/attendancemanager/CRhomesliderfragment.java
@@ -438,6 +438,7 @@ public void destroyItem(ViewGroup container, int position, Object object) {
public void UpdateSubs(String subs){
final String[] days = {"Monday","Tuesday","Wednesday","Thursday","Friday","tomorrow"};
String[] dayTimetable = new String[9];
+ AttendanceServerService.deleteAttendance(context);
for (String day : days ){
switch(day){
case "Monday":
@@ -506,6 +507,8 @@ public void UpdateSubs(String subs){
}
}
+ AttendanceServerService.addAttendance(context);
+
UpdateTTService.startActionTT(getActivity(), j);
getActivity().startActivity(new Intent(getActivity(),CRhome.class));