if((isset($_COOKIE['username'])) && (isset($_COOKIE['password'])))
{
echo "
<br>
<center><div style='background: #EEEEEE; padding: 5px; color: #444444; width: 400px; border: 1px dotted #BBBBBB;'>Logged in as <i><b>$_COOKIE[username]</b></i></div>
<div style='background: #F6F6F6; padding: 5px; width: 400px; border: 1px dotted #BBBBBB;'><a href='?l=true'><font color=red size=4><strong><input type='submit' id='login' name='login' value='LOGOUT' class='commonbtn'/></strong></font></a></div></center>
<br /><br />";
$id = (int) ($_GET['id']);
$proxy1 = $_SERVER['HTTP_X_FORWARDED_FOR'];
$proxy2 = $_SERVER['HTTP_VIA'];
$proxy3 = $_SERVER['HTTP_PROXY_CONNECTION'];
$proxy4 = $_SERVER['HTTP_CONNECTION'];
$proxy5 = $_SERVER['HTTP_ACCEPT'];
$ip = $_SERVER['REMOTE_ADDR'];
if($id > 0)
{
$vote_id = mssql_fetch_array(mssql_query("SELECT * FROM Votes WHERE id='$id'"));
$voted = mssql_fetch_array(mssql_query("SELECT * FROM Vote_Log WHERE voteend > ".time()." AND uid='$id' AND (ip='$ip' OR username='".($_COOKIE['username'])."') ORDER BY id DESC"));
if(!$vote_id) { $error = true; }
if($vote_id['show'] == 0) { $error = true; }
if(@$voted) { $error = true; }
if(!$error)
{
mssql_query("INSERT INTO Vote_Log (uid,ip,username,voteend) VALUES('$id','$ip','".($_COOKIE['username'])."','".(time()+$vote_id['vote_time'])."')");
if(!empty($proxy1) || !empty($proxy2) || !empty($proxy3) || empty($proxy4) || $proxy4=='close') {}
else {
$res = mssql_query("SELECT credits FROM MEMB_CREDITS WHERE memb___id='".($_COOKIE['username'])."'");
if(mssql_num_rows($res)>0) { mssql_query("UPDATE MEMB_CREDITS SET credits=credits+'$vote_id[credits]' WHERE memb___id='".($_COOKIE['username'])."'"); }
else { mssql_query("INSERT INTO MEMB_CREDITS (memb___id, credits) VALUES('".($_COOKIE['username'])."', '$vote_id[credits]')"); }
echo "<font size=2><b>You won $vote_id[credits] credits</b></font><br /><br />";
}
}
}