예제 #1
0
    if ($error) {
        header("Location: ./adminvote.php");
        exit;
    }
    try {
        BaseDonnee::addVote($bdd, $acr, $name, $address);
    } catch (Exception $e) {
        $error = true;
        $_SESSION["error"]["general"] = "Cannot connect to BTC wallet";
    }
    header("Location: ./adminvote.php");
    exit;
}
//CHANGER ETAT VOTE
if (isset($_POST["updateVote"])) {
    unset($_POST["updateVote"]);
    try {
        foreach ($_POST as $key => $value) {
            if ($value == "Activer") {
                BaseDonnee::setVote($bdd, $key, 1);
            } else {
                BaseDonnee::setVote($bdd, $key, 0);
            }
        }
    } catch (Exception $e) {
        echo $e->getMessage();
        die;
    }
    header("Location: ./adminvote.php");
    exit;
}