sub Go_Check_ID { my $id_2_check = shift; my $in_there_already = 0; my $is_completed = 0; my $is_failed = 0; my $is_denied = 0; my $is_pending = 0; my $which_db = ""; if ($is_subscrb) { $which_db = "subscrb"; } else { $which_db = "nonsubscrb"; } my $dbh = MyMODULE::NameConnect(); $sth = $dbh->prepare (qq{ SELECT * FROM $which_db WHERE id = ? }); $sth->execute($id_2_check); $row = $sth->fetchrow_hashref(); $sth->finish(); if ($row && $row->{id} =~ /^$id_2_check$/) { $in_there_already++ if ($row->{payment_status} =~ /^Pending$/i) { # Line 311 $is_pending++; } elsif ($row->{payment_status} =~ /^Failed$/i) { $is_failed++; } elsif ($row->{payment_status} =~ /^Denied$/i) { $is_denied++; } elsif ($row->{payment_status} =~ /^Completed$/i) { $is_completed++; } } if ($in_there_already == 0) { return("JUST_ADD_IT"); } elsif($in_there_already == 1 && $is_completed == 0 && $is_failed == 0 && $is_denied == 0 && $is_pending == 1) { return("JUST_UPDATE_IT"); } elsif ($in_there_already == 1 && ($is_completed == 1 || $is_failed == 1 || $is_denied == 1)) { return 0; } } # Line 329