?> <?php $form = $this->beginWidget('CActiveForm', array('id' => $model::FORM_ID, 'htmlOptions' => array('name' => get_class($model), 'class' => 'forms'))); ?> <fieldset> <ol> <li class="form-row text-input-row" style="display: block; float: left;"> <?php echo $form->dropDownList($model, 'country_id', Country::getOptions('Куди їдемо?'), array('class' => 'text-input', 'style' => 'width: 150px;')); ?> </li> <li class="form-row text-input-row" style="display: block; float: left; margin-left: 15px;"> <?php echo $form->dropDownList($model, 'with_id', TripWith::getOptions('З ким?'), array('class' => 'text-input', 'style' => 'width: 150px;')); ?> </li> <li class="button-row" style="display: block; float: left; margin-left: 15px; margin-top: 3px;"> <?php $onclick = 'return frontendController.ajaxFormSubmit(\'' . $model::FORM_ID; $onclick .= '\', function(data){ $("#trips").html( data.html ) } );'; echo CHtml::submitButton('Знайти!', array('onclick' => $onclick, 'class' => 'button navy', 'style' => 'width: 150px;')); ?> </li> <a style="display: block; float: left; margin-top: 5px; margin-left: 15px" href="#" onclick="return toggleAdvanced( this )"> <span class="icon-plus-1" id="indicator"></span> Розширений пошук
public static function getFiltersForListGrid() { return array('country_id' => Country::getOptions('країна'), 'purpose_id' => TripPurpose::getOptions('ціль'), 'with_id' => TripWith::getOptions('з ким'), 'companion_id' => TripCompanion::getOptions('шукає')); }
public function actionCreateUpdateTrip($id = NULL) { $model = new TripForm(); $this->setAjaxResponseSuccessMessage('Поїздка запланована'); $this->setRedirectUrl($this->createUrl('myTrips')); $this->breadcrumbs = array('Головна' => $this->createUrl('site/index'), 'Туристичні знайомства' => $this->createUrl('index'), 'Мої поїздки' => $this->createUrl('myTrips'), 'Планування поїздку'); if ($id) { $this->breadcrumbs = array('Головна' => $this->createUrl('site/index'), 'Туристичні знайомства' => $this->createUrl('index'), 'Мої поїздки' => $this->createUrl('myTrips'), 'Редагування поїздки'); $this->setAjaxResponseSuccessMessage('Зміни збережені'); $model->load($id); } $this->setModel($model); if (isPostOrAjaxRequest()) { $this->process(); } $this->render('add-edit-trip', array('model' => $this->getModel(), 'purposeOptions' => TripPurpose::getOptions('Для'), 'withOptions' => TripWith::getOptions('Їду з'), 'companionOptions' => TripCompanion::getOptions('Шукаю'), 'countryOptions' => Country::getOptions('Їду в'))); }