Gossamer Forum
Home : Products : DBMan : Discussions :

Record Layout

Quote Reply
Record Layout
Here is the way I am trying to get my record lay out for viewing, after a search or list all. Can't seem to figure it out. :)

Record ID:|Employee Num |Name|Leave Type|Date From
---------------------------------------------------------
21 1214 Jon Doe Sick 1-01-00
22 1215 Jane Doe Annual 1-05-00
23 1212 John Smith Sick 1-01-00

ETC... All records would be listed like this...field names at top, with record contents below them. Thanks for any help you can give. BTW I tried to install the column mod but could not get it to work. I don;t think it would do what I need, anyways..


Quote Reply
Re: Record Layout In reply to
In the html.pl file, sub html_view_success, change

Code:

for (0 .. $numhits - 1) {
print "<P>";
&html_record (&array_to_hash($_, @hits));
}
to

Code:

print "<table><tr>";
foreach $col (@db_cols) {
print "<td>$col</td>";
}
print "</tr>";
for (0 .. $numhits - 1) {
print "<tr>";
%rec = (&array_to_hash($_, @hits));
foreach $col (@db_cols) {
print "<td>$rec{$col}</td>";
}
print "</tr>";
}
print "</table>";
This is really the easiest way to print all of your fields, one record per row, in a table.

You can put similar code in sub html_delete_form and sub html_modify_form, or you can move the printout code to sub html_record.


JPD
http://www.jpdeni.com/dbman/