Kumara - predecessor to Koha
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

225 lines
6.4 KiB

  1. #!/usr/bin/perl
  2. #script to do a borrower enquiery/brin up borrower details etc
  3. #written 20/12/99 by chris@katipo.co.nz
  4. use strict;
  5. use C4::Output;
  6. use CGI;
  7. use C4::Search;
  8. use Date::Manip;
  9. use C4::Reserves2;
  10. my $input = new CGI;
  11. my $bornum=$input->param('bornum');
  12. print $input->header;
  13. #start the page and read in includes
  14. print startpage();
  15. print startmenu('member');
  16. my $data=borrdata('',$bornum);
  17. print <<printend
  18. <FONT SIZE=6><em>$data->{'othernames'} $data->{'surname'}</em></FONT><P>
  19. <p>
  20. <form action=/cgi-bin/koha/wmemberentry.pl method=post>
  21. <TABLE CELLSPACING=0 CELLPADDING=5 border=1 align=left width=270>
  22. <TR VALIGN=TOP>
  23. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>MEMBERSHIP RECORD</TD></TR>
  24. <tr VALIGN=TOP >
  25. <TD>
  26. <p align=right><INPUT TYPE="image" name="submit" VALUE="add-child" height=42 WIDTH=120 BORDER=0 src="/images/add-child.gif">
  27. <input type=hidden name=type value=Add>
  28. </form>
  29. </P><br>
  30. <FONT SIZE=2 face="arial, helvetica">$data->{'title'} $data->{'othernames'} $data->{'surname'} ($data->{'firstname'}, $data->{'initials'})<p>
  31. Membership Number: $data->{'borrowernumber'}<BR>
  32. Card Number: $data->{'cardnumber'}<BR>
  33. Membership: $data->{'categorycode'}<BR>
  34. Area: $data->{'area'}<BR>
  35. Fee:$30/year, Paid<BR>
  36. Joined: $data->{'dateenrolled'}, Expires: <BR>
  37. Joining Branch: Levin<P>
  38. Ethnicity: $data->{'ethnicity'}, $data->{'ethnotes'}<BR>
  39. DoB: $data->{'dateofbirth'}<BR>
  40. Sex: $data->{'sex'}<P>
  41. Postal Address: $data->{'streetaddress'}, $data->{'city'}<BR>
  42. Home Address: $data->{'streetaddress'}, $data->{'city'}<BR>
  43. Phone (Home): $data->{'phone'}<BR>
  44. Phone (Daytime): $data->{'phoneday'}<BR>
  45. Fax: $data->{'faxnumber'}<BR>
  46. E-mail: <a href="mailto:$data->{'emailaddress'}">$data->{'emailaddress'}</a><P>
  47. Alternative Contact:$data->{'contactname'}<BR>
  48. Phone: $data->{'altphone'}<BR>
  49. Relationship: $data->{'altrelationship'}<BR>
  50. Notes: $data->{'altnotes'}<P>
  51. Guarantees: <A HREF="sam.html">Guarantor goes here</a><P>
  52. General Notes: <A HREF="popbox.html" onclick="messenger(200,250,'Form that lets you add to and delete notes.'); return false">
  53. $data->{'borrowernotes'}</a>
  54. <p align=right>
  55. <form action=/cgi-bin/koha/memberentry.pl method=post>
  56. <input type=hidden name=bornum value=$bornum>
  57. <INPUT TYPE="image" name="submit" VALUE="modify" height=42 WIDTH=93 BORDER=0 src="/images/modify-mem.gif">
  58. <INPUT TYPE="image" name="submit" VALUE="delete" height=42 WIDTH=93 BORDER=0 src="/images/delete-mem.gif">
  59. </p>
  60. </TD>
  61. </TR>
  62. </TABLE>
  63. </FORM>
  64. <img src="/images/holder.gif" width=16 height=800 align=left>
  65. <TABLE CELLSPACING=0 CELLPADDING=5 border=1 >
  66. <TR VALIGN=TOP>
  67. <td bgcolor="99cc33" background="/images/background-mem.gif" colspan=4><B>FINES & CHARGES</TD></TR>
  68. printend
  69. ;
  70. my %bor;
  71. $bor{'borrowernumber'}=$bornum;
  72. my ($numaccts,$accts,$total)=getboracctrecord('',\%bor);
  73. if ($numaccts > 10){
  74. $numaccts=10;
  75. }
  76. for (my$i=0;$i<$numaccts;$i++){
  77. #if ($accts->[$i]{'accounttype'} ne 'Pay'){
  78. my $amount= $accts->[$i]{'amount'} + 0.00;
  79. my $amount2= $accts->[$i]{'amountoutstanding'} + 0.00;
  80. print "<tr VALIGN=TOP >";
  81. my $item=" &nbsp; ";
  82. if ($accts->[$i]{'accounttype'} ne 'Res'){
  83. #get item data
  84. #$item=
  85. }
  86. print "<td>$accts->[$i]{'date'}</td>";
  87. # print "<TD>$accts->[$i]{'accounttype'}</td>";
  88. print "<TD>$accts->[$i]{'description'}</td>
  89. <TD>$amount</td><td>$amount2</td>
  90. </tr>";
  91. #}
  92. }
  93. print <<printend
  94. <tr VALIGN=TOP >
  95. <TD colspan=3 align=right>
  96. <nobr>
  97. <a href=/cgi-bin/koha/boraccount.pl?bornum=$bornum><img height=42 WIDTH=187 BORDER=0 src="/images/view-account.gif"></a>
  98. <a href=/cgi-bin/koha/pay.pl?bornum=$bornum><img height=42 WIDTH=187 BORDER=0 src="/images/pay-fines.gif"></a></nobr>
  99. </td>
  100. </tr>
  101. </table>
  102. <p>
  103. <form action="renewscript.pl">
  104. <TABLE CELLSPACING=0 CELLPADDING=5 border=1 >
  105. <TR VALIGN=TOP>
  106. <td bgcolor="99cc33" background="/images/background-mem.gif" colspan=5><B>ITEMS CURRENTLY ON ISSUE</b></TD>
  107. </TR>
  108. <TR VALIGN=TOP>
  109. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Title</b></TD>
  110. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Due</b></TD>
  111. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Charge</b></TD>
  112. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Status</b></TD>
  113. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Renew</b></TD>
  114. </TR>
  115. printend
  116. ;
  117. my ($count,$issue)=borrissues($bornum);
  118. my $today=ParseDate('today');
  119. for (my $i=0;$i<$count;$i++){
  120. print "<tr VALIGN=TOP >
  121. <TD>";
  122. my $datedue=ParseDate($issue->[$i]{'date_due'});
  123. if ($datedue < $today){
  124. print "<font color=red>";
  125. }
  126. print "$issue->[$i]{'title'}</td>
  127. <TD>$issue->[$i]{'date_due'}</td>
  128. <TD></td>";
  129. if ($datedue < $today){
  130. print "<td>Overdue</td>";
  131. } else {
  132. print "<td> &nbsp; </td>";
  133. }
  134. print "<TD><input type=radio name=\"renew_item_123\" value=y>Y
  135. <input type=radio name=\"renew_item_$issue->[$i]{'itemnumber'}\" value=n>N</td>
  136. </tr>
  137. ";
  138. }
  139. print <<printend
  140. <tr VALIGN=TOP >
  141. <TD colspan=5 align=right>
  142. <INPUT TYPE="image" name="submit" VALUE="update" height=42 WIDTH=187 BORDER=0 src="/images/update-renewals.gif">
  143. </td>
  144. </tr>
  145. </table>
  146. <P>
  147. <TABLE CELLSPACING=0 CELLPADDING=5 border=1 >
  148. <TR VALIGN=TOP>
  149. <td bgcolor="99cc33" background="/images/background-mem.gif" colspan=5><B>ITEMS REQUESTED</b></TD>
  150. </TR>
  151. <TR VALIGN=TOP>
  152. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Title</b></TD>
  153. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Requested</b></TD>
  154. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Charge</b></TD>
  155. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Remove</b></TD>
  156. </TR>
  157. printend
  158. ;
  159. my ($rescount,$reserves)=FindReserves('',$bornum); #From C4::Reserves2
  160. for (my $i=0;$i<$rescount;$i++){
  161. print "<tr VALIGN=TOP >
  162. <TD><a href=\"/cgi-bin/koha/request.pl?bib=$reserves->[$i]{'biblionumber'}\">$reserves->[$i]{'title'}</a></td>
  163. <TD>$reserves->[$i]{'reservedate'}</td>
  164. <TD>$2</td>
  165. <TD><input type=radio name=\"remove-request_123\" value=y>Y
  166. <input type=radio name=\"remove-request_123\" value=n>N</td>
  167. </tr>
  168. ";
  169. }
  170. print <<printend
  171. <tr VALIGN=TOP >
  172. <TD colspan=5 align=right>
  173. <INPUT TYPE="image" name="submit" VALUE="update" height=42 WIDTH=187 BORDER=0 src="/images/cancel-requests.gif"></td>
  174. </tr>
  175. </table>
  176. <p align=right>
  177. <a href=rachey-reading.html><img height=42 WIDTH=187 BORDER=0 src="/images/reading-record.gif"></a>
  178. </p>
  179. printend
  180. ;
  181. print endmenu('member');
  182. print endpage();