|
|
@ -3,9 +3,14 @@ package ru.visionlab.femdemo; |
|
|
|
import androidx.appcompat.app.AppCompatActivity; |
|
|
|
|
|
|
|
import android.app.ProgressDialog; |
|
|
|
import android.content.Intent; |
|
|
|
import android.os.Bundle; |
|
|
|
import android.view.View; |
|
|
|
import android.widget.AdapterView; |
|
|
|
import android.widget.ImageButton; |
|
|
|
import android.widget.ListAdapter; |
|
|
|
import android.widget.ListView; |
|
|
|
import android.widget.SimpleAdapter; |
|
|
|
import android.widget.TextView; |
|
|
|
import android.widget.Toast; |
|
|
|
|
|
|
@ -18,6 +23,9 @@ import org.json.JSONArray; |
|
|
|
import org.json.JSONException; |
|
|
|
import org.json.JSONObject; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
|
|
|
|
public class ApprovalListActivity extends AppCompatActivity { |
|
|
|
|
|
|
|
ImageButton back; |
|
|
@ -25,10 +33,14 @@ public class ApprovalListActivity extends AppCompatActivity { |
|
|
|
|
|
|
|
String RequestID,EmployeeID,EmployeeName,LDate,LTimeOut,LTimeIn,NoOfHrs,LeaveType,ApproverID,ApproverName,Reason; |
|
|
|
|
|
|
|
ListView lv; |
|
|
|
ArrayList<HashMap<String,String>> arrayList; |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void onCreate(Bundle savedInstanceState) { |
|
|
|
super.onCreate(savedInstanceState); |
|
|
|
setContentView(R.layout.activity_approval_list); |
|
|
|
//setContentView(R.layout.activity_approval_list); |
|
|
|
setContentView(R.layout.activity_approval_new_list); |
|
|
|
|
|
|
|
back = findViewById(R.id.back); |
|
|
|
back.setOnClickListener(new View.OnClickListener() { |
|
|
@ -39,9 +51,14 @@ public class ApprovalListActivity extends AppCompatActivity { |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
arrayList=new ArrayList<>(); |
|
|
|
lv = findViewById(R.id.listview); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PermissionApprovalList(); |
|
|
|
|
|
|
|
RequestIDVal = findViewById(R.id.RequestIDVal); |
|
|
|
/*RequestIDVal = findViewById(R.id.RequestIDVal); |
|
|
|
EmployeeIDVal = findViewById(R.id.EmployeeIDVal); |
|
|
|
EmployeeNameVal = findViewById(R.id.EmployeeNameVal); |
|
|
|
LDateVal = findViewById(R.id.LDateVal); |
|
|
@ -52,7 +69,7 @@ public class ApprovalListActivity extends AppCompatActivity { |
|
|
|
ApproverIDVal = findViewById(R.id.ApproverIDVal); |
|
|
|
ApproverNameVal = findViewById(R.id.ApproverNameVal); |
|
|
|
ReasonVal = findViewById(R.id.ReasonVal); |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
@ -66,7 +83,11 @@ public class ApprovalListActivity extends AppCompatActivity { |
|
|
|
public void onResponse(String response) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
JSONArray jsonArray=new JSONArray(response); |
|
|
|
for(int i = 0;i<jsonArray.length();i++){ |
|
|
|
|
|
|
|
JSONObject jb1=jsonArray.getJSONObject(0); |
|
|
|
RequestID = jb1.getString("RequestID"); |
|
|
|
EmployeeID = jb1.getString("EmployeeID"); |
|
|
@ -80,7 +101,26 @@ public class ApprovalListActivity extends AppCompatActivity { |
|
|
|
ApproverName = jb1.getString("ApproverName"); |
|
|
|
Reason = jb1.getString("Reason"); |
|
|
|
|
|
|
|
RequestIDVal.setText(RequestID); |
|
|
|
HashMap<String,String> data = new HashMap<>(); |
|
|
|
data.put("EmployeeName",EmployeeName); |
|
|
|
data.put("EmployeeID",EmployeeID); |
|
|
|
data.put("LeaveType",LeaveType); |
|
|
|
data.put("ApproverName",ApproverName); |
|
|
|
|
|
|
|
arrayList.add(data); |
|
|
|
|
|
|
|
ListAdapter adapter = new SimpleAdapter(ApprovalListActivity.this,arrayList,R.layout.listview_layout |
|
|
|
,new String[]{"EmployeeName","EmployeeID","LeaveType","ApproverName"},new int[]{R.id.EmployeeNameVal,R.id.EmployeeIDVal,R.id.LeaveTypeVal,R.id.ApproverNameVal}); |
|
|
|
lv.setAdapter(adapter); |
|
|
|
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() { |
|
|
|
@Override |
|
|
|
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { |
|
|
|
Intent intent = new Intent(ApprovalListActivity.this,LeaveRequestDetailsActivity.class); |
|
|
|
startActivity(intent); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
/*RequestIDVal.setText(RequestID); |
|
|
|
EmployeeIDVal.setText(EmployeeID); |
|
|
|
EmployeeNameVal.setText(EmployeeName); |
|
|
|
LDateVal.setText(LDate); |
|
|
@ -91,7 +131,7 @@ public class ApprovalListActivity extends AppCompatActivity { |
|
|
|
ApproverIDVal.setText(ApproverID); |
|
|
|
ApproverNameVal.setText(ApproverName); |
|
|
|
ReasonVal.setText(Reason); |
|
|
|
|
|
|
|
*/ } |
|
|
|
|
|
|
|
} catch (JSONException e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|