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

📄 newsaddjssave.asp

📁 天创商务网客户资源管理系统 v1,asp+Access,iis5
💻 ASP
字号:
<!--#include file = include.asp-->
<%
'==========================================
'
'  
'
'  
'
'==========================================
'
'子程序作用:添加商务信息到JS列表
'最后修改时间:2003-17-05 17:52:26 
'==========================================
  Domain=Request.ServerVariables("SERVER_NAME")
  gFilePath=Request.ServerVariables("PATH_INFO")
  gFilePath=lcase(left(gFilePath,instrRev(gFilePath,"/")))
  CountN=len(gFilePath)
  gFilePath=lcase(left(gFilePath,CountN-1))
  gFilePath=lcase(left(gFilePath,instrRev(gFilePath,"/")))
  AllPath="http://"+Domain&gfilepath

  if request.form("WordNews")<>"" then
    set rs1=Server.CreateObject("adodb.recordset")
    sql1="select * from JSFile where FileName='"&request.form("FileName1")&"' and JSName='"&request.form("WordNewsName")&"'"
    rs1.open sql1,conn,3,3
    session("errormsg")=""
    if not rs1.eof then session("errormsg")="JS列表已存在此条商务信息,请另选其它的JS列表"    
    if session("errormsg")="" then
      set rs3=Server.CreateObject("adodb.recordset")
      sql3="Select IndexCount from JS where Type='文字商务信息' and JSNameCN='"&request.form("WordNewsName")&"'"
      rs3.open sql3,conn,1,1
      IndexCount=rs3("IndexCount")
      rs3.close
      set rs3=nothing
      set rs2=Server.CreateObject("adodb.recordset")
      sql2="select * from JSFile where JSType='文字商务信息' and JSName='"&request.form("WordNewsName")&"'"
      rs2.open sql2,conn,3,3
      if not rs2.eof then rs2.movefirst
      if rs2.recordcount>=IndexCount then rs2.delete:rs2.update
      set rs=Server.CreateObject("adodb.recordset")
      sql="select Title,BigClassEN,BigClassCN,SmallClassEN,SmallClassCN,FileName,Date from News Where FileName='"&request.form("FileName1")&"'"
      rs.open sql,conn,1,1
      BigClassCN=rs("BigClassCN")
      SmallClassCN=rs("SmallClassCN")
      rs1.addnew
      rs1("Title")=rs("title")
      rs1("BigClassEN")=rs("BigClassEN")
      rs1("SmallClassEN")=rs("SmallClassEN")
      rs1("FileName")=rs("FileName")
      rs1("Date")=rs("Date")
      rs1("JSType")="文字商务信息"
      rs1("JSName")=request.form("WordNewsName")
      rs1.update
      rs.close
      set rs=nothing
    end if
    rs1.close
    set rs1=nothing
    Call WordNews
    Call result
  elseif request.form("PhotoNews")<>"" then
    set rs1=Server.CreateObject("adodb.recordset")
    sql1="select * from JSFile where FileName='"&request.form("FileName2")&"' and JSName='"&request.form("PhotoNewsName")&"'"
    rs1.open sql1,conn,3,3
    session("errormsg")=""
    if not rs1.eof then session("errormsg")="JS列表已存在此条商务信息,请另选其它的JS列表"
    if request.form("PhotoPath")="" then session("errormsg")="图片商务信息必须填写图片的路径"
    if session("errormsg")="" then
      set rs3=Server.CreateObject("adodb.recordset")
      sql3="Select PhotoCSS,IndexCount from JS where Type='图片商务信息' and JSNameCN='"&request.form("PhotoNewsName")&"'"
      rs3.open sql3,conn,1,1
      IndexCount=rs3("IndexCount")
      PhotoCSS=rs3("PhotoCSS")
      rs3.close
      set rs3=nothing
      set rs2=Server.CreateObject("adodb.recordset")
      sql2="select * from JSFile where JSType='图片商务信息' and JSName='"&request.form("PhotoNewsName")&"'"
      rs2.open sql2,conn,3,3
      if not rs2.eof then rs2.movefirst
      if rs2.recordcount>=IndexCount then rs2.delete:rs2.update
      set rs=Server.CreateObject("adodb.recordset")
      sql="select Title,BigClassEN,BigClassCN,SmallClassEN,SmallClassCN,FileName,Date from News Where FileName='"&request.form("FileName2")&"'"
      rs.open sql,conn,1,1
      BigClassCN=rs("BigClassCN")
      SmallClassCN=rs("SmallClassCN")
      rs1.addnew
      rs1("Title")=rs("title")
      rs1("BigClassEN")=rs("BigClassEN")
      rs1("SmallClassEN")=rs("SmallClassEN")
      rs1("FileName")=rs("FileName")	  
      rs1("Date")=rs("Date")
      rs1("JSType")="图片商务信息"
      rs1("JSName")=request.form("PhotoNewsName")
      rs1("PhotoPath")=request.form("PhotoPath")
      rs1.update
      rs.close
      set rs=nothing
    end if
    rs1.close
    set rs1=nothing
    select case PhotoCSS
    case "CSS1" Call CSS1
    case "CSS2" Call CSS2
    case "CSS3" Call CSS3
    end select
    Call result
  End if

  Sub WordNews()
    set rs=Server.CreateObject("adodb.recordset")
    sql="select * from JSFile where JSType='文字商务信息' and JSName='"&request.form("WordNewsName")&"'"
    rs.open sql,conn,1,1
    set rs3=Server.CreateObject("adodb.recordset")
    sql3="Select IndexCount,JSNameEN,NewsTP from JS where Type='文字商务信息' and JSNameCN='"&request.form("WordNewsName")&"'"
    rs3.open sql3,conn,1,1
    Set MyFile=Server.CreateObject("Scripting.FileSystemObject")
    set CrHNJS=MyFile.CreateTextFile(Server.MapPath("..")&"\JS\"&rs3("JSNameEN")&".js")
    set CrHNHt=MyFile.CreateTextFile(Server.MapPath("..")&"\JS\"&rs3("JSNameEN")&".htm")
    CrHNHt.WriteLine("<script src="&rs3("JSNameEN")&".js></script>")
    for i=1 to rs3("IndexCount")
      if rs.eof then exit for
      Content=""&rs3("NewsTP")&"<a href="&AllPath&""&rs("BigClassEN")&"/"&rs("SmallClassEN")&"/"&rs("FileName")&".htm target=_blank>"&rs("Title")&"</a><br>"
      CrHNJS.WriteLine("document.write("""&Content&""")")
      rs.movenext
    next
    rs.close
    set rs=nothing
  End Sub

  Sub CSS1()
    set rs=Server.CreateObject("adodb.recordset")
    sql="select * from JSFile where JSType='图片商务信息' and JSName='"&request.form("PhotoNewsName")&"' order by ID desc"
    rs.open sql,conn,1,1
    set rs3=Server.CreateObject("adodb.recordset")
    sql3="Select IndexCount,JSNameEN,PicWi,PicHi,NewsTP from JS where Type='图片商务信息' and JSNameCN='"&request.form("PhotoNewsName")&"'"
    rs3.open sql3,conn,1,1
    Set MyFile=Server.CreateObject("Scripting.FileSystemObject")
    set CrHNJS=MyFile.CreateTextFile(Server.MapPath("..")&"\JS\"&rs3("JSNameEN")&".js")
    set CrHNHt=MyFile.CreateTextFile(Server.MapPath("..")&"\JS\"&rs3("JSNameEN")&".htm")
    CrHNHt.WriteLine("<script src="&rs3("JSNameEN")&".js></script>")
    Table="<table whidth=100% ><tr>"
    CrHNJS.WriteLine("document.write("""&Table&""")")
    for i=1 to rs3("IndexCount")
      if rs.eof then exit for
      Content="<td><a href="&AllPath&""&rs("BigClassEN")&"/"&rs("SmallClassEN")&"/"&rs("FileName")&".htm target=_blank><img src="&rs("PhotoPath")&" width="&rs3("PicWi")&" height="&rs3("PicHi")&" border=1 style='border-color:#000000'></a></td>"
      CrHNJS.WriteLine("document.write("""&Content&""")")
      rs.movenext
    next
    Table="</tr><tr>"
    CrHNJS.WriteLine("document.write("""&Table&""")")
    rs.movefirst
    for i=1 to rs3("IndexCount")
      if rs.eof then exit for
      Content="<td>"&rs3("NewsTP")&"<a href="&AllPath&""&rs("BigClassEN")&"/"&rs("SmallClassEN")&"/"&rs("FileName")&".htm target=_blank>"&rs("Title")&"</a><br></td>"
      CrHNJS.WriteLine("document.write("""&Content&""")")
      rs.movenext
    next
    Table="</tr></table>"
    CrHNJS.WriteLine("document.write("""&Table&""")")
    rs.close
    set rs=nothing
  End Sub

  Sub CSS2()
    set rs=Server.CreateObject("adodb.recordset")
    sql="select * from JSFile where JSType='图片商务信息' and JSName='"&request.form("PhotoNewsName")&"' order by ID desc"
    rs.open sql,conn,1,1
    set rs3=Server.CreateObject("adodb.recordset")
    sql3="Select Depict,IndexCount,JSNameEN,PicWi,PicHi,NewsTP from JS where Type='图片商务信息' and JSNameCN='"&request.form("PhotoNewsName")&"'"
    rs3.open sql3,conn,1,1
    Set MyFile=Server.CreateObject("Scripting.FileSystemObject")
    set CrHNJS=MyFile.CreateTextFile(Server.MapPath("..")&"\JS\"&rs3("JSNameEN")&".js")
    set CrHNHt=MyFile.CreateTextFile(Server.MapPath("..")&"\JS\"&rs3("JSNameEN")&".htm")
    CrHNHt.WriteLine("<script src="&rs3("JSNameEN")&".js></script>")
    Table="<table whidth=100% >"
    CrHNJS.WriteLine("document.write("""&Table&""")")
    for i=1 to rs3("IndexCount")
      if rs.eof then exit for
      set rs4=Server.CreateObject("adodb.recordset")
      sql4="Select Content from News Where FileName='"&rs("FileName")&"'"
      rs4.open sql4,conn,1,1
      depict=left(replace(rs4("Content"),"'","''"),rs3("Depict"))
      if instr(depict,chr(13))>0 then depict=replace(depict,chr(13),"")'去回车
      if instr(depict,chr(10))>0 then depict=replace(depict,chr(10),"")'去满行
      depict=replace(depict,chr(34),"″")
      Content="<tr><td><a href="&AllPath&""&rs("BigClassEN")&"/"&rs("SmallClassEN")&"/"&rs("FileName")&".htm target=_blank><img src="&rs("PhotoPath")&" width="&rs3("PicWi")&" height="&rs3("PicHi")&" border=1 style='border-color:#000000'></a></td><td width=90% >"&rs3("NewsTP")&"<a href="&AllPath&""&rs("BigClassEN")&"/"&rs("SmallClassEN")&"/"&rs("FileName")&".htm target=_blank>"&rs("title")&"</a><br>&nbsp;&nbsp;"&depict&"....<a href="&AllPath&""&rs("BigClassEN")&"/"&rs("SmallClassEN")&"/"&rs("FileName")&".htm target=_blank>阅读全文</a></td></tr><tr><td colspan=2><hr noshade size=1></td></tr>"
      CrHNJS.WriteLine("document.write("""&Content&""")")
      rs.movenext
    next
    Table="</table>"
    CrHNJS.WriteLine("document.write("""&Table&""")")
    rs.close
    set rs=nothing
  End Sub

  Sub CSS3()
    set rs=Server.CreateObject("adodb.recordset")
    sql="select * from JSFile where JSType='图片商务信息' and JSName='"&request.form("PhotoNewsName")&"' order by ID desc"
    rs.open sql,conn,1,1
    set rs3=Server.CreateObject("adodb.recordset")
    sql3="Select IndexCount,JSNameEN,PicWi,PicHi,NewsTP from JS where Type='图片商务信息' and JSNameCN='"&request.form("PhotoNewsName")&"'"
    rs3.open sql3,conn,1,1
    Set MyFile=Server.CreateObject("Scripting.FileSystemObject")
    set CrHNJS=MyFile.CreateTextFile(Server.MapPath("..")&"\JS\"&rs3("JSNameEN")&".js")
    set CrHNHt=MyFile.CreateTextFile(Server.MapPath("..")&"\JS\"&rs3("JSNameEN")&".htm")
    CrHNHt.WriteLine("<script src="&rs3("JSNameEN")&".js></script>")
    for i=1 to rs3("IndexCount")
      if rs.eof then exit for
      Content="<a href="&AllPath&""&rs("BigClassEN")&"/"&rs("SmallClassEN")&"/"&rs("FileName")&".htm target=_blank><img src="&rs("PhotoPath")&" width="&rs3("PicWi")&" height="&rs3("PicHi")&" border=1 style='border-color:#000000'><br></a>"&rs3("NewsTP")&"<a href="&AllPath&""&rs("BigClassEN")&"/"&rs("SmallClassEN")&"/"&rs("FileName")&".htm target=_blank>"&rs("title")&"</a><br><br>"
      CrHNJS.WriteLine("document.write("""&Content&""")")
      rs.movenext
    next
    rs.close
    set rs=nothing
  End Sub
  Sub result()
%>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<body background="images/BLogo.gif">
<form method=post action=NewsManage.asp?SmallClassCN=<%=SmallClassCN%>&BigClassCN=<%=BigClassCN%>>
 <table  width="349" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="#4397c5">
  <tr bgcolor="#AED2E6" >
      <td height="20"><b>
      <% if session("errorMsg")<>"" then %>
      操作错误
      <% else %>
        添加到JS列表成功
      <% end if%>
	  </b></td>
  </tr>
  <tr align="center"> 
    <td height="115" bgcolor="#FFFFFF" background="images/BLogo.gif">
        <font color=red><%=session("errormsg")%></font>
      <% if session("errorMsg")<>"" then %>
	     <br><br><br>
		 <input type="button" value=" 返 回 " onclick="javascript:history.back()">
      <% else  %>
             <br>按确定键返回"商务信息管理"<br><br><br><br>
             <input type="submit" value=" 确 定 ">
      <% end if:session("errorMsg")="" %>
    </td>
  </tr>
</table>
</form>
<% end Sub%>

⌨️ 快捷键说明

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