Advance Search

2 posts by 2 authors in: Forums > CMS Builder
Last Post: May 4, 2010   (RSS)

By KCMedia - May 3, 2010 - edited: May 3, 2010

Hi

I am trying to write some kind of advance search for a list of motorbikes and their features.

can someone please point me in the right direction as to how i can write something like this please.

i want to users to be able to go to a search page and either select drop downs or tick boxes and then hit search and get a list of results.

i have done up a layout of the search page now i just need to know how to get the data and fields populated and then be able to search the DB for the products then display them.

The display page for the results will be the used-motorcycles.php page.

www.actionmc.com.au/used-motorcyclesSearch.php

also i have attached a screen dump of the admin with all the fields and types.

the only field that might be an issue is the Manufacturer as it is pulling data from another part of the cms db there is also a screen dump of the setting for this.



Thank you

Craig
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Re: [kcmedia] Advance Search

By Jason - May 4, 2010

Hi,

Here are a few tips.

-First things I would do would be to make sure that all of your input fields on your form are named exactly the same as the fields in the database.

-For your checkboxes (Learner Approved, Factory Warranty, Dealer Warranty, Extended Warranty), you should only have 1 box for each. This way if they check it, it's yes, if they don't, it's no. The way it's set up right now, I person could select both yes and no for a single option.

-You can get your list of manufacturers and put them in a list like this:
<select name="Brand">
<?php echo getSelectOptionsFromTable('pre_owned_bikes_logos','title','title','',1); ?>
</select>


You can do something similar for "store".

-Engine is a bit harder, since you're not storing a list of engine sizes in the database and they're just stored as text in your table. You could manually enter your list, but the entries "less than <100cc" and "greater than >1000cc" would take a bit more complicated custom programming.

- On the page that will be displaying the search results, if you use the option 'allowSearch' => true,
where you're getting your records will automatically do the search.

Let me know if you run into any issues. Like I said, we could always do some custom programming for you to get it done quickly.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/