#!/usr/local/bin/perl use File::Basename; use Time::Local; use CGI qw(:standard :cgi-lib); $MAILPROG = '/usr/lib/sendmail'; $RECIPIENT = 'vanessa.george\@lasp.colorado.edu'; #$RECIPIENT = 'steve.roughton\@lasp.colorado.edu'; $SUBJECT = '2008 SORCE Science Meeting Abstract Submission'; $q = new CGI; # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sub displayform { print $q->start_form(-method=>'POST'); print ''; print ''; print $q->th('Preferred Session:'); print $q->td($q->radio_group (-name=>'SESSION', -values=>['1. Variability of the Solar Irradiance Over the Solar Cycle', '2. Atmospheric Models, Processes, and Solar Irradiance', '3. Models of Solar Processes Affecting Climate', '4. Climate Models, Processes, and Solar Irradiance' ], -linebreak=>'true', -class=>'radio')); print ''; print ''; print $q->th('Type of Presentation:'); print $q->td($q->radio_group (-name=>'FORMAT', -values=>['Oral Presentation', 'Poster'], -linebreak=>'true', -class=>'radio')); print ''; print ''; print $q->th('Your Email Address:'); print $q->td($q->textfield(-name=>'EMAIL', -size=>50)); print ''; print ''; print $q->th('Title:'); print $q->td($q->textarea(-name=>'TITLE', -rows=>2, -columns=>100)); print ''; print '', $q->th('Authors'), ''; print ''; print $q->th('Abstract Text:
(250 words or less)'); print $q->td($q->textarea(-name=>'ABSTRACT', -rows=>10, -columns=>100)); print ''; print '
'; print ''; print '', $q->td($q->textfield(-name=>'AUTH-1', -size=>40)), $q->td($q->textfield(-name=>'INST-1', -size=>60)), ''; print '', $q->td($q->textfield(-name=>'AUTH-2', -size=>40)), $q->td($q->textfield(-name=>'INST-2', -size=>60)), ''; print '', $q->td($q->textfield(-name=>'AUTH-3', -size=>40)), $q->td($q->textfield(-name=>'INST-3', -size=>60)), ''; print '', $q->td($q->textfield(-name=>'AUTH-4', -size=>40)), $q->td($q->textfield(-name=>'INST-4', -size=>60)), ''; print '
AuthorAffiliation
'; print $q->p($q->submit('Submit Abstract')); print $q->endform; print $q->p('Email: vanessa.george@lasp.colorado.edu
Fax: 303-492-6444'); } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sub processform { my $email = $q->param('EMAIL'); my @fields = ('EMAIL','SESSION','FORMAT','TITLE', 'AUTH-1','INST-1','AUTH-2','INST-2', 'AUTH-3','INST-3','AUTH-4','INST-4','ABSTRACT'); open(OUT, "|$MAILPROG $RECIPIENT") || die "Can't open $MAILPROG\n"; print OUT "Subject: $SUBJECT\n"; print OUT "From: $email\n"; print OUT "$SUBJECT\n\n"; foreach $key (@fields) { $value = $q->param($key); print OUT "$key: $value\n"; } close OUT; print $q->p('Thanks for submitting your abstract!'); } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - print $q->header; print $q->start_html (-title => 'SUBMIT SORCE ABSTRACT', -style => {'src'=>'../css/abstract.css', 'code'=>'font-family:Arial,Helvetica,sans-serif'}, -BGCOLOR => '#FFFFFF'); print $q->h1('2008 SORCE Science Meeting'); print $q->h2('SORCE\'s Past, Present, and Future Role in Earth Science Research'); print $q->h3('Abstract Submission Form'); my @required = ('EMAIL','SESSION','FORMAT','TITLE', 'AUTH-1','INST-1','ABSTRACT'); my $formstate = 'NEW'; if ($q->param('Submit Abstract')) { $formstate = 'VALID'; foreach $key (@required) { if (!$q->param($key)) { $formstate = 'ERROR'; print $q->p ({-style=>'color:red'}, 'Please complete all fields (including at least one author/affliation).' ); last; } } } if ($formstate eq 'VALID') { processform(); } else { displayform(); } print $q->end_html;