Con Kolivas
11 years ago
13 changed files with 279 additions and 123 deletions
@ -0,0 +1,43 @@
|
||||
<?php |
||||
# |
||||
include_once('page_workers.php'); |
||||
# |
||||
function doallwork($data, $user) |
||||
{ |
||||
$pg = '<h1>All Workers</h1>'; |
||||
|
||||
$pg .= "<table callpadding=0 cellspacing=0 border=0>\n"; |
||||
|
||||
$totshare = 0; |
||||
$totdiff = 0; |
||||
$totinvalid = 0; |
||||
$totrate = 0; |
||||
$offset = 0; |
||||
|
||||
$pg .= worktitle($data, $user); |
||||
|
||||
$ans = getAllUsers($user); |
||||
if ($ans['STATUS'] == 'ok') |
||||
{ |
||||
$count = $ans['rows']; |
||||
for ($i = 0; $i < $count; $i++) |
||||
{ |
||||
$pg .= workuser($data, $ans['username:'.$i], |
||||
$offset, $totshare, $totdiff, |
||||
$totinvalid, $totrate, 3600); |
||||
} |
||||
} |
||||
|
||||
$pg .= worktotal($offset, $totshare, $totdiff, $totinvalid, $totrate); |
||||
|
||||
$pg .= "</table>\n"; |
||||
|
||||
return $pg; |
||||
} |
||||
# |
||||
function show_allwork($page, $menu, $name, $user) |
||||
{ |
||||
gopage(NULL, 'doallwork', $page, $menu, $name, $user); |
||||
} |
||||
# |
||||
?> |
@ -0,0 +1,42 @@
|
||||
SET SESSION AUTHORIZATION 'postgres'; |
||||
|
||||
BEGIN transaction; |
||||
|
||||
DO $$ |
||||
DECLARE ver TEXT; |
||||
BEGIN |
||||
|
||||
UPDATE version set version='0.9.1' where vlock=1 and version='0.9'; |
||||
|
||||
IF found THEN |
||||
RETURN; |
||||
END IF; |
||||
|
||||
SELECT version into ver from version |
||||
WHERE vlock=1; |
||||
|
||||
RAISE EXCEPTION 'Wrong DB version - expect "0.9" - found "%"', ver; |
||||
|
||||
END $$; |
||||
|
||||
CREATE TABLE useratts ( |
||||
userid bigint NOT NULL, |
||||
attname character varying(64) NOT NULL, |
||||
attstr character varying(256) DEFAULT ''::character varying NOT NULL, |
||||
attstr2 character varying(256) DEFAULT ''::character varying NOT NULL, |
||||
attnum bigint DEFAULT 0 NOT NULL, |
||||
attnum2 bigint DEFAULT 0 NOT NULL, |
||||
attdate timestamp with time zone DEFAULT '1970-01-01 00:00:00+00', |
||||
attdate2 timestamp with time zone DEFAULT '1970-01-01 00:00:00+00', |
||||
createdate timestamp with time zone NOT NULL, |
||||
createby character varying(64) DEFAULT ''::character varying NOT NULL, |
||||
createcode character varying(128) DEFAULT ''::character varying NOT NULL, |
||||
createinet character varying(128) DEFAULT ''::character varying NOT NULL, |
||||
expirydate timestamp with time zone DEFAULT '6666-06-06 06:06:06+00', |
||||
PRIMARY KEY (userid, attname, expirydate) |
||||
); |
||||
|
||||
ALTER TABLE ONLY users |
||||
ADD COLUMN salt character varying(256) DEFAULT ''::character varying NOT NULL; |
||||
|
||||
END transaction; |
Loading…
Reference in new issue