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

📄 news_edit_addfj.asp

📁 ASP程序实现的科技期刊系统
💻 ASP
字号:
<!--#include file="../Include/TimeOut.asp"-->
<%modulecode="0301"%>
<!--#include file="../Include/ModuleUserCheck.asp"-->
<!--#include file="../Include/online.asp"-->
<%
dim newstitle,senddate,submit
newstitle=request.querystring("newstitle")
senddate=request.querystring("senddate")
edit=Request.QueryString ("edit")'当修改附件时,此变量不为空
delfj=Request.QueryString ("delfj")'当删除已有附件时,此变量不为空
if newstitle<>"" then
session("newstitle")=newstitle
session("senddate")=senddate
end if

if edit="edit" then '修改
	set rst=server.createobject("ADODB.recordset")
	Strsql="select 附件名 from xt_VD_UserMessage where 消息题名='"&session("newstitle")&"' and 发送日期='"+Cstr(session("senddate"))+"'"
	rst.open Strsql,strconn
	fjFileName=split(rst("附件名"),"/")
	rst.close
	set rst=nothing
end if

if delfj="delfj" then 
	fjName=Request.QueryString ("fjName")
				'删除附件文件
				set fileobj=Server.CreateObject ("scripting.filesystemobject")
				filepath=server.mappath("\news\fj") & "\" & fjName
				if fileobj.FileExists (filepath) then fileobj.DeleteFile(filepath)
				set fileobj=nothing
				'修改数据库记录
				fjName="/"&fjName
				strsql="update XT_TD_usermessage set 附件名=replace(附件名,'"&fjName&"','') where 消息题名='"&session("newstitle")&"' and 发送日期='"+Cstr(session("senddate"))+"'"
				conn.Execute strsql,1
				Response.Redirect "news_edit_addfj.asp?edit=edit"
end if

%>
<script language="javascript">
function del(fjName)
{
form1.action="news_edit_addfj.asp?edit=edit&fjName="+fjName+"&delfj=delfj"
form1.submit()
}
</script>
<html>
<head>
<title>新闻发布</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../CssLib/Cssbutton.css">
</head>

<body text="#000000" bgcolor="#ffffff" >
<img src="images/title_fj.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" align="center"> 
      <table width="95%" border="0" cellspacing="0" cellpadding="0">
        <form name="form1" method="post" action="fjfileup.asp?strsql=<%=server.URLEncode(Request.QueryString("strsql"))%>&edit=<%=request.querystring("edit")%>&page=<%=Cstr(request.querystring("page"))&submit=submit%>" enctype="multipart/form-data">
          <tr> 
            <td width="21%" height="20" align="center">&nbsp;</td>
            <td width="79%" height="20">&nbsp;</td>
          </tr>
          <tr> 
            <td width="21%" height="20" align="center" bgcolor="#EAEAEA"> 新闻标题</td>
            <td width="79%" height="20" bgcolor="#EAEAEA"><%=newstitle%></td>
          </tr>
          <tr> 
            <td width="21%" height="20" align="center">&nbsp;</td>
            <td width="79%" height="20">&nbsp;</td>
          </tr>
		  <% if edit="edit" then %>
          <tr> 
            <td width="21%" height="20" align="center" bgcolor="#EAEAEA"> 已有附件</td>
            <td width="79%" height="20" bgcolor="#EAEAEA"> 
              <%
		if ubound(fjFileName)>0 then
			for i=1 to ubound(fjFileName)
				response.write "<input type='button' name='Submit4' value='删除' class='button' onclick=del('"&fjFileName(i)&"')>  "
				response.write fjFileName(i)
				response.write "<br>"
			next
		else 
				response.write "无"
		end if
			%>
            </td>
          </tr>
          <tr> 
            <td width="21%" height="20" align="center">&nbsp;</td>
            <td width="79%" height="20">&nbsp;</td>
          </tr>
		  <%end if %>
          <tr> 
            <td width="21%" height="20" bgcolor="#EAEAEA" align="center">附件1</td>
            <td width="79%" height="20" bgcolor="#EAEAEA"> 
              <input type="file" name="file" class="button">
              <input type="hidden" name="CopyrightInfo" value="http://www.chinaasp.com">
            </td>
          </tr>
          <tr> 
            <td width="21%" height="20" align="center">&nbsp;</td>
            <td width="79%" height="20">(注:您可以上传4个附件,注意只能上传“.doc/.zip/.rar”类型的文件。) 
            </td>
          </tr>
          <tr> 
            <td width="21%" height="20" bgcolor="#EAEAEA" align="center">附件2</td>
            <td width="79%" height="20" bgcolor="#EAEAEA"> 
              <input type="file" name="file2" class="button">
            </td>
          </tr>
          <tr> 
            <td width="21%" height="20" align="center">&nbsp;</td>
            <td width="79%" height="20">&nbsp;</td>
          </tr>
          <tr> 
            <td width="21%" height="20" align="center" bgcolor="#EAEAEA">附件3</td>
            <td width="79%" height="20" bgcolor="#EAEAEA"> 
              <input type="file" name="file3" class="button">
            </td>
          </tr>
          <tr> 
            <td width="21%" height="20" align="center">&nbsp;</td>
            <td width="79%" height="20">&nbsp;</td>
          </tr>
          <tr> 
            <td width="21%" height="20" align="center" bgcolor="#EAEAEA">附件4</td>
            <td width="79%" height="20" bgcolor="#EAEAEA"> 
              <input type="file" name="file4" class="button">
            </td>
          </tr>
          <tr> 
            <td width="21%" height="20" align="center">&nbsp;</td>
            <td width="79%" height="20">&nbsp;</td>
          </tr>
          <tr align="center"> 
            <td colspan="2" height="20"> 
              <input type="submit" name="Submit" value="提交" class="button">
              <input class="button" type="reset" name="Submit2" value="重填">
              <input class="button" type="button" name="Submit3" value="返回"onClick="history.back()">
            </td>
          </tr>
          <tr align="center"> 
            <td colspan="2" height="20">&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>

⌨️ 快捷键说明

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