array('square_per_metr, in_currency, owner_active, num_of_rooms, is_special_offer, is_free_from, is_free_to, active, metroStations', 'safe'),
'square_per_metr' => 'Площадь за квадратный метр',
<?php if ($model->type == Apartment::TYPE_SALE || $model->type == Apartment::TYPE_BUY) { ?>
<div class="rowold">
<?php echo $form->labelEx($model, 'square'); ?>
<?php echo $form->textField($model, 'square', array('size' => 10)); ?>
<?php echo $form->error($model, 'square'); ?>
</div>
<?php } ?>
<?php if($model->type == Apartment::TYPE_RENT) : ?>
<div class="rowold">
<?php echo $form->labelEx($model, 'square_per_metr'); ?>
<?php echo $form->textField($model, 'square_per_metr', array('size' => 10)); ?>
<?php echo $form->error($model, 'square_per_metr'); ?>
</div>
<?php endif; ?>
if($data->getStrByLang('description_near')){
echo '<p><strong>'.tt('Near').':</strong> '.CHtml::encode($data->getStrByLang('description_near')).'</p>';
}
if($data->type == Apartment::TYPE_RENT && $data->square_per_metr) {
echo '<p><strong>Площадь за квадратный метр:</strong> '.CHtml::encode($data->square_per_metr).'</p>';
}
public function attributeLabels() {
return array(
'id' => tt('ID', 'apartments'),
'type' => tt('Type', 'apartments'),
'price' => tt('Price', 'apartments'),
'num_of_rooms' => tt('Number of rooms', 'apartments'),
'floor' => tt('Floor', 'apartments'),
'floor_total' => tt('Total number of floors', 'apartments'),
'square' => tt('Square', 'apartments'),
'square_per_metr' => tt('Жилая площадь'),
'window_to' => tt('Window to', 'apartments'),
public function rules() {
return array(
//array('price', 'required'),
//array('price ', 'numerical', 'min' => 1),
array('price', 'priceValidator'),
array('title', 'i18nRequired'),
array('price, price_to, floor, floor_total, square, window_to, type, price_type, obj_type_id, city_id', 'numerical', 'integerOnly' => true),
array('price_to', 'priceToValidator'),
array('berths', 'length', 'max' => 255),
array('title', 'i18nLength', 'max' => 255),
array('lat, lng', 'length', 'max' => 25),
array('id', 'safe', 'on' => 'search'),
array('floor', 'myFloorValidator'),
array('is_price_poa', 'boolean'),
array('square_per_metr, in_currency, owner_active, num_of_rooms, is_special_offer, is_free_from, is_free_to, active, metroStations', 'safe'),
array($this->getI18nFieldSafe(), 'safe'),
array('city_id, owner_active, active, type, ownerEmail', 'safe', 'on' => 'search'),
);
}
<div class="rowold">
<?php echo $form->labelEx($model, 'square'); ?>
<?php echo $form->textField($model, 'square', array('size' => 10)); ?>
<?php echo $form->error($model, 'square'); ?>
</div>
<div class="rowold">
<?php echo $form->labelEx($model, 'square_per_metr'); ?>
<?php echo $form->textField($model, 'square_per_metr', array('size' => 10)); ?>
<?php echo $form->error($model, 'square_per_metr'); ?>
</div>
if($data->getStrByLang('description_near')){
echo '<p><strong>'.tt('Near').':</strong> '.CHtml::encode($data->getStrByLang('description_near')).'</p>';
}
if($data->type == Apartment::TYPE_RENT && $data->square_per_metr) {
echo '<p><strong>Жилая площадь:</strong> '.CHtml::encode($data->square_per_metr).'</p>';
}
if ($model->square) {
$echo[] = Yii::t('module_apartments', 'total square: {n}', $model->square).' '.CHtml::decode(param('site_square', 'м<sup>2</sup>'));
}
if ($model->square_per_metr) {
$echo[] = Yii::t('module_apartments', 'total square_per_metr: {n}', $model->square_per_metr).' '.CHtml::decode(param('site_square_per_metr', 'м<sup>2</sup>'));
}
<?php if($model->type == Apartment::TYPE_RENT) : ?>
if($data->type == Apartment::TYPE_RENT && $data->square_per_metr) {
Вернуться в Вопросы и помощь по изменениям
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 31