-
Notifications
You must be signed in to change notification settings - Fork 11
/
insertcashout.php
30 lines (27 loc) · 1 KB
/
insertcashout.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
php_sapi_name() === 'cli' or die('not allowed on web server');
/*
* This is an administrative tool.
* It inserts a cash out operation in order to empty the pot in
* order to recover the admins invested money.
*
* 1- Run with "php insertcashout.php VALUE" where value is the ammount to cash out.
*/
if ($argc > 1) {
include('config.php');
include('constants.php');
$topay = $argv[1];
$amount = 0;
$address = $config['ownaddress'];
$state = STATE_CASH_OUT_INITIAL;
$SQL = "INSERT INTO `transactions` (`id`, `amount`, `topay`, `address`, `state`, `tx`, `date`, `block`, `secret`, `pot_fee`, `fee`) VALUES (NULL, '" . $amount . "', '" . $topay . "', '" . $address . "', '" . $state . "', '', " . (time()) . ", '', '" . $config['hash_secret'] . "', " . $config['pot_fee'] . ", " . $config['fee'] . ");";
if (!mysql_query($SQL)) {
print("ERROR INSERTING!!!\nSQL: " . $SQL);
}
print("Transaction added! [" . $amount . "]\n");
} else {
?>
<H1>PLEASE DO NOT RUN FROM THE WEB</H1>
<?php
}
?>