<?php
/* @var $this PrivilageController */
/* @var $model Privilage */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'privilage-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,'sys_m_module_id'); ?>
		<?php echo $form->dropDownList($model,'sys_m_module_id', CHtml::listData(AppController::model()->findAll(),'sys_m_module_id','sys_m_module_id'), 
                        array('empty'=>'Select', 'ajax' => array(  
                            'type'=>'POST', //request type  
                            'url'=>CController::createUrl('privilage/dinamis', array("sys_m_module_id"=>$model->sys_m_module_id)), //url to call.  
                            'data'=>'js:"sys_m_module_id="+jQuery(this).val()',  
                            'update'=>'#'.CHtml::activeId($model,'sys_m_controller_id'),  //selector to update   
                            ) 
                            )
                        ); 
                   ?> 
		
		<?php echo $form->error($model,'sys_m_module_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'sys_m_controller_id'); ?>
		<?php echo $form->dropDownList($model,'sys_m_controller_id',array(), array('prompt'=>'Select')); ?>
		<?php echo $form->error($model,'sys_m_controller_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'action'); ?>
		<?php echo $form->textField($model,'action',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'action'); ?>
	</div>


	<div class="row">
		<?php echo $form->labelEx($model,'desc'); ?>
		<?php echo $form->textArea($model,'desc',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'desc'); ?>
	</div>

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

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

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