Ejemplo n.º 1
0
    st - stop ID
examples:
abstractedsheep.com/~ashulgach/dataservice.php?action=get_next_eta      # gets the next eta for all stops
abstractedsheep.com/~ashulgach/dataservice.php?action=get_next_eta&rt=1 # gets the next eta for West Route
abstractedsheep.com/~ashulgach/dataservice.php?action=get_all_eta       # gets all the etas for all shuttles and stops
*/
include "application.php";
include "apps/data_service.php";
$data_service = new DataService();
$action = $_REQUEST['action'];
$shuttle_id = $_REQUEST['sh'];
$route_id = $_REQUEST['rt'];
$stop_id = $_REQUEST['st'];
switch ($action) {
    case 'get_next_eta':
        echo $data_service->getNextEta($route_id, $stop_id);
        DataServiceData::recordStats("Get Next ETA");
        exit;
    case 'get_all_eta':
        echo $data_service->getAllEta($route_id, $shuttle_id, $stop_id);
        DataServiceData::recordStats("Get All ETA");
        exit;
    case 'get_all_extra_eta':
        echo $data_service->getAllExtraEta($route_id, $shuttle_id, $stop_id);
        DataServiceData::recordStats("Get Extra ETA");
        exit;
    case 'get_shuttle_positions':
        echo $data_service->getShuttlePositions();
        DataServiceData::recordStats("Get Shuttle Positions");
        exit;
    case 'get_eta_and_positions':