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