functor Make(M : Conference.INPUT) = struct
open M
table bid : {User : userId, Paper : paperId, Interest : char}
PRIMARY KEY (User, Paper)
table assignment : {User : userId, Paper : paperId}
PRIMARY KEY (User, Paper)
val linksForPc =
let
fun yourBids () =
me <- getPcLogin;
ps <- queryX (SELECT paper.Id, paper.{{M.paper}}, bid.Interest
FROM paper LEFT JOIN bid ON bid.Paper = paper.Id
AND bid.User = {[me.Id]})
(fn r =>
{useMore
{summarizePaper (r.Paper -- #Id)}
}
);
return
Bid on papers
and changeBids r =
me <- getPcLogin;
List.app (fn {Paper = p, Bid = b} =>
case b of
"" => return ()
| _ => let
val p = readError p
in
(dml (DELETE FROM bid WHERE Paper = {[p]} AND User = {[me.Id]});
dml (INSERT INTO bid (Paper, User, Interest)
VALUES ({[p]}, {[me.Id]}, {[String.sub b 0]})))
end) r.Papers;
yourBids ()
in