Changeset 178 for minimanager/stat.php


Ignore:
Timestamp:
Dec 23, 2007, 2:55:36 PM (17 years ago)
Author:
george
Message:

Minimanager 0.1.6b

File:
1 edited

Legend:

Unmodified
Added
Removed
  • minimanager/stat.php

    r142 r178  
    88 * License: GNU General Public License v2(GPL)
    99 */
    10  
     10
    1111require_once("header.php");
    1212valid_login(1);
     
    6161 $total_gms = $sql->result($query,1);
    6262
     63 $data = date("Y-m-d H:i:s");
     64 $data_1 = date_create ($data);
     65 $data_1->modify ("-1 day");
     66 $data_1 = date_format($data_1,"Y-m-d H:i:s");
     67$query = $sql->query("select distinct count(`last_ip`) from `account` where `last_login` > '$data_1' and `last_login` < '$data'");
     68 $uniqueIPs = $sql->result($query,0);
     69
    6370 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']);
    6471 $query = $sql->query("SELECT count(*) FROM `character`");
    6572 $total_chars = $sql->result($query,0);
    66  
     73
    6774 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    6875 $query = $sql->query("SELECT AVG(uptime)/60,MAX(uptime)/60,(100*SUM(uptime)/(UNIX_TIMESTAMP()-MIN(starttime))) FROM uptime");
    6976 $uptime = $sql->fetch_row($query);
    70  
     77
    7178 if ($total_chars){
    72  
     79
    7380 $order_race = (isset($_GET['race'])) ? "AND race =".$sql->quote_smart($_GET['race']) : "";
    7481 $order_class = (isset($_GET['class'])) ? "AND class =".$sql->quote_smart($_GET['class']) : "";
     
    7986        $order_level = "AND SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) >= $lvl_min AND SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) <= $lvl_max";
    8087        } else $order_level = "";
    81        
     88
    8289 if(isset($_GET['side'])) {
    8390        if ($sql->quote_smart($_GET['side']) == "h") $order_side = "AND race IN(2,5,6,8,10)";
    8491                elseif ($sql->quote_smart($_GET['side']) == "a") $order_side = "AND race IN (1,3,4,7,11)";
    8592        } else $order_side = "";
    86        
     93
    8794
    8895 $output .= "<div class=\"top\"><h1>{$lang_stat['srv_statistics']}</h1></div>";
    89  
     96
    9097 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']);
    9198
     
    96103 $allies_chars = $total_chars - $horde_chars;
    97104 $allies_pros = 100 - $horde_pros;
    98  
     105
    99106 $output .= "<center>
    100107 <table class=\"hidden\">
     
    103110                {$lang_stat['uptime_prec']}: ".round($uptime[2],1)."%<br />
    104111                {$lang_stat['avg_uptime']}: ".(int)($uptime[0]/60).":".(int)(($uptime[0]%60))."h<br />
    105                 {$lang_stat['max_uptime']}: ".(int)($uptime[1]/60).":".(int)(($uptime[1]%60))."h<br /><br />
     112                {$lang_stat['max_uptime']}: ".(int)($uptime[1]/60).":".(int)(($uptime[1]%60))."h<br />
     113                {$lang_stat['unique_ip']}: $uniqueIPs<br />     <br />
    106114                {$lang_stat['tot_accounts']}: $total_acc<br />
    107115                {$lang_stat['total_of']} $total_gms {$lang_stat['gms_one_for']} ".round($total_acc/$total_gms,1)." {$lang_stat['players']}<br /><br />
    108116                {$lang_stat['tot_chars_on_realm']}: $total_chars<br />
    109117                {$lang_stat['average_of']} ".round($total_chars/$total_acc,1)." {$lang_stat['chars_per_acc']}<br /><br />
    110                
     118
    111119                <table class=\"tot_bar\">
    112120                        <tr>
     
    193201
    194202 $sql->close();
    195  
     203
    196204} else {
    197205        $sql->close();
Note: See TracChangeset for help on using the changeset viewer.