From 7f73888fbb8bd4f2713dffd737cfb613bc18b760 Mon Sep 17 00:00:00 2001 From: chris Date: Wed, 12 Jan 2000 22:44:27 +0000 Subject: [PATCH] add new members --- insertdata.pl | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/insertdata.pl b/insertdata.pl index 8c4c7ea..c356afa 100755 --- a/insertdata.pl +++ b/insertdata.pl @@ -40,12 +40,27 @@ if (my $data=$sth->fetchrow_hashref){ initials='$data{'initials'}',streetaddress='$data{'address'}',ethnicity='$data{'ethnicity'}' where borrowernumber=$data{'borrowernumber'}"; # print $query; + +}else{ + $data{'dateofbirth'}=ParseDate($data{'dateofbirth'}); + $data{'dateofbirth'}=UnixDate($data{'dateofbirth'},'%Y-%m-%d'); + $data{'joining'}=ParseDate($data{'joining'}); + $data{'joining'}=UnixDate($data{'joining'},'%Y-%m-%d'); + $query="insert into borrowers (title,expiry,cardnumber,sex,ethnotes,streetaddress,faxnumber, + firstname,altnotes,dateofbirth,contactname,emailaddress,dateenrolled,streetcity, + altrelationship,othernames,phoneday,categorycode,city,area,phone,borrowernotes,altphone,surname, + initials,ethnicity,borrowernumber) values ('$data{'title'}','$data{'expiry'}','$data{'cardnumber'}', + '$data{'sex'}','$data{'ethnotes'}','$data{'address'}','$data{'faxnumber'}', + '$data{'firstname'}','$data{'altnotes'}','$data{'dateofbirth'}','$data{'contactname'}','$data{'emailaddress'}', + '$data{'joining'}','$data{'streetcity'}','$data{'altrelationship'}','$data{'othernames'}', + '$data{'phoneday'}','$data{'categorycode'}','$data{'city'}','$data{'area'}','$data{'phone'}', + '$data{'borrowernotes'}','$data{'altphone'}','$data{'surname'}','$data{'initials'}', + '$data{'ethnicity'}','$data{'borrowernumber'}')"; +} +#print $query; my $sth2=$dbh->prepare($query); $sth2->execute; $sth2->finish; -}else{ -} - $sth->finish; $dbh->disconnect; print $input->redirect("/cgi-bin/koha/moremember.pl?bornum=$data{'borrowernumber'}");