my $query = qq|SELECT s.* FROM shipto s
- WHERE s.id = $self->{shipto_id}|;
+ WHERE s.shipto_id = $self->{shipto_id}|;
my $sth = $dbh->prepare($query);
$sth->execute || $self->dberror($query);
$ref = $sth->fetchrow_hashref(NAME_lc);
}
$self->{"shipto$item"} =~ s/\'/\'\'/g;
}
-
if ($shipto) {
if ($self->{shipto_id}) {
my $query = qq| UPDATE shipto set
shiptophone = '$self->{shiptophone}',
shiptofax = '$self->{shiptofax}',
shiptoemail = '$self->{shiptoemail}'
- WHERE id = $self->{shipto_id}|;
+ WHERE shipto_id = $self->{shipto_id}|;
$dbh->do($query) || $self->dberror($query);
} else {
my $query =
}
$sth->finish;
- # get adr
- $query = qq|SELECT id, adr_description, adr_code
- FROM adr|;
- $sth = $dbh->prepare($query);
- $sth->execute || $form->dberror($query);
-
-
- $self->{ADR} = [];
- while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
- push @{ $self->{ADR} }, $ref;
- }
- $sth->finish;
$dbh->disconnect;
$main::lxdebug->leave_sub();
}
my ($type, $country, $NLS_file) = @_;
my $self = {};
- %self = ();
if ($country && -d "locale/$country") {
+ local *IN;
$self->{countrycode} = $country;
- eval { require "locale/$country/$NLS_file"; };
+ if (open(IN, "locale/$country/$NLS_file")) {
+ my $code = join("", <IN>);
+ eval($code);
+ close(IN);
+ }
}
$self->{NLS_file} = $NLS_file;
sub text {
my ($self, $text) = @_;
- return (exists $self{texts}{$text}) ? $self{texts}{$text} : $text;
+ return (exists $self->{texts}{$text}) ? $self->{texts}{$text} : $text;
}
sub findsub {
my ($self, $text) = @_;
- if (exists $self{subs}{$text}) {
- $text = $self{subs}{$text};
+ if (exists $self->{subs}{$text}) {
+ $text = $self->{subs}{$text};
} else {
if ($self->{countrycode} && $self->{NLS_file}) {
Form->error(