diff --git a/LICENSE b/LICENSE index 8b23445..2f152fb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,8 @@ MIT License -Copyright (c) 2019 +Copyright (c) 2019 Bubasik and cpu-pool.com + +Copyright (c) 2018 Elicoin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/block.php b/block.php new file mode 100644 index 0000000..ed2fd50 --- /dev/null +++ b/block.php @@ -0,0 +1,25 @@ +Block info'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + if (isset($blockInfo['previousblockhash'])) echo ''; + if (isset($blockInfo['nextblockhash'])) echo ''; + echo '
Block number:' . $blockInfo['height'] . '
Hash:' . $blockInfo['hash'] . '
Time:' . date($GLOBALS['timeFormat'], $blockInfo['time']) . '
Size:' . humansize($blockInfo['size'], 1024) . 'B
Number of confirmations:' . $blockInfo['confirmations'] . '
Number of transactions:' . count($blockInfo['tx']) . '
Difficulty:' . $blockInfo['difficulty'] . '
Nonce:' . $blockInfo['nonce'] . '
Chainwork:' . $blockInfo['chainwork'] . '
Previous block hash:' . $blockInfo['previousblockhash'] . '
Next block hash:' . $blockInfo['nextblockhash'] . '
'; + echo '

Transactions

'; + echo ''; + foreach ($blockInfo['tx'] as $tx) { + echo ''; + } + echo '
' . $tx . '
'; +?> \ No newline at end of file diff --git a/blocklist.php b/blocklist.php new file mode 100644 index 0000000..7c40870 --- /dev/null +++ b/blocklist.php @@ -0,0 +1,35 @@ +Network info'; + $miningInfo = getJSONArray('getmininginfo', '')['result']; + $totalCoins = getJSONArray('gettxoutsetinfo', '')['result']['total_amount']; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
Difficulty:' . round($miningInfo['difficulty'], 5) . '
Network hashrate:' . humansize($miningInfo['networkhashps'], 1000) . 'H/s
Total mined coins:' . round($totalCoins) . '
'; + echo '

Last mined blocks

'; + $blockCount = getJSONArray('getblockcount', '')['result']; + $j = $blockCount - (($pgid - 1) * $listCount); + $k = $j - $listCount + 1; + if ($j < $blockCount) echo 'Newer'; + if ($k > 0) echo 'Older'; + echo '

'; + echo ''; + echo ''; + for ($i = $j; $i >= $k && $i >= 0; $i--) { + if ($i <= $blockCount) { + $blockHash = getJSONArray('getblockhash', array($i))['result']; + $blockData = getJSONArray('getblock', array($blockHash))['result']; + echo ''; + } + } + echo '
NumberMinedTransactionsSize
' . $i . '' . date($GLOBALS['timeFormat'], $blockData['time']) . '' . count($blockData['tx']) . '' . humansize($blockData['size'], 1024) . 'B
'; + echo '
'; + if ($j < $blockCount) echo 'Newer'; + if ($k > 0) echo 'Older'; + echo '
'; +?> \ No newline at end of file diff --git a/coinapi.php b/coinapi.php new file mode 100644 index 0000000..44d71f7 --- /dev/null +++ b/coinapi.php @@ -0,0 +1,29 @@ + \ No newline at end of file diff --git a/config.php b/config.php new file mode 100644 index 0000000..eab3bf8 --- /dev/null +++ b/config.php @@ -0,0 +1,11 @@ + diff --git a/contact.php b/contact.php new file mode 100644 index 0000000..dea9768 --- /dev/null +++ b/contact.php @@ -0,0 +1,6 @@ +

Contact

