Gossamer Forum
Home : Products : DBMan : Customization :

Special Price Search

Quote Reply
Special Price Search
Hi everyone,

I'm looking for some help on a specialised search for 'price'. My normal greater than and less than price search works great - no problem.

Now I have someone who wants to put in POA (price on application) instead of a real price. Of course, the normal price search does not see POA.

Can any one give me some pointers on how to do the normal price search an then also include any records which have the price=POA ?

I've searched Lois' help [pages but couldn't find anything.

Big thanks in advance!


KeefSmile
Quote Reply
Re: [Keef] Special Price Search In reply to
So you want to include another method only to identify the records which have the POA price as a separate option?

The easiest may be to just add another checkbox field called POA_yes (or whatever) in both your .cfg and html.pl subs. If they enter a price in that column they could check the option so it would be included in the search.

On your custom search form you could then use:

<tr><td>Include records with POA prices?</td><td><input type="checkbox" name="POA" value="Yes"></TD></TR>

Hope this helps or gives you an idea.

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] Special Price Search In reply to
Hi Lois,

Thanks for your reply.

My search form is for a property database and includes price(greater than or less than), county, type and bedrooms (greater than or less than) - all of these are searched for to display record matches.

The additional field can be added easily but I think I need a way of searching the 'price' field using the greater than or less than criteria OR searching it for a 'price' field entry = POA.

I hope this makes it a bit clearer.


Thanks again!

Keef Smile
Quote Reply
Re: [Keef] Special Price Search In reply to
Quote:
Now I have someone who wants to put in POA (price on application) instead of a real price. Of course, the normal price search does not see POA.

I have 2 questions;

1. Is it a limited number of "users" who require the modification? If so then perhaps develop a different search routine just for them which ONLY searches POA for "prices".

2. It sounds like the POA field will not be a greater than less than search, is that correct? If so, then perhaps present POA searches as a pull down menu using build_select_field_from_database.

Just a few ideas.
Quote Reply
Re: [joematt] Special Price Search In reply to
Thanks for your additional suggestions.

in answer to your questions:

1. Yes it is a limited number (in fact 1 in 400 so far) but if I do a normal search the POA property is left out of the results. Another way of looking at this is if all the other criteria are met for number of bedrooms, county and property type all POA's should be included in the search results - is there a way to fool the search so that POA always meets the search criteria for price?

2. Correct, the greater than less than does not find the POA and excludes the property from the search results. I could use a pull down menu but it seems a bit much to ask property searchers for a 1 in 400 property?

Any other ideas? It seems to me that I would need to do a greater than or less than price search and then a POA search but would need a Perl hint or two on how to do this.

Thanks again!

Keef
Quote Reply
Re: [Keef] Special Price Search In reply to
Quote:
is there a way to fool the search so that POA always meets the search criteria for price?

Hum? not sure about that, seems like any easy answer would provide either too many or too few results.

How about a few more questions;

1. Are both price and POA numbers? I am assuming so.

2. Are there some records for which there is no POA? In which case we can consider POA = 0 or blank.

3. Is POA alway higher or lower than price? I am imaging POA is always lower, but I am just guessing.

Try this idea, Use the suggestion by LoisC to make an option on the form to allow the user to include POA's in the search (they don't type a POA to search for, just saying they want to include POA's). Then if "include POA's in search" is selected, let Perl build a new field PricePOA which is .....

if POA = 0 or blank then pricePOA = price
if price = 0 or blank then pricePOA = POA
if POA is less than price then pricePOA = POA
if price is less than POA then pricePOA = price

Then the search is performed on the newly created field.
My understanding is that the new field can be temporary, and not need be part of the database.

Regarding the EXACT Perl codes, Unsure

Alon_g made temporary fields, and the "if/then" in Perl is not too hard, there must be something in the FAQ about it.
http://www.gossamer-threads.com/...tring=alon_g;#208442

Bottom line, it sounds like you need a new field which is a duplicate of either price or POA, based on some critera. Then search the new field.
Quote Reply
Re: [joematt] Special Price Search In reply to
Thanks again for your suggestions.

I think you have triggered a way to achieve what I need. I will be away now for a few days but will try the new scheme and get back with results.

Thanks again for your help!

Keef Smile