Gossamer Forum
Home : Products : DBMan : Customization :

Re: Filter search results

Quote Reply
Re: Filter search results In reply to
Welp, since you do not have a separate Month field, this would be highly problematic...The easiest solution is to add the following fields in your default.cfg file:

Month
Day
Year

(There is an upgrade script in the Resource Center that will add these new fields into your default.cfg file. The Month field should be alpha, the Day field should be numer, and the Year field should be numer)

Now in terms of adding and modifying records, you can do the following:

1) Copy the following sub-routine in your html.pl file:

Code:

sub build_fancy_select_field {
# --------------------------------------------------------
# Fancy Display of Fields.

my $field = $_[0];
my $compare = $_[1];
my %selector = (
'Day' => [
['1','1'],
['2','2'],
['3','3'],
['4','4'],
['5','5'],
['6','6'],
['7','7'],
['8','8'],
['9','9'],
['10','10'],
['11','11'],
['12','12'],
['13','13'],
['14','14'],
['15','15'],
['16','16'],
['17','17'],
['18','18'],
['19','19'],
['20','20'],
['21','21'],
['22','22'],
['23','23'],
['24','24'],
['25','25'],
['26','26'],
['27','27'],
['28','28'],
['29','29'],
['30','30'],
['31','31']
],
'Month' => [
['Jan','January'],
['Feb','February'],
['Mar','March'],
['Apr','April'],
['May','May'],
['Jun','June'],
['Jul','July'],
['Aug','August'],
['Sep','September'],
['Oct','October'],
['Nov','November'],
['Dec','December']
],
'Year' => [
['2000','2000'],
['2001','2001'],
['2002','2002'],
['2003','2003'],
['2004','2004'],
['2005','2005'],
['2006','2006'],
['2007','2007'],
['2008','2008'],
['2009','2009'],
['2010','2010']
],
);
$output = qq|<SELECT NAME="$field">\n|;
$i = 0;
while ( $selector{$field}[$i][0] ) {
$selector{$field}[$i][0] eq $compare ?
($output .= qq|<OPTION VALUE="$selector{$field}[$i][0]" SELECTED>$selector{$field}[$i][1]\n|) :
($output .= qq|<OPTION VALUE="$selector{$field}[$i][0]">$selector{$field}[$i][1]\n|);
++$i;
}
if ($i) { $output .= "</SELECT>"; }
else { $output = "Incorrect field definition"; }
return $output;
}


2) Then in your sub html_record_form, add the following codes:

Code:

Day: |; print &build_fancy_select_field("Day", "$rec{'Day'}"); print qq|
Month: |; print &build_fancy_select_field("Month", "$rec{'Month'}"); print qq|
Year: |; &build_fancy_select_field("Year", "$rec{'Year'}"); print qq|


3) Then in your sub html_record and/or sub html_record_long routines, simply add the following codes:

Code:

Date: $rec{'Day'}-$rec{'Month'}-$rec{'Year'}


Now if you have the What's New Mod, you will have tweak the codes a bit to use these three fields.

That should do it...since the sub html_view_search routine[/b] will pull the values from the sub html_record_form.

Hope this helps.

Regards,

Eliot Lee
Subject Author Views Date
Thread Filter search results faithlezz 2132 Jun 25, 2000, 7:41 AM
Thread Re: Filter search results
Stealth 2033 Jun 25, 2000, 10:57 AM
Thread Re: Filter search results
aladdin88 2024 Jun 26, 2000, 10:31 PM
Thread Re: Filter search results
Stealth 2015 Jun 26, 2000, 10:39 PM
Thread Re: Filter search results
aladdin88 2026 Jun 27, 2000, 12:24 AM
Thread Re: Filter search results
JPDeni 2023 Jun 27, 2000, 12:42 AM
Thread Re: Filter search results
aladdin88 2033 Jun 27, 2000, 10:22 PM
Thread Re: Filter search results
JPDeni 1983 Jun 28, 2000, 12:07 AM
Thread Re: Filter search results
aladdin88 1983 Jun 28, 2000, 8:33 PM
Thread Re: Filter search results
JPDeni 1990 Jun 28, 2000, 11:57 PM
Thread Re: Filter search results
aladdin88 1967 Jun 29, 2000, 8:40 PM
Post Re: Filter search results
JPDeni 1962 Jun 30, 2000, 1:38 AM