function db_UpdateSeriesCatalog_All()
{
    $result_status = array("inserted" => 0, "updated" => 0);
    $query = 'SELECT MAX(SiteID), MAX(VariableID), MAX(MethodID), MAX(SourceID), MAX(QualityControlLevelID)
            FROM ' . get_table_name('DataValues') . ' GROUP BY SiteID, VariableID, SourceID, MethodID, QualityControlLevelID';
    $result = mysql_query($query);
    if (!$result) {
        die("<p>Error in executing the SQL query " . $query . ": " . mysql_error() . "</p>");
    }
    $result_array = mysql_fetch_rowsarr($result, MYSQL_NUM);
    foreach ($result_array as $r) {
        $status = update_series_catalog($r[0], $r[1], $r[2], $r[3], $r[4]);
    }
}
    $upped4 = $arr[3]['upspeed'];
    $upped5 = $arr[4]['upspeed'];
    $upped6 = $arr[5]['upspeed'];
    $upped7 = $arr[6]['upspeed'];
    $upped8 = $arr[7]['upspeed'];
    $upped9 = $arr[8]['upspeed'];
    $upped10 = $arr[9]['upspeed'];
    $HTMLOUT .= "{$imgstartbar}&amp;chds=0,{$upped1}&amp;chxr=1,0,{$upped1}&amp;chd=t:{$upped1},{$upped2},{$upped3},{$upped4},{$upped5},{$upped6},{$upped7},{$upped8},{$upped9},{$upped10}&amp;chxt=x,y,x&amp;chxl=0:|{$user1}|{$user2}|{$user3}|{$user4}|{$user5}|{$user6}|{$user7}|{$user8}|{$user9}|{$user10}|1:||||||||||" . mksize($upped1) . "/s|2:|(" . mksize($upped1) . "/s)|(" . mksize($upped2) . "/s)|(" . mksize($upped3) . "/s)|(" . mksize($upped4) . "/s)|(" . mksize($upped5) . "/s)|(" . mksize($upped6) . "/s)|(" . mksize($upped7) . "/s)|(" . mksize($upped8) . "/s)|(" . mksize($upped9) . "/s)|(" . mksize($upped10) . "/s)\" alt='' /></div>";
} else {
    $HTMLOUT .= "<h4>Insufficient Uploaders (" . $counted . ")</h4></div>";
}
$HTMLOUT .= "<div class='article' style='text-align:center'><div class='article_header'><h2>Top 10 Fastest Downloaders</h2></div>";
$result = sql_query("SELECT username, downloaded / (" . TIME_NOW . " - added) AS downspeed FROM users WHERE enabled = 'yes' ORDER BY downspeed DESC LIMIT 10");
$counted = mysqli_num_rows($result);
if ($counted == "10") {
    $arr = mysql_fetch_rowsarr($result);
    $user1 = $arr[0]['username'];
    $user2 = $arr[1]['username'];
    $user3 = $arr[2]['username'];
    $user4 = $arr[3]['username'];
    $user5 = $arr[4]['username'];
    $user6 = $arr[5]['username'];
    $user7 = $arr[6]['username'];
    $user8 = $arr[7]['username'];
    $user9 = $arr[8]['username'];
    $user10 = $arr[9]['username'];
    $upped1 = $arr[0]['downspeed'];
    $upped2 = $arr[1]['downspeed'];
    $upped3 = $arr[2]['downspeed'];
    $upped4 = $arr[3]['downspeed'];
    $upped5 = $arr[4]['downspeed'];
Beispiel #3
0
    $results = mysql_fetch_rowsarr($result_set);
    $numDates = count($results);
    for ($x = 0; $x < $numDates; $x++) {
        $table .= "<th scope='col'>" . $results[$x][1] . "</th>";
    }
    $table .= "</tr></thead>";
}
$sql = "SELECT a.id, l.name, a.attendance, a.comment ";
$sql .= "FROM challenge_attendance a ";
$sql .= "INNER JOIN challenge_leaders l ON a.leader_id=l.id ";
$sql .= "WHERE l.grouptype_id=1 ";
$sql .= "ORDER BY l.name, a.date_id";
$result_set = mysql_query($sql, $connection);
confirm_query($result_set);
if (mysql_num_rows($result_set) >= 1) {
    $results = mysql_fetch_rowsarr($result_set);
    $table .= "<tbody><tr><th scope='row'>" . $results[0][1] . "</th>";
    $c = 0;
    for ($x = 0; $x < count($results); $x++) {
        if ($x != 0 && $results[$x][1] != $results[$x - 1][1]) {
            for ($c; $c < $numDates; $c++) {
                $table .= "<td>&nbsp;</td>";
            }
            $table .= "</tr><tr><th scope='row'>" . $results[$x][1] . "</th>";
            $c = 0;
        }
        $table .= "<td title='" . str_replace("'", "&#39;", $results[$x][3]) . "'>" . $results[$x][2] . "</td>";
        $c++;
    }
    for ($c; $c < $numDates; $c++) {
        $table .= "<td>&nbsp;</td>";