From: Maxious Date: Tue, 13 Mar 2012 03:02:43 +0000 Subject: Fixed - showing old service alerts when calling the future alerts function X-Git-Url: http://maxious.lambdacomplex.org/git/?p=busui.git&a=commitdiff&h=09bede59e797ee703dd0580a93e0710a6c06b6f8 --- Fixed - showing old service alerts when calling the future alerts function --- --- a/.gitmodules +++ b/.gitmodules @@ -1,16 +1,13 @@ -<<<<<<< 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 --- 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(); --- 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +