<?php
if(!isset($_GET['op'])){
require("../includes/denied.php");
denied('register');
}
?>
<table width="331" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center">
<form action="" method="post" name="register_from" id="register_from">
<table align="center" width="100" border="0" cellspacing="2" cellpadding="2">
<tr>
<td><div align="right" class="normal_text_white">Character</div></td>
<td colspan="4"><div align="left">
<input name="character" type="text" class="input" id="character" size="14" maxlength="10" value="">
</div></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><label>
<input name="quest" type="hidden" id="quest" value="quest">
<input type="submit" name="submit" value="Make GrandRes" class="button" onClick="return validate(document.register_from);">
</label><br><Br></td>
</tr>
</FORM> </div></td>
</tr>
</table>
<?php
function reqres()
{
include("config.php");
$account_id = htmlspecialchars($_SESSION['user'], ENT_QUOTES);
$account_id = clean_var($account_id);
$id = (int)$_GET['id'];
$character=htmlspecialchars($_POST[character], ENT_QUOTES);
$resets = $db->Execute("SELECT Resets from Character where Name='$character'");
$resetsdone = $resets->fetchrow();
$isonline = $db->Execute("SELECT ConnectStat from MEMB_STAT where memb___id='$account_id'");
$isonlinedone = $isonline->fetchrow();
$pcredits = $db->Execute("SELECT credits from MEMB_CREDITS where memb___id='$account_id'");
$pcreditsdone = $pcredits->fetchrow();
$gquery = $db->Execute("SELECT GrandRes from Character where name='$character' and accountid='$account_id'");
$gquerydone = $gquery->fetchrow();
if($account_id == NULL)
{
show_error("$warning_start You Are Not Logged! $warning_end");
exit();
}
if($resetsdone[0] < 999)
{
$error=1;
show_error("$warning_start $character Need 999 Resets To Grand Reset! $warning_end");
exit();
}
if($isonlinedone[0] == 1)
{
$error=1;
show_error("$warning_start $character Is Online! $warning_end");
}
if($gquerydone[0] == 0)
{
$run=mssql_query("UPDATE Character set GrandRes=1 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 1 Grand Reset!";
}
elseif($gquerydone[0] == 1)
{
$run1=mssql_query("UPDATE Character set GrandRes=2 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 2 Grand Reset!";
}
elseif($gquerydone[0] == 2)
{
$run1=mssql_query("UPDATE Character set GrandRes=3 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 3 Grand Reset!";
}
elseif($gquerydone[0] == 3)
{
$run1=mssql_query("UPDATE Character set GrandRes=4 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 4 Grand Reset!";
}
elseif($gquerydone[0] == 4)
{
$run1=mssql_query("UPDATE Character set GrandRes=5 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 5 Grand Reset!";
}
elseif($gquerydone[0] == 5)
{
$run1=mssql_query("UPDATE Character set GrandRes=6 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 6 Grand Reset!";
}
elseif($gquerydone[0] == 6)
{
$run1=mssql_query("UPDATE Character set GrandRes=7 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 7 Grand Reset!";
}
elseif($gquerydone[0] == 7)
{
$run1=mssql_query("UPDATE Character set GrandRes=8 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 8 Grand Reset!";
}
elseif($gquerydone[0] == 8)
{
$run1=mssql_query("UPDATE Character set GrandRes=9 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 9 Grand Reset!";
}
elseif($gquerydone[0] == 9)
{
$run1=mssql_query("UPDATE Character set GrandRes=10 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 10 Grand Reset!";
}
}
if(isset($_POST[quest]))
{
reqres();
}
?></table>
<table width="331" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center">
<form action="" method="post" name="register_from" id="register_from">
<table align="center" width="100" border="0" cellspacing="2" cellpadding="2">
<tr>
<td><div align="right" class="normal_text_white">Character</div></td>
<td colspan="4"><div align="left">
<input name="character" type="text" class="input" id="character" size="14" maxlength="10" value="">
</div></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><label>
<input name="quest" type="hidden" id="quest" value="quest">
<input type="submit" name="submit" value="Make GrandRes" class="button" onClick="return validate(document.register_from);">
</label><br><Br></td>
</tr>
</FORM> </div></td>
</tr>
</table>
<?php
function reqres()
{
include("config.php");
$account_id = htmlspecialchars($_SESSION['user'], ENT_QUOTES);
$account_id = clean_var($account_id);
$id = (int)$_GET['id'];
$character=htmlspecialchars($_POST[character], ENT_QUOTES);
$resets = mssql_query("SELECT Resets from Character where Name='$character'");
$resetsdone = mssql_fetch_row($resets);
$isonline = mssql_query("SELECT ConnectStat from MEMB_STAT where memb___id='$account_id'");
$isonlinedone = mssql_fetch_row($isonline);
$pcredits = mssql_query("SELECT credits from MEMB_CREDITS where memb___id='$account_id'");
$pcreditsdone = mssql_fetch_row($pcredits);
$gquery = mssql_query("SELECT GrandRes from Character where name='$character' and accountid='$account_id'");
$gquerydone = mssql_fetch_row($gquery);
if($account_id == NULL)
{
echo("$warning_start You Are Not Logged! $warning_end");
exit();
}
if($resetsdone[0] < 999)
{
$error=1;
echo("$warning_start $character Need 999 Resets To Grand Reset! $warning_end");
exit();
}
if($isonlinedone[0] == 1)
{
$error=1;
echo("$warning_start $character Is Online! $warning_end");
}
if($gquerydone[0] == 0)
{
$run=mssql_query("UPDATE Character set GrandRes=1 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 1 Grand Reset!";
}
elseif($gquerydone[0] == 1)
{
$run1=mssql_query("UPDATE Character set GrandRes=2 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 2 Grand Reset!";
}
elseif($gquerydone[0] == 2)
{
$run1=mssql_query("UPDATE Character set GrandRes=3 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 3 Grand Reset!";
}
elseif($gquerydone[0] == 3)
{
$run1=mssql_query("UPDATE Character set GrandRes=4 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 4 Grand Reset!";
}
elseif($gquerydone[0] == 4)
{
$run1=mssql_query("UPDATE Character set GrandRes=5 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 5 Grand Reset!";
}
elseif($gquerydone[0] == 5)
{
$run1=mssql_query("UPDATE Character set GrandRes=6 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 6 Grand Reset!";
}
elseif($gquerydone[0] == 6)
{
$run1=mssql_query("UPDATE Character set GrandRes=7 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 7 Grand Reset!";
}
elseif($gquerydone[0] == 7)
{
$run1=mssql_query("UPDATE Character set GrandRes=8 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 8 Grand Reset!";
}
elseif($gquerydone[0] == 8)
{
$run1=mssql_query("UPDATE Character set GrandRes=9 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 9 Grand Reset!";
}
elseif($gquerydone[0] == 9)
{
$run1=mssql_query("UPDATE Character set GrandRes=10 where name='$character'");
$run3=mssql_query("UPDATE Character set Resets=0 where name='$character'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits=5000 where memb___id='$account_id'");
echo "You Succesfuly Made Your 10 Grand Reset!";
}
}
if(isset($_POST[quest]))
{
reqres();
}
?></table>
if($resetsdone[0] < 999)
{
$error=1;
echo("$warning_start $character Need 999 Resets To Grand Reset! $warning_end");
exit();
MeMoS при мен с този скрипт, нищо не става, цъкам направи гранд рес и нищо, нито изписва текст, нито кредити нито ГР, все едно току що отварям модула и още не съм направил нищо ?
<form action="" method="post">
<table align="center" width="100" border="0" cellspacing="2" cellpadding="2">
<tr>
<td><div align="right" class="normal_text_white">Character</div></td>
<td colspan="4"><div align="left"><input name="character" type="text" class="input" id="character" size="14" maxlength="10" value="" /></div></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="greset" value="Make Grand Reset" class="button" />
</td>
</tr>
</table>
</form>
<?php
if(isset($_POST['greset']))
{
include("config.php");
$needed_res=999;
$max_gr=10;
$gets_credits=5000;
$account_id = htmlspecialchars($_SESSION['user'], ENT_QUOTES);
$account_id = clean_var($account_id);
$character=htmlspecialchars($_POST['character'], ENT_QUOTES);
$error=0;
$query1 = mssql_query("SELECT Resets,GrandRes FROM Character WHERE Name='".$character."' AND AccountID='".$account_id."'");
$resets = mssql_fetch_row($query1);
$isonline = mssql_query("SELECT ConnectStat from MEMB_STAT WHERE memb___id='".$account_id."'");
$isonlinedone = mssql_fetch_row($isonline);
$pcredits = mssql_query("SELECT credits from MEMB_CREDITS WHERE memb___id='".$account_id."'");
$pcreditsdone = mssql_fetch_row($pcredits);
$new_gr=($resets[1]+1);
$new_credits=($pcreditsdone[0]+$gets_credits);
$new_reset=($resets[0] - $needed_res);
if(!isset($_SESSION['user']))
{
echo("$warning_start You Are Not Logged! $warning_end");
$error=1;
}
if($resets[0] < $needed_res)
{
$error=1;
echo("$warning_start $character Need $needed_res Resets To Grand Reset! $warning_end");
}
if($new_gr > $max_gr)
{
$error=1;
echo("$warning_start $character You Have Reach The Maximum Grand Resets! $warning_end");
}
if($isonlinedone[0] == 1)
{
$error=1;
echo("$warning_start $character Is Online! $warning_end");
}
if($error==0){
$run=mssql_query("UPDATE Character set GrandRes='".$new_gr."',Resets='".$new_reset."' WHERE Name='".$character."' AND AccountID='".$account_id."'");
$run2=mssql_query("UPDATE MEMB_CREDITS set credits='".$new_credits."' WHERE memb___id='".$account_id."'");
echo "You Succesfuly Made Your ".$new_gr." Grand Reset!";
}
}
?>