US 30 both directions : Accident;;Description=>NJ DOT - TOC South: Accident on US 30 both directions East of CR 700/Linden Av (Lindenwold) traffic shift 5-10 minute delay use caution;;PubTime=>Wed, 10 Apr 2013 16:24:37 -0400;;Geo=>39.8154772416 -74.9911315733 */ if(!isset($a)) return array(); $t = explode("%@|", $a); $size = count($t); $ret = array(); for($i=0;$i<$size;$i++) { $t1 = explode(";;", $t[$i]); $title = explode("=>", $t1[0]); $desc = explode("=>", $t1[1]); $time = explode("=>", $t1[2]); if(startsWithNumber($title[1]) && strlen($title[1]) <= 3) { $ret[$i]["time"] = $title[1]; $ret[$i]["title"] = ""; $ret[$i]["desc"] = "" . $title[1] . " ago: " . $desc[1]; } else { $ret[$i]["title"] = $title[1]; $ret[$i]["desc"] = strip_tags($desc[1]); $ret[$i]["time"] = $time[1]; } } return $ret; } function displayDotEvents($stateCode, $NUM) { $events = getDotEvents($stateCode); $ret = parseDotEvents($events); $size = count($ret); for($i=0;$i<$size;$i++) { $desc = $ret[$i]["desc"]; if(isset($NUM)) if( (strpos($desc,"I-$NUM") === false) && (strpos($desc,"I $NUM") === false) &&(strpos($desc,"Interstate $NUM") === false) ) continue; echo "
  • "; if($ret[$i]["title"] == "") { echo $ret[$i]["desc"]; } else { echo "" . $ret[$i]["title"] . ""; echo "
    "; echo $ret[$i]["desc"]; echo "
    "; echo "" . $ret[$i]["time"] . ""; } echo "
  • "; } } $stateIndex = $_GET['i']; if($stateIndex >= count($city_list)) $stateIndex = count($city_list) - 1; $state = $city_list[$stateIndex][0]; $stateCode = $state; $state_name = getStateName($state); $title = "I-$NUM Traffic Road Conditions $state_name - Roadnow"; $content = "I-$NUM traffic,road conditions in $state_name,Interstate $NUM $state_name current traffic,road conditions and accident reports."; $keys = $content; $hwy = $hwy_name; //$bbox = getBboxForRoadInState($hwy,$state); //$incidents = getIncidentsReports($bbox); $size = count($incidents); $k=0; for($i=0;$i<$size;$i++) { if(strpos($incidents[$i]->{"shortDesc"}, $hwy) === false ) continue; $incidents_reports[$k]['title'] = $incidents[$i]->{"shortDesc"}; $incidents_reports[$k]['desc'] = $incidents[$i]->{"fullDesc"}; $incidents_reports[$k]['start'] = $incidents[$i]->{"startTime"}; $incidents_reports[$k]['end'] = $incidents[$i]->{"endTime"}; $incidents_reports[$k]['startOrig'] = $incidents[$i]->{"startTimeOrig"}; $incidents_reports[$k]['endOrig'] = $incidents[$i]->{"endTimeOrig"}; $incidents_reports[$k]['icon'] = $incidents[$i]->{"iconURL"}; $incidents_reports[$k]['la'] = $incidents[$i]->{"lat"}; $incidents_reports[$k]['ln'] = $incidents[$i]->{"lng"}; $incidents_reports[$k]['timeago'] = $incidents[$i]->{"timeago"}; $k++; } $gps = getHwyMidPoint($hwy,$state); $la = $gps[0]; $ln = $gps[1]; $centerLa = $gps[0]; $centerLn = $gps[1]; $pageId="traffic_state"; $stateNameGood = good($state_name); $alerts_count = getWeatherAlertCount($hwy,$state); if($alerts_count == 0 ) $weather = ""; else $weather = "$state Weather Alerts ($alerts_count)"; $dotSite = $dotSites[$state]; $t = explode(";", $dotSite); if(count($t) > 1) $dotSite = trim($t[1]); else $dotSite = trim($t[0]); $numEvents = 0; $events = getDotEvents("$state,S"); $t = explode("%@|", $events); if(count($t) > 1) $numEvents = $t[0]; $stateCode_L = strtolower($state); $state_name_good = strtolower(good($state_names[$state])); if($numEvents ==0) $dot = "( see also $state DOT )"; else $dot = "( see also $state Incident Reports ($numEvents) )"; $stateNameGood = str_replace(" ","+", $state_names[$state]); $news_reports = getNewsEvents("I-$NUM+$stateNameGood"); $news_num = count($news_reports); $news = "I-$NUM $state_name News ($news_num)"; //$content .= "
    " . $dot; ?>

    "; if($numEvents > 0) { echo "
  • "; //echo "$state Incident Reports ($numEvents)"; echo "$state_name DOT Incidents ($numEvents)"; echo "
  • "; } if(strlen($weather) >0) { echo "
  • "; echo $weather; echo "
  • "; } if($news_num >0) { echo "
  • "; echo $news; echo "
  • "; } echo "
  • Report an Incident"; echo ""; ?>


    Traffic Reports


    "; $size = count($incidents_reports); for($i=0;$i<$size;$i++) { $title = $incidents_reports[$i]['title']; $desc = $incidents_reports[$i]['desc']; $start = $incidents_reports[$i]['start']; $end = $incidents_reports[$i]['end']; $startOrig = $incidents_reports[$i]['startOrig']; $endOrig = $incidents_reports[$i]['endOrig']; $la = $incidents_reports[$i]['la']; $ln = $incidents_reports[$i]['ln']; $timeago = $incidents_reports[$i]['timeago']; $citystate = getCityState("$la,$ln"); $city = $citystate[0]; $city_good = good($citystate[0]); $state = $citystate[1]; echo "
  • "; /* echo "
    "; echo "$timeago ago
    "; //echo "$title, near $city_url
    "; echo "$title, near $city, $state
    "; echo "$desc
    "; echo "start time: $start
    "; echo "end time: $end
    "; echo "
    "; */ echo "
    "; echo "$timeago ago
    "; //echo "$title, near $city_url
    "; echo "$title"; echo ", near $city,$state
    "; echo "$desc
    "; echo "start time: $start
    "; echo "end time: $end
    "; echo "
    "; echo "
  • "; } displayDotEvents($stateCode,$NUM); echo ""; ?>