Modification Of Advanced Search To Feed My Need

Hello everyone!

I have to modify the _search view to feed my need.

For now the search form looks like this:

3540

searchForm.png

  • The Hotel name is for searching a particular hotel (the case if the customer is interested in a hotel). It would be nice if I can implement functionality of ajax suggestion textbox. How to do this in a yii way?

  • For the Hotel City field, that is a dropDownList. Now I want it to have a default value ( for example NULL) so that if customers don’t input into that field so the search function just doesn’t pay attention to it. Means that which city the hotel is located is not important. But some how the field is filled out automatically with the first value of the list.

  • The Hotel star rate allows customers to pick up one. Here the text 1 star, 2 star, … is not very nice. So I want instead of text an image would appear there. Like this (here I’m using paint to describe the form)

3541

searchForm.png

This is the code for display labels ‘1 star’, …


  public function getRateOptions()

        {

            return array(

                1 => '1 star',// must change something here to display image insted of text

                2 => '2 star',

                3 => '3 star',

                4 => '4 star',

                5 => '5 star',

            );

        }

I hope my explanation is clear.

Thank you for reading my post and waiting for your answers or suggestions to get me started!

Cheer!

P/s: I just started to use yii from 1 month ago and still learning PHP.