<?php
use yii\widgets\ActiveForm;
use common\models\User;
use yii\helpers\Html;
use qcbase\models\Auth;
use qcbase\models\Department;

$form = ActiveForm::begin([
	'id' => 'main-form',
	'action' => $action,
	'fieldConfig' => [
		'options' => ['tag' => 'tr'],
		'template' => "<th width='120'>{label}</th><td>{input}{hint}{error}</td>",
	]
]);
?>

	<div class="h_a">基本属性</div>
	<div class="table_full">
		<table width="100%">

			<?= $form->field($model, 'username')->textInput(['class' => 'input length_5']) ?>

			<?= $form->field($model, 'password')->passwordInput(['class' => 'input length_5' ,'placeholder' => $model->isNewRecord ? '长度至少6位' : '不需要修改密码则留空']) ?>

			<?= $form->field($model, 'user_no')->textInput(['class' => 'input length_5']) ?>

			<?= $form->field($model, 'role')->dropDownList(Auth::getDropDownRoleList(), ['multiple' => true, 'style' => 'height:200px;']) ?>

			<?= $form->field($model, 'depts')->dropDownList(Department::getDropDownList(), ['multiple' => true, 'style' => 'height:200px;']) ?>

			<?= $form->field($model, 'realname')->textInput(['class' => 'input length_5']) ?>

			<?= $form->field($model, 'email')->textInput(['class' => 'input length_5']) ?>

			<?= $form->field($model, 'gender')->radioList(User::getGenderList(), ['class' => 'switch_list']) ?>

			<?= $form->field($model->info, 'phone')->textInput(['class' => 'input length_5']) ?>

			<?= $form->field($model->info, 'qq')->textInput(['class' => 'input length_5']) ?>

			<?= $form->field($model->info, 'remark')->textarea(['style' => 'width:290px']) ?>

			<?= $form->field($model, 'status')->radioList(User::getStatusList(), ['class' => 'switch_list']) ?>

		</table>
	</div>

	<?= ($model->isNewRecord)?'':Html::hiddenInput('id' ,$model->user_id); ?>

	<div class="btn_wrap">
		<div class="btn_wrap_pd">
			<?= Html::submitButton('提交', ['class' => 'btn btn_submit mr10']) ?>
		</div>
	</div>

<?php ActiveForm::end(); ?>
