public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		// ȡӦֵд뵽ļ
		request.setCharacterEncoding("UTF-8");
		
		String pwd = request.getParameter("pwd");
		String number = request.getParameter("number");		
		String amount = request.getParameter("amount");	
		String name = request.getParameter("name");
		String identity = request.getParameter("identity");
		
		String name1 = request.getParameter("name1");
		String number1 = request.getParameter("number1");

		String message = "";
		String operator = "";
		String operatorType = "";
		
		// ȡCookieϢ
		Cookie cklist[] = request.getCookies();
		if (cklist != null && cklist.length > 0)
		{
			for(Cookie c:cklist)
			{
				if (c.getName().equals("name"))
				{
					operator = java.net.URLDecoder.decode(c.getValue(),"UTF-8");
					message += "<tr><td>: </td>";
					message += "<td>" + operator + "</td></tr>";
				}
				
				if (c.getName().equals("type"))
				{
					operatorType = java.net.URLDecoder.decode(c.getValue(),"UTF-8");
					message += "<tr><td>Ա: </td>";
					message += "<td>" + operatorType + "</td></tr>";
				}
				
			}
		}
		
		// ȡʵ·
		String realPath = this.getServletContext().getRealPath("index.jsp");
		int end = realPath.lastIndexOf("/");
		realPath = realPath.substring(0, end+1);
						
		String folder = realPath + "AccountData";
		
		Log l = new Log();
		Account a = SearchUtil.getAccountByName(number, folder);
		Account b = null;
		if (a != null)
		{
			// ҵƥ˻дϢ
			
			double oldmoney = Double.valueOf(a.getAmount());
			double delta = Double.valueOf(amount);
			double newmoney = oldmoney - delta;
			a.setAmount(String.valueOf(newmoney));
			String filepath = folder + "/" + a.getId();
			FileUtil.writeObject(filepath, a);
		
			message += "<tr><td>˻: " + a.getNumber() + "</td>";
			message += "<tr><td>: " + String.valueOf(newmoney) + "</td></tr>";
			
			b = SearchUtil.getAccountByName(number1, folder);
			if (b != null)
			{
				// ҵƥ˻дϢ
				
				oldmoney = Double.valueOf(b.getAmount());
				delta = Double.valueOf(amount);
				newmoney = oldmoney + delta;
				b.setAmount(String.valueOf(newmoney));
				filepath = folder + "/" + b.getId();
				FileUtil.writeObject(filepath, b);
			
				message += "<tr><td>˻: " + b.getNumber() + "</td>";
				message += "<tr><td>: " + String.valueOf(newmoney) + "</td></tr>";
				
				
				// д־
				String efolder = realPath + "EmployeeData";
				Employee e = SearchUtil.getEmployeeByName(operator, efolder);
				
				
				if (e != null)
				{
					l.setName(operator);
					l.setNumber(e.getNumber());
					l.setDepartment(e.getDepartment());
					l.setPosition(operatorType);
					l.setAccount(a.getNumber());
					l.setOperation("ת");
					l.setOpdetail(":" + String.valueOf(delta));
					
					
					String lfolder = realPath + "LogData";
					FolderUtil.createFolder(lfolder);
					
					Calendar c = Calendar.getInstance();
					String dix = String.valueOf(c.hashCode());
					
					String lfilepath = lfolder + "/" + l.getName() + dix;
					FileUtil.writeObject(lfilepath, l);

				}
				else
				{
					message += "ûжӦԱ";
				}
				
			}
			else
			{
				message += "ûҶԶӦ˻";
				
			}
			
		}
		else
		{
			message += "ûҶԶӦ˻";
			
		}
		

		response.setContentType("text/html");
		// 
		response.setCharacterEncoding("UTF-8");
		response.setHeader("content-type","text/html;charset=UTF-8");
		
		PrintWriter out = response.getWriter();
		out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
		out.println("<HTML>");
		out.println("  <HEAD><TITLE>ת˲</TITLE></HEAD>");
		out.println("  <BODY>");
		out.println("<table align=\"center\">");
		out.println("<tr><td colspan=\"2\"> <h1>ת˽</h1></td></tr>");
		out.println("<tr><td colspan=\"2\"> <h2>ļ洢е</h2></td></tr>");
		out.print(message);
		
		out.println("<tr><td colspan=\"2\"> <h2>ݿе</h2></td></tr>");
		Connection conn=null;
        Statement stmt=null;
        ResultSet rs = null;
		try 
		{
			Class.forName("com.mysql.jdbc.Driver");
			String url = "jdbc:mysql://localhost:3306/bms";
			conn = DriverManager.getConnection(url, "root", "wang33");
			stmt = conn.createStatement();
		
			
			// ȡµļ¼
			stmt.executeUpdate("update account set amount = '" + a.getAmount()  +"' where id = " + a.getId());
			stmt.executeUpdate("update account set amount = '" + b.getAmount()  +"' where id = " + b.getId());
			rs = stmt.executeQuery("select * from account where id = " + a.getId());
			
			rs.next();
			out.println("<tr><td>:</td>");
			out.println("<td>" + rs.getString("amount") +  "</td></tr>");
			 
			
			Calendar c = Calendar.getInstance();
			// д־
			stmt.execute("insert into log values (" + c.hashCode()+ ",'" + l.getName() + "','" + l.getNumber() + "','" + l.getDepartment() + "','" + l.getPosition() + "','" + l.getAccount() + "','" + l.getOperation() + "','" + l.getOpdetail()  + "')");
		} 
		catch (SQLException ee) 
		{
		   // TODO Auto-generated catch block
			out.println("SQLException"+ ee.toString()+ "<br/>");
		}
		catch(ClassNotFoundException ce)
        {
			out.println("ݿʧ<br/>");
			out.println(ce.toString()+ "<br/>");
        }
		
		
		out.println("<tr><td colspan=\"2\"><input type=\"button\" value=\"\" onclick=\"javascript:history.go(-1);\"/></td></tr>");
		out.println("</table>");
		out.println("  </BODY>");
		out.println("</HTML>");
		out.flush();
		out.close();
	}