<?php echo $this->render('admin/header.phtml'); ?>


<script type="text/javascript" language="javascript">

	$(document).ready(function () {		

		<?php if( isset( $this->editUserChangeStatus ) ){ ?>
			alertify.success("<i class='fa fa-check'></i> <?php echo @Lib_Lang::translate(admin_users_changestatus_success); ?>");
		<?php } ?>	

		<?php if( isset( $this->editUserChangePass ) ){ ?>
			alertify.success("<i class='fa fa-check'></i> <?php echo @Lib_Lang::translate(admin_users_changepass_success); ?>");
		<?php } ?>		

		<?php if( isset( $this->editUserSuccess ) ){ ?>
			alertify.success("<i class='fa fa-check'></i> <?php echo @Lib_Lang::translate(admin_users_edituser_success); ?>");
		<?php } ?>		
		
		
	});

</script>

<div class="container">		

<?php echo $this->render('admin/menu.phtml'); ?>



<?php echo $this->render('admin/usersmenu.phtml'); ?>
	



<script type="text/javascript" language="javascript">

	$(document).ready(function () {
	
		$('#genPassButton').click(function(){			
			$('[name="admin_pass"]').focus();
			$('[name="admin_pass"]').val(randString(8));			
		});
	
	
	

		$('#formEditUser').validate({
			errorClass: "formError",
			errorElement: "div",
			rules: {
				admin_login: {
					required: true,
					accept: "^[a-zA-Z0-9]+$"
				},
				admin_firstname: {
					required: true
				},
				admin_secondname: {
					required: true
				},
				admin_email: {
					required: true,
					email: true
				}
			},
			messages: {
				admin_login: {
					required: "<?php echo @Lib_Lang::translate(admin_users_login_required); ?>",
					accept: "<?php echo @Lib_Lang::translate(admin_users_login_accept); ?>"
				},
				admin_firstname: {
					required: "<?php echo @Lib_Lang::translate(admin_users_firstname_required); ?>"
				},
				admin_secondname: {
					required: "<?php echo @Lib_Lang::translate(admin_users_secondname_required); ?>"
				},
				admin_email: {
					required: "<?php echo @Lib_Lang::translate(admin_users_email_required); ?>",
					email: "<?php echo @Lib_Lang::translate(admin_users_email_email); ?>"
				}
			}
		});	
	
	
	});

