</div> <div class="row"> <?php echo $form->labelEx($model, 'subLocation_booking'); ?> <?php echo CHtml::dropDownList('SimpleformModel_subLocation_booking', '', array('0' => tt('Choose sublocation', "apartments")), array('id' => 'SimpleformModel_subLocation_booking')); ?> <?php echo $form->error($model, 'subLocation_booking'); ?> </div> <?php echo $form->labelEx($model, 'type'); $types = ApartmentObjType::model()->findAll(); ?> <table> <tbody> <?php $z = 0; for ($i = 0; $i < count($types) / 2; $i++) { ?> <tr> <?php for ($index = 0; $index < 2; $index++) { if (isset($types[$z])) { ?> <td> <input type="checkbox" value="<?php echo $types[$z]->id;
<div class="table-responsive"> <form action="/usercpanel/main/placerent" method="POST"> <div class="content-side"> <div class="block-1"> <div class="col-1"> <div id="hire-id" class="select-col-1 check"> <span><input type="radio" name="renttype" value="1">Сдам</span> </div> <div id="sell-id" class="select-col-1"> <span><input type="radio" name="renttype" value="3">Продам</span> </div> </div> <div class="col-2"> <?php $selectedObjIndex = ApartmentObjType::getApartmentObjects()[0]; echo CHtml::dropDownList('objType', $select, ApartmentObjType::getApartmentObjects(), ['class' => 'long-select', 'options' => [$selectedObjIndex => ['selected' => 'selected']], 'id' => 'select-hire-id']); ?> <input class="short-input-pl" type="text" id="input-name" name="numOfRooms" value="" placeholder="Комнат"> <select id="arenda-time" class="short-select" name="rentlong"> <option selected="selected" value="1">Длительно</option> <option value="3">Посуточно</option> </select> <input class="short-input" type="text" name="price" size="40" placeholder="Стоимость"> <select class="more-short-select" name="moneyType"> <option value="1">Рубли</option> <option value="2">Доллары</option> </select> <input class="short-input" type="text" name="agentbonus" size="40" placeholder="% агенту"> <div class="block-1-bottom-logic"> <div class="box-1-bottom-logic-left"> <span class="text">Искать:</span>
public static function generateLists() { return array('types' => array('покупка' => Apartment::TYPE_BUY, 'обмен' => Apartment::TYPE_CHANGE, 'съем' => Apartment::TYPE_RENT, 'сдача' => Apartment::TYPE_RENTING, 'продажа' => Apartment::TYPE_SALE), 'category' => CHtml::listData(ApartmentObjType::model()->findAll(), 'name_ru', 'id'), 'location_city' => CHtml::listData(LocationCity::model()->findAll(), 'name_ru', 'id'), 'window_view' => CHtml::listData(WindowTo::model()->findAll(), 'title_ru', 'id')); }
<div class=""> <div class=""><?php echo tc('Region'); ?> :</div> <?php echo CHtml::dropDownList('filter[region_id]', $this->getFilterValue('region_id'), Region::getRegionsArray($this->getFilterValue('country_id'), 2), array('class' => 'searchField', 'id' => 'region', 'ajax' => array('type' => 'GET', 'url' => $this->createUrl('/location/main/getCities'), 'data' => 'js:"region="+$("#region").val()+"&type=0"', 'success' => 'function(result){ $("#ap_city").html(result); }'))); ?> </div> <?php $cities = City::getCitiesArray($this->getFilterValue('region_id')); } $objTypes = CArray::merge(array(0 => ''), ApartmentObjType::getList()); $typeList = CArray::merge(array(0 => ''), Apartment::getTypesArray()); ?> <div class=""> <div class=""><?php echo Yii::t('common', 'City'); ?> :</div> <?php $cities = isset($cities) && count($cities) ? $cities : CArray::merge(array(0 => tc('select city')), ApartmentCity::getAllCity()); echo CHtml::dropDownList('filter[city_id]', $this->getFilterValue('city_id'), $cities, array('class' => ' searchField', 'id' => 'ap_city')); ?> </div> <div class="rowold">
public function run() { $objTypes = ApartmentObjType::model()->findAll(); $this->render('typesEstateWidget', array('objTypes' => $objTypes)); }
public function actionDelete($id) { // Не дадим удалить последний тип if (ApartmentObjType::model()->count() <= 1) { if (!isset($_GET['ajax'])) { $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin')); } Yii::app()->end(); } parent::actionDelete($id); }
</div> <?php } else { echo '<br/>'; echo '<b>' . tt('The name of a field in a table', 'formeditor') . '</b>: ' . $model->field . ''; echo '<br/>'; echo '<b>' . $model->getAttributeLabel('type') . '</b>: ' . $model->getTypeName() . ''; echo '<br/>'; } $this->widget('application.modules.lang.components.langFieldWidget', array('model' => $model, 'field' => 'label', 'type' => 'string')); } echo $form->dropDownListRow($model, 'view_in', FormDesigner::getViewInList()); echo $form->dropDownListRow($model, 'rules', FormDesigner::getRulesList()); //echo $form->dropDownListRow($model, 'view_in', FormDesigner::getViewInList()); echo $form->checkBoxRow($model, 'visible'); echo $form->checkBoxListRow($model, 'objTypesArray', ApartmentObjType::getList()); $this->widget('application.modules.lang.components.langFieldWidget', array('model' => $model, 'field' => 'tip', 'type' => 'string')); echo '<div class="fields_for_search">'; echo '<h5>' . tt('For search') . '</h5>'; $this->widget('application.modules.lang.components.langFieldWidget', array('model' => $translate, 'field' => 'translation', 'type' => 'string')); echo $form->dropDownListRow($model, 'compare_type', FormDesigner::getCompareList()); echo '</div>'; ?> <div id="selMeasureUnitBox" style="display: none;"> <?php echo $form->textFieldRow($model, 'measure_unit'); ?> </div> <br/>
public static function getObjTypesArray($with_all = false) { Yii::import('application.modules.apartmentObjType.models.ApartmentObjType'); $objTypes = array(); $objTypeModel = ApartmentObjType::model()->findAll(array('order' => 'sorter')); foreach ($objTypeModel as $type) { $objTypes[$type->id] = $type->name; } if ($with_all) { $objTypes[0] = tt('All object', 'apartments'); } return $objTypes; }
id="search_form1" method="GET"> <?php $selectedCountryIndex = LocationCountry::getAllCountries()[0]; echo CHtml::dropDownList('country', $select, LocationCountry::getAllCountries(), ['class' => 'main-select-option', 'options' => [$selectedCountryIndex => ['selected' => 'selected']]]); ?> <?php $selectedRegionIndex = LocationRegion::getAllRegions()[0]; echo CHtml::dropDownList('region', $select, LocationRegion::getAllRegions(), ['class' => 'main-select-option', 'options' => [$selectedRegionIndex => ['selected' => 'selected']]]); ?> <?php $selectedCityIndex = LocationCity::getCities()[0]; echo CHtml::dropDownList('city', $select, LocationCity::getCities(), ['class' => 'main-select-option', 'options' => [$selectedCityIndex => ['selected' => 'selected']]]); ?> <?php $selectedObjIndex = ApartmentObjType::getApartmentObjects()[0]; echo CHtml::dropDownList('objectType', $select, ApartmentObjType::getApartmentObjects(), ['class' => 'main-select-option', 'options' => [$selectedObjIndex => ['selected' => 'selected']]]); ?> <?php echo CHtml::dropDownList('room', $select, Apartment::getExistsRooms(), ['class' => 'main-select-option']); ?> <input type="hidden" name="apartmentType" value="2"> <div class="price-counter"> <div class="list-slider"> <div class="slider-range"></div> <div class="slider-values"> <input class="min" name="priceIn" readonly value="0"> <input class="max" name="priceOut" readonly value="250000000"> </div>
public function getObjTypesArray() { if (!$this->saveObjTypes) { if ($this->isNewRecord) { $this->saveObjTypes = array_keys(ApartmentObjType::getList()); } else { $this->saveObjTypes = CHtml::listData($this->objTypes, 'id', 'id'); } } return $this->saveObjTypes; }
}); // $("#cat_menu").css("display","none"); $(".category").mouseover(function(){ $("#cat_menu").show(); }); $(".category").mouseout(function(){ $("#cat_menu").hide(); }); '); $categories = ApartmentObjType::model()->findAll(); if (!empty($categories)) { $menuTemplate = '{menu}' . ApartmentObjType::getMenu($categories); } else { $menuTemplate = '{menu}'; } ?> <?php //ОСНОВНОЙ LAYOUT $this->beginContent('//layouts/main'); ?> <?php if (issetModule('advertising')) { $this->renderPartial('//modules/advertising/views/advert-top', array()); } ?>
<?php $objTypes = ApartmentObjType::getList(); $objTypes = CMap::mergeArray(array(0 => tc('Default search')), $objTypes); $cs = Yii::app()->clientScript; $cs->registerCoreScript('jquery.ui'); $cs->registerCssFile(Yii::app()->clientScript->getCoreScriptUrl() . '/jui/css/base/jquery-ui.css'); $this->adminTitle = tt('Edit search form', 'formeditor'); $this->menu = array(array('label' => tc('The forms designer'), 'url' => array('/formdesigner/backend/main/admin'))); ?> <div class="well"> <div class="flash-notice"><?php echo tt('Edit search form help', 'formeditor'); ?> </div> <?php echo CHtml::dropDownList('obj_type_id', '', $objTypes); ?> <div class="row-fluid"> <div class="span5"> <ul id="sortable1" class="connectedSortable well sortBlue"> </ul> </div> <div class="span5"> <ul id="sortable2" class="connectedSortable well"> </ul> </div>
public static function getList() { if (empty(self::$_cacheList)) { self::$_cacheList = CHtml::listData(ApartmentObjType::model()->findAll(), 'id', 'name'); } return self::$_cacheList; }
<th scope="col" width="8%">Тип поиска</th> <th scope="col" width="9%">Этаж/этажей</th> <th scope="col" width="11%">Доп. сведения</th> <th scope="col" width="25%">Комментарии</th> </tr> <?php foreach ($rentorders as $rentorder) { ?> <tr> <td><img class="star-mark" src="<?php echo Yii::app()->theme->baseUrl . '/views/modules/usercpanel/images/content/star-mark.png'; ?> " width="15" height="15" alt=""/></td> <td><div class="tableObject"> <?php echo $rentorder->numOfRooms . '-к ' . ApartmentObjType::getApartmentObjects()[$rentorder->objTypeId]; ?> </td> <td><?php echo LocationCity::getCities()[$rentorder->loc_city_id] . ',' . $rentorder->stationName; ?> </td> <td><?php echo 'Общая:' . $rentorder->square . 'м2 Кухня:' . $rentorder->squareKitchen . 'м2'; ?> </td> <td> <?php echo $rentorder->price . ($rentorder->moneyType == 1 ? 'р.' : '$') . "<br>" . ApartmentsRents::getStrLabels($rentorder->searchRequirements); ?> </td>