Example #1
0
		<?php 
echo $form->labelEx($model, 'parent_id');
?>
		<?php 
echo $form->dropDownList($model, 'parent_id', GxHtml::listDataEx(CompanyStructure::model()->findAllAttributes(null, true)));
?>
		<?php 
echo $form->error($model, 'parent_id');
?>
		</div><!-- row -->
		<div class="row">
		<?php 
echo $form->labelEx($model, 'type_id');
?>
		<?php 
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');
?>
Example #2
0
<?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 (&lt;, &lt;=, &gt;, &gt;=, &lt;&gt; 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'))));