From: Maxious Date: Tue, 20 Mar 2012 23:35:19 +0000 Subject: Merge branch 'master' of github.com:maxious/ACTBus-ui X-Git-Url: https://maxious.lambdacomplex.org/git/?p=busui.git&a=commitdiff&h=d3875c56a93293248be8ea7c0af8cf264ab7aa9a --- Merge branch 'master' of github.com:maxious/ACTBus-ui --- --- a/.gitmodules +++ b/.gitmodules @@ -1,16 +1,18 @@ -<<<<<<< HEAD [submodule "js/flotr2"] path = js/flotr2 url = https://github.com/HumbleSoftware/Flotr2.git [submodule "js/FlashCanvas"] path = js/FlashCanvas url = https://github.com/timcameronryan/FlashCanvas -======= [submodule "lib/amon-php"] path = lib/amon-php url = https://github.com/martinrusev/amon-php.git [submodule "js/yepnope"] path = js/yepnope url = https://github.com/SlexAxton/yepnope.js.git ->>>>>>> 9714b3c938ad66f914c8d22144b8883e40f2ef09 - +[submodule "javascripts/tesseract"] + path = javascripts/tesseract + url = https://github.com/square/tesseract.git +[submodule "javascripts/d3"] + path = javascripts/d3 + url = https://github.com/mbostock/d3.git --- a/include/db/servicealert-dao.inc.php +++ b/include/db/servicealert-dao.inc.php @@ -106,7 +106,19 @@ function getFutureAlerts() { global $conn; - $query = "SELECT id,extract('epoch' from start) as start, extract('epoch' from \"end\") as \"end\",cause,effect,header,description,url from servicealerts_alerts where NOW() > start or NOW() < \"end\""; + $query = "SELECT id,extract('epoch' from start) as start, extract('epoch' from \"end\") as \"end\",cause,effect,header,description,url from servicealerts_alerts where NOW() < \"end\""; + // debug($query, "database"); + $query = $conn->prepare($query); + $query->execute(); + if (!$query) { + databaseError($conn->errorInfo()); + return Array(); + } + return $query->fetchAll(); +} +function getAllAlerts() { + global $conn; + $query = "SELECT id,extract('epoch' from start) as start, extract('epoch' from \"end\") as \"end\",cause,effect,header,description,url from servicealerts_alerts"; // debug($query, "database"); $query = $conn->prepare($query); $query->execute(); --- /dev/null +++ b/labs/busdelay.csv.php @@ -1,1 +1,52 @@ +prepare(' +SELECT * from myway_timingdeltas' + , array(PDO::ATTR_CURSOR => PDO::FETCH_ORI_NEXT)); +$query->execute(); +$errors = $conn->errorInfo(); +if ($errors[2] != "") { + die("Export terminated, db error" . print_r($errors, true)); +} + +$headers = Array("date", "delay", "distance", "origin", "destination"); + +$fp = fopen('php://output', 'w'); +if ($fp && $query) { + //header('Content-Type: text/csv'); + header('Pragma: no-cache'); + header('Expires: 0'); + fputcsv($fp, $headers); + while ($r = $query->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) { + $row = Array(); + foreach ($headers as $i => $fieldName) { + switch ($fieldName) { + case "date": + $row[] = date("dm",strtotime($r['date'])).date("Hi",strtotime($r['time'])); + break; + case "delay": + $row[] = $r['timing_delta']; + break; + case "distance": + $row[] = $r['stop_sequence']; + break; + case "origin": + $row[] = $r['myway_stop']; + break; + case "destination": + $row[] = $r['route_name']; + break; + default: + break; + } + } + fputcsv($fp, array_values($row)); + } + die; +} +?> + + --- /dev/null +++ b/labs/busdelay.php @@ -1,1 +1,498 @@ - + + +Tesseract + + + +
+
+
Time of Day
+
+
+
Arrival Delay (min.)
+
+
+
Distance (mi.)
+
+
+
Date
+
+
+ + + +
+
+
+ + + + + + + + + --- a/rtpis/servicealert_editor.php +++ b/rtpis/servicealert_editor.php @@ -82,7 +82,7 @@ '; + echo "'; } ?>
" . date("c", $alert['start']) . "" . date("c", $alert['end']) . "" . substr($alert['description'], 0, 999) . 'edit
" . date("c", $alert['start']) . "
to
" . date("c", $alert['end']) . "
" .$alert['header']."
". $alert['description'] . '
edit
--- /dev/null +++ b/setup/graph-config.xml @@ -1,1 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +