Ejemplo n.º 1
0
if ($auth->userdata["acclevel"] < 80) {
    die("Access denied!");
}
function delete_server($server)
{
    global $db;
    $db->query("DELETE FROM `hlstats_Servers_Config` WHERE `serverId` = '" . $db->escape($server) . "';");
    $db->query("DELETE FROM `hlstats_server_load` WHERE `server_id`  = '" . $db->escape($server) . "'");
}
$edlist = new EditList("serverId", "hlstats_Servers", "server", true, true, "serversettings", 'delete_server');
$edlist->columns[] = new EditListColumn("address", "IP Address", 15, true, "ipaddress", "", 15);
$edlist->columns[] = new EditListColumn("port", "Port", 5, true, "text", "27015", 5);
$edlist->columns[] = new EditListColumn("name", "Server Name", 35, true, "text", "", 255);
$edlist->columns[] = new EditListColumn("rcon_password", "Rcon Password", 10, false, "password", "", 128);
$edlist->columns[] = new EditListColumn("publicaddress", "Public Address", 20, false, "text", "", 128);
$edlist->columns[] = new EditListColumn("game", "Game", 20, true, "select", "hlstats_Games.name/code/realgame='" . getRealGame($gamecode) . "'");
$edlist->columns[] = new EditListColumn("sortorder", "Sort Order", 2, true, "text", "", 255);
if ($_POST) {
    if ($edlist->update()) {
        message("success", "Operation successful.");
    } else {
        message("warning", $edlist->error());
    }
}
?>
<br /><br />

<?php 
$result = $db->query("\r\n\t\tSELECT\r\n\t\t\tserverId,\r\n\t\t\taddress,\r\n\t\t\tport,\r\n\t\t\tname,\r\n\t\t\tsortorder,\r\n\t\t\tpublicaddress,\r\n\t\t\tgame,\r\n\t\t\tIF(rcon_password='','','(encrypted)') AS rcon_password\r\n\t\tFROM\r\n\t\t\thlstats_Servers\r\n\t\tWHERE\r\n\t\t\tgame='{$gamecode}'\r\n\t\tORDER BY\r\n\t\t\taddress ASC,\r\n\t\t\tport ASC\r\n\t");
$edlist->draw($result, false);
?>
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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

For support and installation notes visit http://www.hlxcommunity.com
*/
if (!defined('IN_HLSTATS')) {
    die('Do not access this file directly.');
}
flush();
$realgame = getRealGame($game);
$result = $db->query("\n\t\tSELECT\n\t\t\thlstats_Weapons.code,\n\t\t\thlstats_Weapons.name\n\t\tFROM\n\t\t\thlstats_Weapons\n\t\tWHERE\n\t\t\thlstats_Weapons.game = '{$game}'\n\t");
while ($rowdata = $db->fetch_row($result)) {
    $code = $rowdata[0];
    $fname[$code] = htmlspecialchars($rowdata[1]);
}
$tblWeapons = new Table(array(new TableColumn('weapon', 'Weapon', 'width=15&type=weaponimg&align=center&link=' . urlencode("mode=weaponinfo&amp;weapon=%k&amp;game={$game}"), $fname), new TableColumn('modifier', 'Modifier', 'width=10&align=right'), new TableColumn('kills', 'Kills', 'width=11&align=right'), new TableColumn('kpercent', '%', 'width=5&sort=no&align=right&append=' . urlencode('%')), new TableColumn('kpercent', 'Ratio', 'width=18&sort=no&type=bargraph'), new TableColumn('headshots', 'Headshots', 'width=8&align=right'), new TableColumn('hpercent', '%', 'width=5&sort=no&align=right&append=' . urlencode('%')), new TableColumn('hpercent', 'Ratio', 'width=18&sort=no&type=bargraph'), new TableColumn('hpk', 'HS:K', 'width=5&align=right')), 'weapon', 'kills', 'weapon', true, 9999, 'weap_page', 'weap_sort', 'weap_sortorder', 'tabweapons', 'desc', true);
$result = $db->query("\n\t\tSELECT\n\t\t\thlstats_Events_Frags.weapon,\n\t\t\tIFNULL(hlstats_Weapons.modifier, 1.00) AS modifier,\n\t\t\tCOUNT(hlstats_Events_Frags.weapon) AS kills,\n\t\t\tROUND(COUNT(hlstats_Events_Frags.weapon) / {$realkills} * 100, 2) AS kpercent,\n\t\t\tSUM(hlstats_Events_Frags.headshot = 1) AS headshots,\n\t\t\tROUND(SUM(hlstats_Events_Frags.headshot = 1) / IF(COUNT(hlstats_Events_Frags.weapon) = 0, 1, COUNT(hlstats_Events_Frags.weapon)), 2) AS hpk,\n\t\t\tROUND(SUM(hlstats_Events_Frags.headshot = 1) / {$realheadshots} * 100, 2) AS hpercent\n\t\tFROM\n\t\t\thlstats_Events_Frags\n\t\tLEFT JOIN\n\t\t\thlstats_Weapons\n\t\tON\n\t\t\thlstats_Weapons.code = hlstats_Events_Frags.weapon\n\t\tWHERE\n\t\t\thlstats_Events_Frags.killerId = {$player}\n\t\t\tAND\n\t\t\t(\n\t\t\t\thlstats_Weapons.game = '{$game}'\n\t\t\t\tOR hlstats_Weapons.weaponId IS NULL\n\t\t\t)\n\t\tGROUP BY\n\t\t\thlstats_Events_Frags.weapon\n\t\tORDER BY\n\t\t\t{$tblWeapons->sort} {$tblWeapons->sortorder},\n\t\t\t{$tblWeapons->sort2} {$tblWeapons->sortorder}\n\t");
$numitems = $db->num_rows($result);
if ($numitems > 0) {
    printSectionTitle('Weapon Usage *');
    $tblWeapons->draw($result, $numitems, 95);
    ?>
		<br /><br />
<?php 
}