JAVAEE-based-parking-manage.../tingchechang/WebContent/admin/chewei_add_chuli.jsp

42 lines
1.7 KiB
Plaintext
Raw Normal View History

2023-04-26 13:50:08 +00:00
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030" import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="reg" class="com.DB" scope="page" />
<jsp:useBean id="times" class="com.Shijian" scope="page" />
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Insert title here</title>
</head>
<body>
<%
try {
String chewei_no=new String(request.getParameter("chewei_no").getBytes("ISO-8859-1"),"GB18030");
String chewei_type=new String(request.getParameter("chewei_type").getBytes("ISO-8859-1"),"GB18030");
String chewei_state=new String(request.getParameter("chewei_state").getBytes("ISO-8859-1"),"GB18030");
String chewei_didian=new String(request.getParameter("chewei_didian").getBytes("ISO-8859-1"),"GB18030");
Connection con=reg.getCon();
String sqlt="select * from chewei where chewei_no='"+chewei_no+"'";
ResultSet rs=reg.GetRs(sqlt);
if(rs.next()){
out.println("<script lanage='javascript'>alert('<27><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>ѱ<EFBFBD>ռ<EFBFBD><D5BC>');javascript:history.go(-1);</script>");
}
else
{
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>SQL<51><4C><EFBFBD><EFBFBD>
String sql = "insert into chewei(chewei_no,chewei_type,chewei_state,chewei_didian) values('"+chewei_no+"','"+chewei_type+"','"+chewei_state+"','"+chewei_didian+"')";
int row = reg.GetCount(sql);
if(row > 0){
out.println("<script>alert('<27><>λ<EFBFBD><CEBB><EFBFBD>ӳɹ<D3B3><C9B9><EFBFBD>');window.location.href='chewei_mg.jsp';</script>");
}
con.close();}
} catch (Exception e) {
out.print("<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
e.printStackTrace();
}
%>
</body>
</html>