#!c:/perl/bin/perl.exe -w use strict; use DBI; use CGI; use vars qw($CGI $DBH $dbsource $schema $user $psswd $DEBUG $cookie); ($dbsource, $schema, $user, $psswd) = ($ENV{DB_SOURCE}, $ENV{SCHEMA}, $ENV{USER}, $ENV{PSSWD}); $CGI = new CGI; $DBH=DBI->connect($dbsource,$user,$psswd,{RaiseError =>1, AutoCommit =>0}) || die "Database connection not made: $DBI::errstr"; if ( $CGI->param("saveNewInvestBtn") ) { insertNewInvestigator($CGI, $DBH); } elsif ( $CGI->param("peopleSearchBtn") ) { peopleSearchResults($CGI, $DBH); } elsif ($CGI->param("keywords") eq "newInvest" ) { defaultNewInvestigator($CGI); } else { mainPage($CGI); } sub defaultNewInvest { my $q = shift; print $q->header(); print $q->start_html(-title=>'Primary Investigator Information'); print $q->h1("Primary Investigator Information"); print $q->start_form(-action=>"investigator.pl", -method=>"post", -name=>"form1", -onSubmit=>"return checkInvestForm();"); print$q->h3("Address Information"); print $q->table( {-border=>0}, $q->Tr([ $q->td( ["Salutation*:", $q->popup_menu(-name=>"invest_salutation", -values=>["Dr.", "Mr.", "Mrs.", "Ms."])."   Degree:   ".$q->textfield(-name=>"invest_degree")]), $q->td( ["First Name*:", $q->textfield(-name=>"invest_fname", -size=>40)] ), $q->td( ["Mid. Name:", $q->textfield(-name=>"invest_mname", -size=>40)]), $q->td( ["Last Name*:", $q->textfield(-name=>"invest_lname", -size=>40)] ), $q->td( ["Title:", $q->textfield(-name=>"invest_title", -size=>40)]) ]) ); print $q->submit( -name=>"saveNewInvestBtn", -value=>"Save", class=>"buttonstyle" ); print $q->end_form(); print $q->end_html(); }