show.php 2.14 KB
Newer Older
1
<!-- /* Copyright (c) 2011, David Morley. This file is licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file. */ -->
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<table id="myTable" class="tablesorter" width="75%">
<thead>
<tr>
<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>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>
<th>Uptime<a class="tipsy" title="Percent of the time the pod is online for <?php echo date("F") ?>.">?</a></th>
<th>Months<a class="tipsy" title="How many months has this pod been online? Click number for more history.">?</a></th>
<th>Response Time<a class="tipsy" title="Average response time for <?php echo date("F") ?>.">?</a></th>
<th>Ipv6<a class="tipsy" title="Does this pod look to have ipv6">?</a></th>
</tr>
</thead>
<tbody>

David Morley's avatar
David Morley committed
17 18 19 20 21 22
<?php
 include('config.php');
 $dbh = pg_connect("dbname=$pgdb user=$pguser password=$pgpass");
 if (!$dbh) {
     die("Error in connection: " . pg_last_error());
 }  
23
 $sql = "SELECT * FROM pods WHERE hidden <> 'yes'";
David Morley's avatar
David Morley committed
24 25 26 27 28
 $result = pg_query($dbh, $sql);
 if (!$result) {
     die("Error in SQL query: " . pg_last_error());
 }   
 while ($row = pg_fetch_array($result)) {
29
if ($row["secure"] == "true") {$method = "https://";} else {$method = "http://";} 
30
     echo "<tr><td class='tipsy' title='SSL Cert ".$row["sslvalid"]."'>" . $method . $row["domain"] . "</td>";
31
     echo "<td>" . $row["status"] . "</td>";
32 33 34
     echo "<td class='tipsy' title='Git Revision ".$row["hgitref"]."'>" . $row["hgitdate"] . "</td>";
     echo "<td>" . $row["uptimelast7"] . "</td>";
     echo "<td class='tipsy' title='Last Check ".$row["dateupdated"]." '>" . $row["monthsmonitored"] . "</td>";
35
     echo "<td>" . $row["responsetimelast7"] . "</td>";
36
     echo "<td class='tipsy' title='IP Address ".$row["ip"]." '>" . $row["ipv6"] . "</td></tr>";
David Morley's avatar
David Morley committed
37
 }
David Morley's avatar
David Morley committed
38 39
 pg_free_result($result);       
 pg_close($dbh);
40 41 42
?>
</tbody>
</table>