Example #1
0
                //$bg_color="aaffaa";
                if ($uuid == $first_blood[$j]) {
                    $bg_color = "aaaaff";
                }
            } else {
                if (isset($U[$i]->p_wa_num[$j]) && $U[$i]->p_wa_num[$j] > 0) {
                    $aa = 0xaa - $U[$i]->p_wa_num[$j] * 10;
                    $aa = $aa > 16 ? $aa : 16;
                    $aa = dechex($aa);
                    $bg_color = "ff{$aa}{$aa}";
                }
            }
            echo "<td class=well style='background-color:#{$bg_color}'>";
            if (isset($U[$i])) {
                if (isset($U[$i]->p_ac_sec[$j]) && $U[$i]->p_ac_sec[$j] > 0) {
                    echo sec2str($U[$i]->p_ac_sec[$j]);
                }
                if (isset($U[$i]->p_wa_num[$j]) && $U[$i]->p_wa_num[$j] > 0) {
                    echo "(-" . $U[$i]->p_wa_num[$j] . ")";
                }
            }
        }
        echo "</tr>\n";
    }
}
echo "</tbody></table>";
?>
      </div>

    </div> <!-- /container -->
Example #2
0
         $json['error'] = 'lowlevel';
         break;
     }
     $uid = $UserManager->uID;
     $json['stat']['top'] = TOP_SECURITY;
     if ($res = QuerySql("SELECT COUNT(DISTINCT Security) FROM (SELECT Security FROM uploads JOIN BASE_TABLE USING(id) WHERE uid={$uid}) sec")) {
         $row = $res->fetch_row();
         $json['stat']['total'] = (int) $row[0];
         $res->close();
     }
     if ($res = QuerySql("SELECT Security, COUNT(Security) FROM (SELECT Security FROM uploads JOIN BASE_TABLE USING(id) WHERE uid={$uid}) sec GROUP BY Security ORDER BY COUNT(Security) DESC LIMIT " . TOP_SECURITY)) {
         $json['stat']['data'] = array();
         while ($row = $res->fetch_row()) {
             $data = array();
             $data[] = (int) $row[1];
             $data[] = sec2str($row[0]);
             $json['stat']['data'][] = $data;
         }
         $res->close();
     }
     $json['result'] = true;
     break;
     // Статистика пользователя по ключам
 // Статистика пользователя по ключам
 case 'stkey':
     set_time_limit(30);
     if (!$UserManager->isLogged()) {
         $json['error'] = 'unauthorized';
         break;
     }
     if ($UserManager->Level < 1) {