<?php
/* @var $this UserRoleController */
/* @var $model UserRole */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'user-role-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_id'); ?>
                <?php echo $form->dropDownList($model,'user_id',CHtml::listData(User::model()->findAll(array('order'=>'username asc')) ,'sys_m_user_id','username'),array('id'=>'username','prompt'=>'-Select- '));?>
		<?php //echo $form->error($model,'user_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'sys_m_role_id'); ?>
                <?php echo $form->dropDownList($model,'sys_m_role_id',CHtml::listData(Role::model()->findAll(array('order'=>'name asc')) ,'sys_m_role_id','name'),array('id'=>'name','prompt'=>'-Select- '));?>
		<?php //echo $form->error($model,'sys_m_role_id'); ?>
	</div>

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

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

</div><!-- form -->