3 #script to print confirmation screen, then if accepted calls itself to insert data
15 $flagsrequired->{borrower
}=1;
16 my ($loggedinuser, $cookie, $sessionID) = checkauth
($input, 0, $flagsrequired);
17 #get varibale that tells us whether to show confirmation page
19 my $insert=$input->param('insert');
23 my @names=$input->param;
24 foreach my $key (@names){
25 $data{$key}=$input->param($key);
29 my $string="The following compulsary fields have been left blank. Please push the back button
31 for (my $i=0;$i<3;$i++){
32 my $number=$data{"cardnumber_child_$i"};
33 my $firstname=$data{"firstname_child_$i"};
34 my $surname=$data{"surname_child_$i"};
35 my $dob=$data{"dateofbirth_child_$i"};
36 my $sex=$data{"sex_child_$i"};
39 $string.=" Cardnumber<br>";
43 if ($firstname eq ''){
44 $string.=" Given Names<br>";
48 $string.=" Surname<br>";
52 $string.=" Date Of Birth<br>";
56 $string.=" Gender <br>";
59 my $valid=checkdigit
(\
%env,$data{"cardnumber_child_$i"});
62 $string.=" Invalid Cardnumber $number<br>";
68 print startmenu
('member');
71 print mkheadr
(1,'Confirm Record');
73 my $image="/images/background-mem.gif";
74 for (my $i=0;$i<3;$i++){
75 if ($data{"cardnumber_child_$i"} ne ''){
77 print mktablerow
(2,$main,bold
('NEW MEMBER'),"",$image);
78 my $name=$data{"firstname_child_$i"}.$data{"surname_child_$i"};
79 print mktablerow
(2,'white',bold
('Name'),$name);
80 print mktablerow
(2,$main,bold
('MEMBERSHIP DETAILS'),"",$image);
81 print mktablerow
(2,'white',bold
('Membership Number'),$data{"bornumber_child_$i"});
82 print mktablerow
(2,'white',bold
('Date of Birth'),$data{"dateofbirth_child_$i"});
84 if ($data{"sex_child_$i"} eq 'M'){
89 print mktablerow
(2,'white',bold
('Sex'),$sex);
90 print mktablerow
(2,'white',bold
('School'),$data{"school_child_$i"});
91 print mktablerow
(2,'white',bold
('General Notes'),$data{"altnotes_child_$i"});
99 while (my ($key, $value) = each %data) {
101 $inputs[$i]=["hidden","$key","$value"];
104 $inputs[$i]=["submit","submit","submit"];
105 print mkformnotable
("/cgi-bin/koha/insertjdata.pl",@inputs);
113 print endmenu
('member');