<?php echo $form->error($model, 'brand_id'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'category_id'); ?> <?php if (isset($model->id)) { $id = $model->id; } else { $id = '0'; } echo $form->dropDownList($model, 'category_id', Category::TreeArray(false), array('empty' => 'выберите категорию', 'encode' => false, 'ajax' => array('type' => 'POST', 'url' => $this->createUrl('good/featurelist'), 'data' => 'js:{"id":' . $id . ', "cat_id":this.value}', 'success' => 'function(html){ $("#good-features").html(html); }'))); ?> <?php echo $form->error($model, 'category_id'); ?> </div> <div class="row"> <?php if (!$model->isNewRecord) { echo Yii::t('main-ui', 'Check picture if delete'); echo $model->GetGoodImagesWithCheckbox('s'); } ?>
$form = $this->beginWidget('CActiveForm', array('id' => 'category-form', 'enableAjaxValidation' => false)); ?> <p class="note">Fields with <span class="required">*</span> are required.</p> <?php echo $form->errorSummary($model); echo $form->hiddenField($model, 'id'); ?> <div class="row"> <?php echo $form->labelEx($model, 'parentId'); ?> <?php echo $form->dropDownList($model, 'parentId', Category::TreeArray(), array('encode' => false, 'empty' => Yii::t('main-ui', 'Корневой раздел'))); ?> <?php echo $form->error($model, 'parentId'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'name'); ?> <?php echo $form->textField($model, 'name', array('size' => 60, 'maxlength' => 250)); ?> <?php echo $form->error($model, 'name');
echo $form->labelEx($model, 'name'); ?> <?php echo $form->textField($model, 'name', array('size' => 60, 'maxlength' => 250)); ?> <?php echo $form->error($model, 'name'); ?> </div> <div class="row"> <?php CHtml::label('Category', 'category_id_select'); ?> <?php echo CHtml::dropDownList('category_id', $model->isNewRecord ? '' : $model->attrGroup->category_id, Category::TreeArray(false), array('empty' => 'выберите категорию', 'encode' => false, 'onchange' => 'GetCategoryGroups(this.value, \'' . $this->createUrl('group/CategoryGroupsOptions') . '\')', 'id' => 'category_id_select')); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'attr_group_id'); ?> <?php echo $form->dropDownList($model, 'attr_group_id', $model->isNewRecord ? array() : CHtml::listData(AttrGroup::model()->findAll('category_id=' . $model->attrGroup->category_id), 'id', 'name'), array('onchange' => 'GetGroupAttributes(this.value);')); ?> <?php echo $form->error($model, 'attr_group_id'); ?> </div>
$form = $this->beginWidget('CActiveForm', array('id' => 'attr-group-form', 'enableAjaxValidation' => false)); ?> <p class="note">Fields with <span class="required">*</span> are required.</p> <?php echo $form->errorSummary($model); echo $form->hiddenField($model, 'id'); ?> <div class="row"> <?php echo $form->labelEx($model, 'category_id'); ?> <?php echo $form->dropDownList($model, 'category_id', Category::TreeArray(false), array('empty' => 'выберите категорию', 'encode' => false, 'ajax' => array('type' => 'POST', 'url' => $this->createUrl('group/CategoryGroupsList'), 'data' => 'js:{"cat_id":this.value}', 'cache' => false, 'success' => 'function(data){ $("#cat-groups").html(data); }'))); ?> <?php echo $form->error($model, 'category_id'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'name'); ?> <?php $this->widget('zii.widgets.jui.CJuiAutoComplete', array('model' => $model, 'attribute' => 'name', 'name' => 'attr-group-name', 'source' => AttrGroup::GetGroupNames(), 'options' => array('minLength' => '1'), 'htmlOptions' => array('style' => 'width:400px;'))); ?>
<?php $this->breadcrumbs = array('Товары' => array('index'), 'Управление товарами'); $this->menu = array(array('label' => 'Список товаров', 'url' => array('index')), array('label' => 'Добавить товар', 'url' => array('create'))); Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('good-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n"); ?> <h1>Управление товарами</h1> <p> You may optionally enter a comparison operator (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></b> or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done. </p> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'good-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('id', 'name', 'price', array('name' => 'brand_id', 'type' => 'raw', 'filter' => CHtml::listData(Brand::model()->findAll(), 'id', 'name'), 'value' => '$data->brand->name'), array('name' => 'category_id', 'type' => 'raw', 'filter' => Category::TreeArray(false), 'value' => '$data->category->name'), array('name' => 'image', 'type' => 'raw', 'value' => 'count($data->goodImages)'), array('class' => 'CButtonColumn'))));
<?php $this->breadcrumbs = array('Управление группами характеристик'); $this->menu = array(array('label' => 'Добавить группу характеристик', 'url' => array('create'))); ?> <h1>Управление группами характеристик</h1> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'attr-group-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('name' => 'category_id', 'type' => 'raw', 'filter' => Category::TreeArray(false), 'value' => '$data->category->name'), 'name', 'pos', array('class' => 'CButtonColumn', 'template' => '{update}{delete}'))));