#include ../../../../includes/header.iphtml #include ../includes/abstract_header.iphtml #include ./submit_header.iphtml \&first_page, 'Submit' => \&submit_page, 'vs' => \&view_submitted, 'edit' => \&edit_page, 'new' => \&start_new_page, 'Delete Abstract' => \&delete_page, 'Revise Abstract' => \&revise_page, 'Add Info' => \&add_info_page, 'Do Not Withdraw Abstract' => \&first_page, 'Withdraw Abstract' => \&withdraw_page, 'Withdraw Selected Abstracts' => \&withdraw_page, 'Primary' => \&primarycontact_page, 'YES -- Withdraw Abstract(s)' => \&yeswithdraw_page, ); $Current_Screen = $main::cgi->param("Submit") || "Default"; die "No screen for $Current_Screen" unless $States{$Current_Screen}; if ($system == 1) { while (my($screen_name, $function) = each %States) { $function->($screen_name eq $Current_Screen); } } sub yeswithdraw_page { my $active = shift; return unless $active; if (!$main::cgi->param('delete')) { print "No abstracts to delete"; return; } my @abstracts = $main::cgi->param('delete'); foreach my $abstractID (@abstracts) { my $SQL = "UPDATE abstracts SET SUBMIT=\"w\" WHERE abstractID=\"$abstractID\""; my $cursor = $main::dbh->prepare($SQL); $cursor->execute; $cursor->finish; # my $SQL = "SELECT applicationID FROM abstracts WHERE abstractID = \"$abstractID\""; # my $cursor = $main::dbh->prepare($SQL); # $cursor->execute; # my $applicationID=$cursor->fetchrow; # $cursor->finish; # my @tables = qw(abstracts authors author_flags disclosures); # foreach my $table (@tables) { # my $SQL = "DELETE FROM $table WHERE abstractID = \"$abstractID\""; # # print "

$SQL

"; # my $cursor = $main::dbh->prepare($SQL); # $cursor->execute; # # print "

ROWS:" . $cursor->rows . "

