Ejemplo n.º 1
0
         // 4.2.10 Get withdrawals by withdrawal address ID
         $address = mysql_real_escape_string($_GET["a"], $db);
         $slt_transfer_withdrawal_address_a = "SELECT * FROM transfer_withdrawal_address WHERE address = '{$address}' AND user = '******'";
         $rlt_transfer_withdrawal_address_a = mysql_query($slt_transfer_withdrawal_address_a);
         $row_transfer_withdrawal_address_a = mysql_fetch_assoc($rlt_transfer_withdrawal_address_a);
         if ($row_transfer_withdrawal_address_a["user"] != $user_id) {
             json_error("Invalid address.");
         }
         $withdrawals = array();
         $slt_transfer_withdrawal_a = "SELECT *, UNIX_TIMESTAMP(filing_time) AS filing_time_u FROM transfer_withdrawal WHERE withdrawal_address = '{$row_transfer_withdrawal_address_a['id']}'";
         $rlt_transfer_withdrawal_a = mysql_query($slt_transfer_withdrawal_a);
         while ($row_transfer_withdrawal_a = mysql_fetch_assoc($rlt_transfer_withdrawal_a)) {
             if ($row_transfer_withdrawal_address_a["type"] == "intern") {
                 $withdrawals[] = array("txid" => $row_transfer_withdrawal_a["txid"], "time" => $row_transfer_withdrawal_a["filing_time_u"], "amount" => api_sc_format($row_transfer_withdrawal_a["amount"]));
             } else {
                 $withdrawals[] = array("txid" => crypte_transaction($row_transfer_withdrawal_a["txid"]), "time" => $row_transfer_withdrawal_a["filing_time_u"], "amount" => api_sc_format($row_transfer_withdrawal_a["amount"]));
             }
         }
         json_success($withdrawals);
     }
 }
 if ($query[2] == "addresses") {
     $withdrawal_addresses = array();
     $slt_transfer_withdrawal_address_a = "SELECT * FROM transfer_withdrawal_address WHERE user = '******'";
     $rlt_transfer_withdrawal_address_a = mysql_query($slt_transfer_withdrawal_address_a);
     while ($row_transfer_withdrawal_address_a = mysql_fetch_assoc($rlt_transfer_withdrawal_address_a)) {
         $withdrawal_addresses[] = array("id" => $row_transfer_withdrawal_address_a["id"], "address" => $row_transfer_withdrawal_address_a["address"], "group" => $row_transfer_withdrawal_address_a["group"], "type" => $row_transfer_withdrawal_address_a["type"]);
     }
     json_success($withdrawal_addresses);
 }
 json_error("Unknown call.");
