$next_time = $stop_time['nextScheduled']; $next_seconds = $next_time - $time; $stopname = $stop_time['title']; break; } } } if ($next_seconds > 0 && $next_seconds < SHUTTLE_NOTIFY_THRESHOLD) { $shuttle = ShuttleSchedule::get_title($route_id); $minutes = intval($next_seconds / 60); $timestr = date('g:ia', $next_time); switch ($source) { case 'nextbus': $stopname = ShuttleSchedule::get_stop_title($route_id, $stop_id); $message = "$shuttle arriving at $stopname in $minutes minutes ($timestr)"; break; case 'schedule': // $stopname was defined earlier $message = "$shuttle (NOT GPS TRACKED) scheduled to arrive at $stopname in $minutes minutes ($timestr)"; break; } //$stopname = ShuttleSchedule::get_stop_title($route_id, $stop_id); switch ($row['device_type']) { case 'apple': $aps = array('aps' => array('alert' => $message, 'sound' => 'default'));