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

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