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