2 # Note: This file now uses standard 8-space tabs
6 #script to print confirmation screen,
7 #then if accepted calls itself to insert data
8 #modified 2002/12/16 by hdl@ifrance.com : Templating
9 #the "parent" is imemberentry.pl
12 # Copyright 2000-2003 Katipo Communications
14 # This file is part of Koha.
16 # Koha is free software; you can redistribute it and/or modify it under the
17 # terms of the GNU General Public License as published by the Free Software
18 # Foundation; either version 2 of the License, or (at your option) any later
21 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
22 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
23 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License along with
26 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
27 # Suite 330, Boston, MA 02111-1307 USA
33 use C4::Interface::CGI::Output;
41 #get varibale that tells us whether to show confirmation page
43 my $insert=$input->param('insert');
45 my ($template, $loggedinuser, $cookie) = get_template_and_user({
46 template_name => "newimember.tmpl",
50 flagsrequired => {borrowers => 1},
56 my @names=$input->param;
57 foreach my $key (@names){
58 $data{$key}=$input->param($key);
63 my $string="The following compulsary fields have been left blank. Please push the back button
65 if ($data{'cardnumber_institution'} !~ /\S/){
66 $string.="Cardnumber<br>";
69 if ($data{'institution_name'} !~ /\S/){
70 $string.="Institution Name<br>";
73 if ($data{'address'} !~ /\S/){
74 $string.="Postal Address<br>";
77 if ($data{'city'} !~ /\S/){
81 if ($data{'contactname'} !~ /\S/){
82 $string.="Contact Name";
86 $template->param( missingloop => ($missing==1));
87 $template->param( string => $string);
89 $data{'cardnumber_institution'} = C4::Members::fixup_cardnumber
90 ($data{'cardnumber_institution'});
92 my $valid=checkdigit(\%env,$data{"cardnumber_institution"});
94 $template->param( invalid => ($valid !=1));
98 while (my ($key, $value) = each %data) {
99 push(@inputs, { 'key' => $key,
100 'value' => CGI::escapeHTML($value) });
102 $template->param(inputsloop => \@inputs);
105 output_html_with_http_headers $input, $cookie, $template->output;