Ejemplo n.º 2
0
        }
    }
    $server_balance = $solidcoin->sc_getbalance("main") / 10000;
    if (count($errors) == 0 && $server_balance < $amountwithfee * 1.05 + 1) {
        $errors[] = "There's currently not enough Solidcoins on the Solidcoin24 servers to fulfill your withdrawal request. Don't worry, a Solidcoin24 admin has been informed and will resolve this for you. You will get an email as soon as the Solidcoins are available. Sorry for the inconvenience, but remember that a big part of the amounts are stored in a seperate wallets for your own security.";
        send_mail("Emergency! Solidcoin balance exhausted ({$server_balance} left)!", "A user with the email address " . $_SESSION["user_email"] . " legitimately tried to withdraw {$amount} Solidcoins. There are still {$server_balance} Solidcoins on the server. The request was denied. Please resolve this and make sure to inform the user.", "*****@*****.**");
    }
    if (count($errors) == 0) {
        echo "{$amount} Solidcoins are being transferred to {$address}.<br />";
        $result = withdraw_slc($address);
        if ($result["type"] == "extern") {
            $itxid = add_transaction($_SESSION["user_id"], "out", "extern", $amountwithfee, "SLC", "withdrawal", 0, $staticfee);
            $tx = withdraw_slc($address, $amount, "", $itxid);
            $udt_transaction_a = "UPDATE transaction SET info_id = '{$tx['txid']}' WHERE id = '{$itxid}'";
            mysql_query($udt_transaction_a);
            echo "<small>Transaction (extern): " . crypte_transaction($tx["txid"]) . "</small>";
        } else {
            $itxid = add_transaction($_SESSION["user_id"], "out", "intern", $amountwithfee, "SLC", "withdrawal", 0);
            $tx = withdraw_slc($address, $amount, "", $itxid);
            $udt_transaction_a = "UPDATE transaction SET info_id = '{$tx['txid']}' WHERE id = '{$itxid}'";
            mysql_query($udt_transaction_a);
            echo "<small>Transaction (intern): {$tx['txid']}</small>";
        }
    } else {
        foreach ($errors as $error) {
            echo "{$error}<br />";
        }
        ?>
<br />
The Solidcoins will be transferred immediately to the specified address and removed from your balance.<br /><br />
Current balance: <?php 
Ejemplo n.º 3
0
"><?php 
echo $row_transfer_withdrawal_address_a["address"];
?>
</a> (<?php 
echo $row_transfer_withdrawal_address_a["id"];
?>
)</td></tr>
  <tr><td style="padding-right: 10px">Amount</td><td><?php 
echo nice_format($row_transfer_withdrawal_a["amount"], false, 0, 4);
?>
</td></tr>
  <tr><td style="padding-right: 10px">Txid</td><td><?php 
if ($row_transfer_withdrawal_address_a["type"] == "intern") {
    echo $row_transfer_withdrawal_a["txid"];
} else {
    echo crypte_transaction($row_transfer_withdrawal_a["txid"]);
}
?>
</td></tr>
  <tr><td style="padding-right: 10px">Date and time</td><td><?php 
echo date("d.m. H:i:s", $row_transfer_withdrawal_a["filing_time_u"] - $_SESSION["time_offset"] * 60);
?>
</td></tr>
</table>

</p>
</div>

<?php 
function crypte_transaction($id)
{
Ejemplo n.º 4
0
    }
    echo "</td>";
    echo "<td style=\"padding-left: 10px\">";
    echo "<a href=\"?c=services/transfer/deposit_address&amp;a={$row_transfer_deposit_a['address']}\">" . substr($row_transfer_deposit_a["address"], 0, 5) . "..." . substr($row_transfer_deposit_a["address"], -3, 3) . "</a> ({$row_transfer_deposit_a['aid']})";
    echo "</td>";
    echo "<td style=\"text-align: center; padding-left: 10px\">";
    echo date("d.m. H:i:s", $row_transfer_deposit_a["filing_time_u"] - $_SESSION["time_offset"] * 60);
    echo "</td>";
    echo "<td style=\"text-align: right; padding-left: 10px\">";
    echo nice_format($row_transfer_deposit_a["amount"], true, 0, 4);
    echo "</td>";
    echo "<td style=\"padding-left: 10px\">";
    if ($row_transfer_deposit_a["type"] == "intern") {
        echo $row_transfer_deposit_a["txid"];
    } else {
        $txid = crypte_transaction($row_transfer_deposit_a["txid"]);
        echo "<span title=\"{$txid}\">" . substr($txid, 0, 10) . "..." . substr($txid, -3, 3) . "</span>";
    }
    echo "</td>";
    echo "<td style=\"padding-left: 10px\"><a href=\"?c=services/transfer/deposit&amp;id={$row_transfer_deposit_a['id']}\"><img src=\"images/transfer.jpg\" alt=\"Deposit\" title=\"Deposit\" style=\"border: 1px solid #B7B7B7; padding: 2px\" /></a></td>";
    echo "</tr>\n";
}
?>

</table>

<h3>Show</h3>

<form action="?c=services/transfer/deposits" method="post">
<table style="width: 70%">
<tr><td style="width: 50%">