Ejemplo n.º 1
0
<?php

/* @var $this GroupController */
/* @var $model Group */
$this->breadcrumbs = array('Groups' => array('index'), 'Manage');
$this->menu = array(array('label' => 'List Group', 'url' => array('index')), array('label' => 'Create Group', '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\$('#group-grid').yiiGridView('update', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h1>Manage Groups</h1>

<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>

<?php 
echo CHtml::link('Advanced Search', '#', array('class' => 'search-button'));
?>
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'group-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('id' => ['name' => 'id', 'htmlOptions' => ['width' => 30]], 'name', 'faculty_id' => ['name' => 'faculty_id', 'value' => '$data->faculty->name', 'filter' => Faculty::all()], 'direction_id' => ['name' => 'direction_id', 'value' => '$data->direction->name', 'filter' => Direction::all()], array('class' => 'CButtonColumn'))));
Ejemplo n.º 2
0
echo $form->labelEx($model, 'faculty_id');
?>
		<?php 
echo $form->dropDownList($model, 'faculty_id', Faculty::all());
?>
		<?php 
echo $form->error($model, 'faculty_id');
?>
	</div>
<br>
	<div class="row">
		<?php 
echo $form->labelEx($model, 'direction_id');
?>
		<?php 
echo $form->dropDownList($model, 'direction_id', Direction::all());
?>
		<?php 
echo $form->error($model, 'direction_id');
?>
	</div>

	<div class="row buttons">
		<?php 
echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
	</div>

<?php 
$this->endWidget();
?>