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

📄 admin_jsadd.asp

📁 新闻发布系统
💻 ASP
字号:
<!--#include file = "include.asp"-->
<!--#include file = "admin_Checkmana.asp"-->
<%
'=========================================================
'产品目录:风讯产品N系列
'软件名称:风讯站点管理系统
'当前版本:2004.I.0225
'最新更新:2004.2.10
'=========================================================
'Copyright (C) 2002-2004 cooin.com. All rights reserved.
'网站: http://www.cooin.com  Foosun.net
'程序制作:轻风云(QQ:655071)
'Email:skeen@cooin.com,skeen@Foosun.net
'论坛支持:风讯在线论坛(http://bbs.cooin.com   http://bbs.foosun.net)
'=========================================================
if EnoughPopedom("jsmake")=1 then
Response.write"<script>alert(""[操作失败]\n\n你的权限不足!\n\n请与系统管理员联系获得足够的权限!"");location.href=""javascript:history.back()"";</script>"
Response.end
end if

  Set fso=Server.CreateObject("scripting.FileSystemObject")
  Sub DelJS(FileName)
     if fso.FileExists(Server.Mappath("..")&"\otherJS\"&FileName&".js") then
        fso.DeleteFile(Server.Mappath("..")&"\otherJS\"&FileName&".js")
     end if
	 if fso.FileExists(Server.Mappath("..")&"\otherjs\TOPjs\"&FileName&".js") then
        fso.DeleteFile(Server.Mappath("..")&"\otherjs\TOPjs\"&FileName&".js")
     end if
     if fso.FileExists(Server.Mappath("..")&"\otherjs\"&FileName&".htm") then
        fso.DeleteFile(Server.Mappath("..")&"\otherjs\"&FileName&".htm")
     end if
  End SUb

  Sub addjss()
    if request.form("JSNameCN")="" or request.form("JSNameEN")="" then Call Wran("JS中文名称或者英文名称不能为空")
	if len(request.form("JSNameCN"))>10 or len(request.form("JSNameEN"))>10 then Call Wran("中文字数和英文字数超过10个字。")
    set rs=Server.CreateObject("adodb.recordset")
    sql="select * from JS where JSNameCN='"&replace(request.form("JSNameCN"),"'","''")&"' or JSNameCN='"&replace(request.form("JSNameEN"),"'","''")&"'"
    rs.open sql,conn,3,3
    if not rs.eof then Call Wran("JS中文名称或者英文名称与现存的JS重名")
    rs.addnew
      rs("JSNameCN")=replace(request.form("JSNameCN"),"'","''")
      rs("JSNameEN")=replace(request.form("JSNameEN"),"'","''")	  
      rs("Type")=request.form("Type")
      if request.form("Type")="文字新闻" then
        rs("IndexCount")=request.form("IndexCount1")
      else
        rs("IndexCount")=request.form("IndexCount")
        rs("PhotoCSS")=request.form("PhotoCSS")
		if request.form("PhotoCSS")="CSS2" then rs("Depict")=request.form("Depict")
        rs("PicWi")=request.form("PicWi")
        rs("PicHi")=request.form("PicHi")
      end if
    rs.update
    rs.close
    set rs=nothing
	fso.CreateTextFile(Server.Mappath("..")&"\otherjs\"&replace(request.form("JSNameEN"),"'","''")&".js")
	response.redirect"admin_JSManage.asp"
	response.end
  End Sub

  Sub MoJS()
    set rs=Server.CreateObject("adodb.recordset")
    sql="select * from JS where ID="&request.form("ID")
    rs.open sql,conn,3,3
      if request.form("Type")="文字新闻" then
        rs("IndexCount")=request.form("IndexCount1")
      else
        rs("IndexCount")=request.form("IndexCount")
        rs("PicWi")=request.form("PicWi")
        rs("PicHi")=request.form("PicHi")
		rs("Depict")=request.form("Depict")
      end if
    rs.update
    rs.close
    set rs=nothing
    response.redirect"admin_JSManage.asp"
  End Sub


  Sub Wran(content)
%>
  <script>
    history.back()
    alert("<%=content%>")
  </script>
<%
  response.end
  End Sub
%>
<%
  if request.form("o")="ADD" then
    Call addjss
  end if
  set rs=Server.CreateObject("adodb.recordset")
  sql="select * from JS order by Date Desc"
  rs.open sql,conn,1,1
%>
<body bgcolor="#FFFFFF">
<form name="form1" method="POST" action="" onsubmit="return CheckJS()">
  <table  width="98%" border="0" cellpadding="0" align="center" cellspacing="1" bgcolor="#7ED3A7">
    <tr bgcolor="#9FBBDF"> 
      <td height="25" colspan="2" align="center" valign="middle"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/bg1.gif">
          <tr> 
            <td height="26"> <div align="center"><b><font color="0">新建JS列表</font></b></div></td>
          </tr>
        </table>
        
      </td>
    </tr>
    <tr bgcolor="#F7FFF4"> 
      <td width="264" height="20" valign="middle" bgcolor="#F7FFF4" onMouseOver=this.style.backgroundColor='#FAFBFC'; onMouseOut=this.style.backgroundColor=''; this.style.cursor='hand';> 
        <div align="right">JS中文名称:</div></td>
      <td width="488" valign="middle"> 
        <input type="text" name="JSNameCN"> </td>
    </tr>
    <tr bgcolor="#F7FFF4"> 
      <td width="264" height="20" valign="middle"> 
        <div align="right">JS英文名称:</div></td>
      <td width="488" valign="middle"> 
        <input type="text" name="JSNameEN"> </td>
    </tr>
    <tr bgcolor="#F7FFF4"> 
      <td width="264" height="20" valign="middle"> 
        <div align="right">JS类型: 
        </div></td>
      <td width="488" valign="middle"> 
        <input id=WordNews type="radio" name="Type" value="文字新闻" checked onclick="return CheckType()">
        文字新闻 
        <input id=PhotoNews type="radio" name="Type" value="图片新闻" onclick="return CheckType()">
        图片新闻 </td>
    </tr>
    <tr bgcolor="#F7FFF4" align="center"> 
      <td height="27" colspan="2" valign="middle"> 
        <table width="100%" border="0" cellspacing="1" cellpadding="0" id=WordNews style="DISPLAY: ">
          <tr bgcolor="#F7FFF4"> 
            <td width="35%"> 
              <div align="right">新闻调用数量</div></td>
            <td width="4%"> 
              <input type="text" name="IndexCount1" size="5" value="5" onblur="Isvalidity(IndexCount1,'新闻调用数量')"> 
            </td>
            <td width="16%"> 
              <div align="center"></div></td>
            <td width="45%">&nbsp;</td>
          </tr>
        </table>
        <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#7ED3A7" id=PhotoNews style="DISPLAY: none">
          <tr bgcolor="#F7FFF4"> 
            <td width="35%"> 
              <div align="right">新闻调用数量</div></td>
            <td width="65%"> 
              <input type="text" name="IndexCount" size="5" value=1 onBlur="Isvalidity(IndexCount,'新闻调用数量')">
              <strong><font color="#FF0000">注意:如果选择的样式D,新闻调用数目必须为&quot;1&quot;</font></strong></td>
          </tr>
          <tr bgcolor="#F7FFF4"> 
            <td width="35%" height="25"> 
              <div align="right">样式</div></td>
            <td width="65%" height="25"> 
              <input id=CSS1 type="radio" name="PhotoCSS" value="CSS1" onclick="return CheckCSS()" checked>
              样式A 
              <input id=CSS2 type="radio" name="PhotoCSS" value="CSS2" onclick="return CheckCSS()">
              样式B 
              <input id=CSS3 type="radio" name="PhotoCSS" value="CSS3" onclick="return CheckCSS()">
              样式C 
              <input id=CSS4 type="radio" name="PhotoCSS" value="CSS4" onclick="return CheckCSS()">
              样式D</tr>
          <tr bgcolor="#F7FFF4"> 
            <td width="35%" height="20"> 
              <div align="right">图片高度</div></td>
            <td width="65%" bgcolor="#F7FFF4"> 
              <input type="text" name="PicHi" size="5" value="80" onblur="Isvalidity(PicHi,'图片高度')">
            </td>
          </tr>
          <tr bgcolor="#F7FFF4"> 
            <td width="35%" height="22" bgcolor="#F7FFF4"> 
              <div align="right">图片宽度</div></td>
            <td width="65%"> 
              <input type="text" name="PicWi" size="5" value="80" onblur="Isvalidity(PicWi,'图片宽度')"> 
            </td>
          </tr>
          <tr bgcolor="#F7FFF4" ID=Depict style="DISPLAY: none "> 
            <td width="35%" height="20"> 
              <div align="right">新闻描述文字数量</div></td>
            <td width="65%"> 
              <input type="text" name="Depict" size="5" value="100" onblur="Isvalidity(Depict,'新闻描述文字数量')"> 
            </td>
          </tr>
          <tr bgcolor="#F7FFF4"> 
            <td height="23" colspan="2"> 
              <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center" id=CSS1 style="DISPLAY: ">
                <tr align="center"> 
                  <td height="77"><a href="images/anli1.gif" alt="sdfsdf" target="_blank"><img src="images/anli1.gif" width="382" height="69" border="0" alt="样式一 图片高度:80 图片宽度:80" ></a></td>
                </tr>
              </table>
              <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center" id=CSS2 style="DISPLAY: none ">
                <tr align="center"> 
                  <td height="2"><a href="images/type2.gif" target="_blank"><img src="images/anli2.gif" width="233" height="281" border="0"></a></td>
                </tr>
              </table>
              <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center" id=CSS3 style="DISPLAY: none ">
                <tr align="center"> 
                  <td height="163"><a href="images/anli3.gif" target="_blank"><img src="images/anli3.gif" width="75" height="348" border="0" alt="样式三 图片高度:80 图片宽度:80"></a></td>
                </tr>
              </table></td>
          </tr>
          <tr bgcolor="#F7FFF4"> 
            <td height="23" colspan="2"> 
              <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center" id=CSS4 style="DISPLAY: none ">
                <tr align="center"> 
                  <td height="163"><table width="100" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
                      <tr>
                        <td bgcolor="#FFFFFF"><a href="images/anli4-1.gif" target="_blank"><img src="images/anli4.gif" width="206" height="88" border="0"></a></td>
                      </tr>
                    </table></td>
                </tr>
              </table>
            </td>
          </tr>
        </table></td>
    </tr>
    <tr bgcolor="#F7FFF4" align="center"> 
      <td height="51" colspan="2" valign="middle"> 
        <input type="Hidden" name="o" value="ADD"> <input type="submit" name="Submit" value=" 创 建 JS "> 
      </td>
    </tr>
  </table>
</form>
<script>
function CheckType(){
if (document.form1.WordNews.checked == true){
        WordNews.style.display = "";

}else{
        WordNews.style.display = "none";

}

if (document.form1.PhotoNews.checked == true) {
        PhotoNews.style.display = "";

}else{
        PhotoNews.style.display = "none";

}
}
function CheckCSS(){
if (document.form1.CSS1.checked == true) {
        CSS1.style.display = "";
}else{
        CSS1.style.display = "none";

}
if (document.form1.CSS2.checked == true) {
        CSS2.style.display = "";
		Depict.style.display = "";

}else{
        CSS2.style.display = "none";
		Depict.style.display = "none";

}
if (document.form1.CSS3.checked == true) {
        CSS3.style.display = "";

}else{
        CSS3.style.display = "none";
}
if (document.form1.CSS4.checked == true) {
        CSS4.style.display = "";

}else{
        CSS4.style.display = "none";
}
}
</script>

⌨️ 快捷键说明

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