Browse Source

cdb/php - add a red line under the last payout on the shifts page

master
kanoi 9 years ago
parent
commit
6adbec8550
  1. 2
      pool/inc.php
  2. 8
      pool/page_shifts.php
  3. 2
      src/ckdb.h
  4. 13
      src/ckdb_cmd.c

2
pool/inc.php

@ -117,7 +117,9 @@ h1 {margin-top:20px;float:middle;font-size:20px;}
.foot, .push {height:50px;}
.title {background-color:#909090;}
.even {background-color:#cccccc;}
.evenu td {background-color:#cccccc;border-bottom:2px solid red;}
.odd {background-color:#a8a8a8;}
.oddu td {background-color:#a8a8a8;border-bottom:2px solid red;}
.hid {display:none;}
.dl {text-align:left;padding:2px 8px;}
.dr {text-align:right;padding:2px 8px;}

8
pool/page_shifts.php

@ -27,10 +27,14 @@ function doshifts($data, $user)
$pg = '<h1>Last '.($count+1).' Shifts</h1>'.$pg;
for ($i = 0; $i < $count; $i++)
{
$u = '';
if (isset($ans['lastpayoutstart:'.$i])
&& $ans['lastpayoutstart:'.$i] != '')
$u = 'u';
if (($i % 2) == 0)
$row = 'even';
$row = "even$u";
else
$row = 'odd';
$row = "odd$u";
$pg .= "<tr class=$row>";
$shifname = $ans['shift:'.$i];

2
src/ckdb.h

@ -55,7 +55,7 @@
#define DB_VLOCK "1"
#define DB_VERSION "1.0.2"
#define CKDB_VERSION DB_VERSION"-1.232"
#define CKDB_VERSION DB_VERSION"-1.233"
#define WHERE_FFL " - from %s %s() line %d"
#define WHERE_FFL_HERE __FILE__, __func__, __LINE__

13
src/ckdb_cmd.c

@ -5143,6 +5143,7 @@ static char *cmd_shifts(__maybe_unused PGconn *conn, char *cmd, char *id,
int rows, want, i, where_all;
int64_t maxrows;
double wm_count, d;
int64_t last_payout_start = 0;
LOGDEBUG("%s(): cmd '%s'", __func__, cmd);
@ -5169,6 +5170,7 @@ static char *cmd_shifts(__maybe_unused PGconn *conn, char *cmd, char *id,
wm_count *= 1.42;
if (maxrows < wm_count)
maxrows = wm_count;
last_payout_start = payouts->workinfoidstart;
}
i_select = optional_name(trf_root, "select", 1, NULL, reply, siz);
@ -5360,6 +5362,14 @@ static char *cmd_shifts(__maybe_unused PGconn *conn, char *cmd, char *id,
rows, wm->rewards, FLDSEP);
APPEND_REALLOC(buf, off, len, tmp);
snprintf(tmp, sizeof(tmp), "lastpayoutstart:%d=%s%c",
rows,
(wm->workinfoidstart ==
last_payout_start) ?
"Y" : EMPTY,
FLDSEP);
APPEND_REALLOC(buf, off, len, tmp);
rows++;
// Setup for next shift
@ -5399,7 +5409,8 @@ static char *cmd_shifts(__maybe_unused PGconn *conn, char *cmd, char *id,
* other workers start >= 0 and finish <= rows-1 */
snprintf(tmp, sizeof(tmp), "rows=%d%cflds=%s%c",
rows, FLDSEP,
"markerid,shift,start,end,rewards", FLDSEP);
"markerid,shift,start,end,rewards,"
"lastpayoutstart", FLDSEP);
APPEND_REALLOC(buf, off, len, tmp);
snprintf(tmp, sizeof(tmp), "arn=%s", "Shifts");

Loading…
Cancel
Save