</script>

	
	<div class="row">
		<div class="col-xs-3 col-sm-3 col-md-3">
			<h3><?php echo @Lib_Lang::translate(admin_users_edit_top); ?></h3>
		</div>
		<div class="col-xs-9 col-sm-9 col-md-9 text-right">
			<?php echo @Lib_Lang::translate(admin_users_stat_option); ?> <a href="<?php echo @$this->url(array('controller' => 'admin', 'action' => 'usershistory', 'id' => $this->userData['admin_id']), 'default', true); ?>" class="btn btn-primary btn-sm"><i class='fa fa-history'></i> <?php echo @Lib_Lang::translate(admin_users_stat_history); ?></a>
		</div>
	</div>


		
	<form id="formEditUser" method="post" class="form-horizontal">
	
	<div class="row">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right formLabelMarginTop"><?php echo @Lib_Lang::translate(admin_users_login); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8"><input maxlength="50" name="admin_login" class="form-control" disabled value="<?php echo$this->userData['admin_login']; ?>" /></div>
	</div>
	
	<div class="row">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right formLabelMarginTop"><?php echo @Lib_Lang::translate(admin_users_firstname); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8"><input maxlength="100" name="admin_firstname" class="form-control" <?php if( $this->userData['admin_noedit'] == 1 )echo'disabled'; ?> value="<?php echo$this->userData['admin_firstname']; ?>" /></div>
	</div>
	
	<div class="row">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right formLabelMarginTop"><?php echo @Lib_Lang::translate(admin_users_secondname); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8"><input maxlength="100" name="admin_secondname" class="form-control" <?php if( $this->userData['admin_noedit'] == 1 )echo'disabled'; ?> value="<?php echo$this->userData['admin_secondname']; ?>" /></div>
	</div>
	
	<div class="row">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right formLabelMarginTop"><?php echo @Lib_Lang::translate(admin_users_email); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8"><input maxlength="100" name="admin_email" class="form-control" <?php if( $this->userData['admin_noedit'] == 1 )echo'disabled'; ?> value="<?php echo$this->userData['admin_email']; ?>" /></div>
	</div>
	
	<?php if( $this->userData['admin_noedit'] != 1 ){ ?> 
	<div class="row">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right"></div>
		<div class="col-xs-12 col-sm-8 col-md-8"><input name="admin_edituser" class="btn btn-info form-control" type="submit" value="<?php echo @Lib_Lang::translate(admin_users_edit_button); ?>" /></div>
	</div>
	<?php } ?> 
	
	</form>	
	
	
	
	
	
	<?php if( $this->userData['admin_noedit'] != 1 ){ ?> 
	


<script type="text/javascript" language="javascript">

	$(document).ready(function () {
	
		$('#genPassButton').click(function(){			
			$('[name="admin_pass"]').focus();
			$('[name="admin_pass"]').val(randString(8));			
		});
	
	

		$('#formResetpassUser').validate({
			errorClass: "formError",
			errorElement: "div",
			rules: {
				admin_pass: {
					required: true
				}
			},
			messages: {
				admin_pass: {
					required: "<?php echo @Lib_Lang::translate(admin_users_pass_required); ?>"
				}
			}
		});	
	
	});

</script>
	
	<div class="row">
		<div class="col-xs-12 col-sm-12 col-md-12">
			<h3><?php echo @Lib_Lang::translate(admin_users_passreset_top); ?></h3>
		</div>
	</div>
	
	<form id="formResetpassUser" method="post" class="form-horizontal">
	
	
	<div class="row">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right formLabelMarginTop"><?php echo @Lib_Lang::translate(admin_users_resetpass); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8"><input maxlength="50" name="admin_pass" class="form-control" /></div>
	</div>
	
	<div class="row text-right"><div class="col-xs-12 col-sm-12 col-md-12"><a href="javascript:void(0);" id="genPassButton" class="btn btn-primary btn-xs"><i class='fa fa-random'></i> <?php echo @Lib_Lang::translate(admin_users_genpass); ?></a></div></div>
	
	<div class="row">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right"></div>
		<div class="col-xs-12 col-sm-8 col-md-8"><input name="admin_resetpassuser" class="btn btn-info form-control" type="submit" value="<?php echo @Lib_Lang::translate(admin_users_resetpass_button); ?>" /></div>
	</div>
	
	</form>	
	
	
	
	
	<div class="row">
		<div class="col-xs-12 col-sm-12 col-md-12">
			<h3><?php echo @Lib_Lang::translate(admin_users_lock_top); ?></h3>
		</div>
	</div>
	
	
	<form id="formResetpassUser" method="post" class="form-horizontal">
	
	
	<div class="row">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right formLabelMarginTop"><?php echo @Lib_Lang::translate(admin_users_lockaccount); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8">
			<select name="admin_lock" class="form-control">
				<option value="0" <?php if( $this->userData['admin_lock'] == 0 ) echo'selected'; ?>><?php echo @Lib_Lang::translate(admin_users_lock_active); ?></option>
				<option value="1" <?php if( $this->userData['admin_lock'] == 1 ) echo'selected'; ?>><?php echo @Lib_Lang::translate(admin_users_lock_blockade); ?></option>
			</select>		
		</div>
	</div>
	
	<div class="row">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right"></div>
		<div class="col-xs-12 col-sm-8 col-md-8"><input name="admin_changestatususer" class="btn btn-info form-control" type="submit" value="<?php echo @Lib_Lang::translate(admin_users_change_lock); ?>" /></div>
	</div>
	
	
	</form>	
	
	<?php } ?> 
	
	
	
		
</div>

<?php echo $this->render('admin/footer.phtml'); ?>