mnlight has asked for the wisdom of the Perl Monks concerning the following question:
# store subparent for each parent my %parent_hash = ( 'Father' => 'Mother', 'Mother' => 'Father' ); if ( @volunteer_date ){ if (exists $parent_hash{$parent}) { my $sub_parent = $parent_hash{$parent}; for $col ( $parent, $sub_parent ) { $sql = "select $col from Roster where User=?"; $sth = $dbh->selectcol_arrayref( $sql, undef, $user ); if ( @$sth && $sth->[0] ) { # any rows returned? $name = $sth->[0]; # take first one last; } } } print $query->header(), $query->start_html (-title=>'Volunteer List Form', -link=>'#FFFFFF', -vlink=>'#99FF99', -alink=>'black', -style=>{'-src'=>'/CSS/stylesheet.css'}), $query->h1({-align=>'center'},"THANK YOU FOR SIGNING UP $name"); #seperates dates into signed up and duplicate signups. foreach $date ( @volunteer_date ) { $sql = "select distinct Volunteer from Volunteer where Volunte +er =? and Date =?"; my $sth = $dbh->selectcol_arrayref( $sql, undef, $name, $date +); if( @$sth ) { push @dupe_dates, $date; } #end if statement else{ push @signup_dates, $date; } #end else statement } #end foreach loop print $query->start_form('POST', './UnSignup.pl'); #process the signup dates. foreach $signup_date ( @signup_dates ) { my $sql = "select max(Number) from Volunteer where Date =? and + Volunteer = 'TBD'"; my $number = $dbh->selectcol_arrayref($sql, undef, $date); $sql = "update Volunteer set Volunteer = '$name' WHERE Date = +'$date' and Number = $number->[0]"; $sth = $dbh->prepare($sql) || die "prepare: $$sql: $DBI::errst +r"; $sth->execute || die "execute: $sql->[0]: $DBI::errstr"; print $query->start_table({-align=>'center'}), $query->start_Tr({bgcolor=>'#9933FF'}), $query->start_th({-align=>'center', -colspan=>5}), $query->stron +g('VOLUNTEER'), $query->start_th({-align=>'center', -colspan=>5}), $query->stron +g('DATE'), $query->start_th({-align=>'center', -colspan=>5}), $query->stron +g('UNDO'), $query->end_Tr; $query->start_Tr({bgcolor=>'#99FF99'}), $query->start_td({-align=>'center', -colspan=>5}), $query->stron +g($name), $query->start_td({-align=>'center', -colspan=>5}), $query->stron +g($signup_date), $query->start_td({-align=>'center', -colspan=>5}), $query->chec +kbox(-name=>"remove",-value=>$signup_date), $query->end_Tr; print $query->end_table; } #end foreach loop #display the duplicate dates. foreach $dupe_date ( @dupe_dates ) { print $query->h1({-align=>'center'}, "You are already signed up for th +is date: $dupe_date"); } #end foreach loop print $query->center( $query->submit(-name=>'rows', -value=>'Submit'), $query->reset); print $query->end_form(); $sth->finish (); $dbh->disconnect (); } #end if volunteer_date check else{ print $query->h1({-align=>'center'}, "You did not select a dat +e"); } #end else volunteer_date check print $query->h2({-align=>'center'}, $query->a({href=>'../../index.html'}, 'HOME'), ' ', $query->a({href=>'../../Schedule.html'}, 'SCHEDULE'), ' ', $query->a({href=>'Roster.pl'}, 'ROSTER'), ' ', $query->a({href=>'../../News.html'}, 'NEWS'), ' ', $query->a({href=>'../../Pictures.html'}, 'PICTURES'), ' ', $query->a({href=>'UnSignup.pl'}, 'UNDO SIGNUP'), ' ', $query->a({href=>'../BobSchedule.pl'}, 'BOBS SCHEDULE'), ' ' +,); print $query->end_html; print $query->h3({-align=>'center'}, $query->a({href=>'Volunteer.pl'}, 'BACK'), ' ',); print $query->end_html;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why won't my form print to screen
by grep (Monsignor) on Mar 05, 2002 at 07:27 UTC | |
by gellyfish (Monsignor) on Mar 05, 2002 at 09:38 UTC | |
|
Re: Why won't my form print to screen
by Trimbach (Curate) on Mar 05, 2002 at 12:58 UTC | |
|
Re: Why won't my form print to screen
by particle (Vicar) on Mar 05, 2002 at 12:50 UTC | |
by gellyfish (Monsignor) on Mar 05, 2002 at 13:06 UTC |