Commit a7368eb6 authored by root's avatar root

% out of table and change to number vs text so you can sort it for api and more

parent 684e1dbf
......@@ -28,7 +28,7 @@ echo <<<EOF
<title>{$method}{$row['domain']}</title>
<link href="{$method}{$row['domain']}"/>
<id>urn:{$row['domain']}</id>
<summary>Location {$row['city']}, {$row['state']}<![CDATA[<br/>]]>Status {$row['status']}<![CDATA[<br/>]]>Uptime last 7 days {$row['uptimelast7']}<![CDATA[<br/>]]>Response Time {$row['responsetimelast7']}<![CDATA[<br/>]]>Last Git Update {$row['hgitdate']}<![CDATA[<br/>]]>Listed for {$row['monthsmonitored']} months<![CDATA[<br/>]]>Pingdom URL <![CDATA[<A href="{$row['pingdomurl']}">{$row['pingdomurl']}</a>]]></summary>
<summary>Location {$row['city']}, {$row['state']}<![CDATA[<br/>]]>Status {$row['status']}<![CDATA[<br/>]]>Uptime last 7 days {$row['uptimelast7']}%<![CDATA[<br/>]]>Response Time {$row['responsetimelast7']}<![CDATA[<br/>]]>Last Git Update {$row['hgitdate']}<![CDATA[<br/>]]>Listed for {$row['monthsmonitored']} months<![CDATA[<br/>]]>Pingdom URL <![CDATA[<A href="{$row['pingdomurl']}">{$row['pingdomurl']}</a>]]></summary>
<georss:point>{$row['lat']} {$row['long']}</georss:point>
<georss:featureName>{$row['domain']}</georss:featureName>
</entry>
......@@ -63,7 +63,7 @@ elseif ($_GET['format'] == "json") {
while ($row = pg_fetch_array($result)) {
if ($row["status"] == "up"){$status="Online";}else{$status="Offline";}
if ($row["secure"] == "true") {$method = "https://";$class="green";} else {$method = "http://";$class="red";}
echo $method.$row["domain"] ." - ".$status." Now - Up ".$row["uptimelast7"]." This Month";
echo $method.$row["domain"] ." - ".$status." Now - Up ".$row["uptimelast7"]."% This Month";
if ($i < ($numrows -1)) {
echo ",";
}
......
......@@ -217,7 +217,7 @@ $implodemonths = implode(" ", $matchhistory[1]);
preg_match_all('/<option(.*?)/s',$implodemonths,$matchdates);
$months = count($matchdates[0]);
//uptime %
preg_match_all('/<h3>Uptime this month<\/h3>\s*<p class="large">(.*?)</',$pingdom,$matchper);
preg_match_all('/<h3>Uptime this month<\/h3>\s*<p class="large">(.*?)%</',$pingdom,$matchper);
$uptime = preg_replace("/,/", ".", $matchper[1][0]);
//var_dump($matchper);
//last check
......
......@@ -35,7 +35,7 @@ if ($row["secure"] == "true") {$method = "https://";$class="green";$tip="This po
echo "<tr><td><div title='$tip' class='tipsy'><a class='$class' target='new' href='". $method . $row["domain"] ."'>" . $method . $row["domain"] . "</a></div></td>";
echo "<td>" . $row["status"] . "</td>";
echo "<td><div class='tipsy' title='Git Revision ".$row["hgitref"]."'><div id='".$row["hgitdate"]."' class='utc-timestamp'>" . strtotime($row["hgitdate"]) . "</div></div></td>";
echo "<td>" . $row["uptimelast7"] . "</td>";
echo "<td>" . $row["uptimelast7"] . "%</td>";
echo "<td><div title='Last Check ".$row["dateupdated"]."' class='tipsy'><a target='new' href='".$row["pingdomurl"]."'>" . $row["monthsmonitored"] . "</a></div></td>";
if ($row["userrating"] >6) {$userratingclass="green";} elseif ($row["userrating"] <7) {$userratingclass="yellow";} elseif ($row["userrating"] <3) {$userratingclass="red";}
echo "<td><div class='tipsy rating ".$userratingclass."' title='User rating is ".$row["adminrating"]."'>";
......@@ -56,4 +56,4 @@ echo "✪";
pg_close($dbh);
?>
</tbody>
</table>
\ No newline at end of file
</table>
......@@ -26,7 +26,7 @@ CREATE TABLE pods (
pingdomurl text,
pingdomlast text,
monthsmonitored int,
uptimelast7 text,
uptimelast7 numeric{3,3},
status text,
responsetimelast7 text,
dateUpdated timestamp DEFAULT current_timestamp,
......@@ -52,4 +52,4 @@ CREATE TABLE users (
userurl text,
userpod text,
dateCreated timestamp DEFAULT current_timestamp
);
\ No newline at end of file
);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment