<!--#include file=../system/include/config.asp-->
<!--#include file=../share/conn_system.asp-->
<!--#include file=../system/include/access.asp-->
<!--#include file=../system/include/function.asp-->

<%
	dim newpass,oldpass,confirmpass,strSql,rs
	newpass=request("newpass")	
	oldpass=request("oldpass")
	confirmpass=request("confirm")
	if oldpass="" then
		out("请输入旧密码！")
		response.write "<a href=""javascript:window.go(-1)"">返回</a>！"
		response.end
	end if

	if newpass="" then
		out("请输入新密码！")
		response.write "<a href=""javascript:window.go(-1)"">返回</a>！"
		response.end
	end if

	if confirmpass="" then
		out("请输入确认密码！")
		response.write "<a href=""javascript:window.go(-1)"">返回</a>！"
		response.end
	end if
	
	
	set rs=Server.CreateObject("Adodb.RecordSet")
	strSql="select * from [user_zj] where id=" & session("zj_id")
	rs.Open strSql,conn,3,3

	if rs.eof then
		out("找不到该用户！")
	else
		if rs("password")=oldpass then
			rs("password")=newpass
			rs.update %>
<SCRIPT LANGUAGE=vbscript>
<!--
msgbox("恭喜您! 密码修改成功!")
window.top.location.href="index.asp"
-->
</SCRIPT>
			
		<% else %>
<SCRIPT LANGUAGE=vbscript>
<!--
msgbox("密码修改失败! 你输入的旧密码和密码不一致！!")
Sub window_onload
window.history.back
End Sub
-->
</SCRIPT>
		<% end if
	end if
	rs.close
	set rs=nothing
%>
<!--#include file=../system/include/foot.asp-->