<script type="text/javascript">
<!--
function openDialog(value) {
	$('#Label_name').val(value);
	$("#dialog").dialog("open");
}

function check(checker, module)
{
    $('#' + module + ' input').each(function()
    {
        $(this).attr("checked", checker.checked);
    });
}

function checkall(checker)
{
    $('input').each(function()
    {
        $(this).attr("checked", checker.checked)
    });
}

function submitDone(){
    alert("设置成功");
    //window.location.reload();
}
//-->
</script>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'manager-form',
    'enableAjaxValidation'=>false,
));
?>

    <fieldset>
    <legend><?php echo $title;?></legend>
    <div>
        <label>
        <?php echo CHtml::hiddenField('username', $username);?>
        <?php echo '用户名:'.$username ?>
        </label>
        <br>

        <!--角色权限 开始//-->
      <?php $this->renderPartial('_roleform', array(
                'roles'=>$roles,
                'hasoperations'=>$hasoperations,
        )); ?>
        <!--角色权限 结束//-->
        <br>
        <input type='checkbox' onclick='checkall(this)' />全选
        <?php echo CHtml::ajaxSubmitButton('提交',array('assignuser'),array('success'=>'submitDone()'));?>
    </div>
    </fieldset>
 <?php $this->endWidget(); ?>
</div>

<?php $this->widget('admin.widgets.CreateLabelDialog');?>

