📄 tree_change.jsp
字号:
<%@page contentType="text/html;charset=GBK"%>
<%@include file="const\global.jsp"%>
<%
String StrMsg="";
try{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
sqlCon = java.sql.DriverManager.getConnection(ConnStr,ConnUser,ConnPassword);
sqlStmt = sqlCon.createStatement();
String isopen= new String(request.getParameter("isopen").getBytes("8859_1"));
String id= new String(request.getParameter("id").getBytes("8859_1"));
String userid = (String)session.getAttribute("Loginuser");
if(isopen.equals("1")){
isopen="0";
strSQL="update tree_user set isopen='"+isopen+"',icon='plus1.gif' where left(id,len('"+id+"'))='"+id+"' and isend='0' and userid='"+userid+"'";
}
else{
isopen="1";
//打开本接点
strSQL="update tree_user set isopen='"+isopen+"',icon='fix1.gif' where id='"+id+"' and isend='0' and userid='"+userid+"';";
//关闭其他父接点 及 同级别的其他接点
strSQL=strSQL+"update tree_user set isopen='0',icon='plus1.gif' where ( (len(id)>='"+id.length()+"' and left(id,"+(id.length()-2)+")='"+id.substring(0,id.length()-2)+"' and left(id,"+(id.length())+")<>'"+id+"' ) or left(id,2)<>'"+id.substring(0,2)+"') and isend='0' and userid='"+userid+"'";
}
sqlStmt.executeUpdate(strSQL);
//out.print(strSQL);
response.setHeader("Refresh","0;URL=left.jsp");
//关闭SQL语句对象
sqlStmt.close();
//关闭数据库
sqlCon.close();
}catch(SQLException s) {
StrMsg="SQL错误信息:"+s.toString()+" "+s.getErrorCode()+" "+s.getSQLState();
}catch(Exception e) {
StrMsg="错误信息:"+e.toString()+e.getMessage();
}
if(!StrMsg.equals("")){
out.println("<font color=red>"+StrMsg+"</font>");
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -