Exemplo n.º 1
0
CValue::setSession("ua_max_date", $max_date);
CView::enforceSlave();
$auth = new CUserAuthentication();
$ua = new CUserAgent();
$ds = $ua->getDS();
$ljoin = array();
$ljoin["user_authentication"] = "`user_authentication`.`user_agent_id` = `user_agent`.`user_agent_id`";
$where = array();
if ($min_date) {
    $where[] = $ds->prepare("`datetime_login` >= %", $min_date);
}
if ($max_date) {
    $where[] = $ds->prepare("`datetime_login` <= %", $max_date);
}
$where["platform_name"] = $ds->prepare("!= 'unknown'");
$total = $ua->countMultipleList($where, null, "`user_agent`.`user_agent_id`", $ljoin);
$total = count($total);
$browsers = $ua->countMultipleList($where, null, "browser_name", $ljoin, "browser_name");
$versions = $ua->countMultipleList($where, null, "browser_name, browser_version", $ljoin, "browser_name, browser_version");
$platforms = $ua->countMultipleList($where, null, "platform_name", $ljoin, "platform_name");
$devices = $ua->countMultipleList($where, null, "device_type", $ljoin, "device_type");
$screens = $ua->countMultipleList($where, null, "screen_width", $ljoin, "screen_width");
$methods = $ua->countMultipleList($where, null, "pointing_method", $ljoin, "pointing_method");
//$connections = $auth->countMultipleList($where, null, "DATE_FORMAT(`datetime_login`, '%Y-%m-%d')", null, "DATE_FORMAT(`datetime_login`, '%Y-%m-%d') as datetime_login");
$graphs = array();
$graphs[] = CUserAgentGraph::getBrowserNameSeries($browsers);
$graphs[] = CUserAgentGraph::getPlatformNameSeries($platforms);
$graphs[] = CUserAgentGraph::getDeviceTypeSeries($devices);
$graphs[] = CUserAgentGraph::getScreenSizeSeries($screens);
$graphs[] = CUserAgentGraph::getPointingMethodSeries($methods);
$graphs[] = CUserAgentGraph::getBrowserVersionSeries($versions);