Esempio n. 1
0
 function leave()
 {
     if (!isset($_POST["e_eid"])) {
         RoutingEngine::returnAjax("Error.");
     }
     $eid = $_POST["e_eid"];
     $result = Event::removeAttendeeFromEvent($eid);
     RoutingEngine::returnAjax($result, true);
 }
Esempio n. 2
0
 public function ajax_route_data()
 {
     RoutingEngine::setPage("runnDAILY Routes", "PV__300");
     if (!isset($_GET["rid"])) {
         RoutingEngine::returnAjax(false);
     }
     $route = Route::sql()->select("r_points")->where_eq("r_id", $_GET["rid"])->execute(false, false);
     //$route = Route::getPolyline($_GET["rid"]);
     //note that this already is JSON
     RoutingEngine::returnAjax($route["r_points"], false);
 }
Esempio n. 3
0
 public function ajax_remove_friend()
 {
     RoutingEngine::setPage("runnDAILY", "PV__300");
     if (!isset($_POST["f_uid"])) {
         RoutingEngine::returnAjax(array("result" => false), true);
     }
     $friend_uid = $_POST["f_uid"];
     $removed = User::$current_user->removeFriend($friend_uid);
     RoutingEngine::getInstance()->persistUserData();
     RoutingEngine::returnAjax(array("result" => $removed), true);
 }
Esempio n. 4
0
 public function actionCancel()
 {
     RoutingEngine::setPage("runnDAILY Requests", "PV__300");
     $cid = $_POST["cid"];
     $confirmation = Confirmation::fetch($cid);
     $result = false;
     if ($confirmation->uid_from == User::$current_user->uid) {
         $result = $confirmation->delete();
     }
     //Javascript is expecting an object with result and cid
     $output = array("cid" => $cid, "result" => $result);
     RoutingEngine::returnAjax($output, true);
 }
Esempio n. 5
0
 public static function returnAjaxForm($result, $data)
 {
     $output = array("data" => $data, "result" => $result);
     RoutingEngine::returnAjax($output, true);
 }
Esempio n. 6
0
 function ajax_remove_notification()
 {
     RoutingEngine::setPage("runnDAILY User Remove Notification", "PV__300");
     if (!isset($_POST["id"])) {
         return false;
     }
     $id = $_POST["id"];
     Notification::remove($id);
     RoutingEngine::getInstance()->persistUserData();
     RoutingEngine::returnAjax(true);
 }