# ties all these subroutines together. sub PrintForm { # calling from improve if ($method eq "query"){ $user = $query{'user'}; $station = $query{'topstation'}; $topgraph = $query{'topgraph'}; $bottomstation = $query{'bottomstation'}; $bottomgraph = $query{'bottomoption'}; $topfrom = $query{'topfrom'}; $topto = $query{'topto'}; $botfrom = $query{'botfrom'}; $botto = $query{'botto'}; } # calling from map link if ($method eq "map"){ $user = $query{'user'}; $station = $query{'map'}; $topgraph = "nitrogen"; $bottomstation = $query{'map'}; $bottomgraph = "precip"; $topfrom = $query{'topfrom'}; $topto = $query{'topto'}; $botfrom = $query{'botfrom'}; $botto = $query{'botto'}; } # calling from submit on form elsif ($method eq "form"){ $user = $form{'user'}; $station = $form{'topstation'}; $topgraph = $form{'topgraph'}; $bottomstation = $form{'bottomstation'}; $bottomgraph = $form{'bottomoption'}; $topfrom = $form{'topfrom'}; $topto = $form{'topto'}; $botfrom = $form{'botfrom'}; $botto = $form{'botto'}; } if ($topgraph eq 'nitrogen'){ $stationtitle = "Nitrogen Concentration (mg/L)"; } elsif ($topgraph eq 'phosphorus'){ $stationtitle = "Phosphorus (Mg/L)"; } elsif ($topgraph eq 'sediments'){ $stationtitle = "Sediments (Mg/L)"; } elsif ($topgraph eq 'heavymetal'){ $stationtitle = "Heavy Metal (Mg/L)"; } elsif ($topgraph eq 'toxins'){ $stationtitle = "Toxins (Mg/L)"; } elsif ($topgraph eq 'watertemp'){ $stationtitle = "Water Temperature (Degrees Celsius)"; } elsif ($topgraph eq 'temperature'){ $stationtitle = "Air Temperature (Degrees Celsius)"; } elsif ($topgraph eq 'precip'){ $stationtitle = "Precipitation (Inches)"; } elsif ($topgraph eq 'ph'){ $stationtitle = "pH"; } elsif ($topgraph eq 'do'){ $stationtitle = "Dissolved Oxygen (Mg/L)"; } elsif ($topgraph eq 'bod'){ $stationtitle = "BOD (Mg/L)"; } elsif ($topgraph eq 'saturateddo'){ $stationtitle = "Saturated DO (Mg/L)"; } elsif ($topgraph eq 'runoff'){ $stationtitle = "Runoff (Inches)"; } if ($bottomgraph eq 'nitrogen'){ $bottomstationtitle = "Nitrogen Concentration (mg/L)"; } elsif ($bottomgraph eq 'phosphorus'){ $bottomstationtitle = "Phosphorus (Mg/L)"; } elsif ($bottomgraph eq 'sediments'){ $bottomstationtitle = "Sediments (Mg/L)"; } elsif ($bottomgraph eq 'heavymetal'){ $bottomstationtitle = "Heavy Metal (Mg/L)"; } elsif ($bottomgraph eq 'toxins'){ $bottomstationtitle = "Toxins (Mg/L)"; } elsif ($bottomgraph eq 'watertemp'){ $bottomstationtitle = "Water Temperature"; } elsif ($bottomgraph eq 'temperature'){ $bottomstationtitle = "Air Temperature"; } elsif ($bottomgraph eq 'precip'){ $bottomstationtitle = "Precipitation (Inches)"; } elsif ($bottomgraph eq 'ph'){ $bottomstationtitle = "pH (Mg/L)"; } elsif ($bottomgraph eq 'do'){ $bottomstationtitle = "Dissolved Oxygen"; } elsif ($bottomgraph eq 'bod'){ $bottomstationtitle = "BOD (Mg/L)"; } elsif ($bottomgraph eq 'saturateddo'){ $bottomstationtitle = "Saturated DO (Mg/L)"; } elsif ($bottomgraph eq 'runoff'){ $bottomstationtitle = "Runoff (Inches)"; } PrintHtmlHeader(); PrintLeftColumn(); PrintLeftColumnLinks(); PrintTopGraph(); PrintBottomGraph(); PrintHtmlFooter(); } sub PrintHtmlHeader { # $html = 0; print "Content-type: text/html\n\n"; # print 'test'; print <<"HTML";
HTML
}
sub PrintLeftColumn {
print <<"HTML";
![]() |
HTML
}
sub PrintTopGraph {
print "Station $station: $stationtitle "; $changed = 0; # HasImprovementBeenMade sets $changed to 1 if changed HasImprovementBeenMade($bottomstation); $bottomch = $changed; $changed = 0; HasImprovementBeenMade($station); $alen = ($topto - $topfrom); $blen = ($botto - $botfrom); # print "ALEN: $alen. BLEN: $blen"; if (($alen == $blen) && ($changed == $bottomch)){ print "scatter plots of current parameters"; print " Help"; } else { print "Scatter Plot Help"; } print " Notepad "; print "\n"; $locale = "top"; DecideAsssignmentHeader("top"); if (($station != '7') && ($station != '0')){ DecideImproveOrRetract("top"); } PrintGraphLocation("top"); CanImprovementsBeMade("top"); $locale = 0; } sub PrintBottomGraph { $changed = 0; # HasImprovementBeenMade sets $changed to 1 if changed HasImprovementBeenMade($bottomstation); $locale = "bottom"; PrintGraphLocation("bottom"); DecideAsssignmentHeader("bottom"); # generalinfo.pl if (($bottomstation != '7') && ($bottomstation != '0')){ DecideImproveOrRetract("bottom"); } CanImprovementsBeMade("bottom"); $locale = 0; } sub PrintHtmlFooter { print <<"HTML"; |