Exemplo n.º 1
0
    }
    //SInon, on génere une address bitcoin et on l'assigne à ce couple
    $walletid = BaseDonnee::execQuery($bdd, "SELECT Id FROM Wallets WHERE Acronymn = 'BTC'")[0]["Id"];
    $wallet = new Wallet($walletid);
    try {
        $address = $wallet->Client->getnewaddress("vote");
    } catch (Exception $e) {
        $error = true;
        $_SESSION["error"]["general"] = "Cannot connect to BTC wallet";
    }
    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 {