⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 delsub.jsp

📁 在线考试系统
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="../../conndb.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<%
int j=0;
Statement stmt=conn.createStatement();
String teacon=(String)session.getAttribute("teacon");
if(teacon.equals("Clanguage"))
{	j=1;}
 if(teacon.equals("Structure"))
{	j=2;}
 if(teacon.equals("Internet"))
{	j=3;}
 if(teacon.equals("Java"))
{	j=4;}

String subtype=request.getParameter("subtype");
if(subtype.equals("choice"))
{
	String Cid=request.getParameter("Cid");
	switch(j)
	{	
		case 1:
			stmt.executeUpdate("delete from Cchoice where id='"+Cid+"'");
			break;
		case 2:
			stmt.executeUpdate("delete from Schoice where id='"+Cid+"'");
			break;
		case 3:
			stmt.executeUpdate("delete from Ichoice where id='"+Cid+"'");
			break;
		case 4:
			stmt.executeUpdate("delete from Jchoice where id='"+Cid+"'");
			break;
	}
	response.sendRedirect("editSub.jsp");
}
if(subtype.equals("fill"))
{
	String Fid=request.getParameter("Fid");
	switch(j)
	{	
		case 1:
			stmt.executeUpdate("delete from Cfill where id='"+Fid+"'");
			break;
		case 2:
			stmt.executeUpdate("delete from Sfill where id='"+Fid+"'");
			break;
		case 3:
			stmt.executeUpdate("delete from Ifill where id='"+Fid+"'");
			break;
		case 4:
			stmt.executeUpdate("delete from Jfill where id='"+Fid+"'");
			break;
	}
	response.sendRedirect("editSub.jsp");
}
%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -