#! /usr/athena/bin/perl require "commonProcedures.pl"; use CGI; $q = new CGI; $action = $q->param('action'); #This is either hospital or medschool $type = $q->param('type'); #This is either profile or giveEval $title{'hospitalsprofile'} = "Hospital Profiles"; $title{'hospitalsgiveEval'} = "Hospital Evaluations"; $title{'medschoolsprofile'} = "Medical School Profiles"; $title{'medschoolsgiveEval'} = "Medical School Evaluations"; $instructions{'hospitalsprofile'} = "Please select a hospital to profile."; $instructions{'hospitalsgiveEval'} = "Please select a hospital to evaluate."; $instructions{'medschoolsprofile'} = "Please select a medical school to profile."; $instructions{'medschoolsgiveEval'} = "Please select a medical school to evaluate."; &printHeaders; # after printing the headers, do things that might cause an error (like # opening files so that the error message can gets displayed first open (INPUT, "$type/$type.txt") || &printErrorMessageHTML("Can't find $type data file. $!.","You should not have gotten this message, so notify the webmaster."); &printBeginHTML($title{"$type$action"}, $type); print "$title{$type.$action}\n"; print "
$instructions{$type.$action}\n
\n"; while ($line = ) { chop $line; # remove the new line character ($key, $value) = split(/ ?: ?/, $line, 2); $encoded = $value; $encoded =~ s/\s/\%20/g; $encoded =~ s/\&/\%26/g; print "$value
\n"; } print "
\n"; close INPUT; &printEndHTML; exit;