$dbh||die('Error in connection: '.pg_last_error());
$sql='SELECT id,domain,status,secure,score,userrating,adminrating,city,state,country,lat,long,ip,ipv6,statsurl,monthsmonitored,uptime_alltime,responsetimems,local_posts,comment_counts,dateCreated,dateUpdated,dateLaststats,hidden FROM pods WHERE domain = $1';
$result=pg_query_params($dbh,$sql,[$_domain]);
$result||die('Error in SQL query: '.pg_last_error());
while($row=pg_fetch_array($result)){
if($_format==='json'){
echojson_encode($row);
}else{
echo'Status: '.$row['status'].'<br>';
echo'Last Git Pull: '.$row['hgitdate'].'<br>';
echo'Uptime This Month '.$row['uptime_alltime'].'<br>';
$result||die('Error in SQL query: '.pg_last_error());
...
...
@@ -32,12 +32,12 @@ EOF;
'This pod %1$s has been watched for %2$s months and its average ping time is %3$s with uptime of %4$s%% this month and was last checked on %5$s. On a score of 100 this pod is a %6$s right now',
$sql='SELECT id,domain,status,secure,score,userrating,adminrating,city,state,country,lat,long,ip,ipv6,pingdomurl,monthsmonitored,uptimelast7,responsetimelast7,local_posts,comment_counts,dateCreated,dateUpdated,dateLaststats,hidden FROM pods';
$sql='SELECT id,domain,status,secure,score,userrating,adminrating,city,state,country,lat,long,ip,ipv6,statsurl,monthsmonitored,uptime_alltime,responsetimems,local_posts,comment_counts,dateCreated,dateUpdated,dateLaststats,hidden,terms,sslexpire,uptime_custom,dnssec,softwarename,total_users,local_posts,comment_counts,service_facebook,service_twitter,service_tumblr,service_wordpress,service_xmpp FROM pods';
$result=pg_query($dbh,$sql);
$result||die('Error in SQL query: '.pg_last_error());
...
...
@@ -74,21 +74,18 @@ EOF;
}
}else{
$i=0;
$sql="SELECT * FROM pods WHERE hidden <> 'yes' ORDER BY uptimelast7 DESC";
$sql="SELECT domain,uptime_alltime,country FROM pods WHERE NOT hidden ORDER BY uptime_alltime DESC";
$result=pg_query($dbh,$sql);
$result||die('Error in SQL query: '.pg_last_error());
"\n".'This pod %1$s has been watched for %2$s months and its average ping time is %3$s with uptime of %4$s%% this month and was last checked on %5$s. On a score of -20 to +20 this pod is a %6$s right now',
echo'<td class="'.$classver.'"><div title="'.$pre.' codename: '.$row['shortversion'].' master version is: '.$row['masterversion'].'" class="tipsy">'.$version.'</div></td>';
$dbh||die('Error in connection: '.pg_last_error());
$sql='SELECT id,domain,status,secure,score,userrating,adminrating,city,state,country,lat,long,ip,ipv6,pingdomurl,monthsmonitored,uptimelast7,responsetimelast7,local_posts,comment_counts,dateCreated,dateUpdated,dateLaststats,hidden FROM pods WHERE domain = $1';
$result=pg_query_params($dbh,$sql,[$_url]);
$result||die('Error in SQL query: '.pg_last_error());
while($row=pg_fetch_array($result)){
if($_format==='json'){
echojson_encode($row);
}else{
echo'Status: '.$row['status'].'<br>';
echo'Last Git Pull: '.$row['hgitdate'].'<br>';
echo'Uptime This Month '.$row['uptimelast7'].'<br>';
echo'Weight <input type="text" size="2" name="weight" value="'.$row['weight'].'"> This lets you weight your pod lower on the list if you have too much trafic coming in, 10 is the norm use lower to move down the list.<br>';
echo'<td data-toggle="tooltip" data-placement="bottom" title="active six months: '.$row['active_users_halfyear'].', active one month: '.$row['active_users_monthly'].'">'.$row['active_users_halfyear'].'</td>';
$tip.="\n This {$row['softwarename']} pod {$pod_name} has been watched for {$row['monthsmonitored']} months with an overall uptime of {$row['uptimelast7']}% and a response time average today of {$row['responsetimelast7']}ms was last checked on {$row['dateupdated']}. ";
$tip.="\n This {$row['softwarename']} pod {$pod_name} has been watched for {$row['monthsmonitored']} months with an overall uptime of {$row['uptime_alltime']}% and a response time average today of {$row['responsetimems']}ms was last checked on {$row['dateupdated']}. ";
$tip.="On a scale of 100 this pod is a {$row['score']} right now";