Browse Source

php - add 's' to last share as needed

master
kanoi 10 years ago
parent
commit
58471b7ba9
  1. 20
      pool/page_workers.php

20
pool/page_workers.php

@ -1,6 +1,6 @@
<?php <?php
# #
function doworkers($data, $user) function doworker($data, $user)
{ {
$pg = '<h1>Workers</h1>'; $pg = '<h1>Workers</h1>';
@ -48,17 +48,25 @@ function doworkers($data, $user)
{ {
$lst = round($lst/60); $lst = round($lst/60);
if ($lst < 60) if ($lst < 60)
$lstdes = $lst.'m'; $lstdes = $lst.'min';
else else
{ {
$lst = round($lst/60); $lst = round($lst/60);
if ($lst < 24) if ($lst < 24)
{
$lstdes = $lst.'hr'; $lstdes = $lst.'hr';
if ($lst != 1)
$lstdes .= 's';
}
else else
{ {
$lst = round($lst/24); $lst = round($lst/24);
if ($lst < 9999) if ($lst < 9999)
$lstdes = $lst.'days'; {
$lstdes = $lst.'day';
if ($lst != 1)
$lstdes .= 's';
}
else else
$lstdes = 'never'; $lstdes = 'never';
} }
@ -88,6 +96,12 @@ function doworkers($data, $user)
return $pg; return $pg;
} }
# #
function doworkers($data, $user)
{
$pg = doworker($data, $user);
return $pg;
}
#
function show_workers($menu, $name, $user) function show_workers($menu, $name, $user)
{ {
gopage(NULL, 'doworkers', $menu, $name, $user); gopage(NULL, 'doworkers', $menu, $name, $user);

Loading…
Cancel
Save