<?php
/*
		[FuShow.cn] (C) 2013-2014 HXWY Inc.
		FuShow Friend V3.0				Id: usadmin_stat.php
		Email <service@fushow.cn>		http://fushow.cn/
*/

if(!defined('IN_FUSHOW') || !defined('IN_ADMINCP')) {
	exit('Access Denied');
}

//权限
if(!checkperm('managestat')) {
	cpmessage('no_authority_management_operation');
}

$turl = 'usadmin.php?ac=stat';

//处理统计更新
$perpage = empty($_GET['perpage'])?0:intval($_GET['perpage']);
$counttype = empty($_GET['counttype'])?'':$_GET['counttype'].'_stat';
if($perpage && $counttype) {
	$start = empty($_GET['start'])?0:intval($_GET['start']);
	if($start<0) $start = 0;
	
	include_once(S_ROOT.'./source/function_stat.php');
	if(!function_exists($counttype)) {
		cpmessage('choose_to_reconsider_statistical_data_types');
	}
	if($counttype($start, $perpage)) {
		$jump = $turl.'&counttype='.$_GET['counttype'].'&perpage='.$_GET['perpage'].'&start='.($start+$perpage);
		cpmessage('data_processing_please_wait_patiently', $jump, 0, array($jump, $start, $turl));//debug
	} else {
		cpmessage('do_success', $turl);
	}
}

?>