# Define Your Database Fields Here Like So # Field Name => [Number, 'Readable Name', 'type of field, two options are text or textarea' #%fields = ( # ID => [0, 'Link ID:', 'text'], # Name => [1, 'Name:', 'text'], # Email => [2, 'E-Mail Address:', 'text'], # Phone => [3, 'Phone Number:', 'text'], # Address => [4, 'Street Address:', 'textarea'] #); #### %fields = ( ID => [0, 'Link ID:', 'text'], change_type => [1, 'Type Of Change:', 'drop'], change_summary => [2, 'Summary Of Change :', 'text'], machines => [3, 'Machines involved :', 'drop'], date => [4, 'Date of change:', 'text'], time => [5, 'Time of change:', 'text'], change_reason => [6, 'Reason for change:', 'textarea'] ); %fields_drop = ( #types of system change 'sys' => 'sys', 'ops' => 'ops', 'cmd' => 'cmd'); #### sub build_record_page { my (%record) = @_; my ($val) = ""; my ($html) = qq~~; foreach $obj (@db_fields) { if ($obj eq $db_key) { next; } $html .= qq~~; } $html .= "
Record
$db_name{$obj}~; if ($db_type{$obj} eq "text") { # Makes the text box if ($record{$obj}) { $val = qq~ VALUE="$record{$obj}"~; } else { $val = ""; } $html .= qq~~; } if ($db_type{$obj} eq "drop") { # Makes the dropdown box if ($record{$obj}) { $val = qq~ VALUE="$record{$obj}"~; } else { $val = ""; } $html .= qq~~; } $html .= qq~

"; print $html; }