?? tongzhiedit.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()","請先初始化系統(tǒng)以后再操作!","系統(tǒng)通知"));
}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 + "',0)";
//out.println(sql);
sqlbean.executeUpdate(sql);
sqlbean.close();
out.println(sqlbean.showMsg("javascript:window.close()","您的通知已經(jīng)發(fā)表,現(xiàn)在即將關(guān)閉此窗口","系統(tǒng)通知"));
}
}else if(op.compareTo("1")==0){
if( String.valueOf(session.getAttribute("Urule")).compareTo("a")!=0){
out.println("抱歉您的權(quán)限不夠!");
}else{
%>
<LINK href="oa.css" rel=stylesheet>
<script language="JavaScript">
<!--
function validate()
{
if (document.myform.biaoti.value=="")
{
alert("標(biāo)題不能為空");
document.myform.biaoti.focus();
return false ;
}
if (document.myform.neirong.value=="")
{
alert("內(nèi)容不能為空");
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="tongzhiedit.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">
標(biāo) 題</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">
內(nèi) 容</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="發(fā)布通知" name="B1" style="border:1pt solid #636563;height:18px;background-color: #ffffff;filter:chroma(color=#ffffff);"> <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>內(nèi)部通知—<%=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">
發(fā) 布 人</td>
<td width="79%" height="18"><%=sqlbean.getString("part")%> <%=sqlbean.getString("tname")%></td>
</tr>
<tr>
<td width="21%" align="center" height="17">
發(fā)布時間</td>
<td width="79%" height="17"><%=sqlbean.getString("time")%></td>
</tr>
<tr valign=top>
<td width="21%" align="center" height="122">
內(nèi) 容</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("抱歉您的權(quán)限不夠!");
}else{
String sql="delete from notice where ID="+request.getParameter("id");
sqlbean.executeUpdate(sql);
out.println("通知已經(jīng)刪除!");
sqlbean.close();
response.sendRedirect("tongzhi.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>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -