diff --git a/miner.php b/miner.php index 06407b4d..ecabbdb1 100644 --- a/miner.php +++ b/miner.php @@ -1207,7 +1207,7 @@ function process($cmds, $rig) } } # -function rigbutton($rig, $rigname, $when, $row) +function rigname($rig, $rigname) { global $rigs; @@ -1218,12 +1218,21 @@ function rigbutton($rig, $rigname, $when, $row) $rigname = $parts[2]; } - list($value, $class) = fmt('BUTTON', 'Rig', '', $when, $row); + return $rigname; +} +# +function riginput($rig, $rigname) +{ + $rigname = rigname($rig, $rigname); - $button = ""; + return ""; +} +# +function rigbutton($rig, $rigname, $when, $row) +{ + list($value, $class) = fmt('BUTTON', 'Rig', '', $when, $row); - return $button; + return "".riginput($rig, $rigname).''; } # function showrigs($anss, $headname, $rigname) @@ -1445,16 +1454,43 @@ function pagebuttons($rig, $pg) if ($rig === null) { + $prev = null; + $next = null; + if ($pg === null) $refresh = ''; else $refresh = "&pg=$pg"; } else + { + switch (count($rigs)) + { + case 0: + case 1: + $prev = null; + $next = null; + break; + case 2: + $prev = null; + $next = ($rig + 1) % count($rigs); + break; + default: + $prev = ($rig - 1) % count($rigs); + $next = ($rig + 1) % count($rigs); + break; + } + $refresh = "&rig=$rig"; + } echo '
'; + if ($prev !== null) + echo riginput($prev, 'Prev').' '; echo " "; + if ($next !== null) + echo riginput($next, 'Next').' '; + echo ' '; if (count($rigs) > 1) echo " ";