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.

400 lines
9.5 KiB

  1. #!/usr/bin/perl
  2. #script to set up screen for modification of borrower details
  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. my $input = new CGI;
  9. my $member=$input->param('bornum');
  10. if ($member eq ''){
  11. $member=NewBorrowerNumber();
  12. }
  13. my $type=$input->param('type');
  14. print $input->header;
  15. print startpage();
  16. print startmenu('member');
  17. if ($type ne 'Add'){
  18. print mkheadr(1,'Update Member Details');
  19. } else {
  20. print mkheadr(1,'Add New Member');
  21. }
  22. my $data=borrdata('',$member);
  23. print <<printend
  24. <form action=/cgi-bin/koha/newmember.pl method=post>
  25. <input type=hidden name=joining value="$data->{'dateenrolled'}">
  26. <input type=hidden name=expiry value="$data->{'expiry'}">
  27. <input type=hidden name=type value="borrowers">
  28. <input type=hidden name=borrowernumber value="$member">
  29. printend
  30. ;
  31. if ($type eq 'Add'){
  32. print "<input type=hidden name=updtype value=I>";
  33. } else {
  34. print "<input type=hidden name=updtype value=M>";
  35. }
  36. print <<printend
  37. <table border=0 cellspacing=0 cellpadding=5 >
  38. <tr valign=top><td COLSPAN=2><input type=reset value="Clear all Fields"></td><td COLSPAN=3 ALIGN=RIGHT ><font size=4 face='arial,helvetica'>
  39. Member# $member, Card Number* <input type=text name=cardnumber size=10 value="$data->{'cardnumber'}"><br>
  40. </td></tr>
  41. <tr valign=top ><td COLSPAN=3 background="/images/background-mem.gif">
  42. <B>MEMBER PERSONAL DETAILS</b></td> <td COLSPAN=2 ALIGN=RIGHT background="/images/background-mem.gif">
  43. * <input type="radio" name="sex" value="F"
  44. printend
  45. ;
  46. if ($data->{'sex'} eq 'F'){
  47. print " checked";
  48. }
  49. print <<printend
  50. >F
  51. <input type="radio" name="sex" value="M"
  52. printend
  53. ;
  54. if ($data->{'sex'} eq 'M'){
  55. print " checked";
  56. }
  57. print <<printend
  58. >M
  59. &nbsp; &nbsp; <B>Date of Birth</B> (dd/mm/yy)
  60. <input type=text name=dateofbirth size=10 value="$data->{'dateofbirth'}">
  61. </td></tr>
  62. <tr valign=top bgcolor=white>
  63. <td><SELECT NAME="title" SIZE="1">
  64. <OPTION value=" ">No Title
  65. <OPTION value=Miss
  66. printend
  67. ;
  68. if ($data->{'title'} eq 'Miss'){
  69. print " Selected";
  70. }
  71. print ">Miss
  72. <OPTION value=Mrs";
  73. if ($data->{'title'} eq 'Mrs'){
  74. print " Selected";
  75. }
  76. print ">Mrs
  77. <OPTION value=Ms";
  78. if ($data->{'title'} eq 'Ms'){
  79. print " Selected";
  80. }
  81. print ">Ms
  82. <OPTION value=Mr";
  83. if ($data->{'title'} eq 'Mr'){
  84. print " Selected";
  85. }
  86. print ">Mr
  87. <OPTION value=Dr";
  88. if ($data->{'title'} eq 'Dr'){
  89. print " Selected";
  90. }
  91. print ">Dr
  92. <OPTION value=Sir";
  93. if ($data->{'title'} eq 'Sir'){
  94. print " Selected";
  95. }
  96. print <<printend
  97. >Sir
  98. </SELECT>
  99. </td>
  100. <td><input type=text name=initials size=5 value="$data->{'initials'}"></td>
  101. <td><input type=text name=firstname size=20 value="$data->{'firstname'}"></td>
  102. <td><input type=text name=surname size=20 value="$data->{'surname'}"></td>
  103. <td><input type=text name=othernames size=20 value="$data->{'othernames'}"></td></tr>
  104. <tr valign=top bgcolor=white>
  105. <td><FONT SIZE=2>Title</FONT></td>
  106. <td><FONT SIZE=2>Initials</FONT></td>
  107. <td><FONT SIZE=2>Given Names*</FONT></td>
  108. <td><FONT SIZE=2>Surname*</FONT></td>
  109. <td><FONT SIZE=2>Prefered Name</FONT></td>
  110. </tr>
  111. <tr><td>&nbsp; </TD></TR>
  112. <tr valign=top bgcolor=white>
  113. <td colspan=2><SELECT NAME="ethnicity" SIZE="1">
  114. printend
  115. ;
  116. print "<OPTION value=\" \">
  117. <OPTION value=european";
  118. if ($data->{'ethnicity'} eq 'european'){
  119. print " selected";
  120. }
  121. print "
  122. >European/Pakeha
  123. <OPTION value=maori";
  124. if ($data->{'ethnicity'} eq 'maori'){
  125. print " selected";
  126. }
  127. print ">Maori
  128. <OPTION value=asian";
  129. if ($data->{'ethnicity'} eq 'asian'){
  130. print " selected";
  131. }
  132. print ">Asian
  133. <OPTION value=pi";
  134. if ($data->{'ethnicity'} eq 'pi'){
  135. print " selected";
  136. }
  137. print ">Pacific Island
  138. <OPTION value=other";
  139. if ($data->{'ethnicity'} eq 'other'){
  140. print " selected";
  141. }
  142. print <<printend
  143. >Other - please specify-->
  144. </SELECT>
  145. </td>
  146. <td colspan=2><input type=text name=ethnicnotes size=40 ></td>
  147. <td> <select name=categorycode>
  148. <option value="A"
  149. printend
  150. ;
  151. if ($data->{'categorycode'} eq 'A'){
  152. print " Selected";
  153. }
  154. print ">Adult
  155. <option value=B";
  156. if ($data->{'categorycode'} eq 'B'){
  157. print " Selected";
  158. }
  159. print ">Homebound
  160. <option value=P";
  161. if ($data->{'categorycode'} eq 'P'){
  162. print " Selected";
  163. }
  164. print ">Privileged
  165. <option value=E";
  166. if ($data->{'categorycode'} eq 'E'){
  167. print " Selected";
  168. }
  169. print ">Senior Citizen
  170. <option value=W";
  171. if ($data->{'categorycode'} eq 'W'){
  172. print " Selected";
  173. }
  174. print ">Staff
  175. <option value=I";
  176. if ($data->{'categorycode'} eq 'I'){
  177. print " Selected";
  178. }
  179. print ">Institution
  180. <option value=C";
  181. if ($data->{'categorycode'} eq 'C'){
  182. print " Selected";
  183. }
  184. print ">Child
  185. <option value=L";
  186. if ($data->{'categorycode'} eq 'L'){
  187. print " Selected";
  188. }
  189. print ">Library
  190. <option value=F";
  191. if ($data->{'categorycode'} eq 'F'){
  192. print " Selected";
  193. }
  194. print ">Family";
  195. print <<printend
  196. </select>
  197. </td>
  198. </tr>
  199. <tr valign=top bgcolor=white>
  200. <td colspan=2><FONT SIZE=2>Ethnicity</FONT></td>
  201. <td colspan=2><FONT SIZE=2>Ethnicity Notes</FONT></td>
  202. <td><FONT SIZE=2>Membership Category*</FONT></td>
  203. </tr>
  204. <tr><td>&nbsp; </TD></TR>
  205. <tr valign=top bgcolor="99cc33" ><td COLSPAN=5 background="/images/background-mem.gif">
  206. <B>MEMBER ADDRESS</b></td></tr>
  207. <tr valign=top bgcolor=white>
  208. <td COLSPAN=3><input type=text name=address size=40 value="$data->{'streetaddress'}">
  209. <td><input type=text name=city size=20 value="$data->{'city'}"></td>
  210. <td>
  211. <SELECT NAME="area" SIZE="1">
  212. <OPTION value=L
  213. printend
  214. ;
  215. if ($data->{'area'} eq 'L'){
  216. print " Selected";
  217. }
  218. print ">L - Levin
  219. <OPTION value=F";
  220. if ($data->{'area'} eq 'F'){
  221. print " Selected";
  222. }
  223. print ">F - Foxton
  224. <OPTION value=S";
  225. if ($data->{'area'} eq 'S'){
  226. print " Selected";
  227. }
  228. print ">S - Shannon
  229. <OPTION value=H";
  230. if ($data->{'area'} eq 'H'){
  231. print " Selected";
  232. }
  233. print ">H - Horowhenua
  234. <OPTION value=K";
  235. if ($data->{'area'} eq 'K'){
  236. print " Selected";
  237. }
  238. print ">K - Kapiti
  239. <OPTION value=O";
  240. if ($data->{'area'} eq 'O'){
  241. print " Selected";
  242. }
  243. print ">O - Out of District
  244. <OPTION value=X";
  245. if ($data->{'area'} eq 'X'){
  246. print " Selected";
  247. }
  248. print ">X - Temporary Visitor
  249. <OPTION value=Z";
  250. if ($data->{'area'} eq 'Z'){
  251. print " Selected";
  252. }
  253. print ">Z - Interloan Libraries
  254. <OPTION value=V";
  255. if ($data->{'area'} eq 'V'){
  256. print " Selected";
  257. }
  258. print ">V - Villlage";
  259. print <<printend
  260. </SELECT></td></tr>
  261. <tr valign=top bgcolor=white>
  262. <td COLSPAN=3><FONT SIZE=2>Postal Address*</FONT></td>
  263. <td><FONT SIZE=2>Town*</FONT></td>
  264. <td><FONT SIZE=2>Area</FONT></td>
  265. </tr>
  266. <tr><td>&nbsp; </TD></TR>
  267. <tr valign=top bgcolor=white>
  268. <td COLSPAN=3><input type=text name=streetaddress size=40 value="$data->{'physstreet'}"></td>
  269. <td><input type=text name=streetcity size=20 value="$data->{'streetcity'}"></td>
  270. </tr>
  271. </tr>
  272. <tr valign=top bgcolor=white>
  273. <td COLSPAN=3><FONT SIZE=2>Street Address if different</FONT></td>
  274. <td><FONT SIZE=2>Town</FONT></td>
  275. </tr>
  276. <tr><td>&nbsp; </TD></TR>
  277. <tr valign=top bgcolor="99cc33" ><td COLSPAN=5 background="/images/background-mem.gif">
  278. <B>MEMBER CONTACT DETAILS</b></td></tr>
  279. <tr valign=top bgcolor=white>
  280. <td COLSPAN=2 ><input type=text name=phone size=20 value="$data->{'phone'}"></td>
  281. <td><input type=text name=phoneday size=20 value="$data->{'phoneday'}"></td>
  282. <td><input type=text name=faxnumber size=20 value="$data->{'faxnumber'}"></td>
  283. <td><input type=text name=emailaddress size=20 value="$data->{'emailaddress'}"></td></tr>
  284. <tr valign=top bgcolor=white>
  285. <td COLSPAN=2 ><FONT SIZE=2>Phone (Home)</td>
  286. <td><FONT SIZE=2>Phone (day)</td>
  287. <td><FONT SIZE=2>Fax</td>
  288. <td><FONT SIZE=2>Email</td></tr>
  289. <tr><td>&nbsp; </TD></TR>
  290. <tr valign=top bgcolor="99cc33" ><td COLSPAN=5 background="/images/background-mem.gif">
  291. <B>ALTERNATE CONTACT DETAILS</b> </td></tr>
  292. <tr valign=top bgcolor=white>
  293. <td COLSPAN=3 ><input type=text name=contactname size=40 value="$data->{'contactname'}"></td>
  294. <td><input type=text name=altphone size=20 value="$data->{'altphone'}"></td>
  295. <td><select name=altrelationship size=1>
  296. <option value="workplace"
  297. printend
  298. ;
  299. if ($data->{'altrelationship'} eq 'workplace'){
  300. print " selected ";
  301. }
  302. print ">Workplace
  303. <option value=\"relative\"";
  304. if ($data->{'altrelationship'} eq 'relative'){
  305. print " selected ";
  306. }
  307. print ">Relative
  308. <option value=\"friend\"";
  309. if ($data->{'altrelationship'} eq 'workplace'){
  310. print " selected ";
  311. }
  312. print ">Friend
  313. <option value=\"neighbour\"";
  314. if ($data->{'altrelationship'} eq 'workplace'){
  315. print " selected ";
  316. }
  317. print <<printend
  318. >Neighbour
  319. </select></td></tr>
  320. <tr valign=top bgcolor=white>
  321. <td COLSPAN=3 ><FONT SIZE=2>Name*</td>
  322. <td><FONT SIZE=2>Phone</td>
  323. <td><FONT SIZE=2>Relationship*</td></tr>
  324. <tr><td>&nbsp; </TD></TR>
  325. <tr valign=top bgcolor=white>
  326. <td><FONT SIZE=2>Notes</font></td>
  327. <td COLSPAN=4><textarea name=altnotes wrap=physical cols=70 rows=3>$data->{'altnotes'}</textarea></td></tr>
  328. </tr>
  329. <tr><td>&nbsp; </TD></TR>
  330. <tr valign=top bgcolor="99cc33" >
  331. <td COLSPAN=5 background="/images/background-mem.gif"><B>LIBRARY USE</B></td>
  332. </tr>
  333. <tr valign=top >
  334. <td><FONT SIZE=2>Notes</font></td>
  335. <td COLSPAN=4><textarea name=borrowernotes wrap=physical cols=70 rows=3>$data->{'borrowernotes'}</textarea></td></tr>
  336. <tr><td>&nbsp; </TD></TR>
  337. <tr valign=top bgcolor=white><td COLSPAN=5 align=right >
  338. printend
  339. ;
  340. if ($type ne 'modify'){
  341. print <<printend
  342. <input type=image src="/images/save-changes.gif" WIDTH=188 HEIGHT=44 ALT="Add New Member" border=0 ></td>
  343. printend
  344. ;
  345. } else {
  346. print <<printend
  347. <input type=image src="/images/save-changes.gif" WIDTH=188 HEIGHT=44 ALT="Add New Member" border=0 ></td>
  348. printend
  349. ;
  350. }
  351. print <<printend
  352. </tr>
  353. </TABLE>
  354. </table>
  355. </form>
  356. printend
  357. ;
  358. print endmenu('member');
  359. print endpage();