Gossamer Forum
Home : Products : DBMan : Customization :

Whats wrong with my html.pl file?

Quote Reply
Whats wrong with my html.pl file?
Hi guys, thanks for your help in advance. I am having great problems with the html.pl file I produced for my database. I have pasted a copy below, can anyone tell me whats wrong with it and edit it for me please? Thanks again
Simioni

# Copy the subroutines below and use them as replacements for sub html_record form and
# sub html_record in your html.pl file
#

##########################################################
## Record Layout ##
##########################################################

sub html_record_form {
# --------------------------------------------------------
# The form fields that will be displayed each time a record is
# edited (including searching). You don't want to put the
# <FORM> and </FORM tags, merely the <INPUT> tags for each field.
# The values to be displayed are in %rec and should be incorporated
# into your form. You can use &build_select_field, &build_checkbox_field
# and &build_radio_field to generate the respective input boxes. Text and
# Textarea inputs can be inserted as is. If you turn on form auto
# generation, the program will build the forms for you (all though they may
# not be as nice). See the README for more info.

my (%rec) = @_;
($db_auto_generate and print &build_html_record_form(%rec) and return);

my $font_color = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399';

print qq|
<TABLE WIDTH="450" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font_color>Staff Record ID:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> <INPUT TYPE="TEXT" NAME="Staff Record ID" SIZE="20" VALUE="$rec{'Staff Record ID'}" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font_color>Nickname:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> <INPUT TYPE="TEXT" NAME="Nickname" SIZE="20" VALUE="$rec{'Nickname'}" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font_color>Experience Points:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> <INPUT TYPE="TEXT" NAME="Experience Points" SIZE="20" VALUE="$rec{'Experience Points'}" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font_color>Current Colony Position:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> |; print &build_radio_field("Current Colony Position",$rec{'Current Colony Position'}); print qq|</TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font_color>Neighborhood:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> |; print &build_select_field("Neighborhood",$rec{'Neighborhood'}); print qq|</TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font_color>Block:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> <INPUT TYPE="TEXT" NAME="Block" SIZE="20" VALUE="$rec{'Block'}" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font_color>Email Address:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> <INPUT TYPE="TEXT" NAME="Email Address" SIZE="20" VALUE="$rec{'Email Address'}" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font_color>ICQ Number:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> <INPUT TYPE="TEXT" NAME="ICQ Number" SIZE="20" VALUE="$rec{'ICQ Number'}" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font_color>AIM Name:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> <INPUT TYPE="TEXT" NAME="AIM Name" SIZE="20" VALUE="$rec{'AIM Name'}" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font_color>Notes:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> <TEXTAREA NAME="Notes" ROWS="5" COLS="40" WRAP="VIRTUAL" MAXLENGTH="1000">$rec{'Notes'}</TEXTAREA></TD></TR>
</TABLE>
|;
}

sub html_record {
# --------------------------------------------------------
# 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.
($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';

$url{'Email Address'} = $rec{'Email Address'};
$url{'Email Address'} =~ s/<\/?B>//g;
$rec{'Notes'} =~ s/\n/<BR>/g;

print qq|
<TABLE WIDTH="475" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Staff Record ID:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Staff Record ID'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Nickname:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Nickname'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Experience Points:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Experience Points'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Current Colony Position:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Current Colony Position'}</Font></TD></TR>|;
if ($rec{'Neighborhood'}) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Neighborhood:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Neighborhood'}</Font></TD></TR>
|;
}
print qq||;
if ($rec{'Block'}) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Block:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Block'}</Font></TD></TR>
|;
}
print qq||;
if ($rec{'Email Address'}) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Email Address:</FONT></TD>
<TD WIDTH="80%"> <$font><a href="mailto:$url{'Email Address'}">$rec{'Email Address'}</a>
|;
}
print qq||;
if ($rec{'ICQ Number'}) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>ICQ Number:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'ICQ Number'}</Font></TD></TR>
|;
}
print qq||;
if ($rec{'AIM Name'}) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>AIM Name:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'AIM Name'}</Font></TD></TR>
|;
}
print qq||;
if ($rec{'Notes'}) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Notes:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Notes'}</Font></TD></TR>
|;
}
print qq|
</TABLE>
|;
}



Quote Reply
Re: Whats wrong with my html.pl file? In reply to
What is your problem ?