+ + + + +
homepage:
block explorer:
E-mail:
\ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..734e9fa Binary files /dev/null and b/favicon.ico differ diff --git a/fonts/OpenSans-Bold.ttf b/fonts/OpenSans-Bold.ttf new file mode 100644 index 0000000..fd79d43 Binary files /dev/null and b/fonts/OpenSans-Bold.ttf differ diff --git a/fonts/OpenSans-BoldItalic.ttf b/fonts/OpenSans-BoldItalic.ttf new file mode 100644 index 0000000..9bc8009 Binary files /dev/null and b/fonts/OpenSans-BoldItalic.ttf differ diff --git a/fonts/OpenSans-Italic.ttf b/fonts/OpenSans-Italic.ttf new file mode 100644 index 0000000..c90da48 Binary files /dev/null and b/fonts/OpenSans-Italic.ttf differ diff --git a/fonts/OpenSans-Regular.ttf b/fonts/OpenSans-Regular.ttf new file mode 100644 index 0000000..db43334 Binary files /dev/null and b/fonts/OpenSans-Regular.ttf differ diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..59f0248 --- /dev/null +++ b/functions.php @@ -0,0 +1,11 @@ += $devider) { + $bytes /= $devider; + $i++; + } + return round($bytes, 2) . ' ' . $type[$i]; + } +?> \ No newline at end of file diff --git a/img/back.png b/img/back.png new file mode 100644 index 0000000..a9a7507 Binary files /dev/null and b/img/back.png differ diff --git a/img/content.png b/img/content.png new file mode 100644 index 0000000..f034044 Binary files /dev/null and b/img/content.png differ diff --git a/img/footer.png b/img/footer.png new file mode 100644 index 0000000..c9b40c6 Binary files /dev/null and b/img/footer.png differ diff --git a/img/header.png b/img/header.png new file mode 100644 index 0000000..82c133c Binary files /dev/null and b/img/header.png differ diff --git a/img/logo.png b/img/logo.png new file mode 100644 index 0000000..144408d Binary files /dev/null and b/img/logo.png differ diff --git a/index.php b/index.php new file mode 100644 index 0000000..6078c4b --- /dev/null +++ b/index.php @@ -0,0 +1,57 @@ + + + + + + + <?php echo $GLOBALS['name']; ?> block explorer + + + +
+ +
+
+ +
+ + + diff --git a/search.php b/search.php new file mode 100644 index 0000000..9af1ccb --- /dev/null +++ b/search.php @@ -0,0 +1,31 @@ +Search result:'; + echo 'Searching for: ' . $_GET['id'] . '
'; + echo '

Block ID:

'; + $request = getJSONArray('getblockhash', array($_GET['id']))['result']; + if (isset($request)) { + echo '
' . $request . '
'; + } else echo 'Found no results.'; + echo '

Block hash:

'; + $request = getJSONArray('getblock', array($_GET['id']))['result']; + if (isset($request)) { + echo '
' . $request['hash'] . '
'; + /* + echo '
';
+  print_r($request);
+  echo '
'; + */ + } else echo 'Found no results.'; + echo '

Transactions:

