<html>
<body>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript">
Ext.onReady(function(){
Ext.get("bt1").on("click",function(){
Ext.MessageBox.confirm("请确认","是否要注销用户?",function(button,text){
if(button=="yes"){
top.location.href='../index.php';
}
});
});
var mygroup;
Ext.get("bt2").on("click",function(){
Ext.QuickTips.init();//开启表单提示
var simple1=new Ext.form.FormPanel({
width:220,
labelAlign:"right",
height:140,
frame:true,
items:[
{ cls:'key',
xtype:"textfield",
fieldLabel:"请输入原密码",
name:"password",
anchor:"90%",
allowBlank:false,
blankText : ' 密码不能为空 ',
inputType:"password"},
{ cls:'key',
xtype:"textfield",
fieldLabel:"请输入新密码",
name:"password1",
anchor:"90%",
allowBlank:false,
blankText : ' 密码不能为空 ',
inputType:"password"},
{ cls:'key',
xtype:"textfield",
fieldLabel:"再次输入密码",
name:"password2",
anchor:"90%",
allowBlank:false,
blankText : ' 密码不能为空 ',
inputType:"password"},
{
layout:'column',
items:[{
buttons: [{
iconAlign:'right',
scale:"medium" ,
text: '确定',
handler: login
},{
scale:"medium" ,
iconAlign:'right',
text: '重置',
handler:function(){simple.form.reset();}//重置表单
}]
}]
}
]
});
function login(){
if(simple1.form.isValid()){//验证合法后使用加载进度条
Ext.MessageBox.show({
title: '请稍等',
msg: '正在提交...',
progressText: '',
width:300,
progress:true,
closable:false,
animEl: 'loading'
});
//控制进度速度
var f = function(v){
return function(){
var i = v/11;
Ext.MessageBox.updateProgress(i, '');
};
};
for(var i = 1; i < 13; i++){
setTimeout(f(i), i*150);
}
//提交到服务器操作
simple1.form.doAction('submit',{
url:'xiugaimima.php',//文件路径
method:'post',//提交方法post或get
params:'',
//提交成功的回调函数
success:function(form,action){
switch(action.result.msg){
case "ok":
{ Ext.Msg.alert('提示',"修改成功",function(button,text){
if(button=="ok"){
win.close();
simple1.close();
}
});
} break;
default:
Ext.Msg.alert('提示',action.result.msg);
}
},
//提交失败的回调函数
failure:function(){
Ext.Msg.alert('错误','服务器出现错误请稍后再试!');
}
});
}
}
var win=new Ext.Window({title:"窗口",
width:230,
height:160,
resizable :false, //改变window大小
manager:mygroup,
items:[simple1]
});
win.show();
});
});
</script>
<a style="background:url(images/user.gif) no-repeat left top; padding:3px 0 0 18px;" /><button id="bt1">注销退出</button>
<a style="background:url(images/key.gif) no-repeat left top; padding:4px 0 0 18px;" /><button id="bt2">更改密码</button><br />
<a style="background:url(images/home.gif) no-repeat left top; padding:3px 0 0 18px;" href="admin.php"><button id="bt3">查看首页</button></a>
<a style="background:url(images/style.gif) no-repeat left top; padding:4px 0 0 18px;"/></a>
<!--<select onChange="changeSkin(this.value)">
<option value="ext-all">默认风格</option>
<option value="xtheme-gray">银白风格</option>
<option value="xtheme-slate">深蓝风格</option>
</select>-->
</body>
</html>
评论2
最新资源