diff --git a/pool/inc.php b/pool/inc.php index a6126a68..a426580f 100644 --- a/pool/inc.php +++ b/pool/inc.php @@ -2,15 +2,15 @@ # function GBaseJS() { - $g = "function hasCan(){var c0=document.getElementById('can0');c=document.getElementById('can');return !!(c0&&c&&c.getContext&&c.getContext('2d'));} -function sep(d){ans={};var ar=d.split('\\t');var l=ar.length;for(var i=0;i0){ans=c[0].substr(e+1)}}}return ans} +function scnv(n,v){var d=new Date();d.setTime(d.getTime()+(864*Math.pow(10,8)));document.cookie=n+'='+v+';expires='+d.toUTCString()+';path=/'} function ni(e,o){if(e){if(o==0){e.defd=e.style.display;e.style.display='none'}else{e.style.display=e.defd}}} -function domin(o){var e=document.getElementById('minicb');if(e){if(o==0){e.checked=true}else{e.checked=false}};for(var i=0;i<10;i++){e=document.getElementById('mini'+i);ni(e,o)}} +function domin(o){var e=document.getElementById('minicb');if(e){if(o==0){e.checked=true}else{e.checked=false}}for(var i=0;i<10;i++){e=document.getElementById('mini'+i);ni(e,o)}} function mini(){var hm=gcn('mini');if(hm==''){domin(1)}else{domin(0)}} function md(e){var c='';if(e.checked){c='y'}scnv('mini',c);mini()} function tim(){var e=document.getElementById('ftr');if(e){var now=new Date(),t=document.createTextNode(now.toLocaleString());e.appendChild(t)}} -function jst(){var e=document.getElementById('jst');if(e){e.style.visibility='hidden'}}"; +function jst(){var e=document.getElementById('jst');if(e){e.style.visibility='hidden'}} +"; return $h; } # function HeadCSS($iCrap = false) { - $h = "input[type=checkbox] {vertical-align: -2px;} -form {display: inline-block;} -html, body {height: 100%; font-family:Arial, Verdana, sans-serif; font-size:12pt; background-color:#eeffff; text-align: center; background-repeat: no-repeat; background-position: center;} -.page {min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -50px; position: relative;} -div.jst {color:red; font-weight: bold; font-size: 8; text-align: center; vertical-align: top;} -div.accwarn {color:red; font-weight: bold; font-size: 8; text-align: center; vertical-align: top;} -div.topd {background-color:#cff; border-color: #cff; border-style: solid; border-width: 9px;} -.topdes {color:blue; text-align: right;} -.topdesl {color:blue; text-align: left;} -.topwho {color:black; font-weight: bold; margin-right: 8px;} -.topdat {margin-left: 8px; margin-right: 24px; color:green; font-weight: bold;} -span.nb {white-space: pre;} -span.login {float: right; margin-left: 8px; margin-right: 24px;} + $h = "input[type=checkbox] {vertical-align:-2px;} +form {display:inline-block;} +html, body {height:100%;font-family:Arial, Verdana, sans-serif;font-size:12pt;background-color:#eeffff;text-align:center;background-repeat:no-repeat;background-position:center;} +.page {min-height:100%;height:auto !important;height:100%;margin:0 auto -50px;position:relative;} +div.jst {color:red;font-weight:bold;font-size:8;text-align:center;vertical-align:top;} +div.accwarn {color:red;font-weight:bold;font-size:8;text-align:center;vertical-align:top;} +div.topd {background-color:#cff;border-color:#cff;border-style:solid;border-width:9px;} +.topdes {color:blue;text-align:right;} +.topdesl {color:blue;text-align:left;} +.topwho {color:black;font-weight:bold;margin-right:8px;} +.topdat {margin-left:8px;margin-right:24px;color:green;font-weight:bold;} +span.nb {white-space:pre;} +span.login {float:right;margin-left:8px;margin-right:24px;} span.hil {color:blue;} span.user {color:green;} span.addr {color:brown;} -span.warn {color:orange; font-weight:bold;} -span.urg {color:red; font-weight:bold;} -span.err {color:red; font-weight:bold; font-size:120%;} -span.alert {color:red; font-weight:bold; font-size:250%;} -input.tiny {width: 0px; height: 0px; margin: 0px; padding: 0px; outline: none; border: 0px;} -#n42 {margin:0; position: relative; color:#ffffff; background:#0077ee;} -#n42 a {color:#fff; text-decoration:none; padding: 6px; display:block;} -#n42 td {min-width: 100px; float: left; vertical-align: top; padding: 0px 2px;} -#n42 td.navboxr {float: right;} -#n42 td.nav {position: relative;} -#n42 td.ts {border-width: 1px; border-color: #0022ee; border-style: solid none none none;}"; +span.warn {color:orange;font-weight:bold;} +span.urg {color:red;font-weight:bold;} +span.err {color:red;font-weight:bold;font-size:120%;} +span.alert {color:red;font-weight:bold;font-size:250%;} +input.tiny {width:0px;height:0px;margin:0px;padding:0px;outline:none;border:0px;} +#n42 {margin:0;position:relative;color:#ffffff;background:#0077ee;} +#n42 a {color:#fff;text-decoration:none;padding:6px;display:block;} +#n42 td {min-width:100px;float:left;vertical-align:top;padding:0px 2px;} +#n42 td.navboxr {float:right;} +#n42 td.nav {position:relative;} +#n42 td.ts {border-width:1px;border-color:#0022ee;border-style:solid none none none;} +"; if (!$iCrap) { - $h .= " -#n42 div.sub {left: 0px; z-index: 42; position: absolute; visibility: hidden;} + $h .= "#n42 div.sub {left:0px;z-index:42;position:absolute;visibility:hidden;} #n42 td.nav:hover {background:#0099ee;} -#n42 td.nav:hover div.sub {background:#0077ee; visibility: visible;}"; +#n42 td.nav:hover div.sub {background:#0077ee;visibility:visible;} +"; } - $h .= " -h1 {margin-top: 20px; float:middle; font-size: 20px;} -.foot, .push {height: 50px;} -.title {background-color: #909090;} -.even {background-color: #cccccc;} -.odd {background-color: #a8a8a8;} -.hid {display: none;} -.dl {text-align: left; padding: 2px 8px;} -.dr {text-align: right; padding: 2px 8px;} -.dc {text-align: center; padding: 2px 8px;} -.dls {text-align: left; padding: 2px 8px; text-decoration:line-through; font-weight:lighter;} -.drs {text-align: right; padding: 2px 8px; text-decoration:line-through; font-weight:lighter;} -.dcs {text-align: center; padding: 2px 8px; text-decoration:line-through; font-weight:lighter;} + $h .= "h1 {margin-top:20px;float:middle;font-size:20px;} +.foot, .push {height:50px;} +.title {background-color:#909090;} +.even {background-color:#cccccc;} +.odd {background-color:#a8a8a8;} +.hid {display:none;} +.dl {text-align:left;padding:2px 8px;} +.dr {text-align:right;padding:2px 8px;} +.dc {text-align:center;padding:2px 8px;} +.dls {text-align:left;padding:2px 8px;text-decoration:line-through;font-weight:lighter;} +.drs {text-align:right;padding:2px 8px;text-decoration:line-through;font-weight:lighter;} +.dcs {text-align:center;padding:2px 8px;text-decoration:line-through;font-weight:lighter;} .st0 {font-weight:bold;} -.st1 {color:red; font-weight:bold;} -.st2 {color:green; font-weight:bold;} -.st3 {color:blue; font-weight:bold;} -.fthi {color:red; font-size:7px;} -.ftlo {color:green; font-size:7px;} -.ft {color:blue; font-size:7px;} -.ftl {text-align: left; color:blue; font-size:7px; display:inline-block; width:20%; white-space: nowrap;} -.ftm {text-align: middle; font-size:10pt; display:inline-block; width:60%; white-space: nowrap;} -.ftr {text-align: rigth; color:blue; font-size:7px; display:inline-block; width:20%; white-space: nowrap;}"; +.st1 {color:red;font-weight:bold;} +.st2 {color:green;font-weight:bold;} +.st3 {color:blue;font-weight:bold;} +.fthi {color:red;font-size:7px;} +.ftlo {color:green;font-size:7px;} +.ft {color:blue;font-size:7px;} +.ftl {text-align:left;color:blue;font-size:7px;display:inline-block;width:20%;white-space:nowrap;} +.ftm {text-align:middle;font-size:10pt;display:inline-block;width:60%;white-space:nowrap;} +.ftr {text-align:rigth;color:blue;font-size:7px;display:inline-block;width:20%;white-space:nowrap;} +"; return $h; } # +function SortJS() +{ + $s = "function sot(t,s,o){if(t && s>=0){var rs=t.rows;if(rs && rs.length>2){var all=[], rn, ok=true;for(rn=1;rn diff --git a/pool/page.php b/pool/page.php index 20e42f78..6a64d2eb 100644 --- a/pool/page.php +++ b/pool/page.php @@ -66,6 +66,11 @@ function addTips() addCSS($tcss); } # +function addSort() +{ + $s = SortJS(); + addScript($s); +} # function makeURL($page) { @@ -75,6 +80,7 @@ function makeURL($page) $page = '?k='.$page; return "/index.php$page"; } +# function makeLink($page, $rest = '') { $href = ""; $pg .= 'Work Diff'; - $pg .= 'Last Share'; + $pg .= "$r,2,'n');\">:Last Share"; $pg .= 'Shares'; - $pg .= 'Diff'; + $pg .= "$r,4,'r');\">:Diff"; $pg .= 'Invalid'; $pg .= 'Block %'; - $pg .= 'Hash Rate'; + $pg .= "$r,7,'r');\" checked>:Hash Rate"; $pg .= "\n"; + addSort(); return $pg; } # @@ -86,14 +88,15 @@ function workuser($data, $user, &$offset, &$totshare, &$totdiff, $ld = ' '; $pg .= "$ld"; - $pg .= ''.howlongago($lst).''; + $pg .= "".howlongago($lst).''; $shareacc = number_format($all[$i]['w_shareacc'], 0); $totshare += $all[$i]['w_shareacc']; $diffacc = number_format($all[$i]['w_diffacc'], 0); + $ds = round($all[$i]['w_diffacc']); $totdiff += $all[$i]['w_diffacc']; $pg .= "$shareacc"; - $pg .= "$diffacc"; + $pg .= "$diffacc"; $dtot = $all[$i]['w_diffacc'] + $all[$i]['w_diffinv']; if ($dtot > 0) @@ -113,13 +116,17 @@ function workuser($data, $user, &$offset, &$totshare, &$totdiff, $uhr = $all[$i]['w_uhr']; if ($uhr == '?') + { $uhr = '?GHs'; + $su = 0; + } else { $totrate += $uhr; $uhr = dsprate($uhr); + $su = round($uhr); } - $pg .= "$uhr"; + $pg .= "$uhr"; $pg .= "\n"; @@ -137,7 +144,7 @@ function worktotal($offset, $totshare, $totdiff, $totinvalid, $totrate, $blockac $row = 'even'; else $row = 'odd'; - $pg .= "Total:"; + $pg .= "Total: $offset"; $shareacc = number_format($totshare, 0); $pg .= "$shareacc"; $diffacc = number_format($totdiff, 0);