'; + $request = getJSONArray('getrawtransaction', array($_GET['id'], 1))['result']; + if (isset($request)) { + echo '
' . $request['hash'] . '
'; + /* + echo '
';
+  print_r($request);
+  echo '
'; + */ + } else echo 'Found no results.'; +?> \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..eb6a474 --- /dev/null +++ b/style.css @@ -0,0 +1,196 @@ +@font-face { + font-family: 'OpenSans'; + src: url('./fonts/OpenSans-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: 'OpenSans'; + src: url('./fonts/OpenSans-Italic.ttf') format('truetype'); + font-weight: normal; + font-style: italic; +} + +@font-face { + font-family: 'OpenSans'; + src: url('./fonts/OpenSans-Bold.ttf') format('truetype'); + font-weight: bold; + font-style: normal; +} + +@font-face { + font-family: 'OpenSans'; + src: url('./fonts/OpenSans-BoldItalic.ttf') format('truetype'); + font-weight: bold; + font-style: italic; +} + +body { + font-family: OpenSans; + margin: 0 0 0 0; +} + +table { + border: 0px solid #000000; + border-spacing: 0px; + box-shadow: 0px 0px 10px -2px rgba(0,0,0,0.5); +} + +table th { + background-color: #aaaaaa; + padding: 10px; +} + +table td { + padding: 10px; +} + +table tr:nth-child(odd) td { + background-color: #eeeeee; +} + +table tr:nth-child(even) td { + background-color: #dddddd; +} + +input[type=text] { + border: 2px solid #000000; + width: 250px; + height: 30px; + border-radius: 10px; + padding-left: 10px; + padding-right: 10px; +} + +input[type=submit] { + border: 2px solid #000000; + height: 30px; + border-radius: 10px; + background-color: #CC3300; + color: #FFFFFF; + font-weight: bold; + padding-left: 15px; + padding-right: 15px; +} + +#menuback { + background: url('./img/back.png'); +} + +#menubar { + background: url('./img/header.png') no-repeat; + box-shadow: 0px -10px 9px rgba(0,0,0,0.7); + width: 940px; + height: 88px; + margin: auto; + padding-left: 20px; + padding-right: 20px; + color: #FFFFFF; + line-height: 88px; +} + +#logo { + float: left; + padding-top: 12px; + padding-right: 10px; +} + +#logotext { + float: left; + width: 350px; + font-size: 30px; +} + +#logotext a { + color: #FFFFFF; + font-weight: bold; + text-decoration: none; +} + +#searchbox { + float: left; + height: 88px; + line-height: 88px; +} + +#menu { + text-align: right; +} + +#menu a { + color: #FFFF00; + font-weight: bold; + text-decoration: none; +} + +#content { + background: url('./img/content.png') repeat-x 0 0; + box-shadow: 0px -4px 10px rgba(0,0,0,0.4); + background-color: #FFFFFF; + width: 920px; + min-height: 570px; + padding: 30px 30px 30px 30px; + margin: auto; +} + +#content a { + color: #CC3300; + font-weight: bold; + text-decoration: none; +} + +#footerback { + background: url('./img/back.png') repeat 0 0; +} + +#footer { + background: url('./img/footer.png') repeat 0 0; + width: 920px; + height: 100px; + margin: auto; + padding: 0px 30px 0px 30px; + line-height: 100px; + color: #FFFFFF; +} + +#footer a { + color: #FFFFFF; + font-weight: bold; + text-decoration: none; +} + +.bigbold { + font-size: 25px; + font-weight: bold; +} + +.logosmall { + width: 16px; + height: 16px; +} + +.logobig { + width: 64px; + height: 64px; +} + +.center { + text-align: center; +} + +.right { + float: right; +} + +.hundred { + width: 100%; +} + +.fifty { + width: 50%; +} + +.top { + vertical-align: top; +} \ No newline at end of file diff --git a/tx.php b/tx.php new file mode 100644 index 0000000..81d32f2 --- /dev/null +++ b/tx.php @@ -0,0 +1,48 @@ +Transaction details'; + if (isset($tx['vin'])) { + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
Transaction ID:' . $tx['txid'] . '
Time:' . date($GLOBALS['timeFormat'], $tx['time']) . '
Size:' . humansize($tx['size'], 1024) . 'B
Confirmations:' . $tx['confirmations'] . '
'; + echo '

Transaction

'; + echo ''; + echo ''; + echo ''; + echo '
InputOutput
'; + foreach ($tx['vin'] as $vin) { + if (isset($vin['coinbase'])) { + echo 'COINBASE:
' . $vin['coinbase'] . '
'; + } else { + echo 'TX ID: ' . substr($vin['txid'], 0, 30) . '...
'; + echo 'VOUT: ' . $vin['vout'] . '
'; + } + echo '
'; + /* + echo '
';
+   print_r($vin);
+   echo '
'; + */ + } + echo '
'; + foreach ($tx['vout'] as $vout) { + foreach ($vout['scriptPubKey']['addresses'] as $addr) { + echo '' . $addr . '
'; + } + echo $vout['value'] . ' CRP

'; + /* + echo '
';
+   print_r($vout);
+   echo '
'; + */ + } + echo '
'; + } else { + echo 'Transaction not found.'; + } +?> \ No newline at end of file