Roll call system, and update forms to method=post
[hcoop/portal.git] / balances.mlt
index d2c19c9..a6b9352 100644 (file)
@@ -20,7 +20,7 @@ elseif $"mod" <> "" then
        val balance = Balance.lookupBalance (Web.stoi ($"mod")) %>
 <h3><b>Modify balance record</b></h3>
 
-<form action="balances">
+<form action="balances" method="post">
 <input type="hidden" name="id" value="<% $"mod" %>">
 <table>
 <tr> <td align="right"><b>Name</b>:</td> <td><input name="name" value="<% #name balance %>"></td> </tr>
@@ -46,10 +46,11 @@ elseif $"mod" <> "" then
 
 <% end %>
 
-<% if showNormal then %>
+<% if showNormal then
+       ref total = 0.0 %>
 <h3><b>New balance</b></h3>
 
-<form action="balances">
+<form action="balances" method="post">
 <table>
 <tr> <td align="right"><b>Name</b>:</td> <td><input name="name"></td> </tr>
 <tr> <td><input type="submit" name="cmd" value="Create"></td> </tr>
@@ -59,11 +60,14 @@ elseif $"mod" <> "" then
 <h3><b>Manage current balances</b></h3>
 
 <table>
-<% foreach balance in Balance.listBalances () do %>
+<% foreach balance in Balance.listBalances () do
+       total := Util.add (total, #amount balance) %>
        <tr> <td><% Web.html (#name balance) %></td> <td><% #amount balance %></td> <td><a href="balances?mod=<% #id balance %>">[Modify]</a> <a href="balances?del=<% #id balance %>">[Delete]</a></td> </tr>
 <% end %>
 </table>
 
+<br><b>Total</b>: $<% total %>
+
 <% end %>
 
 <% @footer [] %>