function pagebuttons($rig, $pg) { global $readonly, $rigs, $userlist, $ses; global $allowcustompages, $customsummarypages; 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 '<tr><td><table cellpadding=0 cellspacing=0 border=0><tr><td nowrap>'; if ($userlist === null || isset($_SESSION[$ses])) { if ($prev !== null) { echo riginput($prev, 'Prev') . ' '; } echo "<input type=button value='Refresh' onclick='pr(\"{$refresh}\",null)'> "; if ($next !== null) { echo riginput($next, 'Next') . ' '; } echo ' '; if (count($rigs) > 1) { echo "<input type=button value='Summary' onclick='pr(\"\",null)'> "; } } if ($allowcustompages === true) { if ($userlist === null || isset($_SESSION[$ses])) { $list = $customsummarypages; } else { if ($userlist !== null && isset($userlist['def'])) { $list = array_flip($userlist['def']); } else { $list = array(); } } foreach ($list as $pagename => $data) { echo "<input type=button value='{$pagename}' onclick='pr(\"&pg={$pagename}\",null)'> "; } } echo '</td><td width=100%> </td><td nowrap>'; if ($rig !== null && $readonly === false) { $rg = ''; if (count($rigs) > 1) { $rg = " Rig {$rig}"; } echo "<input type=button value='Restart' onclick='prc(\"restart&rig={$rig}\",\"Restart CGMiner{$rg}\")'>"; echo " <input type=button value='Quit' onclick='prc(\"quit&rig={$rig}\",\"Quit CGMiner{$rg}\")'>"; } refreshbuttons(); if (isset($_SESSION[$ses])) { echo " <input type=button value='Logout' onclick='pr(\"&logout=1\",null)'>"; } else { if ($userlist !== null) { echo " <input type=button value='Login' onclick='pr(\"&login=1\",null)'>"; } } echo "</td></tr></table></td></tr>"; }
function pagebuttons($rig, $pg) { global $readonly, $rigs; global $allowcustompages, $customsummarypages; if ($rig === null) { if ($pg === null) { $refresh = ''; } else { $refresh = "&pg={$pg}"; } } else { $refresh = "&rig={$rig}"; } echo '<tr><td><table cellpadding=0 cellspacing=0 border=0><tr><td nowrap>'; echo "<input type=button value='Refresh' onclick='pr(\"{$refresh}\",null)'> "; if (count($rigs) > 1) { echo "<input type=button value='Summary' onclick='pr(\"\",null)'> "; } if ($allowcustompages === true) { foreach ($customsummarypages as $pagename => $data) { echo "<input type=button value='{$pagename}' onclick='pr(\"&pg={$pagename}\",null)'> "; } } echo '</td><td width=100%> </td><td nowrap>'; if ($rig !== null && $readonly === false) { $rg = ''; if (count($rigs) > 1) { $rg = " Rig {$rig}"; } echo "<input type=button value='Restart' onclick='prc(\"restart&rig={$rig}\",\"Restart CGMiner{$rg}\")'>"; echo " <input type=button value='Quit' onclick='prc(\"quit&rig={$rig}\",\"Quit CGMiner{$rg}\")'>"; } refreshbuttons(); echo "</td></tr></table></td></tr>"; }