Bug 6116: Adding a child patron
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / guarantor_search.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Guarantor Search</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4     <style type="text/css">
5     #custom-doc { width:44.46em;*width:43.39em;min-width:578px; margin:auto; text-align:left; }
6     </style>
7     <script type="text/javascript">
8         <!--
9         function fillguarantor(id, surname, firstname, streetnumber, address, address2, city, state, zipcode, country, branchcode) {
10             var $ = window.opener.$;
11             var form = $('#entryform').get(0);
12
13             if (form.guarantorid.value) {
14                 $("#contact-details").find('a').remove();
15                 $("#contactname, #contactfirstname").parent().find('span').remove();
16             }
17
18             form.guarantorid.value = id;
19             $('#contact-details')
20                 .show()
21                 .find('span')
22                 .after('<a target="blank" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=' + id + '">' + id + '</a>');
23
24             $(form.contactname)
25                 .val(surname)
26                 .before('<span>' + surname + '</span>').get(0).type = 'hidden';
27             $(form.contactfirstname)
28                 .val(firstname)
29                 .before('<span>' + firstname + '</span>').get(0).type = 'hidden';
30
31             form.streetnumber.value = streetnumber;
32             form.address.value = address;
33             form.address2.value = address2;
34             form.city.value = city;
35             form.state.value = state;
36             form.zipcode.value = zipcode;
37             form.country.value = country;
38             form.branchcode.value = branchcode;
39
40             form.guarantorsearch.value = 'Change';
41             self.close();
42         }
43         // -->
44     </script>
45 </head>
46
47 <div id="custom-doc" class="yui-t7">
48    <div id="bd">
49         <div class="yui-g">
50         
51
52 <h3>Search for guarantor</h3>
53         <form action="/cgi-bin/koha/members/guarantor_search.pl" method="post">
54                 <fieldset>
55                 <input type="hidden" name="category_type" id="category_type" value="[% category_type %]" />
56                 <input type="text" name="member" id="member" value="[% member %]" class="focus" /> Ordered by
57                 <select name="orderby">
58                         <option value="surname,firstname">Surname</option>
59                         <option value="cardnumber">Cardnumber</option>
60                 </select> <input type="submit" class="button" value="Search" /></fieldset>
61         </form>
62
63 [% IF ( results ) %]
64         <p>Searched for <span class="ex">[% member %]</span>, [% numresults %] patron(s) found:</p>
65         <table>
66                 <tr>
67                         <th>Cardnumber</th>
68                         <th>Name</th>
69                         <th>Date of birth</th>
70                         <th>Address</th>
71             <th>Select?</th>
72                 </tr>
73                 [% FOREACH resultsloo IN resultsloop %]
74                         <tr>
75                                 <td>[% resultsloo.cardnumber %]</td>
76                 <td>
77                     [% resultsloo.surname %], [% resultsloo.firstname %]
78                 </td> 
79                                 <td>[% resultsloo.dateofbirth %]</td>
80                                 <td><p>[% resultsloo.address %] [% resultsloo.address2 %] [% resultsloo.city %] [% resultsloo.state %] [% resultsloo.zipcode %] [% resultsloo.country %]</p></td>
81                 <td>
82                     <form action="">
83                         <input type="button" onclick="fillguarantor('[% resultsloo.borrowernumber %]', '[% resultsloo.surname |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]', '[% resultsloo.firstname |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]', '[% resultsloo.streetnumber |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]', '[% resultsloo.address |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]','[% resultsloo.address2 |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]', '[% resultsloo.city |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]', '[% resultsloo.state |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]','[% resultsloo.zipcode |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]','[% resultsloo.country |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]','[% resultsloo.branchcode |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]'); return false;" value="Select"/>
84                     </form>
85                 </td>
86                         </tr>
87                 [% END %]
88         </table>
89 [% END %]
90
91 <div id="closewindow"><a href="#" class="close">Cancel</a></div>
92 </div>
93 </div>
94 [% INCLUDE 'intranet-bottom.inc' %]