📄 article_dep.jsp
字号:
<%/******************************************
部门文章管理 article_dep.jsp
*********************************************/
%>
<%@page language="java" contentType="text/html;charset=GBK"%>
<%@page import="java.util.*,java.io.*,oa.main.DealString"%>
<%
oa.bean.ArticleBean myBean = null;
oa.bean.RightBean myRightBean = null;
oa.bean.OrgMenuBean orgmenubean = null;
try{
myBean = new oa.bean.ArticleBean();
myRightBean = new oa.bean.RightBean();
orgmenubean = new oa.bean.OrgMenuBean();
DealString ds = new DealString();
//取得菜单类别
String strType = ds.toString((String)request.getParameter("txt_type"));
if(strType.equals(""))strType = "1";
String strbmbh = ds.toString((String)request.getParameter("bmbh"));//部门编号
if(strbmbh.equals(""))
{
String zgbh = (String)session.getAttribute("zgbh");
Hashtable htorgqx = (Hashtable)myBean.getorgqx(zgbh);
String orgqx = (String)htorgqx.get("GL");
if(orgqx.length()>=20)
strbmbh = orgqx.substring(0,20);
}
if(!strbmbh.equals("")){
String strwzlx = ds.toString((String)request.getParameter("wzlx"));//文章类型
//那个分页
String strId = ds.toString((String)request.getParameter("t"));
//操作权限 0:浏览 1:增删改
String czqx = "0";
//文章搜索条件
String select1 = ds.toString((String)request.getParameter("sel1"));
String select2 = ds.toString((String)request.getParameter("sel2"));
String select3 = ds.toString((String)request.getParameter("sel3"));
//权限控制
String uid = (String)session.getAttribute("zgbh");
//查询语句
String sel = "";
if(strwzlx.equals("")||strwzlx.equals("0")){
if(strId.equals("1"))
{
sel = "where menuid is null and writer='"+uid+"'and organid = '"+strbmbh+"' and article.writer=zz_zgb.zgbh order by organid,addtime desc";
if(!select2.equals("null"))
{
select2 = ds.toGBK(select2);
if(select1.equals("0"))
sel = "where menuid is null and writer='"+uid+"'and organid = '"+strbmbh+"' and (title like '%"+select2+"%' or keyword like '"+select2+"') and article.writer=zz_zgb.zgbh order by organid,addtime desc";
if(select1.equals("1"))
sel = "where menuid is null and writer='"+uid+"'and organid = '"+strbmbh+"' and title like '%"+select2+"%' and article.writer=zz_zgb.zgbh order by organid,addtime desc";
if(select1.equals("3"))
sel = "where menuid is null and writer='"+uid+"'and organid = '"+strbmbh+"' and keyword like '%"+select2+"%' and article.writer=zz_zgb.zgbh order by organid,addtime desc";
}
}
if(strId.equals("2"))
{
sel = "where menuid is null and (organid = '"+strbmbh+"') order by organid,addtime desc";
if(!select2.equals("null"))
{
select2 = ds.toGBK(select2);
if(select1.equals("0"))
sel = "where menuid is null and (XM like '%"+select2+"%' or title like '%"+select2+"%' or keyword like '%"+select2+"%') and (organid = '"+strbmbh+"') and article.writer=zz_zgb.zgbh order by organid,addtime desc";
if(select1.equals("1"))
sel = "where menuid is null and title like '%"+select2+"%' and (organid = '"+strbmbh+"') and article.writer=zz_zgb.zgbh order by organid,addtime desc";
if(select1.equals("2"))
sel = "where menuid is null and XM like '%"+select2+"%' and (organid = '"+strbmbh+"') and article.writer=zz_zgb.zgbh order by organid,addtime desc";
if(select1.equals("3"))
sel = "where menuid is null and keyword like '%"+select2+"%' and (organid = '"+strbmbh+"') and article.writer=zz_zgb.zgbh order by organid,addtime desc";
}
}
}
else{
if(strId.equals("1"))
{
sel = "where menuid is null and writer='"+uid+"'and organid = '"+strbmbh+"' and wzlx in (select bh from news.orgmenu where bh="+strwzlx+" or pbh="+strwzlx+") and article.writer=zz_zgb.zgbh order by organid,addtime desc";
if(!select2.equals("null"))
{
select2 = ds.toGBK(select2);
if(select1.equals("0"))
sel = "where menuid is null and writer='"+uid+"'and organid = '"+strbmbh+"' and wzlx in (select bh from news.orgmenu where bh="+strwzlx+" or pbh="+strwzlx+") and (title like '%"+select2+"%' or keyword like '"+select2+"') and article.writer=zz_zgb.zgbh order by organid,addtime desc";
if(select1.equals("1"))
sel = "where menuid is null and writer='"+uid+"'and organid = '"+strbmbh+"' and wzlx in (select bh from news.orgmenu where bh="+strwzlx+" or pbh="+strwzlx+") and title like '%"+select2+"%' and article.writer=zz_zgb.zgbh order by organid,addtime desc";
if(select1.equals("3"))
sel = "where menuid is null and writer='"+uid+"'and organid = '"+strbmbh+"' and wzlx in (select bh from news.orgmenu where bh="+strwzlx+" or pbh="+strwzlx+") and keyword like '%"+select2+"%' and article.writer=zz_zgb.zgbh order by organid,addtime desc";
}
}
if(strId.equals("2"))
{
sel = "where menuid is null and (organid = '"+strbmbh+"') and wzlx in (select bh from news.orgmenu where bh="+strwzlx+" or pbh="+strwzlx+") and article.writer=zz_zgb.zgbh order by organid,addtime desc";
if(!select2.equals("null"))
{
select2 = ds.toGBK(select2);
if(select1.equals("0"))
sel = "where menuid is null and (XM like '%"+select2+"%' or title like '%"+select2+"%' or keyword like '%"+select2+"%') and (organid = '"+strbmbh+"') and wzlx in (select bh from news.orgmenu where bh="+strwzlx+" or pbh="+strwzlx+") and article.writer=zz_zgb.zgbh order by organid,addtime desc";
if(select1.equals("1"))
sel = "where menuid is null and title like '%"+select2+"%' and (organid = '"+strbmbh+"') and wzlx in (select bh from news.orgmenu where bh="+strwzlx+" or pbh="+strwzlx+") and article.writer=zz_zgb.zgbh order by organid,addtime desc";
if(select1.equals("2"))
sel = "where menuid is null and XM like '%"+select2+"%' and (organid = '"+strbmbh+"') and wzlx in (select bh from news.orgmenu where bh="+strwzlx+" or pbh="+strwzlx+") and article.writer=zz_zgb.zgbh order by organid,addtime desc";
if(select1.equals("3"))
sel = "where menuid is null and keyword like '%"+select2+"%' and (organid = '"+strbmbh+"') and wzlx in (select bh from news.orgmenu where bh="+strwzlx+" or pbh="+strwzlx+") and article.writer=zz_zgb.zgbh order by organid,addtime desc";
}
}
}
if(select3.equals("1"))
{
sel = ds.toString((String)request.getParameter("txt_sel"));
}
String bm = (String)request.getParameter("bm");
if(bm==null) bm = "1";
if(bm.equals(""))bm = "1";
int cur = Integer.parseInt(bm);
Vector vect = (Vector)myBean.getOnePage(sel,cur,5);
// System.out.println(vect);
int sum = Integer.parseInt((String)vect.get(0));
int i = 0;
int j = 0;
%>
<table width="95%" cellspacing="1" cellpadding="5" bgcolor=#999999 align=center>
<tr bgColor=#dbcfff >
<td colspan=20 align=right>
文章搜索: 
<select name="select1">
<option value="0" selected>模糊查询</option>
<option value="1">文章标题</option>
<%if(!strId.equals("1")){%><option value="2">录入员</option><%}%>
<option value="3">文章关键字</option>
</select>
 
<input type=text name=select2 size=20>
 
<input type=button value="搜索" onclick="selectart();" style="cursor:hand;background-color:#ffffff;">
</td>
</tr>
<tr bgColor=#ffffff >
<td colspan=20><center>
<b>文章列表</b></center></td>
</tr>
<tr bgcolor=#ffcc00 align=center >
<td width=20> </td>
<td ><b>编号</b></td>
<td ><b>文章标题</b></td>
<td ><b>录入</b></td>
<td ><b>发表时间</b></td>
<td ><b>所属类别</b></td>
<!-- <td><b>焦点</b></td>
<td><b>首页</b></td>
<td><b>图片</b></td>
<td><b>审阅</b></td>
<td><b>操作</b></td>
---> </tr>
<%
for(i=1;i<vect.size();i++)
{
Hashtable hash = (Hashtable)vect.get(i);
String[] str = new String[9];
str[0]=ds.toString((String)hash.get("ID"));
str[1]=ds.toString((String)hash.get("TITLE"));
str[2]=ds.toString((String)hash.get("WRITER"));
str[3]=ds.toString((String)hash.get("ADDTIME"));
str[4]=ds.toString((String)hash.get("WZLX"));
if(str[4].equals("")) str[4] = "25";
orgmenubean.setID(Integer.parseInt(str[4]));
str[5]=orgmenubean.getID1();
str[6]=orgmenubean.getPathWithoutOrg();
// str[7]=(String)hash.get("IFSHOW");
str[8]=(String)hash.get("ORGANID");
//System.out.println("---"+str[8]);
/*
if(str[4].equals("1"))
str[4] = "是";
else
str[4] = "否";
if(str[5].equals("1"))
str[5] = "是";
else
str[5] = "否";
if(str[6].equals("1"))
str[6] = "是";
else
str[6] = "否";
if(str[7].equals("1"))
str[7] = "是";
else
str[7] = "否"; */
%>
<TR bgColor=#ffffff height="22">
<td><%j++;%><input type=checkbox name=checkboxid value="<%=str[0]%>"></td>
<TD align=center><%=i%></TD>
<TD align=left><a onclick="see('<%=str[0]%>','<%=str[5]%>')" style="cursor:hand"><font color=#CC0000><%=str[1]%></font></a></TD>
<TD align=center><%=(String)myBean.toName("zz_zgb","zgbh","xm",str[2])%></TD>
<TD align=center ><%=str[3]%></TD>
<td align=center title="<%=str[6]%>"><%=str[5]%></td>
</TR>
<%
}
%>
<input type=hidden name="txt_leixing">
<input type=hidden name="txt_value">
<input type=hidden name="txt_sel" value="<%=sel%>">
<%if(j>=1){%>
<tr>
<TD align=left colspan=20>
<%if(j>=2){%>
<input type=button value="全选" name=selall onclick="selectall();" style="cursor:hand;">   
<%}%>
<input type=button value="删除" onclick="return del();" style="cursor:hand;"></td>
</tr>
<%}%>
<TR>
<TD align=right bgColor=#dbcfff colspan=20>当前<%=cur%>/<%=sum%>页   <a onclick="gotopage('1')" style="cursor:hand;">第一页    </a>
<%if(cur>1){int t=cur-1;%><a onclick="gotopage('<%=t%>')" style="cursor:hand;">上一页    </a><%}%>
<%if(cur<sum){int s=cur+1;%><a onclick="gotopage('<%=s%>')" style="cursor:hand;">下一页   </a><%}%>
<a onclick="gotopage('<%=sum%>')" style="cursor:hand;">最后页    </a>
直接<input type=image src="../images/hand.gif" name="gotof" onclick="return checkdata();">
<input type=text size=2 name=bm class=formcolor>页</TD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -