- Joined
- Aug 30, 2010
- Messages
- 53
- Reaction score
- 4
Нали знаете вота на дамиан за 5 кредита знаете ли как да го опрая защтото вотва по безкраи пати искам да е само по 1 пат ;( моля за помощ
Code:
if ((isset($_SESSION['pass'])) && (isset($_SESSION['user'])))
{
//Configuration
$credits = '0'; //Credits per vote
$votehours = '12'; // 1= 1 hour, 2= 2 hours ......, 12= 12 hours
//Start voting code
$vote = clean_var($_GET['vote']);
$exist = mssql_fetch_array(mssql_query("SELECT * FROM memb_info WHERE memb___id='$vote'"));
if(!$exist){
echo"<center><font color=red style='font-size: 10pt'><b>Потребителят $vote не съществува!</b></font></center>";}
else{
$account=$exist['memb___id'];
$voteaccount=$_SESSION['user'];
$del = mssql_query("DELETE FROM Vote WHERE VoteEnd < ".time()."");
$voted = mssql_fetch_array(mssql_query("SELECT * FROM Vote WHERE account='$account' and voteaccount='$voteaccount'"));
if(!$voted)
{
$votetime = $votehours * 3600;
$query = mssql_fetch_array(mssql_query("exec XCredits '".$account."','".$credits."';"));
$query = mssql_fetch_array(mssql_query("exec Votes '".$account."','1';"));
$sql = mssql_query("INSERT INTO Vote VALUES('$account',".( time() + $votetime ).",'$voteaccount')");
echo"<center><font color=green style='font-size: 10pt'><b>Вие гласувахте за $account и той получи $credits кредита за WebShop-а.<br> Можете да гласувате отново за него след $votehours часа.</b></font></center>";
}
else{
$voteip = mssql_fetch_array(mssql_query("SELECT * FROM Vote WHERE account='$account' and voteaccount='$voteaccount'"));
if($voteip['VoteEnd'] > time())
{
$voteend = $voteip['VoteEnd'] - time();
echo "<center><font color=white style='font-size: 10pt'><b>Вече сте гласували за $account. Можете да гласувате отново за него след <br><script src=\"images/clock.js\" type=\"text/javascript\"></script><div id=\"bxx\"></div><script src=\"images/clock.js\" type=\"text/javascript\"></script><div id=\"bxx\"></div><SCRIPT language=\"JavaScript\">pp='$voteend'; pk='1'; pl='$account'; ps=''; t(); </script></b></font></center>";
}
}
}}
else{ echo"<center><font color=green style='font-size: 10pt'><b>Трябва да влезете с акаунта си, за да гласувате.<br> Регистрирайте се от <a href='?op=register'>ТУК</a>.</b></font></center>";
}
?>
<br><br><br>