Commit 96215f86 authored by root's avatar root

Revert "Merge branch 'master' of https://github.com/MatrixCrawler/Poduptime...

Revert "Merge branch 'master' of https://github.com/MatrixCrawler/Poduptime into MatrixCrawler-master"

This reverts commit 4bfef977, reversing
changes made to b2666414.
parent 4bfef977
<?php <?php
/** //Copyright (c) 2011, David Morley. This file is licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file.
* Copyright (c) 2011, David Morley. if ($_GET['key'] != "4r45tg") {exit;}
* This file is licensed under the Affero General Public License version 3 or later. include('db/config.php');
* See the COPYRIGHT file. $dbh = pg_connect("dbname=$pgdb user=$pguser password=$pgpass");
*/ if (!$dbh) {
die("Error in connection: " . pg_last_error());
}
if ($_GET['format'] == "georss") {
echo <<<EOF
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:georss="http://www.georss.org/georss">
<title>Diaspora Pods</title>
<subtitle>IP Locations of Diaspora pods on podupti.me</subtitle>
<link href="http://podupti.me/"/>
EOF;
$sql = "SELECT * FROM pods WHERE hidden <> 'yes'";
$result = pg_query($dbh, $sql);
if (!$result) {
die("Error in SQL query: " . pg_last_error());
}
$numrows = pg_num_rows($result);
while ($row = pg_fetch_array($result)) {
if ($row["secure"] == "true") {$method = "https://";} else {$method = "http://";}
echo <<<EOF
<entry>
<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>
<georss:point>{$row['lat']} {$row['long']}</georss:point>
<georss:featureName>{$row['domain']}</georss:featureName>
</entry>
if ($_GET['key'] != "4r45tg") { EOF;
exit; }
} echo "</feed>";
require_once 'db/config.inc.php';
require_once 'db/db.class.php';
$dbConnection = DB::connectDB();
if (!$dbConnection) {
die("Error in connection: " . $dbConnection->errorInfo()[2]);
} }
if (isset($_GET['format'])) { elseif ($_GET['format'] == "json") {
if ($_GET['format'] == "georss") { $sql = "SELECT id,domain,status,secure,score,userrating,adminrating,city,state,country,lat,long,ip,ipv6,hgitdate,hgitref,pingdomurl,pingdomlast,monthsmonitored,uptimelast7,responsetimelast7,hruntime,hencoding,dateCreated,dateUpdated,dateLaststats,hidden FROM pods";
echo ' $result = pg_query($dbh, $sql);
<?xml version="1.0" encoding="utf-8"?> if (!$result) {
<feed xmlns="http://www.w3.org/2005/Atom" die("Error in SQL query: " . pg_last_error());
xmlns:georss="http://www.georss.org/georss"> }
<title>Diaspora Pods</title> $numrows = pg_num_rows($result);
<subtitle>IP Locations of Diaspora pods on podupti.me</subtitle> //json output, thx Vipul A M for fixing this
<link href="http://podupti.me/"/> header('Content-type: application/json');
'; $rows=array_values(pg_fetch_all($result));
$sql = "SELECT * FROM pods WHERE hidden <> 'yes'"; $obj->podcount = $numrows;
$obj->pods = $rows;
$result = $dbConnection->query($sql); if ($_GET['method'] == "jsonp") {
if (!$result) { print $_GET['callback'] . '(' . json_encode($obj) . ')';
die("Error in SQL query: " . $dbConnection->errorInfo()[2]); } else {
} print json_encode($obj);
}
foreach ($result->fetchAll() as $row) {
if ($row["secure"] == "true") {
$method = "https://";
} else {
$method = "http://";
}
echo '
<entry>
<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>
<georss:point>{'.$row['lat'].'} {'.$row['long'].'}</georss:point>
<georss:featureName>{'.$row['domain'].'}</georss:featureName>
</entry>
';
}
echo "</feed>";
} elseif ($_GET['format'] == "json") {
$obj = new stdClass();
$sql = "SELECT id,domain,status,secure,score,userrating,adminrating,city,state,country,lat,long,ip,ipv6,hgitdate,hgitref,pingdomurl,pingdomlast,monthsmonitored,uptimelast7,responsetimelast7,hruntime,hencoding,dateCreated,dateUpdated,dateLaststats,hidden FROM pods";
$result = $dbConnection->query($sql);
if (!$result) {
die("Error in SQL query: " . $dbConnection->errorInfo()[2]);
}
//json output, thx Vipul A M for fixing this
header('Content-type: application/json');
$rows = array_values($result->fetchAll());
$obj->podcount = count($rows);
$obj->pods = $rows;
if (isset($_GET['method']) && $_GET['method'] == "jsonp") {
if (isset($_GET['callback'])) {
print $_GET['callback'] . '(' . json_encode($obj) . ')';
} else {
die("Parameter callback is missing.");
}
} else {
print json_encode($obj);
}
}
} else { } else {
$sql = "SELECT * FROM pods WHERE hidden <> 'yes' ORDER BY uptimelast7 DESC"; $i=0;
$result = $dbConnection->query($sql); $sql = "SELECT * FROM pods WHERE hidden <> 'yes' ORDER BY uptimelast7 DESC";
if (!$result) { $result = pg_query($dbh, $sql);
die("Error in SQL query: " . $dbConnection->errorInfo()[2]); if (!$result) {
} die("Error in SQL query: " . pg_last_error());
foreach ($result->fetchAll() as $row) { }
if ($row["status"] == "up"){ $numrows = pg_num_rows($result);
$status="Online"; while ($row = pg_fetch_array($result)) {
} else { if ($row["status"] == "up"){$status="Online";}else{$status="Offline";}
$status="Offline"; if ($row["secure"] == "true") {$method = "https://";$class="green";} else {$method = "http://";$class="red";}
} echo $row["domain"] ." Up ".$row["uptimelast7"]."% This Month - Located in: ".$row["country"];
if ($row["secure"] == "true") { if ($i < ($numrows -1)) {
$method = "https://";$class="green"; echo ",";
} else { }
$method = "http://";$class="red"; $i++;
} }
echo $row["domain"] ." Up ".$row["uptimelast7"]."% This Month - Located in: ".$row["country"];
echo ",";
}
} }
pg_free_result($result);
pg_close($dbh);
?> ?>
<!-- /* Copyright (c) 2011, David Morley. This file is licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file. */ -->
<?php <?php
/** $valid=0;
* Copyright (c) 2011, David Morley. include('config.php');
* This file is licensed under the Affero General Public License version 3 or later. if (!$_POST['url']){
* See the COPYRIGHT file. echo "no url given";
*/ die;
}
if (!$_POST['email']){
echo "no email given";
die;
}
if (!$_POST['domain']){
echo "no pod domain given";
die;
}
if (!$_POST['url']){
echo "no API key for your stats";
die;
}
if (strlen($_POST['url']) < 14){
echo "API key bad needs to be like m58978-80abdb799f6ccf15e3e3787ee";
die;
}
require_once 'config.inc.php'; $dbh = pg_connect("dbname=$pgdb user=$pguser password=$pgpass");
require_once 'db.class.php'; if (!$dbh) {
require_once 'pull.class.php'; die("Error in connection: " . pg_last_error());
}
$valid = 0; $sql = "SELECT domain,pingdomurl FROM pods";
if (! $_POST ['url']) { $result = pg_query($dbh, $sql);
echo "no url given"; if (!$result) {
die (); die("Error in SQL query: " . pg_last_error());
} }
if (! $_POST ['email']) { while ($row = pg_fetch_array($result)) {
echo "no email given"; if ($row["domain"] == $_POST['domain']) {
die (); echo "domain already exists";die;
} }
if (! $_POST ['domain']) { if ($row["pingdomurl"] == $_POST['url']) {
echo "no pod domain given"; echo "API key already exists";die;
die (); }
} }
if (! $_POST ['url']) {
echo "no API key for your stats"; //curl the header of pod with and without https
die ();
} $chss = curl_init();
if (strlen ( $_POST ['url'] ) < 14) { curl_setopt($chss, CURLOPT_URL, "https://".$_POST['domain']."/users/sign_in");
echo "API key bad needs to be like m58978-80abdb799f6ccf15e3e3787ee"; curl_setopt($chss, CURLOPT_POST, 1);
die (); curl_setopt($chss, CURLOPT_HEADER, 1);
} curl_setopt($chss, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($chss, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($chss, CURLOPT_NOBODY, 1);
$outputssl = curl_exec($chss);
curl_close($chss);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://".$_POST['domain']."/users/sign_in");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_NOBODY, 1);
$output = curl_exec($ch);
curl_close($ch);
if (stristr($outputssl, 'Set-Cookie: _diaspora_session=')) {
echo "Your pod has ssl and is valid<br>";
$valid=1;
}
if (stristr($output, 'Set-Cookie: _diaspora_session=')) {
echo "Your pod does not have ssl but is a valid pod<br>";
$valid=1;
}
$dbConnection = DB::connectDB(); if ($valid=="1") {
if (!$dbConnection) { $sql = "INSERT INTO pods (domain, pingdomurl, email) VALUES($1, $2, $3)";
die ( "Error in connection: " . $dbConnection->errorInfo()[2] ); $result = pg_query_params($dbh, $sql, array($_POST['domain'], $_POST['url'], $_POST['email']));
} if (!$result) {
$sql = "SELECT domain,pingdomurl FROM pods"; die("Error in SQL query: " . pg_last_error());
}
$to = $adminemail;
$subject = "New pod added to poduptime ";
$message = "http://podupti.me\n\n Pingdom Url:" . $_POST["url"] . "\n\n Pod:" . $_POST["domain"] . "\n\n";
$headers = "From: ".$_POST["email"]."\r\nReply-To: ".$_POST["email"]."\r\n";
@mail( $to, $subject, $message, $headers );
$result = $dbConnection->query($sql); echo "Data successfully inserted! Your pod will be reviewed and live on the list soon! You will get a support ticket, no need to do anything if your pod is listed in the next few hours.";
if (! $result) {
die ( "Error in SQL query: " . $dbConnection->errorInfo()[2] ); pg_free_result($result);
pg_close($dbh);
} else {
echo "Could not validate your pod on http or https, check your setup!";
} }
foreach ($result->fetchAll() as $row) {
if ($row ["domain"] == $_POST ['domain']) {
echo "domain already exists";
die ();
}
if ($row ["pingdomurl"] == $_POST ['url']) {
echo "API key already exists";
die ();
}
}
// curl the header of pod with and without https
$outputssl = Pull::getCurlResult("https://" . $_POST ['domain'] . "/users/sign_in");
$output = Pull::getCurlResult("http://" . $_POST ['domain'] . "/users/sign_in");
if (stristr ( $outputssl, 'Set-Cookie: _diaspora_session=' )) {
echo "Your pod has ssl and is valid<br>";
$valid = 1;
}
if (stristr ( $output, 'Set-Cookie: _diaspora_session=' )) {
echo "Your pod does not have ssl but is a valid pod<br>";
$valid = 1;
}
if ($valid == "1") {
$sql = "INSERT INTO pods (domain, pingdomurl, email) VALUES(".$dbConnection->quote($_POST['domain']).", ".$dbConnection->quote($_POST['url']).", ".$dbConnection->quote($_POST['email']).")";
$result = $dbConnection->query($sql);
if (! $result) {
die ( "Error in SQL query: " . $dbConnection->errorInfo()[2]);
}
$subject = "New pod added to poduptime ";
$message = "http://podupti.me\n\n Pingdom Url:" . $_POST ["url"] . "\n\n Pod:" . $_POST ["domain"] . "\n\n";
$headers = "From: " . $_POST ["email"] . "\r\nReply-To: " . $_POST ["email"] . "\r\n";
@mail ( ADMIN_EMAIL, $subject, $message, $headers );
echo "Data successfully inserted! Your pod will be reviewed and live on the list soon! You will get a support ticket, no need to do anything if your pod is listed in the next few hours.";
} else {
echo "Could not validate your pod on http or https, check your setup!";
}
?> ?>
<?php <?php
/** //Copyright (c) 2011, David Morley. This file is licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file.
* Copyright (c) 2011, David Morley.
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYRIGHT file.
*/
//this is just a single api for a pod for the android app to get data //this is just a single api for a pod for the android app to get data
require_once 'config.inc.php'; include('config.php');
require_once 'db.class.php'; $dbh = pg_connect("dbname=$pgdb user=$pguser password=$pgpass");
if (!$dbh) {
if (isset($_GET['url'])) { die("Error in connection: " . pg_last_error());
$dbConnection = DB::connectDB(); }
if (!$dbConnection) { $sql = "SELECT * FROM pods WHERE domain = $1";
die("Error in connection: " . $dbConnection->errorInfo()[2]); $result = pg_query_params($dbh, $sql, array($_GET['url']));
} if (!$result) {
die("Error in SQL query: " . pg_last_error());
$sql = "SELECT * FROM pods WHERE domain = ".$dbConnection->quote($_GET['url']); }
$result = $dbConnection->query($sql); while ($row = pg_fetch_array($result)) {
if (!$result) { echo "Status: " . $row["status"] . "<br>";
die("Error in SQL query: " . $dbConnection->errorInfo()[2]); echo "Last Git Pull: " . $row["hgitdate"] . "<br>";
} echo "Uptime This Month " . $row["uptimelast7"] . "<br>";
echo "Months Monitored: " . $row["monthsmonitored"] . "<br>";
foreach ($result->fetchAll() as $row) { echo "Response Time: " . $row["responsetimelast7"] . "<br>";
echo "Status: " . $row["status"] . "<br>"; echo "User Rating: ". $row["userrating"] . "<br>";
echo "Last Git Pull: " . $row["hgitdate"] . "<br>"; echo "Server Location: ". $row["country"] . "<br>";
echo "Uptime This Month " . $row["uptimelast7"] . "<br>"; }
echo "Months Monitored: " . $row["monthsmonitored"] . "<br>"; pg_free_result($result);
echo "Response Time: " . $row["responsetimelast7"] . "<br>"; pg_close($dbh);
echo "User Rating: ". $row["userrating"] . "<br>";
echo "Server Location: ". $row["country"] . "<br>";
}
unset($dbConnection);
} else {
echo "url parameter is missing";
}
?> ?>
<?php <?php
/** include('config.php');
* Copyright (c) 2011, David Morley. $keep = (60 * 60 * 12) * 3;
* This file is licensed under the Affero General Public License version 3 or later. $dump_date = date("Ymd_Hs");
* See the COPYRIGHT file. $file_name = $backup_dir . "/dump_" . $dump_date . ".sql";
* system("export PGPASSWORD=$pgpass && $pg_dump_dir/pg_dump --username=$pguser $pgdb >> $file_name");
* @todo Add mysql backup support echo "pg backup of $pgdb made";
* @todo Add backup to cronjob $dirh = dir($backup_dir);
*/ while($entry = $dirh->read()) {
$old_file_time = (date("U") - $keep);
require_once 'config.inc.php'; $file_created = filectime("$backup_dir/$entry");
if ($file_created < $old_file_time && !is_dir($entry)) {
if (BACKUP) { if(unlink("$backup_dir/$entry")) {
$keep = (60 * 60 * 12) * 3; echo "Cleaned up old backups";
$dump_date = date("Ymd_Hs"); }
$file_name = BACKUPDIR . "/dump_" . $dump_date . ".sql"; }
if (DB_DRIVER == 'pgsql') {
system("export PGPASSWORD=".DB_PASSWORD." && $pg_dump_dir/pg_dump --username=".DB_USER." ".DB_NAME." >> $file_name");
echo "Backup of ".DB_NAME." made";
}
// Check if there are any Backups to deleted
$dirh = dir($backup_dir);
while($entry = $dirh->read()) {
$old_file_time = (date("U") - $keep);
$file_created = filectime(BACKUPDIR."/$entry");
if ($file_created < $old_file_time && !is_dir($entry)) {
if(unlink(BACKUPDIR."/$entry")) {
echo "Cleaned up old backups";
}
}
}
} }
?> ?>
<?php
/**
* Copyright (c) 2014, Johannes Brunswicker.
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYRIGHT file.
*/
require_once "config.inc.php";
/**
* Connects to database and returns the PDO Object or false
* @author J. Brunswicker
* @return Ambigous <boolean, PDO>
*
*/
class DB {
/**
* Connects to the DB
* @return PDO|boolean
*/
public static function connectDB() {
$dsn = DB_DRIVER.":dbname=".DB_NAME.";host=".DB_HOST;
if (DB_DRIVER == 'mysql') {
$dsn .= ";charset=UTF8";
}
try {
$connection = new PDO($dsn, DB_USER, DB_PASSWORD);
return $connection;
} catch (PDOException $e) {
if (DEBUG) {
echo ("User: ".DB_USER."<br />");
echo ('Connection to database with dsn '.$dsn.' failed: ' . $e->getMessage().'<br />');
}
return false;
}
}
}
?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<?php <?php
/** include('config.php');
* Copyright (c) 2011, David Morley. if (!$_POST['username']){
* This file is licensed under the Affero General Public License version 3 or later. echo "no username given";
* See the COPYRIGHT file. die;
*/
require_once 'config.inc.php';
require_once 'db.class.php';
if (!$_POST['username']) {
echo "no username given";
die;
} }
if (!$_POST['userurl']){ if (!$_POST['userurl']){
echo "no userurl given"; echo "no userurl given";
die; die;
} }
if (!$_POST['domain']){ if (!$_POST['domain']){
echo "no pod domain given"; echo "no pod domain given";
die; die;
} }
if (!$_POST['comment']){ if (!$_POST['comment']){
echo "no comment"; echo "no comment";
die; die;
} }
if (!$_POST['rating']){ if (!$_POST['rating']){
echo "no rating given"; echo "no rating given";
die; die;
}
$dbConnection = DB::connectDB();
if (!$dbConnection) {
die("Error in connection: " . $dbConnection->errorInfo()[2]);
}
$sql = "INSERT INTO rating_comments (domain, comment, rating, username, userurl)"
. " VALUES(".$dbConnection->quote($_POST['domain']).", ".$dbConnection->quote($_POST['comment']).", ".$dbConnection->quote($_POST['rating']). ","
. " ".$dbConnection->quote($_POST['username']).", ".$dbConnection->quote($_POST['userurl']).")";
$result = $dbConnection->query($sql);
if (!$result) {
die("Error in SQL query: " . $dbConnection->errorInfo()[2]);
} }
$subject = "New rating added to poduptime "; $dbh = pg_connect("dbname=$pgdb user=$pguser password=$pgpass");
$message = "Pod:" . $_POST["domain"] . "\n\n"; if (!$dbh) {
$headers = "From: ".$_POST["email"]."\r\n"; die("Error in connection: " . pg_last_error());
@mail( ADMIN_EMAIL, $subject, $message, $headers ); }
$sql = "INSERT INTO rating_comments (domain, comment, rating, username, userurl) VALUES($1, $2, $3, $4, $5)";
$result = pg_query_params($dbh, $sql, array($_POST['domain'], $_POST['comment'], $_POST['rating'], $_POST['username'], $_POST['userurl']));
if (!$result) {
die("Error in SQL query: " . pg_last_error());
}
$to = $adminemail;
$subject = "New rating added to poduptime ";
$message = "Pod:" . $_POST["domain"] . "\n\n";
$headers = "From: ".$_POST["email"]."\r\n";
@mail( $to, $subject, $message, $headers );
echo "Comment posted!";
pg_free_result($result);
pg_close($dbh);
echo "Comment posted!";
?> ?>
<?php <meta charset="utf-8">
/** <!-- /* Copyright (c) 2011, David Morley. This file is licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file. */ -->
* Copyright (c) 2011, David Morley. <table id="myTable" class="tablesorter" width="98%">
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYRIGHT file.
*/
?>
<table id="myTable" class="tablesorter" style="width: 98%">
<thead> <thead>
<tr> <tr>
<th style="width:220px">Diaspora Pod<a class="tipsy" title="A pod is a site for you to set up your account.">?</a></th> <th width="220px">Diaspora Pod<a class="tipsy" title="A pod is a site for you to set up your account.">?</a></th>
<th>Live Status<a class="tipsy" title="Up or Down according to Pingdom">?</a></th> <th>Live Status<a class="tipsy" title="Up or Down according to Pingdom">?</a></th>
<th>Last Code Pull<a class="tipsy" title="Because the alpha is updated everyday pods with old software will not work correcly with pods with new software. This is the date the p <th>Last Code Pull<a class="tipsy" title="Because the alpha is updated everyday pods with old software will not work correcly with pods with new software. This is the date the p
od last updated from the main Diaspora code.">?</a></th> od last updated from the main Diaspora code.">?</a></th>
...@@ -22,65 +16,44 @@ od last updated from the main Diaspora code.">?</a></th> ...@@ -22,65 +16,44 @@ od last updated from the main Diaspora code.">?</a></th>
</thead> </thead>
<tbody> <tbody>
<?php <?php
require_once 'config.inc.php'; include('config.php');
require_once 'db.class.php'; $dbh = pg_connect("dbname=$pgdb user=$pguser password=$pgpass");
if (!$dbh) {
$dbConnection = DB::connectDB(); die("Error in connection: " . pg_last_error());
if (!$dbConnection) { }
die("Error in connection: " . $dbConnection->errorInfo()[2]); if ($_GET['hidden'] == "true") {
} $sql = "SELECT * FROM pods WHERE hidden <> 'no'";
} else {
if (isset($_GET['hidden']) && $_GET['hidden'] == "true") { $sql = "SELECT * FROM pods WHERE hidden <> 'yes'";
$sql = "SELECT * FROM pods WHERE hidden <> 'no'"; }
} else { $result = pg_query($dbh, $sql);
$sql = "SELECT * FROM pods WHERE hidden <> 'yes'"; if (!$result) {
die("Error in SQL query: " . pg_last_error());
}
while ($row = pg_fetch_array($result)) {
if ($row["secure"] == "true") {$method = "https://";$class="green";$tip="This pod uses SSL encryption for traffic.";} else {$method = "http://";$class="red";$tip="This pod does not offer SSL";}
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><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"]."'>";
for ($i = 0; $i < $row["userrating"]; $i++) {
echo "✪";
} }
if ($row["adminrating"] >6) {$adminratingclass="green";} elseif ($row["adminrating"] <7) {$adminratingclass="yellow";} elseif ($row["adminrating"] <3) {$adminratingclass="red";}
$result = $dbConnection->query($sql); echo "</div><br><div class='tipsy rating ".$adminratingclass."' backendscore='".$row["score"]."' title='Poduptime rating is ".$row["adminrating"]."'>";
if (!$result) { for ($i = 0; $i < $row["adminrating"]; $i++) {
die("Error in SQL query: " . $dbConnection->errorInfo()[2]); echo "✪";
} }
foreach ($result->fetchAll() as $row) { echo "</div></td>";
if ($row["secure"] == "true") { echo "<td>" . $row["responsetimelast7"] . "</td>";
$method = "https://";$class="green";$tip="This pod uses SSL encryption for traffic.";