jsp 实现简单的左边菜单
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="../golbal/connection.jsp"%>
<%
String userid=(String)session.getAttribute("userid");
String tempWhere="";
String remoteAddr = request.getRemoteAddr();
String No_of_happy=(String)session.getAttribute("No_of_happy");
if(remoteAddr==null) remoteAddr="";
if(!remoteAddr.equals("127.0.0.1")){
if(!remoteAddr.equals("")){
if(Integer.parseInt(remoteAddr.substring(0,remoteAddr.indexOf(".")))>10)
tempWhere=" and menuinfo.menuid not in ('1402','1401')";
}else{ tempWhere=" and menuinfo.menuid not in ('1402','1401')";}
}
if(No_of_happy.trim().equals("1")) tempWhere=tempWhere+ " and menuinfo.menuid <> '98' ";
int str=con.getConMenu(userid,tempWhere);
%>
) onResize="return window_onresize()" leftmargin="0" topmargin="0" >
<%
String Item="";
String ManName="";
String ItemName="";
int i=0;
String f_id;
sql="SELECT menuinfo.MenuID, menuinfo.Pesciption FROM menu_public INNER JOIN menuinfo ON menu_public.menuid = menuinfo.MenuID WHERE (LEN(menuinfo.MenuID) = 2) AND (menuinfo.MenuID <> '00') AND (menu_public.flag = '1') "+tempWhere+" UNION SELECT popedom.menuid, menuinfo.Pesciption AS Pesciption FROM popedom INNER JOIN menuinfo ON popedom.menuid = menuinfo.MenuID WHERE (LEN(menuinfo.MenuID) = 2) AND (menuinfo.MenuID <> '00') and popedom.flag='1' and erid='"+userid+"' "+tempWhere+" ORDER BY menuinfo.MenuID ";
ResultSet f_rs=stmt.executeQuery(sql);
while (f_rs.next()){
Item=(f_rs.getString("MenuID")).substring(0,2);
ManName=f_rs.getString("Pesciption");
%>
<% i=i+1;
}
f_rs.close();
stmt.close();
stmt1.close();
conn.close();
%>