Yeah pitchers usually stay as pitchers, so a link or something would be fine, doesn't make a big difference to me, I'll probably be the only one adding to this DB anyway
Here's my current subroutine..
Code:
sub html_record_long {
# --------------------------------------------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash.
my (%rec) = @_; # Load any defaults to put in the VALUE field.
if ($db_total_hits > 1) {
# create links to previous and next records
$next_url = $ENV{'QUERY_STRING'};
$next_url =~ s/\&nh=\d+//;
$next_hit = $nh + 1;
$prev_hit = $nh - 1;
if ($prev_hit) {
$previous = qq~<a href="$db_script_url?$next_url&nh=$prev_hit"><$font>Previous</font></a>~;
}
else { $previous = " "; }
if ($next_hit <= $db_total_hits) {
$next = qq~<a href="$db_script_url?$next_url&nh=$next_hit"><$font>Next</font></a>~;
}
else { $next = " "; }
# create link back to short display
$list_url = $next_url;
$list_url =~ s/\&mh=\d+//;
$mh = $db_max_hits;
$lh = int(($nh-1)/$mh) + 1;
$list = qq~<a href="$db_script_url?$list_url&nh=$lh"><$font>Back to record list</font></a>~;
# print out the links
print qq|
<table width=100%>
<tr><td width=50%>$previous</td>
<td width=50% align=right>$next</td></tr>
<tr><td colspan=2 align=center>$list</td></tr>
<tr><td colspan=2 align=center><$font>Record $nh of $db_total_hits</font></table>
|;
}
($db_auto_generate and print &build_html_record(%rec) and return);
my $font_color = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399';
my $font = 'Font face="Verdana, Arial, Helvetica" Size=2';
print qq|
<TABLE WIDTH="475" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">|;
if ($per_add) {
print qq|<TR><TD ALIGN="Right" VALIGN="TOP"></TD><a href="$db_script_url?db=hitting&uid=$db_uid&add_form=1&PlayerID=$rec{'PlayerID'}">
Add Hitting Statistics for $rec{'Name'}</a></TD></TR>
|;
}
if ($per_admin) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>PlayerID:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'PlayerID'}</Font></TD></TR>
|;
}
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Name:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Name'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Position:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Position'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Team:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Team'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Jersey:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Jersey'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Height:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Height'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Weight:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Weight'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Batting:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Batting'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Throwing:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Throwing'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Birthdate:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Birthdate'}</Font></TD></TR>
</TABLE>
|;
&switch_to_hitting;
undef %in;
$rec{'PlayerID'} =~ s/<?.B>//g;
$in{'PlayerID'} = $rec{'PlayerID'};
$in{'sb'} = 2;
$in{'mh'} = 100;
my ($status2,@hits2) = &query("view");
if ($status2 eq "ok") {
my ($numhits2) = ($#hits2+1) / ($#db_cols+1);
print "<table><tr>";
for ($i=2;$i<=$#db_cols;++$i) {
print "<td>$db_cols[$i]</td>";
}
print "</tr>";
for (0 .. $numhits2 - 1) {
%rec2 = &array_to_hash($_, @hits2);
print "<tr>";
for ($i=2;$i<=$#db_cols;++$i) {
print "<td>$rec2{$db_cols[$i]}</td>";
}
print "</tr>";
}
print "</table>";
}
&switch_to_players;
}