// Exchange Online Time normal
function online_hours()
{
global $resethours;
global $wincredits;
$character = secure($_POST['character']);
$account = secure($_POST['login']);
$password = secure($_POST['password']);
check_inject();
$query = mssql_query("Select memb___id,OnlineHours,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='red'>Your Account is incorrect!</font><br><br>"; $error=1; }
if($password != $char[1]) { echo"<font color='red'>Your Password is incorrect!</font><br><br>"; $error=1;}
else
{
if($error != 1) {
$onhourss = $char[3];
$creditshourss = $row[1] * $wincredits;
if($row[1] <= 0) { echo"Account $account must have<font color=red> minimum $resethours Online hour in game</font> !</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><font color='green'>credits !</font><br><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'");
}
}
}
}
}