5 #script to print confirmation screen, then if accepted calls itself to insert data
6 # FIXME - Yes, but what does it _do_?
8 # Copyright 2000-2002 Katipo Communications
10 # This file is part of Koha.
12 # Koha is free software; you can redistribute it and/or modify it under the
13 # terms of the GNU General Public License as published by the Free Software
14 # Foundation; either version 2 of the License, or (at your option) any later
17 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
18 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
19 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License along with
22 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
23 # Suite 330, Boston, MA 02111-1307 USA
33 #get varibale that tells us whether to show confirmation page
35 my $insert=$input->param('insert');
39 my @names=$input->param;
40 foreach my $key (@names){
41 $data{$key}=$input->param($key);
45 my $string="The following compulsary fields have been left blank. Please push the back button
47 for (my $i=0;$i<3;$i++){
48 my $number=$data{"cardnumber_child_$i"};
49 my $firstname=$data{"firstname_child_$i"};
50 my $surname=$data{"surname_child_$i"};
51 my $dob=$data{"dateofbirth_child_$i"};
52 my $sex=$data{"sex_child_$i"};
55 $string.=" Cardnumber<br>";
59 if ($firstname eq ''){
60 $string.=" Given Names<br>";
64 $string.=" Surname<br>";
68 $string.=" Date Of Birth<br>";
72 $string.=" Gender <br>";
75 my $valid=checkdigit(\%env,$data{"cardnumber_child_$i"});
78 $string.=" Invalid Cardnumber $number<br>";
84 print startmenu('member');
87 print mkheadr(1,'Confirm Record');
89 my $image="/images/background-mem.gif";
90 for (my $i=0;$i<3;$i++){
91 if ($data{"cardnumber_child_$i"} ne ''){
93 print mktablerow(2,$main,bold('NEW MEMBER'),"",$image);
94 my $name=$data{"firstname_child_$i"}.$data{"surname_child_$i"};
95 print mktablerow(2,'white',bold('Name'),$name);
96 print mktablerow(2,$main,bold('MEMBERSHIP DETAILS'),"",$image);
97 print mktablerow(2,'white',bold('Membership Number'),$data{"bornumber_child_$i"});
98 print mktablerow(2,'white',bold('Date of Birth'),$data{"dateofbirth_child_$i"});
100 if ($data{"sex_child_$i"} eq 'M'){
105 print mktablerow(2,'white',bold('Sex'),$sex);
106 print mktablerow(2,'white',bold('School'),$data{"school_child_$i"});
107 print mktablerow(2,'white',bold('General Notes'),$data{"altnotes_child_$i"});
115 while (my ($key, $value) = each %data) {
117 $inputs[$i]=["hidden","$key","$value"];
120 $inputs[$i]=["submit","submit","submit"];
121 print mkformnotable("/cgi-bin/koha/insertjdata.pl",@inputs);
129 print endmenu('member');