parent
3f910752da
commit
7be6b413fe
|
|
@ -1,7 +1,9 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
#script to print confirmation screen, then if accepted calls itself to insert data
|
||||
# $Id$
|
||||
|
||||
#script to print confirmation screen, then if accepted calls itself to insert data
|
||||
# FIXME - Yes, but what does it _do_?
|
||||
|
||||
# Copyright 2000-2002 Katipo Communications
|
||||
#
|
||||
|
|
@ -35,46 +37,46 @@ print $input->header;
|
|||
#get rest of data
|
||||
my %data;
|
||||
my @names=$input->param;
|
||||
foreach my $key (@names){
|
||||
$data{$key}=$input->param($key);
|
||||
}
|
||||
foreach my $key (@names){
|
||||
$data{$key}=$input->param($key);
|
||||
}
|
||||
my $ok=0;
|
||||
|
||||
my $string="The following compulsary fields have been left blank. Please push the back button
|
||||
and try again<p>";
|
||||
and try again<p>";
|
||||
for (my $i=0;$i<3;$i++){
|
||||
my $number=$data{"cardnumber_child_$i"};
|
||||
my $firstname=$data{"firstname_child_$i"};
|
||||
my $surname=$data{"surname_child_$i"};
|
||||
my $dob=$data{"dateofbirth_child_$i"};
|
||||
my $sex=$data{"sex_child_$i"};
|
||||
if ($number eq ''){
|
||||
if ($number eq ''){
|
||||
if ($i == 0){
|
||||
$string.=" Cardnumber<br>";
|
||||
$ok=1;
|
||||
$string.=" Cardnumber<br>";
|
||||
$ok=1;
|
||||
}
|
||||
} else {
|
||||
if ($firstname eq ''){
|
||||
$string.=" Given Names<br>";
|
||||
$ok=1;
|
||||
}
|
||||
if ($surname eq ''){
|
||||
$string.=" Surname<br>";
|
||||
$ok=1;
|
||||
if ($firstname eq ''){
|
||||
$string.=" Given Names<br>";
|
||||
$ok=1;
|
||||
}
|
||||
if ($dob eq ''){
|
||||
$string.=" Date Of Birth<br>";
|
||||
$ok=1;
|
||||
if ($surname eq ''){
|
||||
$string.=" Surname<br>";
|
||||
$ok=1;
|
||||
}
|
||||
if ($sex eq ''){
|
||||
$string.=" Gender <br>";
|
||||
$ok=1;
|
||||
}
|
||||
my $valid=checkdigit(\%env,$data{"cardnumber_child_$i"});
|
||||
if ($valid != 1){
|
||||
$ok=1;
|
||||
if ($dob eq ''){
|
||||
$string.=" Date Of Birth<br>";
|
||||
$ok=1;
|
||||
}
|
||||
if ($sex eq ''){
|
||||
$string.=" Gender <br>";
|
||||
$ok=1;
|
||||
}
|
||||
my $valid=checkdigit(\%env,$data{"cardnumber_child_$i"});
|
||||
if ($valid != 1){
|
||||
$ok=1;
|
||||
$string.=" Invalid Cardnumber $number<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -83,11 +85,11 @@ print startmenu('member');
|
|||
|
||||
if ($ok == 0){
|
||||
print mkheadr(1,'Confirm Record');
|
||||
my $main="#99cc33";
|
||||
my $image="/images/background-mem.gif";
|
||||
my $main="#99cc33";
|
||||
my $image="/images/background-mem.gif";
|
||||
for (my $i=0;$i<3;$i++){
|
||||
if ($data{"cardnumber_child_$i"} ne ''){
|
||||
print mktablehdr;
|
||||
print mktablehdr;
|
||||
print mktablerow(2,$main,bold('NEW MEMBER'),"",$image);
|
||||
my $name=$data{"firstname_child_$i"}.$data{"surname_child_$i"};
|
||||
print mktablerow(2,'white',bold('Name'),$name);
|
||||
|
|
@ -103,21 +105,21 @@ if ($ok == 0){
|
|||
print mktablerow(2,'white',bold('Sex'),$sex);
|
||||
print mktablerow(2,'white',bold('School'),$data{"school_child_$i"});
|
||||
print mktablerow(2,'white',bold('General Notes'),$data{"altnotes_child_$i"});
|
||||
|
||||
|
||||
print mktableft;
|
||||
print "<p>";
|
||||
}
|
||||
}
|
||||
my $i=0;
|
||||
my @inputs;
|
||||
while (my ($key, $value) = each %data) {
|
||||
$value=~ s/\"/%22/g;
|
||||
$inputs[$i]=["hidden","$key","$value"];
|
||||
$i++;
|
||||
}
|
||||
$inputs[$i]=["submit","submit","submit"];
|
||||
print mkformnotable("/cgi-bin/koha/insertjdata.pl",@inputs);
|
||||
|
||||
my $i=0;
|
||||
my @inputs;
|
||||
while (my ($key, $value) = each %data) {
|
||||
$value=~ s/\"/%22/g;
|
||||
$inputs[$i]=["hidden","$key","$value"];
|
||||
$i++;
|
||||
}
|
||||
$inputs[$i]=["submit","submit","submit"];
|
||||
print mkformnotable("/cgi-bin/koha/insertjdata.pl",@inputs);
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
|
|
|
|||
14
newmember.pl
14
newmember.pl
|
|
@ -1,7 +1,9 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
#script to print confirmation screen, then if accepted calls itself to insert data
|
||||
# $Id$
|
||||
|
||||
#script to print confirmation screen, then if accepted calls itself to insert data
|
||||
# FIXME - Yes, but what does it _do_?
|
||||
|
||||
# Copyright 2000-2002 Katipo Communications
|
||||
#
|
||||
|
|
@ -35,9 +37,9 @@ my $insert=$input->param('insert');
|
|||
#get rest of data
|
||||
my %data;
|
||||
my @names=$input->param;
|
||||
foreach my $key (@names){
|
||||
$data{$key}=$input->param($key);
|
||||
}
|
||||
foreach my $key (@names){
|
||||
$data{$key}=$input->param($key);
|
||||
}
|
||||
print $input->header;
|
||||
print startpage();
|
||||
print startmenu('member');
|
||||
|
|
@ -49,7 +51,7 @@ if ($insert eq ''){
|
|||
my $string="The following compulsary fields have been left blank. Please push the back button
|
||||
and try again<p>";
|
||||
if ($data{'cardnumber'} eq ''){
|
||||
|
||||
|
||||
$string.=" Cardnumber<br>";
|
||||
$ok=1;
|
||||
} else {
|
||||
|
|
@ -156,7 +158,7 @@ if ($insert eq ''){
|
|||
my @inputs;
|
||||
while (my ($key, $value) = each %data) {
|
||||
$value=~ s/\"/%22/g;
|
||||
$inputs[$i]=["hidden","$key","$value"];
|
||||
$inputs[$i]=["hidden","$key","$value"];
|
||||
$i++;
|
||||
}
|
||||
$inputs[$i]=["submit","submit","submit"];
|
||||
|
|
|
|||
Loading…
Reference in New Issue