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 #print $input->header;
40 my $template = gettemplate("newjmember.tmpl");
44 my @names=$input->param;
45 foreach my $key (@names){
46 $data{$key}=$input->param($key);
50 my $string="The following compulsary fields have been left blank. Please push the back button
52 for (my $i=0;$i<3;$i++){
53 my $number=$data{"cardnumber_child_$i"};
54 my $firstname=$data{"firstname_child_$i"};
55 my $surname=$data{"surname_child_$i"};
56 my $dob=$data{"dateofbirth_child_$i"};
57 my $sex=$data{"sex_child_$i"};
60 $string.=" Cardnumber<br>";
64 if ($firstname eq ''){
65 $string.=" Given Names<br>";
69 $string.=" Surname<br>";
73 $string.=" Date Of Birth<br>";
77 $string.=" Gender <br>";
80 my $valid=checkdigit(\%env,$data{"cardnumber_child_$i"});
82 $string.=" Invalid Cardnumber $number<br>";
88 for (my $i=0;$i<3;$i++){
90 # $ident{'main'}=$main;
91 # $ident{'image'}=$image;
92 $ident{'cardchlid')=($data{"cardnumber_child_$i"} ne '');
93 if ($data{"cardnumber_child_$i"} ne ''){
94 my $name=$data{"firstname_child_$i"}.$data{"surname_child_$i"};
96 $ident{'bornum'}=$data{"bornumber_child_$i"};
97 $ident{'dob'}=$data{"dateofbirth_child_$i"};
98 ($data{"sex_child_$i"} eq 'M') ? ($ident{'sex'}="Male") : ($ident{'sex'}="Female") ;
99 $ident{'school'}=$data{"school_child_$i"};
100 $ident{'notes'}=$data{"altnotes_child_$i"}
101 push(@identsloop, \%ident);
105 while (my ($key, $value) = each %data) {
109 $line{'value'}=$value;
110 push(@inputsloop, \%line);
113 # FIXME IF main and image are not fetched by HTML::TEMPLATE get them into identsloop
114 $template->param( NOK => ($missing==1),
117 identsloop => \@identsloop,
118 inputsloop => \@inputsloop,
121 print "Content-Type: text/html\n\n", $template->output;