* @param approverId
*/
public void approveMyFlight(String userId, String flightId,
String approverId) {
try {
JSONArray flts = (JSONArray) myFlights.get("myflights");
@SuppressWarnings("rawtypes")
Iterator iter = flts.iterator();
while (iter.hasNext()) {
JSONObject o = (JSONObject) iter.next();
String fId = o.getString("UserId");
String uId = o.getString("FlightId");
String aId = o.getString("ApproverId");
// Checks to see if the flight id and uid and aId exist
if (fId.compareTo(flightId) == 0 && uId.compareTo(userId) == 0
&& aId.compareTo(approverId) == 0) {
flts.remove(o);
o.put("state", "approved");
flts.put(o);
}
}
flts.remove(flightId);
myFlights.remove("myflights");
myFlights.put("myflights", flts);
} catch (Exception e) {