3 #script to do a borrower enquiery/brin up borrower details etc
4 #written 20/12/99 by chris@katipo.co.nz
5 #Displays all the detailas about a borrower
6 #needs html removed and to use the C4::Output more, but its tricky
7 #last modified 21/1/2000 by chris@katipo.co.nz
15 use C4::Circulation::Renewals2;
17 my $bornum=$input->param('bornum');
21 #start the page and read in includes
23 print startmenu('member');
24 my $data=borrdata('',$bornum);
25 my @temp=split('-',$data->{'dateenrolled'});
26 $data->{'dateenrolled'}="$temp[2]/$temp[1]/$temp[0]";
27 @temp=split('-',$data->{'expiry'});
28 $data->{'expiry'}="$temp[2]/$temp[1]/$temp[0]";
29 @temp=split('-',$data->{'dateofbirth'});
30 $data->{'dateofbirth'}="$temp[2]/$temp[1]/$temp[0]";
31 if ($data->{'ethnicity'} eq 'maori'){
32 $data->{'ethnicity'} = 'Maori';
34 if ($data->{'ethnicity'}eq 'european'){
35 $data->{'ethnicity'} = 'European/Pakeha';
37 if ($data->{'ethnicity'}eq 'pi'){
38 $data->{'ethnicity'} = 'Pacific Islander';
40 if ($data->{'ethnicity'}eq 'asian'){
41 $data->{'ethnicity'} = 'Asian';
44 <FONT SIZE=6><em>$data->{'firstname'} $data->{'surname'}</em></FONT><P>
46 <form action=/cgi-bin/koha/jmemberentry.pl method=post>
47 <TABLE CELLSPACING=0 CELLPADDING=5 border=1 align=left width=270>
49 <td bgcolor="99cc33" background="/images/background-mem.gif"><B>MEMBERSHIP RECORD</TD></TR>
52 <p align=right><INPUT TYPE="image" name="submit" VALUE="add-child" height=42 WIDTH=120 BORDER=0 src="/images/add-child.gif">
53 <input type=hidden name=type value=Add>
54 <input type=hidden name=bornum value=$data->{'borrowernumber'}>
57 <FONT SIZE=2 face="arial, helvetica">$data->{'title'} $data->{'othernames'} $data->{'surname'} ($data->{'firstname'}, $data->{'initials'})<p>
59 Card Number: $data->{'cardnumber'}<BR>
60 Postal Address: $data->{'streetaddress'}, $data->{'city'}<BR>
61 Home Address: $data->{'physstreet'}, $data->{'streetcity'}<BR>
62 Phone (Home): $data->{'phone'}<BR>
63 Phone (Daytime): $data->{'phoneday'}<BR>
64 Fax: $data->{'faxnumber'}<BR>
65 E-mail: <a href="mailto:$data->{'emailaddress'}">$data->{'emailaddress'}</a><P>
66 Membership Number: $data->{'borrowernumber'}<BR>
67 Membership: $data->{'categorycode'}<BR>
68 Area: $data->{'area'}<BR>
69 Fee:$30/year, Paid<BR>
70 Joined: $data->{'dateenrolled'}, Expires: $data->{'expiry'} <BR>
71 Joining Branch: $data->{'homebranch'}<P>
72 Ethnicity: $data->{'ethnicity'}, $data->{'ethnotes'}<BR>
73 DoB: $data->{'dateofbirth'}<BR>
74 Sex: $data->{'sex'}<P>
76 Alternative Contact:$data->{'contactname'}<BR>
77 Phone: $data->{'altphone'}<BR>
78 Relationship: $data->{'altrelationship'}<BR>
79 Notes: $data->{'altnotes'}<P>
83 my ($count,$guarantees)=findguarantees($data->{'borrowernumber'});
84 for (my $i=0;$i<$count;$i++){
85 print "<A HREF=\"/cgi-bin/koha/moremember.pl?bornum=$guarantees->[$i]->{'borrowernumber'}\">$guarantees->[$i]->{'cardnumber'}</a><br>";
92 General Notes: <A HREF="popbox.html" onclick="messenger(200,250,'Form that lets you add to and delete notes.'); return false">
93 $data->{'borrowernotes'}</a>
95 <form action=/cgi-bin/koha/memberentry.pl method=post>
96 <input type=hidden name=bornum value=$bornum>
97 <INPUT TYPE="image" name="submit" VALUE="modify" height=42 WIDTH=93 BORDER=0 src="/images/modify-mem.gif">
99 <INPUT TYPE="image" name="submit" VALUE="delete" height=42 WIDTH=93 BORDER=0 src="/images/delete-mem.gif">
106 <img src="/images/holder.gif" width=16 height=800 align=left>
107 <TABLE CELLSPACING=0 CELLPADDING=5 border=1 >
109 <td bgcolor="99cc33" background="/images/background-mem.gif" colspan=4><B>FINES & CHARGES</TD></TR>
113 $bor{'borrowernumber'}=$bornum;
114 my ($numaccts,$accts,$total)=getboracctrecord('',\%bor);
115 #if ($numaccts > 10){
118 for (my$i=0;$i<$numaccts;$i++){
119 #if ($accts->[$i]{'accounttype'} ne 'Pay'){
120 my $amount= $accts->[$i]{'amount'} + 0.00;
121 my $amount2= $accts->[$i]{'amountoutstanding'} + 0.00;
123 print "<tr VALIGN=TOP >";
125 @temp=split('-',$accts->[$i]{'date'});
126 $accts->[$i]{'date'}="$temp[2]/$temp[1]/$temp[0]";
127 if ($accts->[$i]{'accounttype'} ne 'Res'){
131 print "<td>$accts->[$i]{'date'}</td>";
132 # print "<TD>$accts->[$i]{'accounttype'}</td>";
133 print "<TD>$accts->[$i]{'description'} $accts->[$i]{'title'}</td>
134 <TD>$amount</td><td>$amount2</td>
141 <TD colspan=3 align=right>
143 <a href=/cgi-bin/koha/boraccount.pl?bornum=$bornum><img height=42 WIDTH=187 BORDER=0 src="/images/view-account.gif"></a>
144 <a href=/cgi-bin/koha/pay.pl?bornum=$bornum><img height=42 WIDTH=187 BORDER=0 src="/images/pay-fines.gif"></a></nobr>
153 <form action="renewscript.pl" method=post>
154 <input type=hidden name=bornum value=$bornum>
155 <TABLE CELLSPACING=0 CELLPADDING=5 border=1 >
159 <td bgcolor="99cc33" background="/images/background-mem.gif" colspan=6><B>ITEMS CURRENTLY ON ISSUE</b></TD>
163 <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Title</b></TD>
164 <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Due</b></TD>
165 <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Itemtype</b></TD>
166 <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Charge</b></TD>
167 <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Renew</b></TD>
171 my ($count,$issue)=borrissues($bornum);
172 my $today=ParseDate('today');
173 for (my $i=0;$i<$count;$i++){
174 print "<tr VALIGN=TOP >
176 my $datedue=ParseDate($issue->[$i]{'date_due'});
177 @temp=split('-',$issue->[$i]{'date_due'});
178 $issue->[$i]{'date_due'}="$temp[2]/$temp[1]/$temp[0]";
179 if ($datedue < $today){
180 print "<font color=red>";
182 print "$issue->[$i]{'title'} $issue->[$i]{'barcode'}</td>
183 <TD>$issue->[$i]{'date_due'}</td>";
184 #find the charge for an item
185 my ($charge,$itemtype)=calc_charges(\%env,$issue->[$i]{'itemnumber'},$bornum);
186 print "<TD>$itemtype</td>";
187 print "<TD>$charge</td>";
189 # if ($datedue < $today){
190 # print "<td>Overdue</td>";
192 # print "<td> </td>";
194 #check item is not reserved
195 my ($rescount,$reserves)=FindReserves($issue->[$i]{'biblionumber'},'');
197 print "<TD>On Request";
201 print "<input type=radio name=\"renew_item_$issue->[$i]{'itemnumber'}\" value=y>Y
202 <input type=radio name=\"renew_item_$issue->[$i]{'itemnumber'}\" value=n>N</td>
210 <TD colspan=5 align=right>
211 <INPUT TYPE="image" name="submit" VALUE="update" height=42 WIDTH=187 BORDER=0 src="/images/update-renewals.gif">
222 <TABLE CELLSPACING=0 CELLPADDING=5 border=1 >
226 <td bgcolor="99cc33" background="/images/background-mem.gif" colspan=5><B>ITEMS REQUESTED</b></TD>
231 <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Title</b></TD>
232 <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Requested</b></TD>
235 <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Charge</b></TD>
237 <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Remove</b></TD>
239 <form action=/cgi-bin/koha/modrequest.pl method=post>
240 <input type=hidden name=from value=borrower>
243 my ($rescount,$reserves)=FindReserves('',$bornum); #From C4::Reserves2
244 for (my $i=0;$i<$rescount;$i++){
245 @temp=split('-',$reserves->[$i]{'reservedate'});
246 $reserves->[$i]{'reservedate'}="$temp[2]/$temp[1]/$temp[0]";
247 print "<tr VALIGN=TOP >
248 <TD><a href=\"/cgi-bin/koha/request.pl?bib=$reserves->[$i]{'biblionumber'}\">$reserves->[$i]{'title'}</a></td>
249 <TD>$reserves->[$i]{'reservedate'}</td>
250 <input type=hidden name=biblio value=$reserves->[$i]{'biblionumber'}>
251 <input type=hidden name=borrower value=$bornum>
253 <TD><select name=\"rank-request\">
255 <option value=del>Yes
263 <TD colspan=5 align=right>
264 <INPUT TYPE="image" name="submit" VALUE="update" height=42 WIDTH=187 BORDER=0 src="/images/cancel-requests.gif"></td>
269 <a href=/cgi-bin/koha/readingrec.pl?bornum=$bornum><img height=42 WIDTH=187 BORDER=0 src="/images/reading-record.gif"></a>
275 print endmenu('member');