コード例 #1
0
ファイル: admin_draw.php プロジェクト: aricent123/cadbis
         if ($g && count($data) < 12) {
             $data[] = $tmp;
             $tmpstr = $key == "length" ? make_fsize_str($tmp) : $tmp;
             $labels[] = ($groupby == 'cid' ? $url['cattitle'] : $url['url']) . " - " . $tmpstr;
         } else {
             $data_other['data'] += $tmp;
         }
     }
     if ($data_other['data']) {
         $data[] = $data_other['data'];
         $tmpstr = $key == "length" ? make_fsize_str($data_other['data']) : $data_other['data'];
         $labels[] = $data_other['label'] . " - " . $tmpstr;
     }
     break;
 case "today":
     $accts = $BILL->GetTodayUsersAccts(0, 1, $gid);
     $params[14] = "Статистика на " . date("d") . " " . $monthsof[date("n") - 1] . ", " . date("H:i:s") . "";
     for ($i = 0; $i < count($accts); ++$i) {
         $data[$i] = $accts[$i]["traffic"];
         $tmp = explode(" ", $accts[$i]["fio"]);
         $fio = $tmp[0];
         $labels[$i] = $fio . " (" . bytes2mb($accts[$i]["traffic"]) . " Мб)";
     }
     break;
 case "month":
     $accts = $BILL->GetMonthUsersAccts(0, 1, $gid);
     $params[14] = "Статистика по пользователям за " . $months[date("n") - 1] . " " . date("Y") . " года";
     for ($i = 0; $i < count($accts); ++$i) {
         $data[$i] = $accts[$i]["traffic"];
         $tmp = explode(" ", $accts[$i]["fio"]);
         $fio = $tmp[0];
コード例 #2
0
ファイル: admin_stats.php プロジェクト: aricent123/cadbis
    $action = "";
}
if (!isset($mod)) {
    $mod = "";
}
if (!isset($sort)) {
    $sort = ">traffic";
}
if ($action) {
    if (!isset($gid)) {
        $gid = "all";
    }
    $BILL = new CBilling($GV["dbhost"], $GV["dbname"], $GV["dblogin"], $GV["dbpassword"]);
    switch ($action) {
        case "today":
            $accts = $BILL->GetTodayUsersAccts($sort, 0, $gid);
            $wday = date("w");
            if ($wday == 0) {
                $wday = 6;
            }
            $head = "Статистика по пользователям за " . $wdaysto[$wday - 1] . ", " . date("d") . " " . $monthsof[date("n") - 1] . "" . date(" Y года");
            break;
        case "month":
            $accts = $BILL->GetMonthUsersAccts($sort, 0, $gid);
            $head = "Статистика по пользователям за " . $months[date("n") - 1] . " " . date("Y") . " года:<br>\n   <small>(по состоянию на " . date("d") . " " . $monthsof[date("n") - 1] . ")</small>";
            break;
        case "week":
            $accts = $BILL->GetWeekUsersAccts($sort, 0, $gid);
            get_current_week(&$b, &$a, 0);
            $head = "Статистика по пользователям за текущую неделю:<br><small>(" . date_dmy(strtotime($b)) . " - " . date_dmy(strtotime($a)) . ")</small>";
            break;