Ejemplo n.º 1
0
<?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'user-form', 'enableAjaxValidation' => false));
?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php 
echo $form->errorSummary($model);
?>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'user_type_id');
?>
		<?php 
echo $form->dropDownList($model, 'user_type_id', UserType::All(), array('maxlength' => 10));
?>
		<?php 
echo $form->error($model, 'user_type_id');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'login');
?>
		<?php 
echo $form->textField($model, 'login', array('size' => 60, 'maxlength' => 255));
?>
		<?php 
echo $form->error($model, 'login');
Ejemplo n.º 2
0
<?php

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

<h1>Manage Users</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' => 'user-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('id', array('name' => 'user_type_id', 'value' => '$data->userType->name', 'filter' => UserType::All()), 'login', 'password', array('class' => 'CButtonColumn'))));