$id)); $coin = getdbo('db_coins', $id); showTableSorter('maintable', "{ tableClass: 'dataGrid', headers: { 0:{sorter:false}, 1:{sorter:false}, 2:{sorter:'metadata'}, 3:{sorter:'numeric'}, 4:{sorter:'currency'}, 5:{sorter:'text'}, 6:{sorter:'numeric'}, 7:{sorter:'numeric'}, 8:{sorter:'text'} }, widgets: ['zebra','filter'], widgetOptions: { filter_columnFilters: false, filter_ignoreCase: true } }"); echo << td.orphan { color: darkred; } Name Time Height Amount Status Difficulty Share Diff Finder Blockhash end; foreach($db_blocks as $db_block) { if(!$db_block->coin_id) continue; if(!$coin) continue; if($db_block->category == 'stake' && !$this->admin) continue; if($db_block->category == 'generated' && !$this->admin) continue; // mature stake income // $remote = new WalletRPC($coin); // $blockext = $remote->getblock($db_block->blockhash); // $tx = $remote->gettransaction($blockext['tx'][0]); // $db_block->category = $tx['details'][0]['category']; if($db_block->category == 'immature') echo ""; else echo ""; echo ''; $flags = $db_block->segwit ? ' ' : ''; echo ''; if ($this->admin) echo ''.$coin->name.''; else echo ''.$coin->name.''; echo ' ('.$coin->symbol.')'.$flags.''; // $db_block->confirmations = $blockext['confirmations']; // $db_block->save(); $d = datetoa2($db_block->time); echo ''.$d.' ago'; echo ''.$coin->createExplorerLink($db_block->height, array('height'=>$db_block->height)).''; echo ''.$db_block->amount.''; echo ''; if($db_block->category == 'orphan') echo "Orphan"; else if($db_block->category == 'immature') { $eta = ''; if ($coin->block_time && $coin->mature_blocks) { $t = (int) ($coin->mature_blocks - $db_block->confirmations) * $coin->block_time; $eta = "ETA: ".sprintf('%dh %02dmn', ($t/3600), ($t/60)%60); } echo "Immature ({$db_block->confirmations})"; } else if($db_block->category == 'generate') echo 'Confirmed'; else if($db_block->category == 'stake') echo "Stake ({$db_block->confirmations})"; else if($db_block->category == 'generated') echo 'Stake'; echo ""; echo ''.round_difficulty($db_block->difficulty).''; $diff_user = $db_block->difficulty_user; if (!$diff_user && substr($db_block->blockhash,0,4) == '0000') $diff_user = hash_to_difficulty($coin, $db_block->blockhash); echo ''.round_difficulty($diff_user).''; $finder = ''; if (!empty($db_block->userid)) { $user = getdbo('db_accounts', $db_block->userid); $finder = $user ? substr($user->username, 0, 7).'...' : ''; } echo ''.$finder.''; echo ''; echo $coin->createExplorerLink($db_block->blockhash, array('hash'=>$db_block->blockhash)); echo ""; echo ""; } echo "";