"; # $cursor->finish; # } # $SQL = "INSERT INTO withdrawn(abstractID, applicationID, contactID) VALUES(\"$abstractID\", \"$applicationID\", " . $main::dbh->quote($main::cgi->remote_user()) . ")"; # # print "

$SQL

"; # $cursor = $main::dbh->prepare($SQL); # $cursor->execute; # $cursor->finish; } print "SELECTED ABSTRACTS WITHDRAWN"; print "

Choose an option on the left"; } sub first_page { my $active = shift; return unless $active; !> Welcome to the Abstract Submission System

Please choose an option on the left. \n"; print "ARE YOU SURE YOU WANT TO WITHDRAW THE FOLLOWING ABSTRACT(S)?

"; print "Withdrawing an abstract will delete all entered and uploaded information

"; if ($main::cgi->param('abstractID')) { my $SQL = "SELECT abstractID, applicationID, title FROM abstracts WHERE abstractID = " . $main::dbh->quote($main::cgi->param('abstractID')); my $cursor = $main::dbh->prepare($SQL); $cursor->execute; my @fields = $cursor->fetchrow; $cursor->finish; $fields[2] =~ s/\[SPCHAR\(([0-9#a-zA-Z]*)\)\]/\&$1\;/g; print $fields[1] . "-" . $fields[0] . "--" . $fields[2] . "
"; print "param('abstractID') . "\">"; } elsif ($main::cgi->param('delete')) { my @abstracts = $main::cgi->param('delete'); foreach my $abstractID (@abstracts) { my $SQL = "SELECT abstractID, applicationID title FROM abstracts WHERE abstractID = \"$abstractID\""; my $cursor = $main::dbh->prepare($SQL); $cursor->execute; my @fields = $cursor->fetchrow; $fields[2] =~ s/\[SPCHAR\(([0-9#a-zA-Z]*)\)\]/\&$1\;/g; print $fields[1] . "-" . $fields[0] . "--" . $fields[2] . "
"; print ""; $cursor->finish; } } else { print "ERROR No abstract selected. No abstract withdrawn"; } print "\n"; print "\n"; print ""; } sub submit_page { my $active = shift; return unless $active; print ""; # foreach ($main::cgi->param) { # print $_ . "==>" . $main::cgi->param($_) . "
"; # } # verify current password my $SQL = "SELECT COUNT(username) FROM mysql_auth WHERE username=" . $main::dbh->quote($main::cgi->remote_user()) . " AND passwd=" . $main::dbh->quote($main::cgi->param('cpassword')); my $cursor = $main::dbh->prepare($SQL); $cursor->execute; my $count = $cursor->fetchrow; $cursor->finish; if ($count != 1) { print "ERROR - Current Password is incorrect!!

"; primarycontact_page(1); return; } if ($main::cgi->param('npassword') ne $main::cgi->param('npassword2')) { print "ERROR - Please type your new password exactly the same both times"; primarycontact_page(1); return; } if ($main::cgi->param('npassword')) { if ($main::cgi->param('npassword') eq $main::cgi->param('npassword2')) { $SQL = "UPDATE mysql_auth SET passwd=" . $main::dbh->quote($main::cgi->param('npassword')) . "WHERE username=" . $main::dbh->quote($main::cgi->remote_user()); $cursor = $main::dbh->prepare($SQL); $cursor->execute; $count = $cursor->rows; $cursor->finish; if ($count != 1) { print "ERROR - Password Not Changed"; } else { print "Password Changes"; print "

You will have to login again!"; } } } # this page if for submitting changes to the primary contact # print "BEGIN SUBMIT_PAGE
\n"; # foreach ($main::cgi->param) { # print $_ . "==>" . $main::cgi->param($_) . "
\n"; # } # my $complete=1; # check required fields my ($complete, $foo) = check_required(1, "c_"); # print "

$foo
"; # my $foo; # my ($complete, %required_errors) = check_required(1, "c_", \%errors); # print "FOO from Check_Required:
\n$foo"; # foreach (keys %required_errors) { # # print $_ . " ==> " . $required_errors->{$_} . "
\n"; # print $_ . " ==> " . $required_errors{$_} . "
\n"; # } # $complete=0; # $errors{"c_fname"} = "1"; if (!$complete) { # print "NOT COMLETE CALLING PRIMARYCONTACT PAGE"; primarycontact_page(1); return; } # check for duplicate username first # my $SQL = "SELECT COUNT(username) FROM primary_contacts WHERE username = \"" . $main::cgi->param("c_email") . "\""; # print "SQL=" . $SQL; # my $cursor = $main::dbh->prepare($SQL); my $connum = time(); # $cursor->execute; # my $count = $cursor->fetchrow; # $cursor->finish; # $count=1; # if ($count > 0) { # # $email_problem = 1; # primarycontact_page(1,1); # return; # } my $send_email = 0; if ($main::cgi->param('c_email') ne $main::cgi->remote_user()) { $send_email = 1; } # insert data into the primary_contacts table my $table = "primary_contacts"; # my $values = ") VALUES ("; my $SQL="UPDATE $table SET "; foreach ($main::cgi->param) { next if (($_ eq "Submit") || ($_ eq "c_email") || ($_ =~ m/(password|Edit)/)); my $field_name = $_; my $prefix = $table_prefix{$table}; my $values = $main::dbh->quote($main::cgi->param($field_name)) . ", "; $field_name =~ s/$prefix//; $SQL .= "$field_name=$values"; } $SQL .= "username=" . $main::dbh->quote($main::cgi->param("c_email")); if ($send_email) { $SQL .= ", conID=\"$connum\""; $SQL .= ", olduserID=" . $main::dbh->quote($main::cgi->remote_user()); } $SQL .= " WHERE username=" . $main::dbh->quote($main::cgi->remote_user()); # print "

SQL=$SQL

"; my $cursor = $main::dbh->prepare($SQL); $cursor->execute; my $affected = $cursor->rows; $cursor->finish; # print "AFFECTED: $affected"; if ($affected == 1) { !> Login ID Updated! quote($main::cgi->remote_user()); # print "

$SQL

"; $cursor = $main::dbh->prepare($SQL); $cursor->execute; my $rows = $cursor->rows; $cursor->finish; # send confirmation email my $email = $main::cgi->param('c_email'); my $sender = $society . "_abstracts\@societyhq.com"; my $bcc = "leonard\@societyhq.com"; my $subject = uc($society) . " Online Abstract Registration"; my $URL = $ENV{"SCRIPT_SRC_URL"}; my $script = $ENV{"SCRIPT_SRC_URL_FILE"}; $URL =~ s/$script//; $URL =~ s/submit\///; $URL .= "confirm.iphtml"; my $confirmURL = $URL . "?conID=" . $connum . "&email=" .$main::cgi->escape($email); my $IP = $ENV{"REMOTE_ADDR"}; # print "

$confirmURL

"; # foreach (%ENV) { # print $_ . " ==> " . $ENV{$_} . "
"; # } open (MAIL, "|/usr/lib/sendmail -oi -t") or die "can't fork sendmail: $!"; print MAIL < Thank you.

Because you changed your email address, you must now confirm your registration. An email has been sent to with further instructions. Please Choose an option on the left"; } } sub view_submitted { my $active = shift; return unless $active; print ""; my $SQL = "SELECT abstractID, applicationID, title FROM abstracts WHERE contactID = " . $main::dbh->quote($main::cgi->remote_user()) . " AND SUBMIT = \"y\""; # print "

$SQL

"; my $cursor = $main::dbh->prepare($SQL); $cursor->execute; my $rows = $cursor->rows; print "You have $rows submitted abstract(s):

"; if ($rows > 0) { print "\n"; while (my @fields = $cursor->fetchrow) { $fields[2] =~ s/\[SPCHAR\(([0-9#a-zA-Z]*)\)\]/\&$1\;/g; print "\n"; } print "
AbstractIDTitle
$fields[1]-$fields[0]$fields[2] 
"; } else { print "

Create a new abstract"; } $cursor->finish; } sub edit_page { my $active = shift; return unless $active; print ""; # list current abstract not yet submitted my $SQL = "SELECT abstractID, applicationID, title FROM abstracts WHERE contactID = " . $main::dbh->quote($main::cgi->remote_user()) . " AND SUBMIT = \"n\""; # print "

$SQL

"; my $cursor = $main::dbh->prepare($SQL); $cursor->execute; my $rows = $cursor->rows; print "You have $rows unsubmitted abstract(s):

"; print "To edit an abstract click on the the Abstract ID or Title of the abstract.

"; print "To withdraw an abstract, check the box and click the button at the bottom.

"; if ($rows > 0) { print "

\n"; print "\n"; while (my @fields = $cursor->fetchrow) { $fields[2] =~ s/\[SPCHAR\(([a-zA-Z#0-9]*)\)\]/\&$1\;/g; print "\n"; } print "
AbstractIDTitleWithdraw
$fields[1]-$fields[0]$fields[2] 
"; print ""; print "
"; } else { print "

You have any abstracts in progress.

Create a new abstract"; } $cursor->finish; } sub start_new_page { my $active = shift; return unless $active; print ""; !>

You have chosen to create a new abstract.

The creation process contains many steps. These steps should be completed in the order listed although you can go back and edit information at any time. The steps do not have to be completed in one session.

Once an abstract is submitted, information cannot be edited.
"; print "setNewColor(2);"; print ""; print "Please Note: If you change your email address you will have to reconfirm your login id before continuing."; print "

Changing Primary Contact Infomrmaion will change it for all abstracts (including abstracts already submitted)."; $email_problem = shift; # print "BEGIN FIRST_PAGE
\n"; foreach (keys %errors) { # print $_ . " ==> " . $errors{$_} . "
\n"; $errors{$_} = 0; } if ($main::cgi->param('Submit') eq "Submit") { ($complete, $foo) = check_required(1, "c_"); } # my $r_error = 0; # $r_error = shift; # my %required_errors = %{$r_error}; !>

There was an error. Please correct the fields in RED"; } if ($email_problem) { print "This email address is already in the system.
If you have forgotten your password please go to the Lost Password Page If you have not yet confirmed your registration please go to the Confirmation Page" } !>
param('c_email')) && ($main::cgi->param("Submit") eq "Submit"))) { print "Email"; } else { print "Email"; } !> param('c_email'); } else { print $main::cgi->remote_user(); } !>">(please make sure this is a valid email)

Current Password:
New Password:(leave blank if you do not want to change your password)
Verify New Password:

Please note that the Primary Contact is the only person who will recieve communications regarding the abstract status #include ./submit_footer.iphtml #include ../includes/abstract_footer.iphtml #include ../../../../includes/footer.iphtml