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.

51 lines
1.5 KiB

  1. #!/usr/bin/perl
  2. #script to enter borrower data into the data base
  3. #needs to be moved into a perl module
  4. # written 9/11/99 by chris@katipo.co.nz
  5. use CGI;
  6. use C4::Database;
  7. use C4::Input;
  8. use Date::Manip;
  9. use strict;
  10. my $input= new CGI;
  11. #print $input->header;
  12. #print $input->Dump;
  13. #get all the data into a hash
  14. my @names=$input->param;
  15. my %data;
  16. my $keyfld;
  17. my $keyval;
  18. my $problems;
  19. my $env;
  20. foreach my $key (@names){
  21. $data{$key}=$input->param($key);
  22. }
  23. my $dbh=C4Connect;
  24. my $surname=$data{'institution_name'};
  25. my $query="insert into borrowers (title,expiry,cardnumber,sex,ethnotes,streetaddress,faxnumber,
  26. firstname,altnotes,dateofbirth,contactname,emailaddress,dateenrolled,streetcity,
  27. altrelationship,othernames,phoneday,categorycode,city,area,phone,borrowernotes,altphone,surname,
  28. initials,ethnicity,borrowernumber,guarantor,school)
  29. values ('','$data{'expiry'}','$data{'cardnumber_institution'}',
  30. '','$data{'ethnotes'}','$data{'address'}','$data{'faxnumber'}',
  31. '$data{'firstname'}','$data{'altnotes'}','','$data{'contactname'}',
  32. '$data{'emailaddress'}',
  33. now(),'$data{'streetcity'}','$data{'altrelationship'}','$data{'othernames'}',
  34. '$data{'phoneday'}','I','$data{'city'}','$data{'area'}','$data{'phone'}',
  35. '$data{'borrowernotes'}','$data{'altphone'}','$surname','$data{'initials'}',
  36. '$data{'ethnicity'}','$data{'borrowernumber'}','','')";
  37. #print $query;
  38. my $sth2=$dbh->prepare($query);
  39. $sth2->execute;
  40. $sth2->finish;
  41. #$sth->finish;
  42. $dbh->disconnect;
  43. print $input->redirect("/cgi-bin/koha/moremember.pl?bornum=$data{'borrowernumber'}");