<?

include '../../config.php';
include '../../func.php';
head();


$id = num($_GET['id']);
$vote = mysql_fetch_assoc(mysql_query("SELECT * FROM `votes` WHERE `id` = '".$id."'"));

if ( empty($vote['id']) ) {
    
    echo link2 . 'Голосование не найдено' . div;
    navig();
    foot();
    exit();
    
}

$result = mysql_query("DELETE FROM `votes` WHERE `id` = '".$id."'");
mysql_query("DELETE FROM `votes_list` WHERE `vote` = '".$id."'");


    if ( $result != NULL ) {
        
        header('Location: index.php?mod=vote_delete&result=good');
        
    } else {
        
        header('Location: index.php?mod=vote_delete&result=error');
        
    }