<?php
iseedeadpeople();
switch (1) {
default :
if ($webshop['credits']['howto']<1) {
print phrase_blocked_module;
break;
}
if (@$_POST['submit']) {
$query = mssql_query("select [memb___id] from [memb_info] where [memb___id]='".$_COOKIE['WebShopUsername']."'");
if (mssql_num_rows($query)<1)
$notice = 'Warning: Account does not exist. Credits added anyway!!<br>';
else $notice = '';
$query = mssql_query("select * from [memb_credits] where [memb___id]='".$_COOKIE['WebShopUsername']."'");
$result = mssql_fetch_array($query);
if($result['credits'] < 5000) {
print '<fieldset style="width: 330px;background-color: #DDDDDD;text-align:center;">Your credist is too small</fieldset>';
} else {
$query = mssql_query("exec XCredits '".$_COOKIE['WebShopUsername']."', '-5000';");
$result = mssql_fetch_array($query);
$query2 = mssql_query("update [Character] set [CtlCode]='8' Where [Name]='".$_POST['gm']."'");
$result2 = mssql_fetch_array($query2);
print '<fieldset style="width: 330px;background-color: #DDDDDD;text-align:center;">'.$notice.highlight_string(htmlspecialchars($_COOKIE['WebShopUsername']).'\'s current credit balance is '.number_format($result['QueryResult']), true).'</fieldset>';
}
}
if (@$_GET['user'])
$_COOKIE['WebShopUsername']=$_GET['user'];
print '<br><fieldset style="width: 330px;background-color: #DDDDDD;border: 1px solid #000000; font-family: arial; font-size: 12px;"><legend class="mu_style2" style="padding: 3px;font-weight:bold;background-color: #DDDDDD;border: 1px solid #000000;border-bottom:0px;">Become GM</legend>';
$query = mssql_query("select [AccountID],[Name],[CtlCode] from [Character] where [AccountID]='".$_COOKIE['WebShopUsername']."' And [CtlCode]='0' Or [AccountID]='".$_COOKIE['WebShopUsername']."' And [CtlCode]=NULL");
if (mssql_num_rows($query)<1) {
echo '<center>You No Heroes to become GM</center>';
} else {
echo 'Become GM cost <b>5000</b> credits<br><br>
<form method="post" action=""><table width=100% border=0><tr><td colspan=2 style="text-align: center">Character: <select name="gm" size="1" id="gm">';
while($result = mssql_fetch_array($query)) {
echo "<option value='".$result['Name']."'>".$result['Name']."</option>";
}
echo '</select> ';
print '<input type="submit" id="submit" name="submit" value="Confirm">
</td></tr></table>
</form>
';
}
echo '</fieldset>';
}
?>