⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 news_edit.asp

📁 ASP程序实现的科技期刊系统
💻 ASP
字号:
<!--#include file="../Include/TimeOut.asp"-->
<%modulecode="0301"%>
<!--#include file="../Include/ModuleUserCheck.asp"-->
<!--#include file="../Include/online.asp"-->
<%
'无变量传来时先赋初值,即添加状态
dim newsTitle,newsType,DepartCode,geterCode,YesYear,YesMonth,Yesday,YesDate,Contents,edit
newsTitle=""
newsType=""
DepartCode=""
geterCode=""
NewYesDate=date+7
NewYesYear=year(NewYesDate)
NewYesMonth=Month(NewYesDate)
NewYesday=day(NewYesDate)
YesDate=""
Contents=""
Senddate=""
edit=""

'取得传来变量
strsqlzh=Request.QueryString("strsql")
Newstitle=Request.Querystring("NewsTitle")
SendDate=Request.Querystring("SendDate")
page=Cstr(Request.Querystring("page"))
edit=Request.Querystring("edit")

  if Newstitle<>"" and SendDate<>"" then
	set rst=server.createobject("ADODB.recordset")
	Strsql="select * from xt_VD_UserMessage where 消息题名='"&newsTitle&"' and 发送日期='"+Cstr(SendDate)+"'"
	rst.open Strsql,strconn
	newsTitle=rst("消息题名")
	SendDate=rst("发送日期")
	yesDate=rst("有效日期")
	NewsType=rst("发送类别")
	GeterCode=rst("用户编码")
	DepartCode=rst("部门编码")
	SenderCode=rst("发送人编码")
	SenderName=rst("发送人姓名")
	Contents=rst("消息内容")
  end if
%>
<html>
<head>
<title>新闻发布</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../CssLib/Cssbutton.css">
<link rel="stylesheet" href="../CssLib/Csslink.css">
</head>

