Exemple #1
0
                } else {
                    $hash_display = $globall_hashrate;
                    $hash_string = ' H/s';
                }
            }
        }
    }
    return round($hash_display, 2) . $hash_string;
}
$ctx = stream_context_create(['http' => ['timeout' => 1]]);
$json = json_decode(file_get_contents("http://eu.p2pool.ovh:9171/global_stats", false, $ctx));
$vtc_hashrate = ghash($json->{"pool_hash_rate"});
$json = json_decode(file_get_contents("http://eu.p2pool.ovh:7903/global_stats", false, $ctx));
$drk_hashrate = ghash($json->{"pool_hash_rate"});
$json = json_decode(file_get_contents("http://eu.p2pool.ovh:9332/global_stats", false, $ctx));
$btc_hashrate = ghash($json->{"pool_hash_rate"});
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="./favicon.ico">
    <title>P2Pool: Bitcoin, Vertcoin, DASH, DASH</title>
	<meta name="description" content="p2pool vertcoin, dash, bitcoin, darkcoin, feathercoin" />
	<meta name="keywords" content="p2pool, dash, bitcoin, vertcoin, darkcoin, feathercoin" />
	<link rel="stylesheet" href="//p2pool.ovh/css/bootstrap.css">
	<link rel="stylesheet" href="//p2pool.ovh/css/bootstrap-theme.min.css">
Exemple #2
0

foreach($mn_arr as $key => $value){
	//echo $key." => ".strtotime($key)." => ".round($value[0]/$value[1])."<br/>";
	$mn_count = "$mn_count [".strtotime($key)."000, ".round($value[0]/$value[1])."],";
	
	echo "$key => ".strtotime($key)." => $value[0] / $value[1] => ".round($value[0]/$value[1])." <br/>";
	*/
}

//echo $mn_count;

$query = $db->prepare("SELECT * FROM `node`");
$query->execute();
while($row=$query->fetch()){
	$table = $table."<tr><td><a href='http://{$row['ip']}:7903' target='_blank'>{$row['ip']}:7903</a></td><td><img src=\"https://dash.org.ru/img/16/".mb_strtolower(geoip_country_code_by_name($row['ip'])).".png\"> {$row['country']}</td><td>{$row['users']}</td><td>".ghash($row['hash'])."</td><td>{$row['fee']}</td><td>".secondsToTime($row['uptime'])."</td></tr>";
}
//$query = $db->prepare("SELECT avg(hash), avg(ghash), time FROM `global` group by day(from_unixtime(`time`)) order by `time` asc"); // order by `time` asc
$query = $db->prepare("select avg(hash), avg(ghash), date(from_unixtime(`time`)) as dateNum from `global` group by dateNum");
$query->execute();
while($row=$query->fetch()){
	//$hash_rate = "$hash_rate [{$row['time']}000, {$row['avg(hash)']}],";
	$hash_rate = "$hash_rate [".strtotime($row['dateNum'])."000, {$row['avg(hash)']}],";
	//if($row['time'] < 1430193602) continue;
	if($row['avg(ghash)'] != 0){
		//$ghash_rate = "$ghash_rate [{$row['time']}000, {$row['avg(ghash)']}],";
		if (strtotime($row['dateNum']) < 1429909201) continue;
		$ghash_rate = "$ghash_rate [".strtotime($row['dateNum'])."000, {$row['avg(ghash)']}],";
	}
}