set_body('
'.$stats_vhost_select[$lang].'
'); if ($vhost_valid === true) { $db->total_messages($vhost_active); $total_messages = $db->result; $html->set_body('

'.$stats_for[$lang].$vhost_active.'

'.$stats_messages[$lang].' '.number_format($total_messages[1][total_messages]).' '.$stats_messages_b[$lang].''.number_format($total_messages[1][total_chats]).''.$stats_messages_c[$lang].'


'); // get dates $today = date("Y-n-j"); $yesterday = date("Y-n-j", strtotime("-1 day")); $last_week = date("Y-n-j", strtotime("-7 days")); for ($ds=0;$ds<=4;$ds++) { $days[$ds] = date("Y-n-j", strtotime("-$ds day")); } // Top 10 $html->set_body('
'.$stats_top[$lang].'
'); foreach ($days as $current_day) { $i=0; $html->set_body(''.verbose_date($current_day,$months_names,$weekdays,true).' :
'); $db->get_top_ten($current_day,$vhost_active); $result = $db->result; foreach ($result as $entry) { $i++; $db->get_user_name($entry[owner_id],$vhost_active); $local_user = $db->result->username; $db->get_user_name($entry[peer_name_id],$vhost_active); $peer_name = $db->result->username; $db->get_server_name($entry[peer_server_id],$vhost_active); $peer_server = $db->result->server_name; $html->set_body('  '.$i.'. '.htmlspecialchars($local_user).'@'.$vhost_active.' --> '.htmlspecialchars($peer_name).'@'.htmlspecialchars($peer_server).' ('.$entry[count].')
'); } $html->set_body('
'); } $html->set_body('
'); // get data for graphs. We can now draw data only if we have full array. This is known issue. $db->get_monthly_stats($vhost_active); $result = $db->result; if (count($result)<30) { $html->status_message($stats_not_eno[$lang]); } else { foreach ($result as $entry) { $i++; $f[$i] = $entry[time_unix]; $d[$i] = $entry[messages]; $e[$i] = $entry[users_total]; } // hourly stats $db->get_hourly_stats($yesterday,$vhost_active); $result = $db->result; foreach ($result as $entry) { $hs[$entry[hour]] = $entry[value]; } // weekly stats $db->get_weekly_stats($last_week,$yesterday,$vhost_active); $result = $db->result; foreach ($result as $entry) { $idx++; $hy[$idx] = $entry[value]; } $html->set_body('



'); } } require_once("footer.php"); ?>