#####################################################
# S P R E A D S H E E T F O R M A T D I S P L A Y
# written by JPDeni
# Written 13 Jul 2000
#####################################################
#
# This is a non-autogenerated way to display search results in a
# spreadsheet format, with all fields in one table and each record in a row on the table.
#
# This is not for use with a short/long display mod. This includes
# clickable links in the header that will resort the search results
# by the field. Clicking the same header a second time will sort the results in reverse order.
#####################################################
# Replace sub html_record with the following:
sub html_record {
my (%rec) = @_;
# Replace FieldName below with the names of the fields you want to display. Create as many table cells as you wish, one for each field.
print qq|
$rec{'FieldName'} | $rec{'FieldName'} | $rec{'FieldName'} | $rec{'FieldName'} | |;
}
#####################################################
# In sub html_view_success, change
for (0 .. $numhits - 1) {
print "";
&html_record (&array_to_hash($_, @hits));
}
# to
$new_url = $ENV{'QUERY_STRING'};
$new_url =~ s/\&sb=\d+//;
$new_url =~ s/\&so=\w+//;
for ($col=0; $col <=$#db_cols; ++$col) {
if ($in{'sb'} == $col) {
if ($in{'so'} eq 'descend') { $sb[$col] = 'ascend'; }
else { $so[$col] = 'descend'; }
}
else { $so[$col] = 'ascend'; }
}
# Note: In each of the header cells, replace # with the field number
# of the field that is associated with that header -- in both places within each line.
print qq|
";
#####################################################
# In sub html_delete_form, change
for (0 .. $numhits - 1) {
%tmp = &array_to_hash($_, @hits);
print qq|\n|;
}
# to
$new_url = $ENV{'QUERY_STRING'};
$new_url =~ s/\&sb=\d+//;
$new_url =~ s/\&so=\w+//;
for ($col=0; $col <=$#db_cols; ++$col) {
if ($in{'sb'} == $col) {
if ($in{'so'} eq 'descend') { $sb[$col] = 'ascend'; }
else { $so[$col] = 'descend'; }
}
else { $so[$col] = 'ascend'; }
}
# Note: In each of the header cells, replace # with the field number
# of the field that is associated with that header -- in both places within each line.
print qq|
";
#####################################################
# In sub html_modify_form, change
for (0 .. $numhits - 1) {
%tmp = &array_to_hash($_, @hits);
print qq|\n|;
}
# to
$new_url = $ENV{'QUERY_STRING'};
$new_url =~ s/\&sb=\d+//;
$new_url =~ s/\&so=\w+//;
for ($col=0; $col <=$#db_cols; ++$col) {
if ($in{'sb'} == $col) {
if ($in{'so'} eq 'descend') { $sb[$col] = 'ascend'; }
else { $so[$col] = 'descend'; }
}
else { $so[$col] = 'ascend'; }
}
# Note: In each of the header cells, replace # with the field number
# of the field that is associated with that header -- in both places within each line.
print qq|
";
#####################################################
# In sub html_add_success and sub html_modify_success, change
&html_record(&get_record($in{$db_key}));
# to
print qq|
| FieldName | FieldName | FieldName | FieldName |
\n
|;
&html_record(&get_record($in{$db_key}));
print "
";