<commit_before><?php
/*
	File: staff/staff_settings.php
	Created: 6/1/2016 at 6:06PM Eastern Time
	Info: Allows admins to view and change the game settings at will.
	Author: TheMasterGeneral
	Website: http://mastergeneral156.pcriot.com/
*/
require('sglobals.php');
echo "<h3>Admin</h3><hr />";
if (!isset($_GET['action']))
{
    $_GET['action'] = '';
}
switch ($_GET['action'])
{
case "basicset":
    basicsettings();
    break;
case "announce":
    announce();
    break;
case "diagnostics":
    diagnostics();
    break;
case "restore":
    restore();
    break;
default:
    home();
    break;
}
function home()
{
	global $h,$lang;
	echo"
	<table class='table table-bordered'>
		<tr>
			<td>
				<a href='?action=basicset'>Game Settings</a>
			</td>
		</tr>
		<tr>
			<td>
				<a href='?action=announce'>Create an Announcement</a>
			</td>
		</tr>
		<tr>
			<td>
				<a href='?action=diagnostics'>Game Diagnostics</a>
			</td>
		</tr>
		<tr>
			<td>
				<a href='?action=restore'>Restore All Users</a>
			</td>
		</tr>
	</table>";
}
function basicsettings()
{
	global $h,$ir,$db,$lang,$set;
	if (!isset($_POST['gamename']))
	{
		$csrf=request_csrf_html('staff_sett_1');
		echo "
		<form method='post'>
		<table class='table table-bordered table-hover'>
			<tr>
				<th>
					Game Name
				</th>
				<td>
					<input type='text' name='gamename' class='form-control' required='1' value='{$set['WebsiteName']}'>
				</td>
			</tr>
			<tr>
				<th>
					Owner's Name
				</th>
				<td>
					<input type='text' name='ownername' class='form-control' required='1' value='{$set['WebsiteName']}'>
				</td>
			</tr>
			<tr>
				<th>
					Refferal Award
				</th>
				<td>
					<input type='number' name='refkb' class='form-control' min='1' required='1' value='{$set['ReferalKickback']}'>
				</td>
			</tr>
			<tr>
				<th>
					Energy Cost for Attacking <br />
					<small>(100 divided by this number)</small>
				</th>
				<td>
					<input type='number' name='attenc' class='form-control' min='1' required='1' value='{$set['AttackEnergyCost']}'>
				</td>
			</tr>
			<tr>
				<th>
					HTTPS Redirection<br />
					<small>(Does nothing yet)</small>
				</th>
				<td>
					<input type='text' readonly='1' class='form-control' value='{$set['HTTPS_Support']}'>
				</td>
			</tr>
			<tr>
				<th>
					Password Effort<br />
					<small>Lower is faster and less secure.</small>
				</th>
				<td>
					<input type='number' name='PWEffort' class='form-control' value='{$set['Password_Effort']}'>
				</td>
			</tr>
			<tr>
				<th>
					Paypal Email
				</th>
				<td>
					<input type='email' class='form-control' name='ppemail' value='{$set['PaypalEmail']}'>
				</td>
			</tr>
			<tr>
				<th><commit_msg>Admins can now alter game settings.<commit_after><?php
/*
	File: staff/staff_settings.php
	Created: 6/1/2016 at 6:06PM Eastern Time
	Info: Allows admins to view and change the game settings at will.
	Author: TheMasterGeneral
	Website: http://mastergeneral156.pcriot.com/
*/
require('sglobals.php');
echo "<h3>Admin</h3><hr />";
if (!isset($_GET['action']))
{
    $_GET['action'] = '';
}
switch ($_GET['action'])
{
case "basicset":
    basicsettings();
    break;
case "announce":
    announce();
    break;
case "diagnostics":
    diagnostics();
    break;
case "restore":
    restore();
    break;
default:
    home();
    break;
}
function home()
{
	global $h,$lang;
	echo"
	<table class='table table-bordered'>
		<tr>
			<td>
				<a href='?action=basicset'>Game Settings</a>
			</td>
		</tr>
		<tr>
			<td>
				<a href='?action=announce'>Create an Announcement</a>
			</td>
		</tr>
		<tr>
			<td>
				<a href='?action=diagnostics'>Game Diagnostics</a>
			</td>
		</tr>
		<tr>
			<td>
				<a href='?action=restore'>Restore All Users</a>
			</td>
		</tr>
	</table>";
}
function basicsettings()
{
	global $h,$ir,$db,$lang,$set;
	if (!isset($_POST['gamename']))
	{
		$csrf=request_csrf_html('staff_sett_1');
		echo "
		<form method='post'>
		<table class='table table-bordered table-hover'>
			<tr>
				<th>
					Game Name
				</th>
				<td>
					<input type='text' name='gamename' class='form-control' required='1' value='{$set['WebsiteName']}'>
				</td>
			</tr>
			<tr>
				<th>
					Owner's Name
				</th>
				<td>
					<input type='text' name='ownername' class='form-control' required='1' value='{$set['WebsiteName']}'>
				</td>
			</tr>
			<tr>
				<th>
					Refferal Award
				</th>
				<td>
					<input type='number' name='refkb' class='form-control' min='1' required='1' value='{$set['ReferalKickback']}'>
				</td>
			</tr>
			<tr>
				<th>
					Energy Cost for Attacking <br />
					<small>(100 divided by this number)</small>
				</th>
				<td>
					<input type='number' name='attenc' class='form-control' min='1' required='1' value='{$set['AttackEnergyCost']}'>
				</td>
			</tr>
			<tr>
				<th>
					HTTPS Redirection<br />
					<small>(Does nothing yet)</small>
				</th>
				<td>
					<input type='text' readonly='1' class='form-control' value='{$set['HTTPS_Support']}'>
				</td>
			</tr>
			<tr>
				<th>
					Password Effort<br />
					<small>Lower is faster and less secure.</small>
				</th>
				<td>
					<input type='number' name='PWEffort' min='5' max='20' class='form-control' value='{$set['Password_Effort']}'>
				</td>
			</tr>
			<tr>
				<th>
					Paypal Email
				</th>
				<td>
					<input type='email' class='form-control' name='ppemail' value='{$set['PaypalEmail']}'>
				</td>
			</tr>
			<tr>
				<th>
{'fraction_non_alphanumeric': 0.207498621576916, 'fraction_numerical': 0.00974085646020952, 'mean_word_length': 3.0400890868596884, 'pattern_counts': {'":': 8, '<': 187, '<?xml version=': 0, '>': 185, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5694288', 'n_tokens_mistral': 2548, 'n_tokens_neox': 2068, 'n_words': 448}