
<script>
	$(document).ready(function(){
	  $("#regform").validationEngine();
	}); 
</script>

<?php 
if(isset($success))
	echo '<p id="success" class="msg done">'.$success.'</p>';
if(isset($error))
	echo '<p id="error" class="msg error">'.$error.'</p>';
?>

<form action="" method="post" id="regform">

	<fieldset class="b-form_fieldset ng-scope">
	    
	    <div class="b-form_fieldset_title ng-binding" ng-hide=" !block.name ">
			<h3>Ma'lumotlarni tahrirlash</h3>
	    </div>

	    <div class="ng-scope">
	        <div class="b-field ng-scope">
	            <div class="b-field__name ng-binding">
	                Login
	            </div>
	            <div class="b-field__input ng-scope">
	            	<input type="hidden" name="userid" value="<?=$userdetails->user_id;?>">
	                <input type="text" name="username" style="background: rgb(224, 255, 221);" value="<?=$userdetails->username;?>" readonly="readonly" class="b-field__type ng-pristine ng-untouched ng-valid ng-scope">
	                <?=form_error('username'); ?>
	            </div>
	        </div>
	    </div>
	    <div class="ng-scope">
	        <div class="b-field ng-scope">
	            <div class="b-field__name ng-binding">
	                Ismingiz
	            </div>
	            <div class="b-field__input ng-scope">
	                <input type="text" name="firstname" size="39" value="<?=$userdetails->firstname;?>" class="b-field__type ng-pristine ng-untouched ng-valid ng-scope">
	                <?=form_error('firstname'); ?>
	            </div>
	        </div>
	    </div>
	    <div class="ng-scope">
	        <div class="b-field ng-scope">
	            <div class="b-field__name ng-binding">
	                Familyangiz
	            </div>
	            <div class="b-field__input ng-scope">
	                <input type="text" name="lastname" size="39" value="<?=$userdetails->lastname;?>" class="b-field__type ng-pristine ng-untouched ng-valid ng-scope">
	                <?=form_error('lastname'); ?>
	            </div>
	        </div>
	    </div>
	    <div class="ng-scope">
	        <div class="b-field ng-scope">
	            <div class="b-field__name ng-binding">
	                Email manzilingiz
	            </div>
	            <div class="b-field__input ng-scope">
	                <input type="text" name="email" size="39" value="<?=$userdetails->email;?>" class="b-field__type ng-pristine ng-untouched ng-valid ng-scope">
	                <?=form_error('email'); ?>
	            </div>
	        </div>
	    </div>

	</fieldset>

	<fieldset class="b-form_fieldset ng-scope">
	    
	    <div class="b-form_fieldset_title ng-binding" ng-hide=" !block.name ">
			<h3>Parolni o'zgartirish</h3>
	    </div>

	    <div class="ng-scope">
	        <div class="b-field ng-scope">
	            <div class="b-field__name ng-binding">
	                Yangi parol
	            </div>
	            <div class="b-field__input ng-scope">
	                <input type="password" name="newpassword" id="newpassword" size="39" class="b-field__type ng-pristine ng-untouched ng-valid ng-scope">
	                <?=form_error('newpassword'); ?>
	            </div>
	        </div>
	    </div>
	    <div class="ng-scope">
	        <div class="b-field ng-scope">
	            <div class="b-field__name ng-binding">
	                Yangi parolni takroran yozing
	            </div>
	            <div class="b-field__input ng-scope">
	                <input type="password" name="confirmnewpassword" size="39" class="b-field__type ng-pristine ng-untouched ng-valid ng-scope">
	                <?=form_error('confirmnewpassword'); ?>
	            </div>
	        </div>
	    </div>
	    <div class="ng-scope">
	        <div class="b-field ng-scope">
	            <div class="b-field__name ng-binding">
	                <font color="red">O'zgarishni saqlash uchun joriy parolni kiriting</font>
	            </div>
	            <div class="b-field__input ng-scope">
	                <input type="password" name="currentpassword" size="39" class="b-field__type ng-pristine ng-untouched ng-valid ng-scope">
	                <?=form_error('currentpassword'); ?>
	            </div>
	        </div>
	    </div>

	</fieldset>

	<div class="b-button__inline">
	    <input type="submit" name="updateprofilebttn" value="Saqlash" class="b-button">
	    <a href="/users/" class="b-button b-button__white">bekor qilish</a>
	</div>

</form>
