<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.sql.*,gbase.db.*,java.util.*,gbase.init.*,gbase.util.*,java.text.*"%>
<%
	SeqIdGenerater theSeqIdGenerater=new SeqIdGenerater();
	ConvertSql theConvertSql=new ConvertSql();
	DBOperation theDBOperation = new DBOperation();
	String message="操作失败,请重新留言!";
	String web_account= request.getParameter("web_account")==null?"":request.getParameter("web_account");
	String username = request.getParameter("username") == null ? "" :request.getParameter("username");
        String title = request.getParameter("title") == null ? "" :request.getParameter("title");
        String telno = request.getParameter("telno") == null ? "" :request.getParameter("telno");
        String email = request.getParameter("email") == null ? "" :request.getParameter("email");
        String content = request.getParameter("content") == null ? "" :request.getParameter("content");
        content=theConvertSql.convertSqlValue(content);
        String url="liuyan.jsp?web_account="+web_account;
        
        SimpleDateFormat timeformat = new SimpleDateFormat("yyyy-MM-dd");
        java.util.Date date = Calendar.getInstance().getTime();
        String create_date = timeformat.format(date).toString();
        
        String sql="insert into web_liuyan(username,title,telno,email,content,create_date,state,web_account,check_desc) values('"+username+"','"+title+"','"+telno+"','"+email+"','"+content+"','"+create_date+"','未处理','"+web_account+"','')";
        
      try {
        int i=theDBOperation.executeSql(sql);
        if(i>=0)
          message = "留言成功!";
        else
          message = "操作失败,请重新留言!";
      }
      catch (Exception ex) {
        message = "操作失败,请重新留言!";
      }
	
%>
<script language="javascript">
	function process ( message,url){
		alert(message);
		self.location = url;
	}
</script>
<html>
	<head>
		<title></title>
	</head>
	<body onload="javascript: process('<%=message%>','<%=url%>');">
	</body>
</html>