package SPA2017winterSUBMITi; my $path="../../../../"; my $apath="../"; my $title="Online Abstract Submission"; my $header = $title; !> #include ../../../../includes/wp-spa-header.iphtml #include ../includes/abstract_header.iphtml #include ./submit_header.iphtml # useful vars my $email_problem; my $complete = 1; my $foo; my %States=0; my $Current_Screen=0; %States = ( 'Default' => \&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 "
Choose an option on the left"; } sub first_page { my $active = shift; return unless $active; !> Welcome =$username!> to the =uc($society)!> Abstract Submission System
Please choose an option on the left. } sub withdraw_page { my $active = shift; return unless $active; print "
"; } sub submit_page { my $active = shift; return unless $active; print ""; # foreach ($main::cgi->param) { # print $_ . "==>" . $main::cgi->param($_) . ""; 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:
Because you changed your email address, you must now confirm your registration. An email has been sent to =$email!> with further instructions. } else { print "Please Choose an option on the left"; } } else { # login id not created print "Login ID NOT Changed"; print "
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 "
"; if ($rows > 0) { print "
AbstractID | Title |
$fields[1]-$fields[0] | $fields[2] |
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 "
"; 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 "
"; } 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.
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};
!>