Example #1
0
                $gender = $_REQUEST['gender'];
                $o = Event::getNearbyEvents($u, $radius, $gender);
                if ($o) {
                    echo json_encode($o);
                } else {
                    error("Problem with the DB");
                }
            } else {
                if ($_REQUEST['action'] == "getlastevents") {
                    $fp->log("getlastevents");
                    $lon = $_REQUEST['lon'];
                    $lat = $_REQUEST['lat'];
                    $radius = isset($_REQUEST['radius']) ? $_REQUEST['radius'] : 20000;
                    $start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
                    $n = isset($_REQUEST['n']) ? $_REQUEST['n'] : 20;
                    $o = Event::getLastEvents($lon, $lat, $radius, $start, $n);
                    if ($o) {
                        echo json_encode($o);
                    } else {
                        error("Problem with the DB");
                    }
                } else {
                    error('action unrecognized');
                }
            }
        }
    }
} else {
    error('no action specified');
}
//$timer->setMarker('setup');