changeradio.jsp~24~
上传用户: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><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.     DBConn dbc = new DBConn();
  100.     String gasql = "select top(20) * from article where type = '2' or type = '0' order by id desc";
  101.     String[][] gart = dbc.getArray(gasql);
  102.     if(gart==null){
  103.     }else{
  104.       for(int i = 0; i < gart.length; i++){
  105.         %>
  106.         &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 />
  107.         <%
  108.         }
  109.     }
  110.     %>
  111.     </div>
  112.         <div id="file" style="display:none" align="justify" >
  113.           <div align="right"><a href="#" onclick="fh()">关闭</a></div>
  114.           <%
  115.           String fsql = "select top(20) * from files order by id desc";
  116.           String[][] file = dbc.getArray(fsql);
  117.           if(art1==null){
  118.           }else{
  119.             for(int i = 0; i < file.length; i++){
  120.               %>
  121.               &nbsp;&nbsp;<a href="#" id="fhref<%=i%>" onClick="writeFHref('<%=file[i][6] %>','<%=file[i][1] %>','fhref<%=i%>')"><%=file[i][1]%></a> <br />
  122.               <%
  123.               }
  124.             }
  125.             %>
  126.             </div>
  127.             <script language="javascript" type="text/javascript">
  128.             function articleDivShow(){
  129.               document.getElementById("article").style.display="block";
  130.             }
  131.             function articleDivHide(){
  132.               setTimeout("adh()",500);
  133.             }//延迟0.5秒后关掉层
  134.             function adh(){
  135.               document.getElementById("article").style.display="none";
  136.             }
  137.             function writeHref(aid,atit,hrefn){
  138.               document.myform.context.value=document.myform.context.value+'<br /><br /><a href=changearticle.jsp?id='+aid+'>点击进入文章 '+atit+'</a>';
  139.               document.getElementById(hrefn).style.display='none';
  140.             }
  141.             function fileDivShow(){
  142.               document.getElementById("file").style.display="block";
  143.             }
  144.             function fileDivHide(){
  145.               setTimeout("fh()",500);
  146.             }//延迟0.5秒后关掉层
  147.             function fh(){
  148.               document.getElementById("file").style.display="none";
  149.             }
  150.             function writeFHref(aid1,atit1,hrefn1){
  151.               document.myform.context.value=document.myform.context.value+'<br /><br /><a href=download.jsp?fn='+aid1+'>点击下载文件 '+atit1+'</a>';
  152.               document.getElementById(hrefn1).style.display='none';
  153.             }
  154.             function makeempty(){
  155.               if(document.myform.title.value=='输入公告名称'){
  156.                 document.myform.title.value='';
  157.               }
  158.             }
  159.             function makefull(){
  160.               if(document.myform.title.value==''){
  161.                 document.myform.title.value='输入公告名称';
  162.               }
  163.             }
  164.             function makeempty1(){
  165.               if(document.myform.context.value=='在此处输入具体内容(不超过200字)'){
  166.                 document.myform.context.value='';
  167.               }
  168.             }
  169.             function makefull1(){
  170.               if(document.myform.context.value==''){
  171.                 document.myform.context.value='在此处输入具体内容(不超过200字)';
  172.               }
  173.             }
  174.             </script>
  175.             <%
  176.             }else{
  177.             }
  178.          %>
  179.             <%
  180.             art.close();
  181.             sql.closeDB();
  182.           }else{
  183.             response.sendRedirect("userlogin.jsp");
  184.           }
  185.         }catch(Exception ex){
  186.           ex.printStackTrace();
  187.         }
  188.         %>
  189.         </body>
  190. </html>