<?php $this->breadcrumbs = array($model->label(2) => array('index'), 'Manage'); $this->menu = array(array('label' => 'List' . ' ' . $model->label(2), 'url' => array('index')), array('label' => 'Create' . ' ' . $model->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('company-structure-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n"); ?> <h1><?php echo 'Manage' . ' ' . GxHtml::encode($model->label(2)); ?> </h1> <p> You may optionally enter a comparison operator (<, <=, >, >=, <> or =) at the beginning of each of your search values to specify how the comparison should be done. </p> <?php echo GxHtml::link('Advanced Search', '#', array('class' => 'search-button')); ?> <div class="search-form"> <?php $this->renderPartial('_search', array('model' => $model)); ?> </div><!-- search-form --> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'company-structure-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('id', 'name', array('name' => 'parent_id', 'value' => 'GxHtml::valueEx($data->parent)', 'filter' => GxHtml::listDataEx(CompanyStructure::model()->findAllAttributes(null, true))), array('name' => 'type_id', 'value' => 'GxHtml::valueEx($data->type)', 'filter' => GxHtml::listDataEx(CompanyStructureType::model()->findAllAttributes(null, true))), array('name' => 'location_id', 'value' => 'GxHtml::valueEx($data->location)', 'filter' => GxHtml::listDataEx(Location::model()->findAllAttributes(null, true))), 'create_at', array('class' => 'CButtonColumn'))));
echo $form->dropDownList($model, 'type_id', GxHtml::listDataEx(CompanyStructureType::model()->findAllAttributes(null, true))); ?> <?php echo $form->error($model, 'type_id'); ?> </div><!-- row --> <div class="row"> <?php echo $form->labelEx($model, 'location_id'); ?> <?php echo $form->dropDownList($model, 'location_id', GxHtml::listDataEx(Location::model()->findAllAttributes(null, true))); ?> <?php echo $form->error($model, 'location_id'); ?> </div><!-- row --> <label><?php echo GxHtml::encode($model->getRelationLabel('companyStructures')); ?> </label> <?php echo $form->checkBoxList($model, 'companyStructures', GxHtml::encodeEx(GxHtml::listDataEx(CompanyStructure::model()->findAllAttributes(null, true)), false, true)); ?> <?php echo GxHtml::submitButton('Save'); $this->endWidget(); ?> </div><!-- form -->
<div class="row"> <?php echo $form->label($model, 'name'); ?> <?php echo $form->textField($model, 'name', array('maxlength' => 128)); ?> </div> <div class="row"> <?php echo $form->label($model, 'parent_id'); ?> <?php echo $form->dropDownList($model, 'parent_id', GxHtml::listDataEx(CompanyStructure::model()->findAllAttributes(null, true)), array('prompt' => 'All')); ?> </div> <div class="row"> <?php echo $form->label($model, 'type_id'); ?> <?php echo $form->dropDownList($model, 'type_id', GxHtml::listDataEx(CompanyStructureType::model()->findAllAttributes(null, true)), array('prompt' => 'All')); ?> </div> <div class="row"> <?php echo $form->label($model, 'location_id');