newradio.jsp~227~
资源名称:bangong.rar [点击查看]
上传用户:dlqqsh
上传日期:2021-11-13
资源大小:7840k
文件大小:7k
源码类别:
OA系统
开发平台:
Java
- <%@ page contentType="text/html; charset=GBK" import="officeol.mc.tools.*,java.sql.*,java.lang.*" %>
- <%request.setCharacterEncoding("gbk"); %>
- <html>
- <head>
- <title>
- newarticle
- </title>
- <link href="css/div11.css" rel="stylesheet" type="text/css">
- </head>
- <jsp:useBean id="sql" scope="page" class="control.sqlcontrol" />
- <%try{
- sql.getSQL2005conn("dbconfig.xml");
- //部门名:
- String ud = (String)session.getAttribute("UD");
- //部门ID:
- String udid = (String)session.getAttribute("UDID");
- //用户名:
- String un = (String)session.getAttribute("UN");
- //用户ID:
- String uid = (String)session.getAttribute("UID");
- //权限:
- String pp = (String)session.getAttribute("POPE");
- //LOGIN:
- String login = (String)session.getAttribute("LOGIN");
- if(login!=null&&login.equals("OK")){
- if(pp.equals("com")){//普通权限
- out.print("你没有权限查看这个页面!");
- }else {
- %>
- <body bgcolor="#ffffff">
- <br /><h4 align="center">公告发布页面</h4><%
- if(pp.equals("dep")){
- out.print("<br />你有部门权限,可以发布部门内部公告!");
- }else if(pp.equals("all")){
- out.print("<br /> 你有全局权限,可以发布全局公告!");
- }
- %><div align="center">
- <form action="newradio_do.jsp" method="post" name="myform">
- <table cellpadding="0" cellspacing="0" border="1">
- <tr>
- <td>标题:<input type="text" name="title" lang="50" onBlur="makefull()" onFocus="makeempty();" /></td>
- </tr>
- <tr>
- <td>类型:<select name="type">
- <% if(pp.equals("dep")){//部门权限
- %><option value="0">内部公告</option>
- <%
- }else if(pp.equals("all")){//全局权限
- %>
- <option value="1">全局公告</option>
- <option value="0">部门内公告</option>
- <%
- }%>
- </select>
- </td>
- </tr>
- <tr><td>
- <textarea cols="85" rows="8" name="context" onBlur="makefull1()" onFocus="makeempty1()">在此处输入具体内容(不超过200字)</textarea>
- </td></tr>
- <% if(pp.equals("all")){
- %>
- <tr>
- <td>
- <a onClick="fileDivShow()" href="#">添加已上传文件下载链接</a>
- </td>
- </tr>
- <tr>
- <td width="300">
- <a onClick="articleDivShow()" href="#">添加多部门编辑文章链接(可编辑)</a>
- </td>
- </tr>
- <tr>
- <td width="300">
- <a onClick="garticleDivShow()" href="#">添加共享文章链接(只查看)</a>
- </td>
- </tr>
- <%
- }
- %>
- <tr><td align="center">
- <input type="submit" value="录入公告" />
- <input type="reset" value="重新填写" />
- </td></tr>
- </table>
- <input type="hidden" value="<%=uid%>" name="usersid" />
- <input type="hidden" value="<%=udid%>" name="depar" />
- </form>
- <div id="garticle" align="justify" >
- <div align="right"><a href="#" onclick="gh()">关闭</a></div>
- <%
- DBConn dbc = new DBConn();
- String gasql = "select top(20) * from article where type = '2' or type = '0' order by id desc";
- String[][] gart = dbc.getArray(gasql);
- if(gart==null){
- }else{
- for(int i = 0; i < gart.length; i++){
- %>
- <a href="#" id="ghref<%=i%>" onClick="writegHref('<%=gart[i][0] %>','<%=gart[i][3] %>','ghref<%=i%>')"><%=gart[i][3] %> <%=gart[i][1]%> </a> <br />
- <%
- }
- }
- %>
- </div>
- <div id="article" align="justify" >
- <div align="right"><a href="#" onclick="adh()">关闭</a></div>
- <%
- String asql = "select top(20) * from article where type = '2' order by id desc";
- String[][] art = dbc.getArray(asql);
- if(art==null){
- }else{
- for(int i = 0; i < art.length; i++){
- %>
- <a href="#" id="href<%=i%>" onClick="writeHref('<%=art[i][0] %>','<%=art[i][3] %>','href<%=i%>')"><%=art[i][3] %> <%=art[i][1]%> </a> <br />
- <%
- }
- }
- %>
- </div>
- <div id="file" style="display:none" align="justify" >
- <div align="right"><a href="#" onclick="fh()">关闭</a></div>
- <%
- String fsql = "select top(20) * from files order by id desc";
- String[][] file = dbc.getArray(fsql);
- if(art==null){
- }else{
- for(int i = 0; i < file.length; i++){
- %>
- <a href="#" id="fhref<%=i%>" onClick="writeFHref('<%=file[i][6] %>','<%=file[i][1] %>','fhref<%=i%>')"><%=file[i][1]%></a> <br />
- <%
- }
- }
- %>
- </div>
- <script language="javascript" type="text/javascript">
- function garticleDivShow(){
- document.getElementById("garticle").style.display="block";
- }
- function garticleDivHide(){
- setTimeout("gh()",500);
- }//延迟0.5秒后关掉层
- function gh(){
- document.getElementById("garticle").style.display="none";
- }
- function writegHref(gaid,gatit,ghrefn){
- document.myform.context.value=document.myform.context.value+'<br /><br /><a href=showarticle.jsp?id='+gaid+'>点击查看文章 '+gatit+'</a><br />';
- document.getElementById(ghrefn).style.display='none';
- }
- function articleDivShow(){
- document.getElementById("article").style.display="block";
- }
- function articleDivHide(){
- setTimeout("adh()",500);
- }//延迟0.5秒后关掉层
- function adh(){
- document.getElementById("article").style.display="none";
- }
- function writeHref(aid,atit,hrefn){
- document.myform.context.value=document.myform.context.value+'<br /><br /><a href=changearticle.jsp?id='+aid+'>点击编辑文章 '+atit+'</a><br />';
- document.getElementById(hrefn).style.display='none';
- }
- function fileDivShow(){
- document.getElementById("file").style.display="block";
- }
- function fileDivHide(){
- setTimeout("fh()",500);
- }//延迟0.5秒后关掉层
- function fh(){
- document.getElementById("file").style.display="none";
- }
- function writeFHref(aid1,atit1,hrefn1){
- document.myform.context.value=document.myform.context.value+'<br /><br /><a href=download.jsp?fn='+aid1+'>点击下载文件 '+atit1+'</a>';
- document.getElementById(hrefn1).style.display='none';
- }
- document.myform.title.value='输入公告名称';
- function makeempty(){
- if(document.myform.title.value=='输入公告名称'){
- document.myform.title.value='';
- }
- }
- function makefull(){
- if(document.myform.title.value==''){
- document.myform.title.value='输入公告名称';
- }
- }
- document.myform.context.value='在此处输入具体内容(不超过200字)';
- function makeempty1(){
- if(document.myform.context.value=='在此处输入具体内容(不超过200字)'){
- document.myform.context.value='';
- }
- }
- function makefull1(){
- if(document.myform.context.value==''){
- document.myform.context.value='在此处输入具体内容(不超过200字)';
- }
- }
- </script>
- </div>
- <%sql.closeDB();
- }
- }else{
- response.sendRedirect("userlogin.jsp");
- }
- }catch(Exception ex){
- ex.printStackTrace();
- }
- %>
- </body>
- </html>