Пример #1
0
        } else {
            $return[$t]['under_10k']++;
            $return[$t]['sjcx_under_10k'] += $bal;
        }
    }
    return $return;
}
$data = array();
$final_height = 0;
$final_sjcx = 0;
$final_peers = 0;
$limited_height = 0;
echo "Updating balances...";
$wl = array('wl' => "Crowdsale", 'non-wl' => "Other Testers");
foreach ($urls as $version => $url) {
    $data[$version] = GetStats($version, $url);
    if (isset($data[$version]["error"])) {
        die("Error parsing {$url}: {$data[$version]['error']}\n\n");
    }
}
echo " done.\n";
date_default_timezone_set('UTC');
echo "\nData correct as of " . date(DATE_RFC822) . "\n";
$duplicate_list = array();
foreach ($urls as $version => $url) {
    foreach ($wl as $key => $val) {
        $thisOne = $data[$version][$key];
        $final_height += $thisOne['total_height'];
        $final_sjcx += $thisOne['total_sjcx'];
        $this_served = number_format($thisOne['total_height'] / 8192, 3);
        $farmers = $thisOne['farmers'];
Пример #2
0
    die($error);
}
/*$structure = $database->query('PRAGMA table_info(temps);');
			while ($row = $structure->fetchArray()) {
			print_r($row);
			}
			*/
// 2015-09-01 22:20:09 because that's the last timestamp in the database
$statement = $database->prepare("SELECT ID, timestamp, temp FROM temps WHERE timestamp > datetime('2015-09-01 22:20:09', :time)");
$statement->bindValue(':time', '-' . $interval . ' hours');
//$now->ToString());
$starttime = StartTimer();
$result = $statement->execute();
$selecttime = StopTimer($starttime);
if (!$result) {
    die("Impossible to execute query.");
}
#As reported above, this means that the db owner is different from the web server's one, but we did not commit any syntax mistake.
?>
    <link href="css/styles.css" rel="stylesheet" type="text/css"/>
    <title>
Raspberry Pi Temperature Logger
    </title>
</head>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([ ['Time', 'Temperature S1', 'Temperature S2', 'Minimum', 'Maximum', 'Average'],
		<?php