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

📄 wtongzhiedit.jsp

📁 网络版办公管理系统,采用最新技术java开发,对学习java语语的朋友可以借鉴
💻 JSP
字号:
<%@ page contentType="text/html;charset=gb2312" %><%@ include file="check.jsp" %>
<%@ page import="java.util.Date" %>
<script language=javascript src="mouse.js"></script>

<%
//String op =
String op = request.getParameter("op");

if( op.compareTo("6")==0){

	if(session.getAttribute("Rname").toString().compareTo("还没有添加")==0){
		out.println(sqlbean.showMsg("javascript:window.close()","请先初始化系统以后再操作!","系统通知"));	        
	}else{

		Calendar now = Calendar.getInstance();
		String sj = now.get(Calendar.YEAR)+"-"+(now.get(Calendar.MONTH)+1)+"-"+now.get(Calendar.DAY_OF_MONTH)+" "+now.get(Calendar.HOUR_OF_DAY)+":"+now.get(Calendar.MINUTE)+":"+now.get(Calendar.SECOND);


		String sql = "insert into notice(userid,tname,part,title,ttext,time,type) values("
				+ session.getAttribute("Uid") + ",'"
				+ sqlbean.to_8859_1(session.getAttribute("Rname").toString()) + "','"
				+ sqlbean.to_8859_1(session.getAttribute("Upart").toString()) + "','"
				+ sqlbean.to_8859_1(request.getParameter("biaoti")) + "','"
				+ sqlbean.to_8859_1(request.getParameter("neirong")) + "','"
				+ sj + "',2)";
	        
		//out.println(sql);
		sqlbean.executeUpdate(sql);
		sqlbean.close();        
		out.println(sqlbean.showMsg("javascript:window.close()","您的通知已经发表,现在即将关闭此窗口","系统通知"));
	}
}else if(op.compareTo("1")==0){

	if( String.valueOf(session.getAttribute("Urule")).compareTo("a")!=0){ 
		out.println("抱歉您的权限不够!");      
	}else{ 

 %>
<LINK href="oa.css" rel=stylesheet>
<script language="JavaScript">
<!--
function  validate()
    {
       
	if  (document.myform.biaoti.value=="")
	{
	    alert("标题不能为空");
	    document.myform.biaoti.focus();
	    return false ;
	}
		if  (document.myform.neirong.value=="")
	{
	    alert("内容不能为空");
	    document.myform.neirong.focus();
	    return false ;
	}
		}
//-->
</script>
</head>

<BODY
style="BACKGROUND-ATTACHMENT: scroll; BACKGROUND-IMAGE: url(images/main_bg.gif); BACKGROUND-POSITION: left bottom; BACKGROUND-REPEAT: no-repeat">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
  <TBODY>
	  <TR> 
	    <TD>
			<form method="POST" name="myform" action="wtongzhiedit.jsp"  onsubmit="return  validate();">
			<input type=hidden name=op value="6">
 
  <table border=1 width="100%" cellspacing=1 height="121" bordercolorlight=#000000 bordercolordark=#ffffff>
    <tr>
      <td width='21%' align="center" height="21">
	标  题</td> 
      <td width='79%' height="21"><input type="text" name="biaoti" size="21" style="width: 288; height: 18;background-color: #ffffff;filter:chroma(color=#ffffff);"></td>
    </tr>
    <tr>
      <td width='21%' align="center" height="122">
	内  容</td>
      <td width='79%'  valign="middle"><textarea rows="13" name="neirong" cols="38" style="font-size: 10pt;background-color: #ffffff;filter:chroma(color=#ffffff);overflow: auto"></textarea></td>
    </tr>
  </table>
  <p align="center">
    <input type="submit" value="发布通知" name="B1" style="border:1pt solid #636563;height:18px;background-color: #ffffff;filter:chroma(color=#ffffff);">&nbsp;&nbsp;<INPUT TYPE="reset" value="重新填写" style="border:1pt solid #636563;height:18px;background-color: #ffffff;filter:chroma(color=#ffffff);">
    </p>
</form></TD>
	    
      </TR>	  
      </table>
</body>
</html>
<%      
	}       
	sqlbean.close();
}else if(op.compareTo("4")==0){

	String sql="select * from notice where ID="+request.getParameter("id");
	sqlbean.executeQuery(sql); 
	if(sqlbean.next()){
%>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="oa.css" rel=stylesheet>
<title>内部通知—<%=sqlbean.getString("title")%></title>
</head>

<body style="background-image: url('images/main_bg.gif'); background-attachment: scroll; background-repeat: no-repeat; background-position: left bottom">

<div align="center">
  <center>
  <table border="1" width="100%" cellspacing="0" cellpadding=0 height="209" bordercolorlight=#000000 bordercolordark=#ffffff>
    <tr valign=top>
      <td width="21%" align="center" height="14">
	主  题</td>
      <td width="79%" height="14"><%=sqlbean.getString("title")%></td>
    </tr>
    <tr>
      <td width="21%" align="center" height="18">
	发 布 人</td> 
      <td width="79%" height="18"><%=sqlbean.getString("part")%> <%=sqlbean.getString("tname")%></td>
    </tr>
    <tr>
      <td width="21%" align="center" height="17">
	发布时间</td>
      <td width="79%" height="17"><%=sqlbean.getString("time")%></td>
    </tr>
    <tr valign=top>
      <td width="21%" align="center" height="122">
	内  容</td>
      <td width="79%" height="122"><%=sqlbean.getString("ttext")%></td>
    </tr>
  </table>
  </center>
</div>

</body>

</html>
<%}
sqlbean.close();
}else if(op.compareTo("3")==0){
	if( String.valueOf(session.getAttribute("Urule")).compareTo("a")!=0){ 
		out.println("抱歉您的权限不够!");      
	}else{ 
		String sql="delete from notice where ID="+request.getParameter("id");
		sqlbean.executeUpdate(sql); 
		out.println("通知已经删除!");
		sqlbean.close();
		response.sendRedirect("wtongzhi.jsp");
	}
}
 %>
<p align=center><a href="Javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','images/close_2.gif',1)">
<img name="Image3" border="0" src="images/close_1.gif" width="85" height="19" hspace="5"></a> </p>

⌨️ 快捷键说明

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