Esempio n. 1
0
 $msg .= "</SELECT>\n";
 $msg .= $STAT_TITLE_FONTEND0;
 $msg .= "<INPUT TYPE=\"SUBMIT\" VALUE=\"" . $STAT_TXT["0053"] . "\">\n";
 $msg .= "</TD>\n";
 $msg .= "</TR>\n";
 $msg .= "</FORM>\n";
 $msg .= "</TABLE>\n";
 $msg .= "</CENTER>\n";
 // Statistiken einzeln nach Monaten
 $r1 = @mysql_query("SELECT DISTINCT c_host FROM chat WHERE date(c_timestamp) LIKE '{$y}-{$m}%' AND c_host LIKE '{$v}' ORDER BY c_host");
 if ($r1 > 0) {
     $j = 0;
     $o = @mysql_num_rows($r1);
     while ($j < $o) {
         $c_host = @mysql_result($r1, $j, "c_host");
         statsResetMonth($y, $m);
         $r0 = @mysql_query("SELECT *, DATE_FORMAT(c_timestamp,'%d') as tag FROM chat WHERE date(c_timestamp) LIKE '{$y}-{$m}%' AND c_host='" . mysql_real_escape_string($c_host) . "' ORDER BY c_timestamp");
         if ($r0 > 0) {
             $i = 0;
             $n = @mysql_num_rows($r0);
             while ($i < $n) {
                 $x = @mysql_result($r0, $i, "tag");
                 $c_users = @mysql_result($r0, $i, "c_users");
                 if ($c_users > $grapharray["{$x}"]) {
                     $grapharray["{$x}"] = $c_users;
                 }
                 $i++;
             }
             $msg .= statsPrintGraph($c_host, $STAT_TXT["0102"], $STAT_TXT["0105"]);
         }
         $j++;
function statsOverview($v = "%")
{
    global $STAT_DB_HOST;
    global $STAT_DB_USER;
    global $STAT_DB_PASS;
    global $STAT_DB_NAME;
    global $STAT_TXT;
    global $STAT_TITLE_FONTBEG0;
    global $STAT_TITLE_FONTEND0;
    global $STAT_TITLE_FONTBEG2;
    global $STAT_TITLE_FONTEND2;
    global $STAT_TITLE_BACK1;
    global $grapharray;
    @mysql_connect($STAT_DB_HOST, $STAT_DB_USER, $STAT_DB_PASS);
    mysql_set_charset("utf8mb4");
    $m = date("m", time());
    $y = date("Y", time());
    $r1 = @mysql_query("SELECT DISTINCT c_host FROM chat WHERE c_timestamp LIKE '{$y}{$m}%' AND c_host LIKE '" . mysql_real_escape_string($v) . "' ORDER BY c_host");
    if ($r1 > 0) {
        $j = 0;
        $o = @mysql_num_rows($r1);
        if ($o > 0) {
            echo "<TABLE BORDER=\"0\" CELLPADDING=\"1\" CELLSPACING=\"1\">\n";
            echo "<TR>\n";
            echo "<TD" . coreMakeBackground($STAT_TITLE_BACK1) . ">" . $STAT_TITLE_FONTBEG2 . $STAT_TXT["0054"] . $STAT_TITLE_FONTEND2 . "</TD>\n";
            echo "<TD" . coreMakeBackground($STAT_TITLE_BACK1) . " ALIGN=\"RIGHT\">" . $STAT_TITLE_FONTBEG2 . $STAT_TXT["0055"] . $STAT_TITLE_FONTEND2 . "</TD>\n";
            echo "<TD" . coreMakeBackground($STAT_TITLE_BACK1) . " ALIGN=\"RIGHT\">" . $STAT_TITLE_FONTBEG2 . $STAT_TXT["0056"] . $STAT_TITLE_FONTEND2 . "</TD>\n";
            echo "</TR>\n";
            while ($j < $o) {
                $c_host = @mysql_result($r1, $j, "c_host");
                statsResetMonth($y, $m);
                $r0 = @mysql_query("SELECT * FROM chat WHERE c_timestamp LIKE '{$y}{$m}%' AND c_host='" . mysql_real_escape_string($c_host) . "' ORDER BY c_timestamp");
                if ($r0 > 0) {
                    $i = 0;
                    $u = 0;
                    $n = @mysql_num_rows($r0);
                    while ($i < $n) {
                        $c_timestamp = @mysql_result($r0, $i, "c_timestamp");
                        $c_users = @mysql_result($r0, $i, "c_users");
                        $x = trim(substr($c_timestamp, 6, 2));
                        if ($c_users > $grapharray["{$x}"]) {
                            $grapharray["{$x}"] = $c_users;
                        }
                        $i++;
                    }
                    reset($grapharray);
                    while (list($i, $n) = each($grapharray)) {
                        if ($n > $u) {
                            $u = $n;
                        }
                    }
                    if ($c_host == "") {
                        $c_host = $STAT_TXT["0080"];
                    }
                    echo "<TR>\n";
                    echo "<TD>";
                    echo $STAT_TITLE_FONTBEG0;
                    echo $c_host;
                    echo $STAT_TITLE_FONTEND0;
                    echo "</TD>\n";
                    echo "<TD ALIGN=\"RIGHT\">";
                    echo $STAT_TITLE_FONTBEG0;
                    echo $u;
                    echo $STAT_TITLE_FONTEND0;
                    echo "</TD>\n";
                    echo "<TD ALIGN=\"RIGHT\">";
                    echo $STAT_TITLE_FONTBEG0;
                    echo "&nbsp;&nbsp;" . $m . "/" . $y;
                    echo $STAT_TITLE_FONTEND0;
                    echo "</TD>\n";
                    echo "</TR>\n";
                }
                $j++;
            }
            echo "</TABLE>\n";
        }
    }
}