sub makeTable {
my ($ref, $cols) = @_;
my $one_col = "";
#pull in ref. to hash (doc. name, URL)
my $links_ref = ($cols =~ /MPS/) ? &getMPSlinks : "";
#----make column titles, and begin html code for table
my @cols = split (/,/,$cols);
foreach (@cols)
{$labels .= qq|
$_ | |;}
my $table = qq|$labels
|;
foreach (@$ref) { #loop thru array of arrays, inside we'll take each array and break out into table
$table .= ++$count % 2 == 1 ? qq|| : qq|
|; #alaternate row colors
#---Build tables here-----------------------------------------------
if ($form{"query"} eq "deptcodes") {
my $doc_num = qq|@$_[2]|;
#PROBLEM CHILD ON NEXT LINE
$table .= qq|| @$_[0] | @$_[1] | @$_[2] | |;
}
}
$table .= "
";
return($table);
}
#this returns a ref to a hash. key is doc. name, value is URL
sub getMPSlinks {
our %mps_hash=();
my ($one_mps, $one_url) = "";
open(HANDLE, "< $cgi_path/mpslinks.txt") or die "***Couldn't open $path for reading: $!\n";
while ()
{
($one_mps, $one_url) = split (/\|/,$_);
$mps_hash{$one_mps} = "$one_url";
#print "$one_mps
$one_url";
}
close (HANDLE);
return (\%mps_hash);
}