3 #script to enter borrower data into the data base
4 #needs to be moved into a perl module
5 # written 9/11/99 by chris@katipo.co.nz
14 #print $input->header;
17 #get all the data into a hash
18 my @names=$input->param;
24 foreach my $key (@names){
25 $data{$key}=$input->param($key);
28 my $surname=$data{'institution_name'};
29 my $query="insert into borrowers (title,expiry,cardnumber,sex,ethnotes,streetaddress,faxnumber,
30 firstname,altnotes,dateofbirth,contactname,emailaddress,dateenrolled,streetcity,
31 altrelationship,othernames,phoneday,categorycode,city,area,phone,borrowernotes,altphone,surname,
32 initials,ethnicity,borrowernumber,guarantor,school)
33 values ('','$data{'expiry'}','$data{'cardnumber_institution'}',
34 '','$data{'ethnotes'}','$data{'address'}','$data{'faxnumber'}',
35 '$data{'firstname'}','$data{'altnotes'}','','$data{'contactname'}',
36 '$data{'emailaddress'}',
37 now(),'$data{'streetcity'}','$data{'altrelationship'}','$data{'othernames'}',
38 '$data{'phoneday'}','I','$data{'city'}','$data{'area'}','$data{'phone'}',
39 '$data{'borrowernotes'}','$data{'altphone'}','$surname','$data{'initials'}',
40 '$data{'ethnicity'}','$data{'borrowernumber'}','','')";
44 my $sth2=$dbh->prepare($query);
50 print $input->redirect("/cgi-bin/koha/moremember.pl?bornum=$data{'borrowernumber'}");