Well, I was hoping that you would have the actual values included so I would know what I'm going to be working with. But I think I can figure it out.
For "unlimited" values, set the value to -1.
Your data transfer needs to be:
Code:
<select name=datatransfer>
<option value="---" selected>
No preference
<option value="1000">
Less than 1GB
<option value="1000 - 5000">
1GB - 5GB
<option value="5000 - 10000">
5GB - 10GB
<option value="10000+">
More than 10GB
<option value="-1">
unlimited
</select>
Your monthly storage needs to be:
Code:
<select name=monthlystorage>
<option value="---" selected>
No preference
<option value="5" selected>
Less than 5MB
<option value="5 - 10">
5MB - 10MB
<option value="10 - 20">
10MB - 20MB
<option value="20 - 30">
20MB - 30MB
<option value="30 - 40">
30MB - 40MB
<option value="40 - 50">
40MB - 50MB
<option value="50">
Less than 50MB
<option value="50 - 150">
50MB - 150MB
<option value="150+">
More than 150MB
</select>
(No "unlimited" option on storage?)
In db.cgi, sub query, just after
local (%sortby);
add
Code:
if ($in{'datatransfer'} gt -1) {
$in{'datatransfer'} =~ s/ //g;
@trans = split "-",$in{'datatransfer'};
$in{'datatransfer'} = '';
if ($trans[0] =~ /\+/) {
$trans[0] =~ s/\+//;
$in{'datatransfer-gt'} = $trans[0];
}
elsif (!$trans[1]) {
$in{'datatransfer-lt'} = $trans[0];
}
else {
$in{'datatransfer-gt'} = $trans[0];
$in{'datatransfer-lt'} = $trans[1];
}
}
if ($in{'monthlystorage'} gt -1) {
$in{'monthlystorage'} =~ s/ //g;
@stor = split "-",$in{'monthlystorage'};
$in{'monthlystorage'} = '';
if ($stor[0] =~ /\+/) {
$stor[0] =~ s/\+//;
$in{'monthlystorage-gt'} = $stor[0];
}
elsif (!$stor[1]) {
$in{'monthlystorage-lt'} = $stor[0];
}
else {
$in{'monthlystorage-gt'} = $stor[0];
$in{'monthlystorage-lt'} = $stor[1];
}
}
You do understand that you will need to have a search form that is different from your add/modify form, right?
------------------
JPD