<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*"%>
<%@ page import="java.sql.*"%> 
<%@ page import="java.util.*"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.text.*"%>
<%@ include file="../inc/conn.jsp"%>
<%!String sql;%>
<%
String img=request.getParameter("img");
String bbsname=new String(request.getParameter("clubuser_name").getBytes("iso-8859-1"));
String bbsuser=new String(request.getParameter("bbsuser").getBytes("iso-8859-1"));
String clubuser_sex=new String(request.getParameter("sex").getBytes("iso-8859-1"));
String password=new String(request.getParameter("password").getBytes("iso-8859-1"));
String question=new String(request.getParameter("question").getBytes("iso-8859-1"));
String answer=new String(request.getParameter("answer").getBytes("iso-8859-1"));
String email=new String(request.getParameter("email").getBytes("iso-8859-1"));
String signname=new String(request.getParameter("signname").getBytes("iso-8859-1"));
String IP=request.getRemoteAddr();

Date currTime = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss",Locale.US);
String ftime=new String(formatter.format(currTime).getBytes("iso-8859-1"));

if(signname==null||signname.equals("")||email==null||email.equals("")){
sql="update clubuser set clubuser_nickname='"+bbsuser+"',clubuser_password='"+password+"',clubuser_question='"+question+"',clubuser_answer='"+answer+"',clubuser_sex='"+clubuser_sex+"',clubuser_ip='"+IP+"',userimg='"+img+"' where clubuser_name='"+bbsname+"'";
}
else{
sql="update clubuser set clubuser_nickname='"+bbsuser+"',clubuser_password='"+password+"',clubuser_question='"+question+"',clubuser_answer='"+answer+"',clubuser_sex='"+clubuser_sex.trim()+"',clubuser_email='"+email+"',clubuser_ip='"+IP+"',userimg='"+img+"',signname='"+signname+"' where clubuser_name='"+bbsname+"'";
}

stmt.executeUpdate(sql);
out.print("<script>");
out.print("alert('恭喜你，修改个人信息成功!');");
out.print("window.location.href='../user/user_manage.jsp';");
out.print("</script>");
%>