<body text="#000000" bgcolor="#ffffff" onload="javascript:ifHidden();">
<img src="images/title_edit.gif" width="200" height="27"><font color="#00CCFF" size="1">★★★★★<font color="#00CCFF" size="1">★★★★★</font><font color="#00CCFF" size="1">★★★★★</font><font color="#00CCFF" size="1">★★★★★</font>★★</font><br>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td width="22" height="20"><img src="../public/images/edit_bg_zs.gif" width="21" height="20"></td>
    <td background="../public/images/bg_left.gif" bgcolor="#0099FF"> 
      <div align="center"></div>
    </td>
    <td width="10"><img src="../public/images/edit_bg_ys.gif" width="21" height="20"></td>
  </tr>
  <tr> 
    <td background="../public/images/bg_left.gif">&nbsp;</td>
    <td bgcolor="#FFFFFF" height="200"> 
      <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
        <form name="conlist" method="post" action="../news/news_regist.asp?newstitle=<%=newstitle%>&oldSenddate=<%=SendDate%>&strsql=<%=server.URLEncode(Request.QueryString("strsql"))%>&edit=<%=request.querystring("edit")%>&page=<%=Cstr(request.querystring("page"))%>" onSubmit="return checkfun()">
          <tr> 
            <td height="20" width="8%">&nbsp;</td>
            <td height="20" width="18%">&nbsp;</td>
            <td height="20" width="68%">&nbsp;</td>
            <td height="20" width="6%">&nbsp;</td>
          </tr>
          <tr> 
            <td height="20" width="8%" bgcolor="#EAEAEA">&nbsp;</td>
            <td height="20" width="18%" bgcolor="#EAEAEA"> 
              <div align="left">标题</div>
            </td>
            <td height="20" width="68%" bgcolor="#EAEAEA"> 
              <input type="text" name="NewsTitle" size="40" maxlength="25" value="<%=newstitle%>">
              <font color="#FF0000">**</font> <br>
              (注:**为必填项,下同) <br>
            </td>
            <td height="20" width="6%" bgcolor="#EAEAEA">&nbsp;</td>
          </tr>
          <tr> 
            <td height="20" width="8%" bgcolor="white">&nbsp;</td>
            <td height="20" width="18%" bgcolor="white"> 
              <div align="left"></div>
            </td>
            <td height="20" width="68%" bgcolor="white">&nbsp;</td>
            <td height="20" width="6%" bgcolor="white">&nbsp;</td>
          </tr>
          <tr> 
            <td height="20" width="8%" bgcolor="#EAEAEA">&nbsp;</td>
            <td height="20" width="18%" bgcolor="#EAEAEA"> 
              <div align="left">发送类别</div>
            </td>
            <td height="20" width="68%" bgcolor="#EAEAEA"> 
              <input type="radio" name="NewsType" value="全体" <%if newstype<>"部门" and newstype<>"个人" then Response.Write "checked"%> onclick="hidden_D_U()">
              全体 
              <input type="radio" name="NewsType" value="部门" <%if newstype="部门" then response.write "checked"%> onclick="displayD()">
              部门 
              <input type="radio" name="NewsType" value="个人" <%if newstype="个人" then response.write "checked"%> onclick="displayU()">
              个人 <font color="#FF0000">**</font> </td>
            <td height="20" width="6%" bgcolor="#EAEAEA">&nbsp;</td>
          </tr>
          <tr> 
            <td height="20" width="8%" bgcolor="white">&nbsp;</td>
            <td height="20" width="18%" bgcolor="white"> 
              <div align="left"></div>
            </td>
            <td height="20" width="68%" bgcolor="white">&nbsp;</td>
            <td height="20" width="6%" bgcolor="white">&nbsp;</td>
          </tr>
          <tr> 
            <td id=DepartCode height="20" colspan="4" sytle="display:none"> 
              <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
                <tr> 
                  <td height="20" width="8%" bgcolor="#EAEAEA">&nbsp;</td>
                  <td height="20" width="18%" bgcolor="#EAEAEA"> 
                    <div align="left">接收部门编码</div>
                  </td>
                  <td height="20" width="68%" bgcolor="#EAEAEA"> 
                    <input type="text" name="DepartCode" maxlength="10" size="10" value="<%=DepartCode%>">
                    <font color="#FF0000"><font color="#FF0000"><a href="javascript:open2('CodeHelp/TopDepartType.asp')"><img src="../public/images/search.gif" width="21" height="22" border="0" ></a></font></font> 
                  </td>
                  <td height="20" width="6%" bgcolor="#EAEAEA">&nbsp;</td>
                </tr>
                <tr> 
                  <td height="20" width="8%" bgcolor="white">&nbsp;</td>
                  <td height="20" width="18%" bgcolor="white"> 
                    <div align="left"></div>
                  </td>
                  <td height="20" width="68%" bgcolor="white">&nbsp;</td>
                  <td height="20" width="6%" bgcolor="white">&nbsp;</td>
                </tr>
              </table>
            </td>
          </tr>
          <tr> 
            <td id=UserCode height="20" colspan="4"> 
              <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
                <tr> 
                  <td height="20" width="8%" bgcolor="#EAEAEA">&nbsp;</td>
                  <td height="20" width="18%" bgcolor="#EAEAEA"> 
                    <div align="left">接收者编码</div>
                  </td>
                  <td height="20" width="68%" bgcolor="#EAEAEA"> 
                    <input type="text" name="getercode" maxlength="10" size="10" value="<%=getercode%>">
                    <font color="#FF0000"><font color="#FF0000"><a href="javascript:open2('CodeHelp/Person_CodeHelp.asp?Table_name=Xt_VC_user&Pname=getercode')"><img src="../public/images/search.gif" width="21" height="22" border="0" ></a></font></font><br>
                    <font color="#FF0000"> </font></td>
                  <td height="20" width="6%" bgcolor="#EAEAEA">&nbsp;</td>
                </tr>
                <tr> 
                  <td height="20" width="8%" bgcolor="white">&nbsp;</td>
                  <td height="20" width="18%" bgcolor="white"> 
                    <div align="left"></div>
                  </td>
                  <td height="20" width="68%" bgcolor="white">&nbsp;</td>
                  <td height="20" width="6%" bgcolor="white">&nbsp;</td>
                </tr>
              </table>
            </td>
          </tr>
          <tr> 
            <td height="20" width="8%" bgcolor="#EAEAEA">&nbsp;</td>
            <td height="20" width="18%" bgcolor="#EAEAEA"> 
              <div align="left">有效日期</div>
            </td>
            <td height="20" width="68%" bgcolor="#EAEAEA"> 
              <input name="YesYear"maxlength=4 size="4" value="<%if edit="edit" then response.write year(yesdate) else response.write NewYesYear end if%>">
              <select name="YesMonth">
                <%for i=1 to 12%>
                <option value="<%=i%>"<%if edit="edit" then if month(yesdate)=i then response.write "selected" end if else if NewYesMonth=i then response.write "selected" end if end if%>> 
                <%=i%></option>
                <%next %>
              </select>
              <select name="YesDay">
                <%for i=1 to 31%>
                <option value="<%=i%>" <%if edit="edit" then if day(yesdate)=i then response.write "selected" end if else if NewYesday=i then response.write "selected" end if end if%>> 
                <%=i%></option>
                <%next %>
              </select>
              日<font color="#FF0000">**</font>(请输入4位年份数字) </td>
            <td height="20" width="6%" bgcolor="#EAEAEA">&nbsp;</td>
          </tr>
          <tr> 
            <td height="20" width="8%" bgcolor="white">&nbsp;</td>
            <td height="20" width="18%" bgcolor="white"> 
              <div align="left"></div>
            </td>
            <td height="20" width="68%" bgcolor="white">&nbsp;</td>
            <td height="20" width="6%" bgcolor="white">&nbsp;</td>
          </tr>
          <tr> 
            <td height="20" width="8%" bgcolor="#EAEAEA">&nbsp;</td>
            <td height="20" width="18%" bgcolor="#EAEAEA"> 
              <div align="left">内容</div>
            </td>
            <td height="20" width="68%" bgcolor="#EAEAEA"> 
              <textarea name="Contents" rows="5" cols="50"><%=contents%></textarea>
              <font color="#FF0000"> ** </font> </td>
            <td height="20" width="6%" bgcolor="#EAEAEA">&nbsp;</td>
          </tr>
		  <%if edit="edit" then%>
          <tr> 
            <td height="20" width="8%" bgcolor="#FFFFFF">&nbsp;</td>
            <td height="20" width="18%" bgcolor="#FFFFFF">&nbsp;</td>
            <td height="20" width="68%" bgcolor="#FFFFFF">&nbsp;</td>
            <td height="20" width="6%" bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
          <tr bgcolor="#EAEAEA"> 
            <td height="20" width="8%">&nbsp;</td>
            <td height="20" colspan="2" bgcolor="#EAEAEA"> <a href="News_edit_addfj.asp?edit=edit&newstitle=<%=newstitle%>&SendDate=<% =senddate%>" class="blank"><img src="images/fj.gif" width="16" height="16" alt="修改附件" border="0"> 
              添加/修改附件</a> </td>
            <td height="20" width="6%">&nbsp;</td>
          </tr>
		  <%end if%>
          <tr> 
            <td height="20" width="8%" bgcolor="#FFFFFF">&nbsp;</td>
            <td height="20" width="18%" bgcolor="#FFFFFF"> 
              <input type="hidden" name="senddate" value="<%=senddate%>">
            </td>
            <td height="20" width="68%" bgcolor="#FFFFFF">&nbsp;</td>
            <td height="20" width="6%" bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
          <tr> 
            <td height="20" colspan="4" bgcolor="#FFFFFF"> 
              <div align="center"> 
                <input class="button" type="submit" name="Submit" value="提交" >
                <input class="button" type="reset" name="Submit2" value="重填">
                <input class="button" type="button" name="Submit3" value="返回"onClick="back()">
              </div>
            </td>
          </tr>
          <tr> 
            <td height="20" width="8%" bgcolor="#FFFFFF">&nbsp;</td>
            <td height="20" width="18%" bgcolor="#FFFFFF">&nbsp;</td>
            <td height="20" width="68%" bgcolor="#FFFFFF">&nbsp;</td>
            <td height="20" width="6%" bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
        </form>
      </table>
    </td>
    <td bgcolor="#FFFFFF" background="../public/images/bg_left.gif">&nbsp;</td>
  </tr>
  <tr> 
    <td width="22"><img src="../public/images/edit_bg_zx.gif" width="21" height="20"></td>
    <td bgcolor="#FFFFFF" background="../public/images/bg_left.gif" height="20">&nbsp;</td>
    <td width="10"> 
      <div align="right"><img src="../public/images/edit_bg_yx.gif" width="21" height="20"></div>
    </td>
  </tr>
