5 #script to print confirmation screen, then if accepted calls itself to insert data
6 # FIXME - Yes, but what does it _do_?
7 # 2002/12/18 hdl@ifrance.comTemplating
9 # Copyright 2000-2002 Katipo Communications
11 # This file is part of Koha.
13 # Koha is free software; you can redistribute it and/or modify it under the
14 # terms of the GNU General Public License as published by the Free Software
15 # Foundation; either version 2 of the License, or (at your option) any later
18 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
19 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
20 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
22 # You should have received a copy of the GNU General Public License along with
23 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
24 # Suite 330, Boston, MA 02111-1307 USA
35 #get varibale that tells us whether to show confirmation page
37 my $insert=$input->param('insert');
39 my $template = gettemplate("newjmember.tmpl");
43 my @names=$input->param;
44 foreach my $key (@names){
45 $data{$key}=$input->param($key);
49 my $string="The following compulsary fields have been left blank. Please push the back button
51 for (my $i=0;$i<3;$i++){
52 my $number=$data{"cardnumber_child_$i"};
53 my $firstname=$data{"firstname_child_$i"};
54 my $surname=$data{"surname_child_$i"};
55 my $dob=$data{"dateofbirth_child_$i"};
56 my $sex=$data{"sex_child_$i"};
59 $string.=" Cardnumber<br>";
63 if ($firstname eq ''){
64 $string.=" Given Names<br>";
68 $string.=" Surname<br>";
72 $string.=" Date Of Birth<br>";
76 $string.=" Gender <br>";
79 my $valid=checkdigit(\%env,$data{"cardnumber_child_$i"});
81 $string.=" Invalid Cardnumber $number<br>";
87 for (my $i=0;$i<3;$i++){
89 # $ident{'main'}=$main;
90 # $ident{'image'}=$image;
91 $ident{'cardchlid')=($data{"cardnumber_child_$i"} ne '');
92 if ($data{"cardnumber_child_$i"} ne ''){
93 my $name=$data{"firstname_child_$i"}.$data{"surname_child_$i"};
95 $ident{'bornum'}=$data{"bornumber_child_$i"};
96 $ident{'dob'}=$data{"dateofbirth_child_$i"};
97 ($data{"sex_child_$i"} eq 'M') ? ($ident{'sex'}="Male") : ($ident{'sex'}="Female") ;
98 $ident{'school'}=$data{"school_child_$i"};
99 $ident{'notes'}=$data{"altnotes_child_$i"}
100 push(@identsloop, \%ident);
104 while (my ($key, $value) = each %data) {
108 $line{'value'}=$value;
109 push(@inputsloop, \%line);
112 # FIXME IF main and image are not fetched by HTML::TEMPLATE get them into identsloop
113 $template->param( NOK => ($missing==1),
116 identsloop => \@identsloop,
117 inputsloop => \@inputsloop,
120 print "Content-Type: text/html\n\n", $template->output;