Browse Source

format numbers

yggdrasil-0.4.7
ghost 1 year ago
parent
commit
349ea9e361
  1. 16
      src/public/index.php
  2. 8
      src/public/peer.php
  3. 2
      src/public/search.php

16
src/public/index.php

@ -287,22 +287,22 @@ $peers = $memory->getByMethodCallback( @@ -287,22 +287,22 @@ $peers = $memory->getByMethodCallback(
<tbody>
<tr>
<td class="text-left"><?php echo _('Online') ?></td>
<td class="text-right"><?php echo $memory->getByMethodCallback($db, 'findPeerTotalByTimeUpdated', [time() - WEBSITE_PEER_REMOTE_TIME_ONLINE_TIMEOUT,
strtotime('+1 month', strtotime(sprintf('%s-%s-%s 00:00', date('Y'), date('n'), 1)))]) ?></td>
<td class="text-right"><?php echo number_format($memory->getByMethodCallback($db, 'findPeerTotalByTimeUpdated', [time() - WEBSITE_PEER_REMOTE_TIME_ONLINE_TIMEOUT,
strtotime('+1 month', strtotime(sprintf('%s-%s-%s 00:00', date('Y'), date('n'), 1)))])) ?></td>
</tr>
<tr>
<td class="text-left"><?php echo _('New') ?></td>
<td class="text-right"><?php echo $memory->getByMethodCallback($db, 'findPeerTotalByTimeAdded', [strtotime(sprintf('%s-%s-%s 00:00', date('Y'), date('n'), 1)),
strtotime('+1 month', strtotime(sprintf('%s-%s-%s 00:00', date('Y'), date('n'), 1)))]) ?></td>
<td class="text-right"><?php echo number_format($memory->getByMethodCallback($db, 'findPeerTotalByTimeAdded', [strtotime(sprintf('%s-%s-%s 00:00', date('Y'), date('n'), 1)),
strtotime('+1 month', strtotime(sprintf('%s-%s-%s 00:00', date('Y'), date('n'), 1)))])) ?></td>
</tr>
<tr>
<td class="text-left"><?php echo _('Active') ?></td>
<td class="text-right"><?php echo $memory->getByMethodCallback($db, 'findPeerTotalByTimeUpdated', [strtotime(sprintf('%s-%s-%s 00:00', date('Y'), date('n'), 1)),
strtotime('+1 month', strtotime(sprintf('%s-%s-%s 00:00', date('Y'), date('n'), 1)))]) ?></td>
<td class="text-right"><?php echo number_format($memory->getByMethodCallback($db, 'findPeerTotalByTimeUpdated', [strtotime(sprintf('%s-%s-%s 00:00', date('Y'), date('n'), 1)),
strtotime('+1 month', strtotime(sprintf('%s-%s-%s 00:00', date('Y'), date('n'), 1)))])) ?></td>
</tr>
<tr>
<td class="text-left"><?php echo _('Total') ?></td>
<td class="text-right"><?php echo $memory->getByMethodCallback($db, 'getPeersTotal') ?></td>
<td class="text-right"><?php echo number_format($memory->getByMethodCallback($db, 'getPeersTotal')) ?></td>
</tr>
</tbody>
</table>
@ -386,7 +386,7 @@ $peers = $memory->getByMethodCallback( @@ -386,7 +386,7 @@ $peers = $memory->getByMethodCallback(
<br />
<?php echo sprintf(_('database since %s contains %s peers'),
date('M, Y', $memory->getByMethodCallback($db, 'getPeerFirstByTimeAdded')->timeAdded),
$memory->getByMethodCallback($db, 'getPeersTotal')) ?>
number_format($memory->getByMethodCallback($db, 'getPeersTotal'))) ?>
</div>
</div>
</div>

8
src/public/peer.php

@ -366,15 +366,15 @@ $peerPortStatuses = $db->findLastPeerPortStatusesByPeerId($requestPeerId); @@ -366,15 +366,15 @@ $peerPortStatuses = $db->findLastPeerPortStatusesByPeerId($requestPeerId);
</tr>
<tr>
<td class="text-left"><?php echo _('Remote') ?></td>
<td class="text-right"><?php echo $peerInfo->remoteTotal ?></td>
<td class="text-right"><?php echo number_format($peerInfo->remoteTotal) ?></td>
</tr>
<tr>
<td class="text-left"><?php echo _('Session') ?></td>
<td class="text-right"><?php echo $peerInfo->sessionTotal ?></td>
<td class="text-right"><?php echo number_format($peerInfo->sessionTotal) ?></td>
</tr>
<tr>
<td class="text-left"><?php echo _('Coordinate') ?></td>
<td class="text-right"><?php echo $peerInfo->coordinateTotal ?></td>
<td class="text-right"><?php echo number_format($peerInfo->coordinateTotal) ?></td>
</tr>
</tbody>
</table>
@ -519,7 +519,7 @@ $peerPortStatuses = $db->findLastPeerPortStatusesByPeerId($requestPeerId); @@ -519,7 +519,7 @@ $peerPortStatuses = $db->findLastPeerPortStatusesByPeerId($requestPeerId);
<br />
<?php echo sprintf(_('database since %s contains %s peers'),
date('M, Y', $memory->getByMethodCallback($db, 'getPeerFirstByTimeAdded')->timeAdded),
$memory->getByMethodCallback($db, 'getPeersTotal')) ?>
number_format($memory->getByMethodCallback($db, 'getPeersTotal'))) ?>
</div>
</div>
</div>

2
src/public/search.php

@ -275,7 +275,7 @@ $results = $sphinx->searchPeers($requestQuery, @@ -275,7 +275,7 @@ $results = $sphinx->searchPeers($requestQuery,
<br />
<?php echo sprintf(_('database since %s contains %s peers'),
date('M, Y', $memory->getByMethodCallback($db, 'getPeerFirstByTimeAdded')->timeAdded),
$memory->getByMethodCallback($db, 'getPeersTotal')) ?>
number_format($memory->getByMethodCallback($db, 'getPeersTotal'))) ?>
</div>
</div>
</div>

Loading…
Cancel
Save