public function getCurrencyList() { return CHtml::listData(Currency::getList(), 'id', 'name'); }
/** * Получение блока стоимостей объекта в разных валютах * @param string $attributeName * @return type */ public function getPriceLabel($attributeName) { if (!$this->eavEnable || !$this->hasEavAttribute($attributeName) || empty($this->{$attributeName})) { return; } $html = ''; $currentCurrency = $this->getCurrentCurrency(); $currencyList = Currency::getList(); foreach ($currencyList as $currency) { $price = $this->_getCurrencyPrice($this->{$attributeName}, $currency); $value = $this->_getPriceString($price, $currency); if ($currency->id == $currentCurrency->id) { $html .= '<span class="property_price currency_' . $currency->code . '">' . $value . '</span>'; } else { $html .= '<span class="property_price currency_' . $currency->code . '" style="display: none">' . $value . '</span>'; } } return $html; }
?> <?php echo $form->dropDownListGroup($model, 'supplier_id', ['widgetOptions' => ['data' => Supplier::getList(), 'htmlOptions' => ['class' => 'span5', 'maxlength' => 9, 'ajax' => ['type' => 'POST', 'url' => ['getLoadingAddressList'], 'update' => '#Order_loading_id', 'error' => "function(data){\n \$('#Order_loading_id').empty().html('<option value=\"\">Select supplier address</option>');\n }"], 'empty' => 'Select supplier company']]]); ?> <?php echo $form->dropDownListGroup($model, 'loading_id', ['widgetOptions' => ['data' => [], 'htmlOptions' => ['class' => 'span5', 'maxlength' => 9, 'empty' => 'Select supplier address']]]); ?> <?php echo $form->dropDownListGroup($model, 'delivery_id', ['widgetOptions' => ['data' => DeliveryAddress::getList(), 'htmlOptions' => ['class' => 'span5', 'maxlength' => 9, 'empty' => 'Select delivery address']]]); ?> <?php echo $form->dropDownListGroup($model, 'currency_id', ['widgetOptions' => ['data' => Currency::getList(), 'htmlOptions' => ['class' => 'span5', 'empty' => 'Select currency']]]); ?> <?php echo $form->dropDownListGroup($model, 'temperature_id', ['widgetOptions' => ['data' => Temperature::getList(), 'htmlOptions' => ['class' => 'span5', 'empty' => 'Select temperature']]]); ?> <?php echo $form->datePickerGroup($model, 'valid_date', ['widgetOptions' => ['options' => ['format' => 'yyyy-mm-dd', 'startDate' => '0d', 'autoclose' => true], 'htmlOptions' => ['class' => 'span5', 'placeholder' => 'Select date']]]); ?> <?php echo $form->datePickerGroup($model, 'load_date', ['widgetOptions' => ['options' => ['format' => 'yyyy-mm-dd', 'startDate' => '0d', 'autoclose' => true], 'htmlOptions' => ['class' => 'span5', 'placeholder' => 'Select date']]]); ?> <?php
<?php $value = is_array($model->{$attributeName}) ? implode(", ", $model->{$attributeName}) : $model->{$attributeName}; $model->{$attributeName} = $value; if (!key_exists($attributeName, $model->range)) { $model->range[$attributeName] = array('from' => '', 'to' => ''); } $inputFrom = $form->textFieldGroup($model, "range[{$attributeName}][from]", ['label' => false, 'widgetOptions' => ['htmlOptions' => ['placeholder' => $attr->label . ' от', 'name' => "filter[range][{$attributeName}][from]", 'id' => $attributeId]]]); $inputTo = $form->textFieldGroup($model, "range[{$attributeName}][to]", ['label' => false, 'widgetOptions' => ['htmlOptions' => ['placeholder' => $attr->label . ' до', 'name' => "filter[range][{$attributeName}][to]", 'id' => $attributeId]]]); ?> <?php if ($viewType != 'simple') { $currencyList = CHtml::listData(Currency::getList(), 'id', 'code'); ?> <div class="form-group"> <div class="row"> <div class="col-sm-6"> <div class="input-group"> <span class="input-group-addon currency-icon"> <i class="fa fa-<?php echo key_exists($this->getCurrentCurrency(), $currencyList) ? $currencyList[$this->getCurrentCurrency()] : 'rub'; ?> "></i> </span> <?php echo $inputFrom; ?> </div> </div><!-- /.col-sm-6 --> <div class="col-sm-6">