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

📄 articlesacceptsave.jsp

📁 一个很有用的电子刊物发布系统
💻 JSP
字号:
<%@ page language="java" contentType="text/html;charset=gb2312" %>
<%@ page import="java.sql.*,com.am.*" %>
<html>
<head>
	<title>刊物文章管理系统</title>
	<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<jsp:useBean id="register" scope="page" class="com.am.register"/>
<jsp:useBean id="dbconn" scope="application" class="com.am.OpenDB"/>
<div align=center>
<%
	String allID=request.getParameter("allID");
	Statement stmt=dbconn.getConnection().createStatement();
    String strAccept ="0";
    String strRefuse ="0";
    String strAllowmodify ="0";
	String[] Accept=request.getParameterValues("chkAccept");
    String[] Refuse=request.getParameterValues("chkRefuse");
    String[] Allowmodify=request.getParameterValues("chkAllowmodify");
	String fieldID=request.getParameter("fieldID");


	if(Accept!=null)
	{
		for(int i=0;i<Accept.length;i++)
		{
			
			strAccept =strAccept + "," + Accept[i];
			
		}
	}
       
    if(Refuse!=null)
	{
		for(int i=0;i<Refuse.length;i++)
		{
			strRefuse=strRefuse + "," + Refuse[i];		
		}
	}

	if(Allowmodify!=null)
	{
		for(int i=0;i<Allowmodify.length;i++)
		{
			strAllowmodify =strAllowmodify + "," + Allowmodify[i];
		}
	}
	
	try
	{
		String strsqlall="update articles set accept=0 where ID in(" + allID +")";
		String strsql="update articles set accept=1 where ID in(" + strAccept +")";
out.println(strsqlall+"<br>"+strsql+"<br>");
		stmt.execute(strsqlall);
		stmt.execute(strsql);

		strsql="update articles set accept=-1 where ID in(" + strRefuse +")";
		stmt.execute(strsql);
out.println(strsqlall+"<br>"+strsql+"<br>");	  
		strsqlall="update articles set allowmodify=0 where ID in(" + allID +")";
		strsql="update articles set allowmodify=1 where ID in(" + strAllowmodify +")";
		stmt.execute(strsqlall);
		stmt.execute(strsql);
		out.println(strsqlall+"<br>"+strsql+"<br>");
	%>
		<font  size=4><b>信息修改成功!</b></font>
					<br><br>
		<input type=button name=sub value="确定" onclick="javascript:window.location='articlesAcceptForm.jsp?ID=<%=fieldID%>'">
	<%
	}
	catch(Exception e)
	{
	%>
		<font color="red" size=4><b>信息保存失败,请稍后再试!</b></font>
					<br><br>
		<input type=button name=Goback value="返回" onclick="javascript:window.history.go(-1)">
	<%
	
	}
	
%>
</div>
</body>
</html>

⌨️ 快捷键说明

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