<% elseif $"cmd" = "pay" then
Group.requireGroupName "money";
val uid = (case $"user" of "" => ~1 | s => Web.stoi s);
showNormal := false %>
New member payment
<% elseif $"cmd" = "pay2" then
Group.requireGroupName "money";
val amount = Web.stor ($"amount");
val descr = $"descr";
val descr = iff descr = "" then $"descr2" else descr;
val id = Money.addTransaction ($"descr", amount, $"d");
Money.addCharge {trn = id, usr = Web.stoi ($"usr"), amount = amount};
Money.applyCharges id;
%>
Payment transaction added.
<% elseif $"modPay" <> "" then
Group.requireGroupName "money";
showNormal := false;
val id = Web.stoi ($"modPay");
val trn = Money.lookupTransaction id %>
Modify member payment
<% elseif $"cmd" = "even" then
Group.requireGroupName "money";
val id = Money.addTransaction ($"descr", Web.stor ($"amount"), $"d");
Money.addEvenCharges (id, map Web.stoi (Web.getMultiParam "usrs"))
%>
Even transaction added.
<% elseif $"modEven" <> "" then
Group.requireGroupName "money";
showNormal := false;
val trn = Money.lookupTransaction (Web.stoi ($"modEven")) %>
Modify even transaction
<% elseif $"saveEven" <> "" then
Group.requireGroupName "money";
val id = Web.stoi ($"saveEven");
val trn = Money.lookupTransaction id;
Money.clearCharges id;
Money.modTransaction {trn with descr = $"descr", d = $"d", amount = Web.stor ($"amount")};
Money.addEvenCharges (id, map Web.stoi (Web.getMultiParam "usrs"))
%>
Even transaction modified
<% elseif $"del" <> "" then
Group.requireGroupName "money";
showNormal := false;
val trn = Money.lookupTransaction (Web.stoi ($"del")) %>
<% elseif $"cmd" = "paypal" then
showNormal := false;
val apps = App.searchPaypal ($"email");
val users = Init.searchPaypal ($"email");
switch apps of
_ :: _ =>
%>
Approved applications
<% foreach appl in apps do %>
Received:
<% #applied appl %>
Approved by:
<%
ref first = true;
ref found = false;
foreach (id, name) in App.votes (#id appl) do
if first then
first := false
else
%>, <%
end
%><% name %><%
end %>
<% end
end;
switch (apps, users) of
(nil, nil) => %>No matches.<%
end
elseif $"cmd" = "checkout" then
showNormal := false;
val apps = App.searchCheckout ($"email");
val users = Init.searchCheckout ($"email");
switch apps of
_ :: _ =>
%>
Approved applications
<% foreach appl in apps do %>
Received:
<% #applied appl %>
Approved by:
<%
ref first = true;
ref found = false;
foreach (id, name) in App.votes (#id appl) do
if first then
first := false
else
%>, <%
end
%><% name %><%
end %>