changeradio.jsp
资源名称:bangong.rar [点击查看]
上传用户:dlqqsh
上传日期:2021-11-13
资源大小:7840k
文件大小:8k
源码类别:
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" />
- <body bgcolor="#ffffff">
- <%
- try{
- sql.getSQL2005conn("dbconfig.xml");
- String id = request.getParameter("id");
- ResultSet art = sql.getStatement("select * from radio where id="+id+";");art.next();
- String ud = (String)session.getAttribute("UD");
- String udid = (String)session.getAttribute("UDID");
- String un = (String)session.getAttribute("UN");
- String uid = (String)session.getAttribute("UID");
- String pp = (String)session.getAttribute("POPE");
- String login = (String)session.getAttribute("LOGIN");
- if(login!=null&&login.equals("OK")){
- %>
- <div align="center">
- <form action="changeradio_do.jsp" method="post" name="myform">
- <input type="hidden" value="<%=id%>" name="id" />
- <table cellpadding="0" cellspacing="0" border="1" width="96%">
- <tr>
- <td>公告名:<input type="text" onBlur="makefull()" onFocus="makeempty();" value="<%=art.getString("title")%>" name="title" size="50" /></td>
- </tr>
- <tr>
- <td>类型:
- <select name="type">
- <%
- String type = art.getString("type");
- if(pp.equals("all")){
- if(type.equals("1")){
- out.println("<option value='1' selected='selected'>全局公告</option>");
- out.println("<option value='0'>内部公告</option>");
- }else{
- out.println("<option value='0' selected='selected'>内部公告</option>");
- out.println("<option value='1'>全局公告</option>");
- }
- }else{
- if(type.equals("0")){
- out.println("<option value='0' selected='selected'>内部公告</option>");
- }
- }
- %>
- </select>
- </td>
- </tr>
- <tr>
- <td>
- <textarea id="my_Editor1" onBlur="makefull1()" onFocus="makeempty1()" name="context" cols="80" rows="8" ><%=art.getString("context")%></textarea>
- </td>
- </tr>
- <% if(pp.equals("all")){
- %>
- <tr>
- <td>
- <a onClick="fileDivShow()" href="#">添加已上传文件下载链接</a>
- </td>
- </tr>
- <tr>
- <td>
- <a onClick="articleDivShow()" href="#">添加多部门编辑文章链接(可编辑)</a>
- </td>
- </tr>
- <tr>
- <td>
- <a onClick="garticleDivShow()" href="#">添加共享文章链接(只查看)</a>
- </td>
- </tr>
- <%
- }
- %>
- <tr>
- <td align="center"><input type="submit" value="保存" /> <input type="reset" value="重新设定" /></td>
- </tr>
- </table>
- </form>
- </div>
- <%if(pp.equals("all")){ %>
- <div id="article" align="justify" >
- <div align="right"><a href="#" onclick="adh()">关闭</a></div>
- <%
- DBConn dbc = new DBConn();
- String asql = "select top(20) * from article where type = '2' order by id desc";
- String[][] art1 = dbc.getArray(asql);
- if(art1==null){
- }else{
- for(int i = 0; i < art1.length; i++){
- %>
- <a href="#" id="href<%=i%>" onClick="writeHref('<%=art1[i][0] %>','<%=art1[i][3] %>','href<%=i%>')"><%=art1[i][3] %> <%=art1[i][1]%> </a> <br />
- <%
- }
- }
- %>
- </div>
- <div id="garticle" align="justify" >
- <div align="right"><a href="#" onclick="gh()">关闭</a></div>
- <%
- 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="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(art1==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><br />';
- document.getElementById(hrefn1).style.display='none';
- }
- function makeempty(){
- if(document.myform.title.value=='输入公告名称'){
- document.myform.title.value='';
- }
- }
- function makefull(){
- if(document.myform.title.value==''){
- document.myform.title.value='输入公告名称';
- }
- }
- 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>
- <%
- }else{
- }
- %>
- <%
- art.close();
- sql.closeDB();
- }else{
- response.sendRedirect("userlogin.jsp");
- }
- }catch(Exception ex){
- ex.printStackTrace();
- }
- %>
- </body>
- </html>