forked from Someguy123/Litecoin-Wallet
/
server.php
45 lines (43 loc) · 2.44 KB
/
server.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php include("core/header.php"); ?>
<div class="container">
<div class="content">
<div class="page-header">
<h1>Server Information <small>Debugging for admins...</small></h1>
</div>
<div class="row">
<div class="span10">
<?php
include("core/bitcoin.inc");
$btclient = new bitcoinClient("http","root","qwerty","localhost","9332");
switch($_GET['debug']) {
case "enable":
setcookie("debug", 1, time()+3600);
echo '<div class="alert-message error" data-alert="alert"><a class="close" onclick="\$().alert()" href="#">×</a><p>Debugging enabled</p></div>';
break;
case "disable":
setcookie("debug", 0, time()-3600);
echo '<div class="alert-message error" data-alert="alert"><a class="close" onclick="\$().alert()" href="#">×</a><p>Debugging disabled</p></div>';
}
$derp = $btclient->getinfo();
echo '<h3>Litecoind statistics</h3>
<table class=\'zebra-striped\'>
<tr><td>Server balance total: </td><td>' . $derp['balance'] . '</td></tr>
<tr><td>Server block count: </td><td>' . $derp['blocks'] . '</td></tr>
<tr><td>Server connection count: </td><td>' . $derp['connections'] . '</td></tr>
<tr><td>Server balance recieved: </td><td>' . $btclient->getreceivedbyaccount('server') . '</td></tr>
<tr><td>Server address: </td><td>' . $btclient->getaccountaddress("server") . '</td></tr></table>';
echo '<h3>Other information</h3>
<table class=\'zebra-striped\'>
<tr><td>Server Hostname: </td><td>' . $_SERVER['SERVER_NAME'] . '</td></tr>
<tr><td>Server IP Address: </td><td>' . $_SERVER['SERVER_ADDR'] . '</td></tr>
<tr><td>Server requested file: </td><td>' . $_SERVER['REQUEST_URI'] . '</td></tr>
<tr><td>Server time: </td><td>' . date("D M j G:i:s T Y") . '</td></tr>
<tr><td>Your IP/Host: </td><td>' . gethostbyaddr($_SERVER['REMOTE_ADDR']) . '</td></tr></table>
<a href="?debug=enable">Enable debugging</a><br />
<a href="?debug=disable">Disable debugging</a>';
?>
</div>
<?php include("core/sidebar.php"); ?>
</div>
</div>
<?php include("core/footer.php"); ?>