Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $explorerUrl = 'https://explorer.projectmerge.org/ext/getmasternodes';
- $myTxIds = ["76c727c128dc1c32df8f4e49bbc0202d1d64cf9dcc04bc44f12ff0f4f9a1cb01",
- "80ec01d5cd1e247297ccc46826a8b1ce45478096b64550c789968ea9c91105f2",
- "b28572a738fcef3dd98de34500567cf2e46f21b93a00fce203ed5feebf8f459e",
- ];
- $fieldsDisplay = ["rank", "status", "version", "network", "lastseen", "activetime", "lastpaid", "txhash"];
- $dataContainer = [];
- $data = file_get_contents($explorerUrl);
- $data = json_decode($data, true);
- // Prepare Data
- foreach ($data['data'] as $item) {
- if (!in_array($item['txhash'], $myTxIds)) {
- continue;
- } else {
- $dataContainer[] = $item;
- }
- }
- ?>
- <!DOCTYPE html>
- <html lang="eng">
- <head>
- <meta charset="UTF8">
- <title>Masternode Viewer</title>
- <style>
- h1 {
- text-align:center;
- }
- #customers {
- font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
- border-collapse: collapse;
- width: 90%;
- margin-left: auto;
- margin-right: auto;
- }
- #customers th {
- text-transform: capitalize;
- }
- #customers td, #customers th {
- border: 1px solid #ddd;
- padding: 8px;
- }
- #customers tr:hover {background-color: #ddd;}
- #customers th {
- padding-top: 12px;
- padding-bottom: 12px;
- text-align: left;
- background-color: #4CAF50;
- color: white;
- }
- </style>
- </head>
- <body>
- <h1>Masternode Viewer</h1>
- <table id="customers">
- <tr>
- <?php
- foreach ($fieldsDisplay as $key) {
- echo "<th>$key</th>\r\n";
- }
- ?>
- </tr>
- <?php
- foreach ($dataContainer as $row) {
- echo "<tr>\r\n";
- foreach ($fieldsDisplay as $key) {
- echo "<td>$row[$key]</td>\r\n";
- }
- echo "</tr>\r\n";
- }
- ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement