Пример #1
0
        <div>
            <form method="POST" class= "form-inline">
                <p>SEND BT:</p>
                <div class="form-group">
                AMMOUNTS:<p><input class="form-control" type="text" name="ammounts" ></p>
                FROM ADDRESS:<p><input class="form-control" type="text" name="fromAddress"></p>
                TO ADDRESS:<p><input class="form-control" type="text" name="toAddress" ></p>


                <input class="btn btn-default" type="submit" name="submit_sendBT" value="Send BT">
                <input class="btn btn-default"  type="submit" name="submit_home" value="Home">
            </form>
            <?php 
    if (isset($_POST["submit_sendBT"])) {
        if (!empty($_POST['ammounts']) && !empty($_POST['ammounts']) && !empty($_POST['fromAddress']) && !empty($_POST['toAddress'])) {
            $handler->sendBT($_POST['ammounts'], $_POST['fromAddress'], $_POST['toAddress'], Session::getPin());
        } else {
            echo "Field is not filled";
        }
    }
    if (isset($_POST['submit_home'])) {
        header('Location: main.php');
    }
    ?>
        </div>


    </div>

    <?php 
}
Пример #2
0
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>TEST_BlockIO</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
    <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>

<body>
<header id="header">
    <div id="top_right">
        <?php 
include 'login.php';
$apiKey = Session::getApiKey();
//API Key
$pin = Session::getPin();
//Pin
$handler = new Handler($apiKey, $pin);
if (Session::isLoggedIn()) {
    if (isset($_POST['btn_newAddress'])) {
        //Create new address if button active
        $handler->setAddress();
    }
}
?>
    </div>
    <div>
        <div style="text-align: center">
            <h2> <?php 
if (Session::isLoggedIn()) {
    echo $handler->getBalance();