Файл: modules/profile/tmpls/edit.html
Строк: 103
<?php
{{if({uid}!=0)}}
<h1>Редактирование данных</h1><hr />
<div class="modal fade" id="passModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
<form class="form-horizontal" id="changepass">
<div class="control-group">
<label class="control-label" for="">Старый пароль</label>
<div class="controls">
<input name="old" type="password" placeholder="" value="">
</div>
</div>
<div class="control-group">
<label class="control-label" for="">Новый пароль</label>
<div class="controls">
<input name="password" type="password" placeholder="" value="">
</div>
</div>
<div class="control-group">
<label class="control-label" for="">Повторите пароль</label>
<div class="controls">
<input name="password2" type="password" placeholder="" value="">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-primary" id="confirmpass">Save changes</button>
</div>
</div>
<script>
$(function(){
$('#passModal').modal({
keyboard: false,
show:false
});
$('#confirmpass').click(function(){
$.post("/ajax/profile/changepass",$('#changepass').serialize()).done(function(data) {
if(data=='ok'){
Noty.Show('green','Пароль успешно изменён');
$('#passModal').modal('hide');
} else if(data=='password'){
Noty.Show('red','Старый пароль указан неверно','error');
$('#passmodal input[name=old]').parent().parent().addClass('error');
} else if(data=='password2'){
Noty.Show('red','Пароли не совпадают','error');
$('#passmodal input[name=password').parent().parent().addClass('error');
$('#passmodal input[name=password2]').parent().parent().addClass('error');
}
});
});
});
</script>
<form class="form-horizontal" id="edit">
<div class="control-group">
<label class="control-label" for="">Имя</label>
<div class="controls">
<input name="name" type="text" placeholder="" value="{name}">
</div>
</div>
<div class="control-group">
<label class="control-label" for="">Фамилия</label>
<div class="controls">
<input name="lastname" type="text" placeholder="" value="{lastname}">
</div>
</div>
<div class="control-group">
<label class="control-label" for="">Пароль</label>
<div class="controls">
<a href="#passModal" role="button" class="btn" data-toggle="modal">Поменять пароль</a>
</div>
</div>
<div class="control-group">
<label class="control-label" for="">День рождения</label>
<div class="controls">
<script type="text/javascript">
$(function(){
$('.birth-day [value="'+{bday}+'"]').attr('selected',true);
$('.birth-month [value="'+{bmonth}+'"]').attr('selected',true);
$('.birth-year [value="'+{byear}+'"]').attr('selected',true);
});
</script>
<div id="datepicker"></div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="">Код безопасности</label>
<div class="controls">
<img src="/secure.php" id="secure" align="absmiddle" onclick="LoadCaptcha()" /> <input name="seckey" style="width:70px;height:27px;">
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Сохранить</button>
<button type="button" class="btn btn-inverse" onclick="return:false;">Отмена</button>
</div>
<div id="status"></div>
</form>
{{else}}
<div class="alert alert-error">Ошибка доступа.</div>
{{endif}}
?>