-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
132 lines (118 loc) · 5.84 KB
/
Copy pathindex.php
File metadata and controls
132 lines (118 loc) · 5.84 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<html>
<head>
<link rel="stylesheet" href="js/micropos.css">
</head>
<body>
<?php
//Project: micro-pos Bitcore BTX php script
//Author: Jon D. <info@darkjon.de>
//Github page: https://github.com/dArkjON/micro-pos/
//This script is released under the GNU General Public License v3.0 See the LICENSE file for more information
echo '<h6>This is a Demo for the micro-pos script<br /><a href="https://github.com/dArkjON/micro-pos">https://github.com/dArkjON/micro-pos</a></h6>';
$coin = 'Bitcore';
include 'wallet.php';
$price = number_format($_POST['amount'], 2);
$msg1 = $_GET['msg'];
$msg2 = $_GET['wallet'];
$msg3 = $_GET['amount'];
$json = file_get_contents('https://api.coinmarketcap.com/v1/ticker/'.$coin.'/?convert=EUR');
$data = json_decode($json);
$pusd = number_format($data[0]->price_usd, 2);
$peuro = number_format($data[0]->price_eur, 2);
$pbtc = $data[0]->price_btc;
$psymbole = $data[0]->symbol;
echo '<h6>Coin : '.$coin.'<br>';
echo 'USD : $'.$pusd.' // EUR : '.$peuro.'</h6>';
//echo 'BTC : '.$pbtc.'<br>';
//echo 'Wallet 1:'.$wallet.'<br>'.'Wallet 2:'.$wallet1.'<br>'.'Wallet 3:'.$wallet2.'<br>'.'Wallet 4:'.$wallet3.'<br>'.'Wallet 5:'.$wallet4.'<br>';
echo '<br>';
if ($_POST['amount'] == ''){
if ($msg1 == "123"){
echo '<br><br><br>';
echo '<h6>Payment : '.$msg3.' '.$psymbole.' to wallet : '.$msg2.' completed.</h6>';
echo '<meta http-equiv="refresh" content="3; URL=/micro-pos">';
}else{
echo '<form action="" method="post">';
echo '<h6>Invoice Amount : <input type="number" class="text" step="any" name="amount"> €<br><br>';
echo '<input type="submit" value="Create Invoice"></h6>';
echo '</form>';
}
}else{
$target = number_format($price/$peuro, 8);
$json2 = file_get_contents('https://insight.bitcore.cc/api/addr/'.$wallet);
$data2 = json_decode($json2);
$addrStr = $data2->addrStr;
$balance = $data2->balance;
$unconfirmedBalance = $data2->unconfirmedBalance;
$unconfirmedTxApperances = $data2->unconfirmedTxApperances;
$txApperances = $data2->txApperances;
if ($unconfirmedTxApperances == '0'){
echo '<h6>Invoice total amount of : '.$price.' €<br />'.$target.' '.$psymbole.'<br /></h6>';
echo '<a href="bitcore:'.$wallet.'?amount='.$target.'"><img src="https://chart.googleapis.com/chart?chs=200x200&cht=qr&chl=bitcore:'.$wallet.'?amount='.$target.'" title="'.$wallet.'" /></a>';
echo '<div id="open"><h6>Payment Wallet : '.$wallet.'<br><br>... loading Details ...</h6></div>';
}else{
$json2 = file_get_contents('https://insight.bitcore.cc/api/addr/'.$wallet1);
$data2 = json_decode($json2);
$addrStr = $data2->addrStr;
$balance = $data2->balance;
$unconfirmedBalance = $data2->unconfirmedBalance;
$unconfirmedTxApperances = $data2->unconfirmedTxApperances;
$txApperances = $data2->txApperances;
if ($unconfirmedTxApperances == '0'){
echo '<h6>Invoice total amount of : '.$price.' €<br />'.$target.' '.$psymbole.'<br /></h6>';
echo '<a href="bitcore:'.$wallet1.'?amount='.$target.'"><img src="https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=bitcore:'.$wallet1.'?amount='.$target.'" title="'.$wallet1.'" /></a>';
echo '<div id="open"><h6>Payment Wallet : '.$wallet1.'<br><br>... loading Details ...</h6></div>';
}else{
$json2 = file_get_contents('https://insight.bitcore.cc/api/addr/'.$wallet2);
$data2 = json_decode($json2);
$addrStr = $data2->addrStr;
$balance = $data2->balance;
$unconfirmedBalance = $data2->unconfirmedBalance;
$unconfirmedTxApperances = $data2->unconfirmedTxApperances;
$txApperances = $data2->txApperances;
if ($unconfirmedTxApperances == '0'){
echo '<h6>Invoice total amount of : '.$price.' €<br />'.$target.' '.$psymbole.'<br /></h6>';
echo '<a href="bitcore:'.$wallet2.'?amount='.$target.'"><img src="https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=bitcore:'.$wallet2.'?amount='.$target.'" title="'.$wallet2.'" /></a>';
echo '<div id="open"><h6>Payment Wallet : '.$wallet2.'<br><br>... loading Details ...</h6></div>';
}else{
$json2 = file_get_contents('https://insight.bitcore.cc/api/addr/'.$wallet3);
$data2 = json_decode($json2);
$addrStr = $data2->addrStr;
$balance = $data2->balance;
$unconfirmedBalance = $data2->unconfirmedBalance;
$unconfirmedTxApperances = $data2->unconfirmedTxApperances;
$txApperances = $data2->txApperances;
if ($unconfirmedTxApperances == '0'){
echo '<h6>Invoice total amount of : '.$price.' €<br />'.$target.' '.$psymbole.'<br /></h6>';
echo '<a href="bitcore:'.$wallet3.'?amount='.$target.'"><img src="https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=bitcore:'.$wallet3.'?amount='.$target.'" title="'.$wallet3.'" /></a>';
echo '<div id="open">Payment Wallet : '.$wallet3.'<br><br>... loading Details ...</div>';
}else{
$json2 = file_get_contents('https://insight.bitcore.cc/api/addr/'.$wallet4);
$data2 = json_decode($json2);
$addrStr = $data2->addrStr;
$balance = $data2->balance;
$unconfirmedBalance = $data2->unconfirmedBalance;
$unconfirmedTxApperances = $data2->unconfirmedTxApperances;
$txApperances = $data2->txApperances;
if ($unconfirmedTxApperances == '0'){
echo '<h6>Invoice total amount of : '.$price.' €<br />'.$target.' '.$psymbole.'<br /></h6>';
echo '<a href="bitcore:'.$wallet4.'?amount='.$target.'"><img src="https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=bitcore:'.$wallet4.'?amount='.$target.'" title="'.$wallet4.'" /></a>';
echo '<div id="open">Payment Wallet : '.$wallet4.'<br><br>... loading Details ...</div>';
}else{
echo 'Sorry, all Wallets in use. Please try again after a new Block.<br>';
echo '<a href="/micro-pos">Restart process</a>';
} } } } }
$myfile = fopen("logs.txt", "a") or die("Unable to open file!");
$txt = "Create Invoice : ".$addrStr." ".$target." ".$price." \n";
fwrite($myfile, $txt);
fclose($myfile);
}
?>
<script type="text/javascript">
setInterval(function(){
$('#open').load('open.php?wallet=<?php echo $addrStr;?>&coin=<?php echo $target;?>');
},15000);
</script>
<script src="js/jquery.min.js"></script>
</body>
</html>