Location: PHPKode > projects > Zitro-Stats > include/out_admin_display.inc.php
<?php

	// ANTIHACK
	defined('INSTATS') AND defined('OUT') OR die();

	////////////////////////////////////////////////////////////////
	// ADMINCHECK
	if(!isset($_COOKIE['ZITROSTATS']['ADMIN_PASSWORD']) || $_COOKIE['ZITROSTATS']['ADMIN_PASSWORD']!=md5($options['ADMIN_PASSWORD'])) {
		header("Location: ?inc=admin");
		die();
	}

	////////////////////////////////////////////////////////////////
	// EDIT
	elseif(@$_POST['mode']=='display') {
		$sql->query("
			REPLACE `$options[SQL_TABPREFIX]options`
			(`key`,`value`) VALUES
			('THEME',				'".$sql->escape($_POST['THEME'])."'),
			('PLAYERS_LIMIT',				".max(1,intval(@$_POST['PLAYERS_LIMIT']))."),
			('PLAYERS_LIMIT_MAX',			".max(1,intval(@$_POST['PLAYERS_LIMIT_MAX']))."),
			('PLAYERS_PAGES',				".max(1,intval(@$_POST['PLAYERS_PAGES']))."),
			('PLAYERS_LIMIT_WEAPONS',		".max(1,intval(@$_POST['PLAYERS_LIMIT_WEAPONS']))."),
			('PLAYERS_LIMIT_WEAPONS_MAX',	".max(1,intval(@$_POST['PLAYERS_LIMIT_WEAPONS_MAX']))."),
			('PLAYERS_LIMIT_OPPONENTS',		".max(1,intval(@$_POST['PLAYERS_LIMIT_OPPONENTS']))."),
			('PLAYERS_LIMIT_OPPONENTS_MAX',	".max(1,intval(@$_POST['PLAYERS_LIMIT_OPPONENTS_MAX']))."),
			('CLANS_LIMIT',					".max(1,intval(@$_POST['CLANS_LIMIT']))."),
			('CLANS_LIMIT_MAX',				".max(1,intval(@$_POST['CLANS_LIMIT_MAX']))."),
			('CLANS_PAGES',					".max(1,intval(@$_POST['CLANS_PAGES']))."),
			('CLANS_LIMIT_WEAPONS',			".max(1,intval(@$_POST['CLANS_LIMIT_WEAPONS']))."),
			('CLANS_LIMIT_WEAPONS_MAX',		".max(1,intval(@$_POST['CLANS_LIMIT_WEAPONS_MAX']))."),
			('WEAPONS_LIMIT_PLAYERS',		".max(1,intval(@$_POST['WEAPONS_LIMIT_PLAYERS']))."),
			('WEAPONS_LIMIT_PLAYERS_MAX',	".max(1,intval(@$_POST['WEAPONS_LIMIT_PLAYERS_MAX']))."),
			('HISTORY_LIMIT',				".max(1,intval(@$_POST['HISTORY_LIMIT']))."),
			('HISTORY_LIMIT_MAX',			".max(1,intval(@$_POST['HISTORY_LIMIT_MAX']))."),
			('HISTORY_PAGES',				".max(1,intval(@$_POST['HISTORY_PAGES'])).")
			");

		header("Location: $_SERVER[REQUEST_URI]");
		die();
	}


	////////////////////////////////////////////////////////////////
	// OUTPUT
	$out = "";
	$dir = opendir('themes');
	while($file = readdir($dir))
		if(is_dir('themes/'.$file) && $file!='.' && $file!='..' && is_file('themes/'.$file.'/index.inc.php'))
			$out .= "<option ".($options['THEME']==$file?" selected=\"selected\"":"").">".htmlentities($file)."</option>";
	closedir($dir);

	$i = 0;
	$out =
		"<form method=\"post\" action=\"?inc=$include\">\n".
		out_table(
			out_table_row(
				out_table_cell(0,1,1,"Theme",H).
				out_table_cell(0,2,1,"<select name=\"THEME\" size=\"1\" style=\"width:100%\">$out</select>",C),
				++$i&1 ? "light" : "dark").
			out_table_row(
				out_table_cell(1,1,1,"Players",H).
				out_table_cell(1,1,1,"Default",H).
				out_table_cell(1,1,1,"Maximum",H)
				).
			out_table_row(
				out_table_cell(0,1,1,"Players per Page",H).
				out_table_cell(0,1,1,"<input type=\"text\" name=\"PLAYERS_LIMIT\" size=\"5\" maxlength=\"5\" value=\"$options[PLAYERS_LIMIT]\"/>",C).
				out_table_cell(0,1,1,"<input type=\"text\" name=\"PLAYERS_LIMIT_MAX\" size=\"5\" maxlength=\"5\" value=\"$options[PLAYERS_LIMIT_MAX]\"/>",C),
				++$i&1 ? "light" : "dark").
			out_table_row(
				out_table_cell(0,1,1,"Players Page Links",H).
				out_table_cell(0,1,1,"<input type=\"text\" name=\"PLAYERS_PAGES\" size=\"5\" maxlength=\"5\" value=\"$options[PLAYERS_PAGES]\"/>",C).
				out_table_cell(0,1,1,""),
				++$i&1 ? "light" : "dark").
			out_table_row(
				out_table_cell(0,1,1,"Player's Weapons",H).
				out_table_cell(0,1,1,"<input type=\"text\" name=\"PLAYERS_LIMIT_WEAPONS\" size=\"5\" maxlength=\"5\" value=\"$options[PLAYERS_LIMIT_WEAPONS]\"/>",C).
				out_table_cell(0,1,1,"<input type=\"text\" name=\"PLAYERS_LIMIT_WEAPONS_MAX\" size=\"5\" maxlength=\"5\" value=\"$options[PLAYERS_LIMIT_WEAPONS_MAX]\"/>",C),
				++$i&1 ? "light" : "dark").
			out_table_row(
				out_table_cell(0,1,1,"Player's Opponents",H).
				out_table_cell(0,1,1,"<input type=\"text\" name=\"PLAYERS_LIMIT_OPPONENTS\" size=\"5\" maxlength=\"5\" value=\"$options[PLAYERS_LIMIT_OPPONENTS]\"/>",C).
				out_table_cell(0,1,1,"<input type=\"text\" name=\"PLAYERS_LIMIT_OPPONENTS_MAX\" size=\"5\" maxlength=\"5\" value=\"$options[PLAYERS_LIMIT_OPPONENTS_MAX]\"/>",C),
				++$i&1 ? "light" : "dark").
			out_table_row(
				out_table_cell(1,1,1,"Clans",H).
				out_table_cell(1,1,1,"Default",H).
				out_table_cell(1,1,1,"Maximum",H)
				).
			out_table_row(
				out_table_cell(0,1,1,"Clans per Page",H).
				out_table_cell(0,1,1,"<input type=\"text\" name=\"CLANS_LIMIT\" size=\"5\" maxlength=\"5\" value=\"$options[CLANS_LIMIT]\"/>",C).
				out_table_cell(0,1,1,"<input type=\"text\" name=\"CLANS_LIMIT_MAX\" size=\"5\" maxlength=\"5\" value=\"$options[CLANS_LIMIT_MAX]\"/>",C),
				++$i&1 ? "light" : "dark").
			out_table_row(
				out_table_cell(0,1,1,"Clans Page Links",H).
				out_table_cell(0,1,1,"<input type=\"text\" name=\"CLANS_PAGES\" size=\"5\" maxlength=\"5\" value=\"$options[CLANS_PAGES]\"/>",C).
				out_table_cell(0,1,1,""),
				++$i&1 ? "light" : "dark").
			out_table_row(
				out_table_cell(0,1,1,"Clans' Weapons",H).
				out_table_cell(0,1,1,"<input type=\"text\" name=\"CLANS_LIMIT_WEAPONS\" size=\"5\" maxlength=\"5\" value=\"$options[CLANS_LIMIT_WEAPONS]\"/>",C).
				out_table_cell(0,1,1,"<input type=\"text\" name=\"CLANS_LIMIT_WEAPONS_MAX\" size=\"5\" maxlength=\"5\" value=\"$options[CLANS_LIMIT_WEAPONS_MAX]\"/>",C),
				++$i&1 ? "light" : "dark").
			out_table_row(
				out_table_cell(1,1,1,"Weapons",H).
				out_table_cell(1,1,1,"Default",H).
				out_table_cell(1,1,1,"Maximum",H)
				).
			out_table_row(
				out_table_cell(0,1,1,"Weapons' Players",H).
				out_table_cell(0,1,1,"<input type=\"text\" name=\"WEAPONS_LIMIT_PLAYERS\" size=\"5\" maxlength=\"5\" value=\"$options[WEAPONS_LIMIT_PLAYERS]\"/>",C).
				out_table_cell(0,1,1,"<input type=\"text\" name=\"WEAPONS_LIMIT_PLAYERS_MAX\" size=\"5\" maxlength=\"5\" value=\"$options[WEAPONS_LIMIT_PLAYERS_MAX]\"/>",C),
				++$i&1 ? "light" : "dark").
			out_table_row(
				out_table_cell(1,1,1,"History",H).
				out_table_cell(1,1,1,"Default",H).
				out_table_cell(1,1,1,"Maximum",H)
				).
			out_table_row(
				out_table_cell(0,1,1,"Actions per Page",H).
				out_table_cell(0,1,1,"<input type=\"text\" name=\"HISTORY_LIMIT\" size=\"5\" maxlength=\"5\" value=\"$options[HISTORY_LIMIT]\"/>",C).
				out_table_cell(0,1,1,"<input type=\"text\" name=\"HISTORY_LIMIT_MAX\" size=\"5\" maxlength=\"5\" value=\"$options[HISTORY_LIMIT_MAX]\"/>",C),
				++$i&1 ? "light" : "dark").
			out_table_row(
				out_table_cell(0,1,1,"Actions Page Links",H).
				out_table_cell(0,1,1,"<input type=\"text\" name=\"HISTORY_PAGES\" size=\"5\" maxlength=\"5\" value=\"$options[HISTORY_PAGES]\"/>",C).
				out_table_cell(0,1,1,""),
				++$i&1 ? "light" : "dark")
			).
		"<div>\n".
		"	<input type=\"hidden\" name=\"mode\" value=\"display\" /><input class=\"button\" type=\"submit\" value=\"Save\"/>\n".
		"</div>\n".
		"</form>\n";

	$navi[] = "<a href=\"?inc=admin\">Admin</a>";
	$navi[] = "<a href=\"?inc=admin_display\">Display</a>";
	$links[] = "<link rel=\"up\" href=\"?inc=admin\" />";
	$out =
		"<h1>Display Administration<br /></h1>\n".
		"<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n".
		"	<tr>\n".
		"		<td align=\"center\" valign=\"top\">\n".
		out_indent($out,3).
		"		</td>\n".
		"	</tr>\n".
		"</table>\n";

?>
Return current item: Zitro-Stats