</table>
</body>
</html>
<script language="vbscript">
function checkfun()
		checkfun=true
		if ConList.NewsTitle.value ="" then 
			checkfun=false
			window.alert "消息标题不能为空,请重新输入!"
			exit function
		end if
		if ConList("Newstype")(1).checked then 
		   if ConList.DepartCode.value ="" then 
			checkfun=false
			window.alert "您选择的发送类型为部门,部门编码不能为空,请重新输入!"
			end if 
			exit function
		end if

		if ConList("NewsType")(2).checked then 
		   if ConList.Getercode.value ="" then 
			checkfun=false
			window.alert "您选择的发送类型为个人,接收人姓名不能为空,请重新输入!"
			end if 
			exit function
		end if		
		if isnumeric(ConList.Yesyear.value)then 
			 if ConList.Yesyear.value<1901 or ConList.Yesyear.value>2099 then
				checkfun=false
				window.alert "有效日期填写错误,请重新填写!"
				exit function
			end if
			else
			checkfun=false
			window.alert "数据类型错误,请输入四位数字年份!"
			exit function	
		end if

		if ConList.Contents.value ="" then 
			checkfun=false
			window.alert "消息内容不能为空,请重新输入!"
			exit function
		end if
	end function
	function back()
		history.back
	end function

</script>
<script language="javascript">
function hidden_D_U(){
DepartCode.style.display="none"
UserCode.style.display="None"
	}
function displayD(){
DepartCode.style.display=""
UserCode.style.display="None"
	}
function displayU(){
DepartCode.style.display="none"
UserCode.style.display=""
	}
function ifHidden(){
	if (ConList("NewsType")(0).checked)
	{
DepartCode.style.display="none"
UserCode.style.display="None"
	}
	if (ConList("NewsType")(1).checked)
	{
DepartCode.style.display=""
UserCode.style.display="None"
	}
	if (ConList("NewsType")(2).checked)
	{
DepartCode.style.display="none"
UserCode.style.display=""
	}
}
function open1()
{
	window.open("CodeHelp/TopDepartType.asp?Table_name=Xt_VC_user&Pname=DepartCode","帮助","height=220,width=330,toolbar=no,menubar=no,resizable=no,status=no,location=no")
}
function open2(url)
{
	window.open(url,"帮助","height=220,width=330,toolbar=no,menubar=no,scrollbar=0,resizable=no,status=no,location=no")
}
</script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -