-
Notifications
You must be signed in to change notification settings - Fork 1
/
dedupedvisits.html
74 lines (72 loc) · 2.56 KB
/
dedupedvisits.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html>
<title>St. Vincent de Paul (St. Charles Borromeo Conference) Visits Counts</title>
{{ template "scripts" }}
<script type="text/javascript" src="/js/json.js"></script>
<body class="main">
{{ template "header" . }}
<form action="/dedupedvisits" method="GET">
<label>start date: <span class="invisible" id="sdatefmt">(yyyy-mm-dd)</span></label><input type="date" id="startdate" value="{{ .Start }}" name="startdate"/>
<label>end date: <span class="invisible" id="edatefmt">(yyyy-mm-dd)</span></label><input type="date" id="enddate" value="{{ .End }}" name="enddate"/>
<input type="submit">
</form>
{{ if gt .Start "" }}
<h4 class="contained">Unique people assisted between {{ .Start }} and {{ .End }}</h4>
<a class="contained" href="/dedupedvisits?startdate={{ .Start }}&enddate={{ .End }}&csv=true">Download</a>
<br>
<br>
{{ end }}
<table class="contained">
<thead>
<tr>
<th class="bordered">Client</th>
<th class="bordered">Address</th>
<th class="bordered">Adults (18-59)</th>
<th class="bordered">Seniors (60+) </th>
<th class="bordered">Minors</th>
<th class="bordered">Family Size</th>
</tr>
</thead>
<tbody>
{{ range $i, $clt := .CV }}
<tr>
<td class="bordered"><a href="/client/{{ .Id }}">{{ .Name }}</a></td>
<td class="bordered">{{ .Address }}</td>
<td class="bordered number">{{ .Adults}}</td>
<td class="bordered number">{{ .Seniors }}</td>
<td class="bordered number">{{ .Minors }}</td>
<td class="bordered number">{{ .FamilySize }}</td>
</tr>
{{ end }}
</tbody>
<tfoot>
<tr>
<td class="bordered"></td>
<td class="bordered"></td>
<td class="bordered number">{{ .TotalAdults}}</td>
<td class="bordered number">{{ .TotalSeniors }}</td>
<td class="bordered number">{{ .TotalMinors }}</td>
<td class="bordered number">{{ .TotalFamSize }}</td>
</tr>
</tfoot>
</table>
<script>
$( document ).ready(function() {
console.log( 'ready!' );
if (!browserSupportsDateInput()) {
console.log("trying to un-hide datefmt hints");
$(' span#sdatefmt ').removeClass("invisible");
$(' span#edatefmt ').removeClass("invisible");
}
});
function visitedtoday() {
today = new Date();
day = today.getDate();
if (day < 10) { day = "0" + day;}
month = parseFloat(today.getMonth() + 1);
if (month < 10) { month = "0" + month;}
$(' input#visitdate' ).val(today.getFullYear() + '-' + month + '-' + day);
}
</script>
</body>
</html>