bnbweb/temp/compiled/agent/change_password.htm.php

145 lines
4.2 KiB
PHP
Raw Normal View History

2022-11-14 17:31:15 +00:00
<!-- $Id: privilege_info.htm 16616 2009-08-27 01:56:35Z liuhui $ -->
<?php echo $this->fetch('pageheader.htm'); ?>
<div class="main-div">
<form name="theForm" method="post" enctype="multipart/form-data" onsubmit="return validate();">
<table id="form-table" class="table table-bordered table-hover">
<tr>
<td><?php echo $this->_var['lang']['user_name']; ?></td>
<td><?php echo htmlspecialchars($this->_var['user_name']); ?></td>
</tr>
<tr>
<td><?php echo $this->_var['lang']['new_password']; ?></td>
<td>
<input type="password" name="new_password" maxlength="32" size="34" /><?php echo $this->_var['lang']['require_field']; ?></td>
</tr>
<tr>
<td><?php echo $this->_var['lang']['pwd_confirm']; ?></td>
<td>
<input type="password" name="pwd_confirm" value="" size="34" /><?php echo $this->_var['lang']['require_field']; ?></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="<?php echo $this->_var['lang']['button_submit']; ?>" class="button" />&nbsp;&nbsp;&nbsp;
<input type="reset" value="<?php echo $this->_var['lang']['button_reset']; ?>" class="button" />
<input type="hidden" name="act" value="<?php echo $this->_var['form_act']; ?>" />
<input type="hidden" name="token" value="<?php echo $this->_var['token']; ?>" />
<input type="hidden" name="id" value="<?php echo $this->_var['agent_id']; ?>" /></td>
</tr>
</table>
</form>
</div>
<?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js,validator.js')); ?>
<script language="JavaScript">
var action = "<?php echo $this->_var['action']; ?>";
<!--
document.forms['theForm'].elements['user_name'].focus();
onload = function()
{
}
/**
* 切换增加按钮的状态
*/
function toggleAddButton()
{
var sel = document.getElementById("all_menu_list");
document.getElementById("btnAdd").disabled = (sel.selectedIndex > -1) ? false : true;
}
/**
* 切换移出,上移,下移按钮状态
*/
function toggleButtonSatus()
{
var sel = document.getElementById("menus_navlist");
document.getElementById("btnRemove").disabled = (sel.selectedIndex > -1) ? false : true;
document.getElementById("btnMoveUp").disabled = (sel.selectedIndex > -1) ? false : true;
document.getElementById("btnMoveDown").disabled = (sel.selectedIndex > -1) ? false : true;
}
/**
* 移动选定的列表项
*/
function moveOptions(direction)
{
var sel = document.getElementById('menus_navlist');
if (sel.selectedIndex == -1)
{
return;
}
len = sel.length
for (i = 0; i < len; i++)
{
if (sel.options[i].selected)
{
if (i == 0 && direction == 'up')
{
return;
}
newOpt = sel.options[i].cloneNode(true);
sel.removeChild(sel.options[i]);
tarOpt = (direction == "up") ? sel.options[i-1] : sel.options[i+1]
sel.insertBefore(newOpt, tarOpt);
newOpt.selected = true;
break;
}
}
}
/**
* 检查表单输入的数据
*/
function validate()
{
get_navlist();
validator = new Validator("theForm");
validator.password = function (controlId, msg)
{
var obj = document.forms[this.formName].elements[controlId];
obj.value = Utils.trim(obj.value);
if (!(obj.value.length >= 6 && /\d+/.test(obj.value) && /[a-zA-Z]+/.test(obj.value)))
{
this.addErrorMsg(msg);
}
}
if (action == "add")
{
if (document.forms['theForm'].elements['password'])
{
validator.password("password", password_invaild);
validator.eqaul("password", "pwd_confirm", password_error);
}
}
if (action == "edit" || action == "modif")
{
if (document.forms['theForm'].elements['old_password'].value.length > 0)
{
validator.password("new_password", password_invaild);
validator.eqaul("new_password", "pwd_confirm", password_error);
}
}
return validator.passed();
}
function get_navlist()
{
if (!document.getElementById('nav_list[]'))
{
return;
}
document.getElementById('nav_list[]').value = joinItem(document.getElementById('menus_navlist'));
//alert(document.getElementById('nav_list[]').value);
}
//-->
</script>
<?php echo $this->fetch('pagefooter.htm'); ?>