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.

220 lines
6.2 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=3><B>FINES & CHARGES</TD></TR>
  68. printend
  69. ;
  70. my %bor;
  71. $bor{'borrowernumber'}=$bornum;
  72. my ($numaccts,$accts,$total)=getboracctrecord('',\%bor);
  73. for (my$i=0;$i<$numaccts;$i++){
  74. if ($accts->[$i]{'accounttype'} ne 'Pay'){
  75. my $amount= $accts->[$i]{'amountoutstanding'} + 0.00;
  76. print "<tr VALIGN=TOP >";
  77. my $item=" &nbsp; ";
  78. if ($accts->[$i]{'accounttype'} ne 'Res'){
  79. #get item data
  80. #$item=
  81. }
  82. print "<TD>$item</td>";
  83. print "<TD>$accts->[$i]{'description'}</td>
  84. <TD>$amount</td>
  85. </tr>";
  86. }
  87. }
  88. print <<printend
  89. <tr VALIGN=TOP >
  90. <TD colspan=3 align=right>
  91. <nobr>
  92. <a href=/cgi-bin/koha/accounts.pl?bornum=$bornum><img height=42 WIDTH=187 BORDER=0 src="/images/view-account.gif"></a>
  93. <a href=/cgi-bin/koha/pay.pl?bornum=$bornum><img height=42 WIDTH=187 BORDER=0 src="/images/pay-fines.gif"></a></nobr>
  94. </td>
  95. </tr>
  96. </table>
  97. <p>
  98. <form action="renewscript.pl">
  99. <TABLE CELLSPACING=0 CELLPADDING=5 border=1 >
  100. <TR VALIGN=TOP>
  101. <td bgcolor="99cc33" background="/images/background-mem.gif" colspan=5><B>ITEMS CURRENTLY ON ISSUE</b></TD>
  102. </TR>
  103. <TR VALIGN=TOP>
  104. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Title</b></TD>
  105. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Due</b></TD>
  106. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Charge</b></TD>
  107. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Status</b></TD>
  108. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Renew</b></TD>
  109. </TR>
  110. printend
  111. ;
  112. my ($count,$issue)=borrissues($bornum);
  113. my $today=ParseDate('today');
  114. for (my $i=0;$i<$count;$i++){
  115. print "<tr VALIGN=TOP >
  116. <TD>";
  117. my $datedue=ParseDate($issue->[$i]{'date_due'});
  118. if ($datedue < $today){
  119. print "<font color=red>";
  120. }
  121. print "$issue->[$i]{'title'}</td>
  122. <TD>$issue->[$i]{'date_due'}</td>
  123. <TD></td>";
  124. if ($datedue < $today){
  125. print "<td>Overdue</td>";
  126. } else {
  127. print "<td> &nbsp; </td>";
  128. }
  129. print "<TD><input type=radio name=\"renew_item_123\" value=y>Y
  130. <input type=radio name=\"renew_item_$issue->[$i]{'itemnumber'}\" value=n>N</td>
  131. </tr>
  132. ";
  133. }
  134. print <<printend
  135. <tr VALIGN=TOP >
  136. <TD colspan=5 align=right>
  137. <INPUT TYPE="image" name="submit" VALUE="update" height=42 WIDTH=187 BORDER=0 src="/images/update-renewals.gif">
  138. </td>
  139. </tr>
  140. </table>
  141. <P>
  142. <TABLE CELLSPACING=0 CELLPADDING=5 border=1 >
  143. <TR VALIGN=TOP>
  144. <td bgcolor="99cc33" background="/images/background-mem.gif" colspan=5><B>ITEMS REQUESTED</b></TD>
  145. </TR>
  146. <TR VALIGN=TOP>
  147. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Title</b></TD>
  148. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Requested</b></TD>
  149. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Charge</b></TD>
  150. <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Remove</b></TD>
  151. </TR>
  152. printend
  153. ;
  154. my ($rescount,$reserves)=FindReserves('',$bornum); #From C4::Reserves2
  155. for (my $i=0;$i<$rescount;$i++){
  156. print "<tr VALIGN=TOP >
  157. <TD><a href=\"/cgi-bin/koha/request.pl?bib=$reserves->[$i]{'biblionumber'}\">$reserves->[$i]{'title'}</a></td>
  158. <TD>$reserves->[$i]{'reservedate'}</td>
  159. <TD>$2</td>
  160. <TD><input type=radio name=\"remove-request_123\" value=y>Y
  161. <input type=radio name=\"remove-request_123\" value=n>N</td>
  162. </tr>
  163. ";
  164. }
  165. print <<printend
  166. <tr VALIGN=TOP >
  167. <TD colspan=5 align=right>
  168. <INPUT TYPE="image" name="submit" VALUE="update" height=42 WIDTH=187 BORDER=0 src="/images/cancel-requests.gif"></td>
  169. </tr>
  170. </table>
  171. <p align=right>
  172. <a href=rachey-reading.html><img height=42 WIDTH=187 BORDER=0 src="/images/reading-record.gif"></a>
  173. </p>
  174. printend
  175. ;
  176. print endmenu('member');
  177. print endpage();