Bug 24958: Remember last selected tab in SQL reports
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reports / borrowers_stats.tt
1 [% USE Branches %]
2 [% USE Koha %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Reports [% IF ( do_it ) %]&rsaquo; Patrons statistics &rsaquo; Results[% ELSE %]&rsaquo; Patrons statistics[% END %]</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 <style>
8         .sql {display:none;}
9         .debug {display:none;}
10 </style>
11 </head>
12
13 <body id="rep_borrowers_stats" class="rep">
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'cat-search.inc' %]
16
17 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a> &rsaquo; <a href="/cgi-bin/koha/reports/borrowers_stats.pl">Patrons statistics</a>[% IF ( do_it ) %] &rsaquo; Results[% END %]</div>
18
19 <div class="main container-fluid">
20     <div class="row">
21         <div class="col-sm-10 col-sm-push-2">
22             <main>
23
24 [% IF ( do_it ) %]
25         [% FOREACH mainloo IN mainloop %]
26                 <h1>Patrons statistics</h1>
27         [% IF ( mainloo.loopfilter.size>0 ) %]
28             <p>Filtered on:</p>
29                         [% FOREACH loopfilte IN mainloo.loopfilter %]
30                                 <p>
31                                         [% loopfilte.crit | html %] = [% loopfilte.filter | html %]
32                                 </p>
33                         [% END %]
34                 [% END %]
35                 <table>
36                         <tr>
37                                 <th>[% mainloo.line | html %] / [% mainloo.column | html %]</th>
38                                 [% FOREACH loopco IN mainloo.loopcol %]
39                                         <th>[% IF ( loopco.coltitle_display ) %][% loopco.coltitle_display | html %][% ELSE %][% loopco.coltitle | html %][% END %]
40                                         </th>
41                                 [% END %]
42                                 <th>TOTAL</th>
43                         </tr>
44                                 [% FOREACH loopro IN mainloo.looprow %]
45                     <tr>
46                                                 <td>[% IF ( loopro.rowtitle_display ) %][% loopro.rowtitle_display | html %][% ELSE %][% loopro.rowtitle | html %][% END %]
47                                                 </td>
48                                                 [% FOREACH loopcel IN loopro.loopcell %]
49                                                 <td>[% IF ( loopcel.value ) %][% loopcel.value | html %][% ELSE %]&nbsp;[% END %]
50                                                 </td>
51                                                 [% END %]
52                                                 <td>[% loopro.totalrow | html %]</td>
53                                         </tr>
54                                 [% END %]
55                                 <tr>
56                                         <th>TOTAL</th>
57                                         [% FOREACH loopfoote IN mainloo.loopfooter %]
58                                                 <th>[% loopfoote.totalcol | html %]</th>
59                                         [% END %]
60                                         <th>[% mainloo.total | html %]</th>
61                                 </tr>
62                 </table>
63         [% END %]
64 [% ELSE %]
65
66         <form method="post" action="/cgi-bin/koha/reports/borrowers_stats.pl">
67         <fieldset class="rows"><legend>Patrons statistics</legend>
68         <table>
69                 <thead>
70                         <tr>
71                         <th>Title</th>
72                         <th>Row</th>
73                         <th>Column</th>
74                         <th>Filter</th>
75                         </tr>
76                 </thead>
77                 <tbody>
78             <tr>
79                         <td>Patron category</td>
80                         <td><input type="radio" name="Line" value="categorycode" /></td>
81             <td><input type="radio" checked="checked" name="Column" value="categorycode" /></td>
82             <td>
83                 <select name="Filter"  size="1" id="catcode">
84                     <option value=""></option>
85                     [% FOREACH patron_category IN patron_categories %]
86                         <option value="[% patron_category.categorycode | html %]">[% patron_category.description | html %]</option>
87                     [% END %]
88                 </select>
89             </td>
90                         </tr>
91                         <tr>
92                         <td>Patron status</td>
93                         <td colspan="2"></td>
94                         <td ><select name="status"><option value=""> </option><option value="debarred">restricted</option><option value="gonenoadress">gone no address</option><option value="lost">lost</option></select></td>
95                         </tr>
96             <tr>
97                         <td>Patron activity</td>
98                         <td colspan="2"><select name="period" id="period">
99                         <option value="1">1</option>
100                         <option value="2">2</option>
101                         <option value="3">3</option>
102                         </select>
103                         <label for="period">years of activity</label> 
104                         </td>
105                         <td><select name="activity"><option value=""> </option><option value="active">active</option><option value="nonactive">no active</option></select></td>
106                         </tr>
107
108                         <tr>
109             <td rowspan="2">ZIP/Postal code</td>
110                         <td><input type="radio" name="Line" value="zipcode" /></td>
111                         <td><input type="radio" name="Column" value="zipcode" /></td>
112                         <td><select name="Filter"  size="1" id="zipcode">
113                                 <option value=""> </option>
114                                 [% FOREACH ZIP_LOO IN ZIP_LOOP %]
115                                 <option value="[% ZIP_LOO.zipcode | html %]">[% ZIP_LOO.zipcode | html %]</option>
116                                 [% END %]
117                                 </select>
118                         </td>
119                         </tr>
120                         <tr>
121                         <td colspan="2"><select name="digits" id="digits">
122                         <option value=""> </option>
123                         <option value ="1">1</option>
124                         <option value ="2">2</option>
125                         <option value ="3">3</option>
126                         <option value ="4">4</option>
127                         <option value ="5">5</option>
128                         <option value ="6">6</option>
129                         <option value ="7">7</option>
130                         <option value ="8">8</option>
131                         <option value ="9">9</option>
132                         <option value ="10">10</option>
133                         </select>
134                         <label for="digits">digits</label> 
135                         </td>
136                         <td>&nbsp;</td>
137                         </tr>
138
139             <tr>
140                         <td>Library</td>
141             <td><input type="radio" checked="checked" name="Line"   value="branchcode" /></td>
142                         <td><input type="radio" name="Column" value="branchcode" /></td>
143                         <td>
144                 <select name="Filter"  size="1" id="branch">
145                 <option value=""></option>
146                 [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
147                     <option value="[% l.branchcode | html %]">[% l.branchcode | html %] - [% l.branchname || 'UNKNOWN' | html %]</option>
148                 [% END %]
149                 </select>
150                         </td>
151                         </tr>
152                     <tr>
153             <td>Date of birth</td>
154             <td colspan="2"></td>
155                 <td><label for="from">From</label> <input type="text" size="10" id="from" name="Filter" class="datepickerfrom" />
156                     <label for="to">To</label> <input size="10" id="to" name="Filter" value="" type="text" class="datepickerto" />
157                     <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
158                     </td>
159                 </tr>
160             <tr>
161                 <td>Gender</td>
162                 <td><input type="radio" name="Line" value="sex" /></td>
163                 <td><input type="radio" name="Column" value="sex" /></td>
164                 <td>
165                     <select id="sex" size="1" name="Filter">
166                         <option value="" />
167                         <option value="M">Men</option>
168                         <option value="F">Women</option>
169                     </select>
170                 </td>
171             </tr>
172                         [% IF ( SORT1_LOOP ) %]
173                 <tr>
174                                 <td>Sort1</td>
175                                 <td><input type="radio" name="Line" value="sort1" /></td>
176                                 <td><input type="radio" name="Column" value="sort1" /></td>
177                                 <td>
178                                         <select id="sort1" size="1" name="Filter">
179                                         <option value=""/>
180                                         [% FOREACH SORT1_LOO IN SORT1_LOOP %]
181                                                 <option value="[% SORT1_LOO.authorized_value | html %]">[% SORT1_LOO.lib | html %]</option>
182                                         [% END %]
183                                         </select>
184                                 </td>
185                                 </tr>
186             [% ELSE %]
187                 <input type="hidden" name="Filter" />
188                         [% END %]
189                         [% IF ( SORT2_LOOP ) %]
190                 <tr>
191                                 <td>Sort2</td>
192                                 <td><input type="radio" name="Line" value="sort2" /></td>
193                                 <td><input type="radio" name="Column" value="sort2" /></td>
194                                 <td>
195                                         <select id="sort2" size="1" name="Filter">
196                                         <option value=""/>
197                                         [% FOREACH SORT2_LOO IN SORT2_LOOP %]
198                                                 <option value="[% SORT2_LOO.value | html %]">[% SORT2_LOO.value | html %]</option>
199                                         [% END %]
200                                         </select>
201                                 </td>
202                                 </tr>
203             [% ELSE %]
204                 <input type="hidden" name="Filter" />
205                         [% END %]
206             [% IF Koha.Preference('ExtendedPatronAttributes') %]
207                 <tr>
208                     <th colspan="4">Patron attributes</th>
209                 </tr>
210             [% FOREACH pa_loo IN patron_attributes %]
211                 [% IF (pa_loo.class) %]
212                     <tr>
213                         <th>[% pa_loo.class | html %] ([% pa_loo.lib | html %])</th>
214                         <th colspan="3"></th>
215                     </tr>
216                 [% END %]
217             [% FOREACH patron_attribute IN pa_loo.items %]
218                 <tr data-category_code="[% patron_attribute.category_code | html %]">
219                     <td>
220                         [% patron_attribute.code | html %]
221                         ([% patron_attribute.description | html %])
222                     </td>
223                     <td>
224                         <input type="radio" name="Line"
225                             value="patron_attr.[% patron_attribute.code | html %]" />
226                     </td>
227                     <td>
228                         <input type="radio" name="Column"
229                             value="patron_attr.[% patron_attribute.code | html %]" />
230                     </td>
231                     <td>
232                         [% IF ( patron_attribute.use_dropdown ) %]
233                             <select name="Filter_patron_attr.[% patron_attribute.code | html %]"  >
234                                 <option value="" />
235                                 [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
236                                     <option value="[% auth_val_loo.authorised_value | html %]" >
237                                         [% auth_val_loo.lib | html %]
238                                     </option>
239                                 [% END %]
240                             </select>
241                         [% ELSE %]
242                             <input type="text" maxlength="64"
243                                    name="Filter_patron_attr.[% patron_attribute.code | html %]" />
244                         [% END %]
245                     </td>
246                 </tr>
247             [% END %]
248             [% END %]
249             [% END %]
250         </tbody>
251     </table>
252     </fieldset>
253
254         
255         <fieldset class="rows">
256         <legend>Output</legend>
257     <ol>
258         <li>
259             <label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" />
260         </li>
261         <li>
262             <label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" />
263             <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" />
264             <label class="inline" for="MIME">Into an application:</label>
265             <select name="MIME" id="MIME" size="1">
266             [% FOREACH value IN CGIextChoice %]
267                 <option value="[% value | html %]">[% value | html %]</option>
268             [% END %]
269             </select>
270             <select name="sep" id="sep" size="1">
271             [% FOREACH value IN CGIsepChoice.values.sort() %]
272               [% IF ( value == CGIsepChoice.default ) %]
273                 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
274               [% ELSE %]
275                 <option value="[% value | html %]">[% value | html %]</option>
276               [% END %]
277             [% END %]
278             </select>
279         </li>
280     </ol>
281         </fieldset>
282
283         <fieldset class="action">
284         <input type="submit" value="Submit" />
285         <input type="hidden" name="report_name" value="[% report_name | html %]" />
286         <input type="hidden" name="do_it" value="1" />
287         </fieldset>
288         </form>
289 [% END %]
290
291             </main>
292         </div> <!-- /.col-sm-10.col-sm-push-2 -->
293
294         <div class="col-sm-2 col-sm-pull-10">
295             <aside>
296                 [% INCLUDE 'reports-menu.inc' %]
297             </aside>
298         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
299      </div> <!-- /.row -->
300
301 [% MACRO jsinclude BLOCK %]
302     [% INCLUDE 'calendar.inc' %]
303 [% END %]
304
305 [% INCLUDE 'intranet-bottom.inc' %]