/* Jorge - frontend for mod_logdb - ejabberd server-side message archive module. Copyright (C) 2009 Zbigniew Zolkiewski This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ require_once("headers.php"); require_once("upper.php"); if (ADMIN_NAME !== TOKEN) { print 'no access'; exit; } // vhost stats $vhost_selected = $_POST['stats_vhost']; if (array_key_exists($vhost_selected, $vhosts) === true) { $vhost_valid = true; $vhost_active = $vhost_selected; } else{ $vhost_valid = false; $vhost_active = null; } $html->set_body('
'); if ($vhost_valid === true) { $db->total_messages($vhost_active); $total_messages = $db->result; $html->set_body(''.$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].'
'.$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(' |
|