Changeset 178 for minimanager/stat.php
- Timestamp:
- Dec 23, 2007, 2:55:36 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/stat.php
r142 r178 8 8 * License: GNU General Public License v2(GPL) 9 9 */ 10 10 11 11 require_once("header.php"); 12 12 valid_login(1); … … 61 61 $total_gms = $sql->result($query,1); 62 62 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 63 70 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 64 71 $query = $sql->query("SELECT count(*) FROM `character`"); 65 72 $total_chars = $sql->result($query,0); 66 73 67 74 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']); 68 75 $query = $sql->query("SELECT AVG(uptime)/60,MAX(uptime)/60,(100*SUM(uptime)/(UNIX_TIMESTAMP()-MIN(starttime))) FROM uptime"); 69 76 $uptime = $sql->fetch_row($query); 70 77 71 78 if ($total_chars){ 72 79 73 80 $order_race = (isset($_GET['race'])) ? "AND race =".$sql->quote_smart($_GET['race']) : ""; 74 81 $order_class = (isset($_GET['class'])) ? "AND class =".$sql->quote_smart($_GET['class']) : ""; … … 79 86 $order_level = "AND SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) >= $lvl_min AND SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) <= $lvl_max"; 80 87 } else $order_level = ""; 81 88 82 89 if(isset($_GET['side'])) { 83 90 if ($sql->quote_smart($_GET['side']) == "h") $order_side = "AND race IN(2,5,6,8,10)"; 84 91 elseif ($sql->quote_smart($_GET['side']) == "a") $order_side = "AND race IN (1,3,4,7,11)"; 85 92 } else $order_side = ""; 86 93 87 94 88 95 $output .= "<div class=\"top\"><h1>{$lang_stat['srv_statistics']}</h1></div>"; 89 96 90 97 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 91 98 … … 96 103 $allies_chars = $total_chars - $horde_chars; 97 104 $allies_pros = 100 - $horde_pros; 98 105 99 106 $output .= "<center> 100 107 <table class=\"hidden\"> … … 103 110 {$lang_stat['uptime_prec']}: ".round($uptime[2],1)."%<br /> 104 111 {$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 /> 106 114 {$lang_stat['tot_accounts']}: $total_acc<br /> 107 115 {$lang_stat['total_of']} $total_gms {$lang_stat['gms_one_for']} ".round($total_acc/$total_gms,1)." {$lang_stat['players']}<br /><br /> 108 116 {$lang_stat['tot_chars_on_realm']}: $total_chars<br /> 109 117 {$lang_stat['average_of']} ".round($total_chars/$total_acc,1)." {$lang_stat['chars_per_acc']}<br /><br /> 110 118 111 119 <table class=\"tot_bar\"> 112 120 <tr> … … 193 201 194 202 $sql->close(); 195 203 196 204 } else { 197 205 $sql->close();
Note:
See TracChangeset
for help on using the changeset viewer.