<?php
/* @var $this UsersController */
/* @var $model Users */
/* @var $form CActiveForm */
?>


<div class="form-normal form-horizontal clearfix">
	<div class="col-lg-9 col-md-10">

		<?php $form = $this->beginWidget('CActiveForm', array(
			'id' => 'users-form',
			'enableAjaxValidation' => FALSE,
			'enableClientValidation' => true,
			'clientOptions' => array(
				'validateOnSubmit' => true,
			),
			'errorMessageCssClass' => 'label label-danger',
			'htmlOptions' => array('class' => 'form-horizontal', 'role' => 'form')
		)); ?>

		<?php echo $form->errorSummary($model, null, null, array('class' => 'alert alert-warning')); ?>

		<div class="form-group">

			<div class="col-sm-4 control-label">
				<?php echo $form->labelEx($model, 'username'); ?>
			</div>

			<div class="col-sm-8">
				<?php echo $form->error($model, 'username'); ?>
				<?php echo $form->textField($model, 'username', array('class' => 'form-control', 'placeholder' => 'Username')); ?>
			</div>

		</div>


		<div class="form-group">

			<div class="col-sm-4 control-label">
				<?php echo $form->labelEx($model, 'password'); ?>
			</div>

			<div class="col-sm-8">
				<?php echo $form->error($model, 'password'); ?>
				<?php echo $form->passwordField($model, 'password', array('class' => 'form-control', 'placeholder' => 'Type Password')); ?>
			</div>

		</div>


		<div class="form-group">

			<div class="col-sm-4 control-label">
				<?php echo $form->labelEx($model, 'division'); ?>
			</div>

			<div class="col-sm-8">
				<?php echo $form->error($model, 'division'); ?>
				<?php
				echo $form->dropDownList(
					$model,
					"division",
					CHtml::listData(
						Village::model()->findall(array('condition' => 'status=1')),
						'id_village',
						'name'
					),
					array("empty" => "-- Unit Kerja --", 'class' => 'select2 form-control')
				);
				?>

			</div>

		</div>


		<div class=" form-group">

			<div class="col-sm-4 control-label">
				<?php echo $form->labelEx($model, 'level'); ?>
			</div>

			<div class="col-sm-8 be-radio">
				<?php echo $form->error($model, 'level'); ?>
				<?php
				echo $form->radioButtonList(
					$model,
					'level',
					array('2' => 'Petugas Kelurahan', '3' => 'Petugas Kecamatan'),
					array(
						'template' => '{input}{label}',
						'separator' => '',
						'labelOptions' => array(
							'style' => 'padding-right:20px;margin-left:15px'
						),

					)
				);
				?>
			</div>

		</div>


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

<div class="panel-footer text-right">
	<?php echo CHtml::submitButton($model->isNewRecord ? 'Simpan' : 'Edit', array('class' => 'btn btn-info btn-flat pull-right')); ?>
	<BR><BR>
</div>

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