$nome_pagina = "Hunter";
$page = "vote_do.php";
$cat = "hunter";
$image_page = "index.jpg";
include('../../lib/variabili.x');
?>
include('../../lib/top.x');?>
| img/top_left.jpg"> |
"> |
img/top_right.jpg"> |
img/center_sfondo.jpg">
|
if (!isset($_COOKIE[jk_id])) {
echo"Devi essere registrato sul sito per votare";
} else {
include ('../../lib/connect.x');
$result = mysql_query("select votes, who from hunter_voti where quotation_id = '$_GET[quotation_id]' and voter_id ='$_COOKIE[jk_id]'");
$r = mysql_fetch_array($result);
$votes = $r["votes"];
$who = $r["who"];
if ($votes == "0" or $votes == "" or !$votes) {
mysql_query("INSERT INTO hunter_voti (quotation_id, voter_id) VALUES ('$_GET[quotation_id]','$_COOKIE[jk_id]')");
}
if ($votes < 3) {
$who = $who . " u$_GET[commento_id]," ;
mysql_query("UPDATE rating set hunter = hunter + 1 where id = '$_GET[poster_id]'");
$result = mysql_query("UPDATE hunter_commenti set voti = voti + 1 where commento_id = '$_GET[commento_id]'");
mysql_query("UPDATE hunter_voti set votes = votes + 1, who = '$who' where quotation_id = '$_GET[quotation_id]' and voter_id ='$_COOKIE[jk_id]'");
if ($result) {echo"Hai votato con successo.
";} else { echo"Si è verificato un errore durante la votazione. Riprova grazie.";}}
else {
echo"Hai già votato tre volte per questa quotation";
}
}
include ('../../lib/cconnect.x');
?> |
|
include('../../lib/bottom.x')
?>
|