📄 index.jsp
字号:
<%@page language="java" contentType="text/html;charset=GBK"%>
<%@page import="java.util.*,oa.main.DealString,java.io.*,oa.bean.*"%>
<%
oa.bean.MainBean myBean = null;
try{
myBean = new oa.bean.MainBean();
DealString ds = new DealString();
//取得菜单类别
String strId1 = ds.toString((String)request.getParameter("txt_type1"));//一级版面编号
String strId2 = ds.toString((String)request.getParameter("txt_type2"));//二级版面编号
if(strId1.equals(""))strId1 = "4";
if(strId2.equals(""))strId2 = "0";
//int intId1 = Integer.parseInt(strId1);
///String strMenuName = myBean.toMenu1(strId1);
//String strMenuName2 = myBean.toMenu2(strId1,strId2); 以下没有用到,
String strFileId = ds.toString((String)request.getParameter("txt_fileid"));//文章编号
if(strFileId.equals(""))strFileId = "0";
String strSub = ds.toString((String)request.getParameter("txt_sub"));//
if(strSub.equals("")) strSub="0";
String wtb = "";
if(Integer.parseInt(strSub)>3) wtb = "0";
else wtb = "1";
String strEdit = ds.toString((String)request.getParameter("txt_edit"));
if(strEdit.equals("")) strEdit = "0";
String strmenuid = ds.toString((String)request.getParameter("txt_menuid"));
if(strmenuid.equals("")) strmenuid = "0";//菜单唯一编号
String strtopicid = ds.toString((String)request.getParameter("txt_topicid"));
if(strtopicid.equals("")) strtopicid = "0";
String strRoll = myBean.getRoll();
String strsearch = ds.toString((String)request.getParameter("txt_search"));
if(strsearch.equals("")) strsearch="0";
//String mainStyle = myBean.getStyle(strId1);//所选的模板
//跳页--定义子版面
String childfile = "";
if(strsearch.equals("0"))
{
if(strFileId.equals("0"))
{
childfile = "main.jsp";
if(!strId2.equals("0")||!strtopicid.equals("0")||strmenuid.equals("20")||strmenuid.equals("21")||strmenuid.equals("22")||strmenuid.equals("23"))
{
childfile = "child.jsp";
}
}
else
{
if(strEdit.equals("1"))
{
childfile = "comment.jsp?title="+request.getParameter("title");
}
else
{
childfile = "viewnews.jsp";
}
}
}
else
{
childfile = strsearch;
}
//取得所有的CSS风格
Vector vet = (Vector)myBean.getCss();
int j=vet.size();
String str[] = new String[j];
String strisnow[] = new String[j];
String strfilename[] = new String[j];
int inow = -1;
for(int i=0;i<vet.size();i++)
{
Hashtable hash = (Hashtable)vet.get(i);
str[i] = (String)hash.get("STYLE");
strisnow[i] = (String)hash.get("ISNOW");
if(strisnow[i].equals("1")) inow = i;
strfilename[i] = (String)hash.get("FILENAME");
}
//看能否换成ds.toString ()以前是toGBK
String selcss = ds.toString((String)request.getParameter("sel_css"));
//out.println("HHH"+selcss+"这是从request 中取的一个sel_css 用了toGBK");
String strCssFile = myBean.styleToname(selcss);
if(strCssFile.equals(""))
{
strCssFile = strfilename[inow];
}
//取得所有的一级菜单
Vector vet1 = (Vector)myBean.getMenu();
int j1=vet1.size();
String oneMname[] = new String[j1];//存放一级菜单名称
String oneMnum[] = new String[j1];//存放一级菜单编号
for(int i1=0;i1<vet1.size();i1++)
{
Hashtable hash1 = (Hashtable)vet1.get(i1);
oneMname[i1] = (String)hash1.get("MENU1");
oneMnum[i1] = (String)hash1.get("ID1");
}
//根据一级菜单取得其下的所有二级菜单信息
myBean.setId1(strId1);
Vector vet2 = (Vector)myBean.getMenu2();
int j2=vet2.size();
String twoMname[] = new String[j2];//存放二级菜单名称
String twoMnum[] = new String[j2];//存放二级菜单序号
for(int i2=0;i2<vet2.size();i2++)
{
Hashtable hash2 = (Hashtable)vet2.get(i2);
twoMname[i2] = (String)hash2.get("MENU2");
twoMnum[i2] = (String)hash2.get("ID2");
}
String css = strCssFile;
session.setAttribute("CSS",strCssFile);
%>
<link href="../css/css.css" rel=stylesheet type="text/css">
<html>
<head>
<title>金瑞科技公司首页</title>
<style type="text/css">
<!--
.style1 {color: #0000FF}
-->
</style>
<script>
//改变一级菜单
function changemenu1(type)
{
document.all.txt_type1.value = type;
document.all.txt_type2.value = "";
document.all.txt_fileid.value = "";
document.all.txt_sub.value = "1";
document.all.txt_edit.value = "";
document.all.txt_menuid.value = "";
document.all.txt_topicid.value = "";
document.all.txt_search.value = "";
document.all.form1.action = "index.jsp";
document.all.form1.submit();
}
//改变二级菜单
function changemenu2(type)
{
document.all.txt_type1.value = "<%=strId1%>";
document.all.txt_type2.value = type;
document.all.txt_fileid.value = "";
document.all.txt_sub.value = "2";
document.all.txt_edit.value = "";
document.all.txt_menuid.value = "";
document.all.txt_topicid.value = "";
document.all.txt_search.value = "";
document.all.form1.action = "index.jsp";
document.all.form1.submit();
}
//用户登陆时进行语法验证
function checkout()
{
if(document.all.userid.value=="")
{
alert("请输入用户名!");
document.all.userid.focus();
return false;
}
else if(document.all.password.value=="")
{
alert("请输入密码!");
document.all.password.focus();
return false;
}
else
{
var user=document.all.userid.value;
var pwd=document.all.password.value;
//document.all.userid.value="";
//document.all.password.value="";
document.all.IFRAME0.src="../servlet/logSystem?userid="+user+"&password="+pwd;
//?userid="+document.all.userid.value+"&password="+document.all.password.value;
//var oawin =
// window.open("middle.htm","HGOA","height=120,width=350,scrollbars=no,resizable=yes,left=231,top=196,status=no,toolbar=no,menubar=no");
//oawin.focus();
//oawin.opener=window;
}
}
function search()
{
document.all.txt_type1.value = "<%=strId1%>";
document.all.txt_type2.value = "<%=strId2%>";
document.all.txt_fileid.value = "";
document.all.txt_edit.value = "";
document.all.txt_menuid.value = "";
document.all.txt_topicid.value = "";
var value = document.all.select1.options[document.all.select1.selectedIndex].value;
if(document.all.key.value=="关键字:"||document.all.key.value=="")
{
alert("请输入搜索关键字!");
}
else if(value=="1")
{
document.all.txt_search.value = "search.jsp?s1=1&s2=all&keyword="+document.all.key.value;
document.all.form1.action = "index.jsp";
document.all.form1.submit();
}
else
{
window.open(value+document.all.key.value);
}
}
function findpsw()
{
if(document.all.userid.value=="")
{
alert("请输入用户名!");
document.all.userid.focus();
return false;
}
var url = "findPSW.jsp?yhm="+document.all.userid.value;
var hWnd = window.open(url,"HelpWindow4","width=350,height=220,resizable=no,scrollbars=no,menubar=no,status=no");
if ((document.window != null) && (!hWnd.opener))
hWnd.opener = document.window;
hWnd.focus();
}
</script>
</head>
<BODY leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
<form name=form1 action="index.jsp" method=post>
<input type=hidden name="txt_type1" value="<%=strId1%>">
<input type=hidden name="txt_type2" value="<%=strId2%>">
<input type=hidden name="txt_fileid" value="">
<input type=hidden name="txt_sub" value="">
<input type=hidden name="txt_edit" value="">
<input type=hidden name="txt_menuid" value="">
<input type=hidden name="txt_topicid" value="">
<input type=hidden name="txt_search" value="">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -