// Exchange Online Time VIP
function online_hours_vip()
{
global $resethours_vip;
global $wincredits_vip;
$character = secure($_POST['character']);
$account = secure($_POST['login']);
$password = secure($_POST['password']);
check_inject();
$query = mssql_query("Select memb___id,TotalTime,ConnectTM,DisConnectTM from MEMB_STAT where memb___id='$account'");
$row = mssql_fetch_row($query);
$querypass = mssql_query("Select memb___id,memb__pwd,memb_name,bloc_code,vip From MEMB_INFO where memb___id='$account' and memb__pwd='$password'");
$char = mssql_fetch_row($querypass);
$queryonline = mssql_query("Select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$onlinecheck = mssql_num_rows($queryonline);
if($account != $char[0]) { echo"<font color='orange'>Your $char[0] Account is not correct!</font><br>"; $error=1; }
if($password != $char[1]) { echo"<font color='red'>Password is not correct</font><br>"; $error=1; }
else
{
if($error != 1) {
$onhourss = $char[3];
$creditshourss = $row[1] * $wincredits_vip;
if($char[4] == 0) {echo"<font color='red'>You are not a <font color='green'>VIP</font> member <img src='_img/vip-no.gif'></img></font><br>"; $error=2;}
if($row[1] <= 0) { echo"<font color='red'>Account $account must have minimum $resethours_vip Online hours in game !</font><br><br>"; $error=2;}
if($onlinecheck >= 1) { echo"<font color='red'>Account $account is online!<br> Please LogOff First!</font><br><br>"; $error=2;}
else
{
if($error != 2)
{
echo"All the hours spent in game were removed and you earned <font color=orange>$creditshourss</font> credits!<br>";
$a = mssql_query("DELETE FROM MEMB_STAT Where memb___id='$account'");
$b = mssql_query("Update MEMB_CREDITS set credits = credits+$creditshourss WHERE memb___id='$account'");
}
}
}
$query2 = mssql_query("Select CREDITS from MEMB_CREDITS where memb___id='$account'");
$row2 = mssql_fetch_row($query2);
echo"<font color=green>Now you have $row2[0] credits</font><br><br>";
}
}