Block list page

This commit is contained in:
marcdeb1 2018-12-19 00:57:43 +01:00
parent dfd7af81f9
commit 90eee866fc
2 changed files with 4 additions and 4 deletions

View file

@ -292,7 +292,7 @@ class MainController extends AppController {
$page = intval($this->request->query('page')); $page = intval($this->request->query('page'));
$conn = ConnectionManager::get('default'); $conn = ConnectionManager::get('default');
$stmt = $conn->execute('SELECT COUNT(id) AS Total FROM Blocks'); $stmt = $conn->execute('SELECT COUNT(id) AS Total FROM block');
$count = $stmt->fetch(\PDO::FETCH_OBJ); $count = $stmt->fetch(\PDO::FETCH_OBJ);
$numBlocks = $count->Total; $numBlocks = $count->Total;

View file

@ -181,10 +181,10 @@
<tbody> <tbody>
<?php foreach ($blocks as $block): ?> <?php foreach ($blocks as $block): ?>
<tr> <tr>
<td class="right"><a href="/blocks/<?php echo $block->height ?>"><?php echo $block->Height ?></a></td> <td class="right"><a href="/blocks/<?php echo $block->height ?>"><?php echo $block->height ?></a></td>
<td class="pad-left"><?php echo number_format($block->d0ifficulty, 8, '.', '') ?></td> <td class="pad-left"><?php echo number_format($block->difficulty, 8, '.', '') ?></td>
<td class="right"><?php echo number_format((($currentBlock->height - $block->height) + 1), 0, '', ',') ?></td> <td class="right"><?php echo number_format((($currentBlock->height - $block->height) + 1), 0, '', ',') ?></td>
<td class="right"><?php echo count(json_decode($block->transaction_hashes)) ?></td> <td class="right"><?php echo count(preg_split('#,#', $block->transaction_hashes)) ?></td>
<td class="right"><?php echo round($block->block_size / 1024, 2) . 'KB' ?></td> <td class="right"><?php echo round($block->block_size / 1024, 2) . 'KB' ?></td>
<td class="right pad-left"><?php echo $block->nonce ?></td> <td class="right pad-left"><?php echo $block->nonce ?></td>
<td class="pad-left"><?php echo \DateTime::createFromFormat('U', $block->block_time)->format('d M Y H:i:s') ?> UTC</td> <td class="pad-left"><?php echo \DateTime::createFromFormat('U', $block->block_time)->format('d M Y H:i:s') ?> UTC</td>