newradio.jsp~220~
上传用户:dlqqsh
上传日期:2021-11-13
资源大小:7840k
文件大小:7k
源码类别:

OA系统

开发平台:

Java

  1. <%@ page contentType="text/html; charset=GBK" import="officeol.mc.tools.*,java.sql.*,java.lang.*" %>
  2. <%request.setCharacterEncoding("gbk"); %>
  3. <html>
  4. <head>
  5. <title>
  6. newarticle
  7. </title>
  8. <link href="css/div11.css" rel="stylesheet" type="text/css">
  9. </head>
  10. <jsp:useBean id="sql" scope="page" class="control.sqlcontrol" />
  11. <%try{
  12.   sql.getSQL2005conn("dbconfig.xml");
  13.   //部门名:
  14.   String ud = (String)session.getAttribute("UD");
  15.     //部门ID:
  16.   String udid = (String)session.getAttribute("UDID");
  17.     //用户名:
  18.   String un = (String)session.getAttribute("UN");
  19.     //用户ID:
  20.   String uid = (String)session.getAttribute("UID");
  21.     //权限:
  22.   String pp = (String)session.getAttribute("POPE");
  23.   //LOGIN:
  24.   String login = (String)session.getAttribute("LOGIN");
  25.   if(login!=null&&login.equals("OK")){
  26.     if(pp.equals("com")){//普通权限
  27. out.print("你没有权限查看这个页面!");
  28. }else {
  29.   if(pp.equals("dep")){
  30.     out.print("<br />你有部门权限,可以发布部门内部公告!");
  31.   }else if(pp.equals("all")){
  32.     out.print("你有全局权限,可以发布全局公告!");
  33.   }
  34. %>
  35. <body bgcolor="#ffffff">
  36. <div align="center">
  37.   <form action="newradio_do.jsp" method="post" name="myform">
  38.   <table cellpadding="0" cellspacing="0" border="1">
  39.     <tr>
  40.       <td>标题:<input type="text" name="title" lang="50" onBlur="makefull()" onFocus="makeempty();" /></td>
  41.     </tr>
  42.     <tr>
  43.       <td>类型:<select name="type">
  44.         <% if(pp.equals("dep")){//部门权限
  45.   %><option value="0">内部公告</option>
  46.   <%
  47. }else if(pp.equals("all")){//全局权限
  48. %>
  49.         <option value="1">全局公告</option>
  50.         <option value="0">部门内公告</option>
  51. <%
  52. }%>
  53. </select>
  54.       </td>
  55.     </tr>
  56.     <tr><td>
  57.       <textarea cols="85" rows="8" name="context" onBlur="makefull1()" onFocus="makeempty1()">在此处输入具体内容(不超过200字)</textarea>
  58. </td></tr>
  59. <% if(pp.equals("all")){
  60.   %>
  61. <tr>
  62.   <td>
  63.     &nbsp; &nbsp; &nbsp; <a onClick="fileDivShow()" href="#">添加已上传文件下载链接</a>
  64.   </td>
  65. </tr>
  66. <tr>
  67.   <td width="300">
  68.     &nbsp; &nbsp; &nbsp; <a onClick="articleDivShow()" href="#">添加多部门编辑文章链接(可编辑)</a>
  69.   </td>
  70. </tr>
  71. <tr>
  72.   <td width="300">
  73.     &nbsp; &nbsp; &nbsp; <a onClick="garticleDivShow()" href="#">添加共享文章链接(只查看)</a>
  74.   </td>
  75. </tr>
  76. <%
  77. }
  78. %>
  79. <tr><td align="center">
  80.   <input type="submit" value="录入公告" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  81.   <input type="reset" value="重新填写" />
  82. </td></tr>
  83.   </table>
  84.   <input type="hidden" value="<%=uid%>" name="usersid"  />
  85.   <input type="hidden" value="<%=udid%>" name="depar"  />
  86.   </form>
  87. <div id="garticle" align="justify" >
  88. <div align="right"><a href="#" onclick="gh()">关闭</a></div>
  89.     <%
  90.     DBConn dbc = new DBConn();
  91.     String gasql = "select top(20) * from article where type = '2' or type = '0' order by id desc";
  92.     String[][] gart = dbc.getArray(gasql);
  93.     if(gart==null){
  94.     }else{
  95.       for(int i = 0; i < gart.length; i++){
  96.         %>
  97.         &nbsp;&nbsp;&nbsp; <a href="#" id="ghref<%=i%>" onClick="writegHref('<%=gart[i][0] %>','<%=gart[i][3] %>','ghref<%=i%>')"><%=gart[i][3] %> &nbsp;&nbsp;&nbsp; <%=gart[i][1]%> </a>  &nbsp;<br />
  98.         <%
  99.         }
  100.     }
  101.     %>
  102.     </div>
  103. <div id="article" align="justify" >
  104. <div align="right"><a href="#" onclick="adh()">关闭</a></div>
  105.     <%
  106.     String asql = "select top(20) * from article where type = '2' order by id desc";
  107.     String[][] art = dbc.getArray(asql);
  108.     if(art==null){
  109.     }else{
  110.       for(int i = 0; i < art.length; i++){
  111.         %>
  112.         &nbsp;&nbsp;&nbsp; <a href="#" id="href<%=i%>" onClick="writeHref('<%=art[i][0] %>','<%=art[i][3] %>','href<%=i%>')"><%=art[i][3] %> &nbsp;&nbsp;&nbsp; <%=art[i][1]%> </a>  &nbsp;<br />
  113.         <%
  114.         }
  115.     }
  116.     %>
  117.     </div>
  118. <div id="file" style="display:none" align="justify" >
  119. <div align="right"><a href="#" onclick="fh()">关闭</a></div>
  120.     <%
  121.     String fsql = "select top(20) * from files order by id desc";
  122.     String[][] file = dbc.getArray(fsql);
  123.     if(art==null){
  124.     }else{
  125.       for(int i = 0; i < file.length; i++){
  126.         %>
  127.          &nbsp;&nbsp;<a href="#" id="fhref<%=i%>" onClick="writeFHref('<%=file[i][6] %>','<%=file[i][1] %>','fhref<%=i%>')"><%=file[i][1]%></a> <br />
  128.         <%
  129.         }
  130.     }
  131.     %>
  132.     </div>
  133.   <script language="javascript" type="text/javascript">
  134.   function garticleDivShow(){
  135.     document.getElementById("garticle").style.display="block";
  136.   }
  137.   function garticleDivHide(){
  138.     setTimeout("gh()",500);
  139.   }//延迟0.5秒后关掉层
  140.   function gh(){
  141.     document.getElementById("garticle").style.display="none";
  142.   }
  143.   function writegHref(gaid,gatit,ghrefn){
  144.     document.myform.context.value=document.myform.context.value+'<br /><br /><a href=showarticle.jsp?id='+gaid+'>点击查看文章 '+gatit+'</a>';
  145.     document.getElementById(ghrefn).style.display='none';
  146.   }
  147.   function articleDivShow(){
  148.     document.getElementById("article").style.display="block";
  149.   }
  150.   function articleDivHide(){
  151.     setTimeout("adh()",500);
  152.   }//延迟0.5秒后关掉层
  153.   function adh(){
  154.     document.getElementById("article").style.display="none";
  155.   }
  156.   function writeHref(aid,atit,hrefn){
  157.     document.myform.context.value=document.myform.context.value+'<br /><br /><a href=changearticle.jsp?id='+aid+'>点击编辑文章 '+atit+'</a>';
  158.     document.getElementById(hrefn).style.display='none';
  159.   }
  160.   function fileDivShow(){
  161.     document.getElementById("file").style.display="block";
  162.   }
  163.   function fileDivHide(){
  164.     setTimeout("fh()",500);
  165.   }//延迟0.5秒后关掉层
  166.   function fh(){
  167.     document.getElementById("file").style.display="none";
  168.   }
  169.   function writeFHref(aid1,atit1,hrefn1){
  170.     document.myform.context.value=document.myform.context.value+'<br /><br /><a href=download.jsp?fn='+aid1+'>点击下载文件 '+atit1+'</a>';
  171.     document.getElementById(hrefn1).style.display='none';
  172.   }
  173.   document.myform.title.value='输入公告名称';
  174.   function makeempty(){
  175.     if(document.myform.title.value=='输入公告名称'){
  176.       document.myform.title.value='';
  177.     }
  178.   }
  179.   function makefull(){
  180.     if(document.myform.title.value==''){
  181.       document.myform.title.value='输入公告名称';
  182.     }
  183.   }
  184.   document.myform.context.value='在此处输入具体内容(不超过200字)';
  185.   function makeempty1(){
  186.     if(document.myform.context.value=='在此处输入具体内容(不超过200字)'){
  187.       document.myform.context.value='';
  188.     }
  189.   }
  190.   function makefull1(){
  191.     if(document.myform.context.value==''){
  192.       document.myform.context.value='在此处输入具体内容(不超过200字)';
  193.     }
  194.   }
  195.   </script>
  196. </div>
  197. <%sql.closeDB();
  198. }
  199.   }else{
  200.     response.sendRedirect("userlogin.jsp");
  201.   }
  202.   }catch(Exception ex){
  203.     ex.printStackTrace();
  204.   }
  205. %>
  206. </body>
  207. </html>