index.php 1015 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. require_once __DIR__.'/_init.php';
  3. // 检查是否登录
  4. check_auth();
  5. $func = isset($_GET['fn']) ? $_GET['fn'] : 'main';
  6. $func = "\\Statistics\\Modules\\".$func;
  7. if(!function_exists($func))
  8. {
  9. foreach(glob(ST_ROOT . "/Modules/*") as $php_file)
  10. {
  11. require_once $php_file;
  12. }
  13. }
  14. if(!function_exists($func))
  15. {
  16. $func = "\\Statistics\\Modules\\main";
  17. }
  18. $module = isset($_GET['module']) ? $_GET['module'] : '';
  19. $interface = isset($_GET['interface']) ? $_GET['interface'] : '';
  20. $date = isset($_GET['date']) ? $_GET['date'] : date('Y-m-d');
  21. $start_time = isset($_GET['start_time']) ? $_GET['start_time'] : strtotime(date('Y-m-d'));
  22. $offset = isset($_GET['offset']) ? $_GET['offset'] : 0;
  23. $log_count_per_ip = $log_count_per_page = 40;
  24. if(empty($_GET['count']) && $ip_count = count(\Statistics\Lib\Cache::$ServerIpList))
  25. {
  26. $log_count_per_ip = ceil($log_count_per_page/$ip_count);
  27. }
  28. call_user_func_array($func, array($module, $interface, $date, $start_time, $offset, $log_count_per_ip));