-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
120 lines (75 loc) · 2.66 KB
/
index.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
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
<?php
/*
* Blockexplorer for Umkoin (SHA256) crypto currency
*
* Author: vmta
* Date: 5 Jan 2018
*
* Version_Major: 0
* Version_Minor: 0
* Version_Build: 1
*
* Changelog:
*
*/
/* Load configuration file */
require "./include/config.php";
/* Autoload and register any classes not previously loaded */
spl_autoload_register(function ($class_name){
$classFile = "include/" . $class_name . ".php";
if( is_file($classFile) && ! class_exists($class_name) )
include $classFile;
});
/* Construct underlying RPC daemon connection credentials */
$server = "$proto://$host:$port";
$auth = "$rpcuser:$rpcpass";
/* Check if debug is of correct type (boolean) */
(is_bool($debug) === true) ? $debug : false;
/* Create a Block object */
$block = new Block($server, $auth, $debug);
/* Create a Page object */
$p = new Page($block);
?>
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
<link rel="shortcut icon" href="../favicon.ico">
<link rel="icon" type="image/icon" href="../favicon.ico" >
<title>Umkoin (U) [UMK] Block Explorer</title>
<!-- <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-timeago/1.4.0/jquery.timeago.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-sparklines/2.1.2/jquery.sparkline.min.js"></script>
//-->
<link href="/css/themes/dark/style.css" rel="stylesheet" id="theme_link">
<!-- <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
//-->
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="//fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css">
</head>
<body>
<?php
/* HTML Content Holder */
$html_content = "";
/* Add Navigation bar to HTML Content Holder */
$html_content .= $p->getNavigationBar();
/* Add Page Content based on Request to HTML Content Holder */
if (isset($_GET['blockhash'])) {
$html_content .= $p->getContent('blockhash', $_GET['blockhash']);
} elseif (isset($_GET['blockheight'])) {
$html_content .= $p->getContent('blockheight', $_GET['blockheight']);
} elseif (isset($_GET['txid'])) {
$html_content .= $p->getContent('txid', $_GET['txid']);
} elseif (isset($_GET['search'])) {
$html_content .= $p->getContent('search', $_GET['search']);
} else {
$html_content .= $p->getContent('default', '');
}
/* Add Footer to HTML Content Holder */
$html_content .= $p->getFooter();
/* Display HTML Content */
print_r($html_content);
?>
</body>
</html>