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

📄 admin_softlinktype.asp

📁 动感系统XP Access版,服务器需要安装Jmail 组件 配置SendMessages.asp 最后部分的参数
💻 ASP
字号:
<!-- #include file="conn.asp" -->
<!-- #include file="inc/const.asp" -->
<!-- #include file="inc/function.asp" -->
<HTML><HEAD><TITLE>后台管理 </TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="admin.css" type=text/css rel=stylesheet>
</HEAD>
<BODY leftMargin=0 topMargin=0>
<!-- #include file="admin_header.asp" -->
<table width="100%" border="0" cellspacing="2">
  <tr>
    <td width="20%" align="center" valign="top" class="tdbgleft"><!-- #include file="Admin_Left.asp" --></td> 
    <td  class="b1" valign="top">
      <% 
if not isnull(cUserName) and cUserName<>"" then 
 if chkMaster(cUserName) then   
   	dim isedit
	
  select case request("action")
  case "saveadd" 
       call SaveAdd()
  case "modify"  
       call SaveModify()
  case "edit"
       isEdit=True
       call myform()
  case "add" 
       isEdit=False
	   call myform()
  case "del" 
	   call del()
  case "isActive" 
	   call isActive()
  case else
       call Viewlist()
  end select
  
  
	sub del()
    conn.execute("delete from SoftDown_SoftLinkType where id="&Trim(Request.QueryString("ID")))
	call Viewlist()
	end sub
	
	'sub isActive()
	'conn.execute("update SoftDown_SoftLinkType set isActive=0")
	'conn.execute("update SoftDown_SoftLinkType set isActive=true where ID="&Trim(Request.Form("isActive")))
	'call Viewlist()
	'end sub
	
  sub SaveModify()
      set rs=server.createobject("adodb.recordset")
	  sql="select * from SoftDown_SoftLinkType where ID="&request.form("ID")
	   rs.open sql,conn,1,3
	   rs("SiteName")=checkstr(Trim(request.form("SiteName")))
	   rs("SiteURL")=checkstr(Trim(request.form("SiteURL")))
	   DownloadName=split(request.form("DownloadName"),chr(13)&chr(10))
	   for i = 0 to ubound(DownloadName)
	   if not (DownloadName(i)="" or DownloadName(i)=" ") then
	   		if i<>ubound(DownloadName) then
				DownloadName_1=""&DownloadName_1&""&DownloadName(i)&","
			else
				DownloadName_1=""&DownloadName_1&""&DownloadName(i)&""
			end if
	   end if
	   next
	   rs("DownloadName")=Trim(DownloadName_1)
	   
	   DownloadURL=split(request.form("DownloadURL"),chr(13)&chr(10))
	   for i = 0 to ubound(DownloadURL)
	   if not (DownloadURL(i)="" or DownloadURL(i)=" ") then
	   		if i<>ubound(DownloadURL) then
				DownloadURL_1=""&DownloadURL_1&""&DownloadURL(i)&","
			else
				DownloadURL_1=""&DownloadURL_1&""&DownloadURL(i)&""
			end if
	   end if
	   next
	   rs("DownloadURL")=Trim(DownloadURL_1)
	   rs("Readme")=Trim(Request.Form("Readme"))
	   rs("isLB")=Request.Form("isLB")
	   rs("isdefault")=Request.Form("isdefault")	   
	   rs.update
	   rs.close
	   set rs=nothing
	   msgtitle="保存修改"
	   msginfo="<li>修改成功!<li><a href=""Admin_SoftLinkType.asp"">返回列表</a></li>"
	   call Sysmsg(msgtitle,msginfo)  
	end sub 
	
	sub SaveAdd()
      set rs=server.createobject("adodb.recordset")
	  sql="select * from SoftDown_SoftLinkType where (ID is null)"
	  rs.open sql,conn,1,3
  	   rs.addnew
	   rs("SiteName")=checkstr(Trim(request.form("SiteName")))
	   rs("SiteURL")=checkstr(Trim(request.form("SiteURL")))
	   DownloadName=split(request.form("DownloadName"),chr(13)&chr(10))
	   for i = 0 to ubound(DownloadName)
	   if not (DownloadName(i)="" or DownloadName(i)=" ") then
	   		if i<>ubound(DownloadName) then
				DownloadName_1=""&DownloadName_1&""&DownloadName(i)&","
			else
				DownloadName_1=""&DownloadName_1&""&DownloadName(i)&""
			end if
	   end if
	   next
	   rs("DownloadName")=Trim(DownloadName_1)
	   
	   DownloadURL=split(request.form("DownloadURL"),chr(13)&chr(10))
	   for i = 0 to ubound(DownloadURL)
	   if not (DownloadURL(i)="" or DownloadURL(i)=" ") then
	   		if i<>ubound(DownloadURL) then
				DownloadURL_1=""&DownloadURL_1&""&DownloadURL(i)&","
			else
				DownloadURL_1=""&DownloadURL_1&""&DownloadURL(i)&""
			end if
	   end if
	   next
	   rs("DownloadURL")=Trim(DownloadURL_1)
	   rs("Readme")=Trim(Request.Form("Readme"))
	   rs("isLB")=Request.Form("isLB")
	   rs("isdefault")=Request.Form("isdefault")
	   rs.update
	   rs.close
	   set rs=nothing	
	   msgtitle="添加"
	   msginfo="<li>添加成功!<li><a href=""Admin_SoftLinkType.asp"">返回列表</a></li>"
	   call Sysmsg(msgtitle,msginfo)
	end sub
	'=================================
	 sub ViewList()
	%>
      <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableBorder">
        <tr class="tdbg1"> 
          <th>ID</th>
          <th>名称 [<a href="Admin_SoftLinkType.asp?action=add">添加</a>]</th>
          <th width="90">负载均衡</th>
          <th width="90">编辑</th>
        </tr>
        <form action="Admin_SoftLinkType.asp" method="post" name="viewlist">
          <% Set Rs=server.createobject("adodb.recordset")  
		   sql="select * from SoftDown_SoftLinkType "
           rs.open sql,conn,1,1 
   	       if not(rs.eof and rs.bof) then 
	       do while not rs.eof
		 %>
          <tr class="tdbg2"> 
            <td align="center"><%=rs("ID")%></td>
            <td><a href="<%=rs("SiteURL")%>" target="_blank"><%=rs("SiteName")%></a></td>
            <td align="center"> 
              <% if rs("isLB")=1 then
			Response.Write("是")
			else
			Response.Write("否")
			end if %>
            </td>
            <td> 
              <% 
			Response.Write(" (<a href=""Admin_SoftLinkType.asp?action=edit&id="&rs("id")&""">修改</a> | ")
			Response.Write("<a href=""Admin_SoftLinkType.asp?action=del&id="&rs("id")&""">删除</a> )")
			%>
            </td>
          </tr>
          <% rs.movenext 
             loop 
			 else
			 Response.Write("<tr><td colspan=""2"" bgcolor=""#FFFFFF"">没有找到任何记录!</td></tr>")
	         end if
	         rs.close  
             Set Rs=nothing %>
        </form>
      </table>
      <%
	 end sub
	 '================================
	 sub myform 	 
	 if isedit then
	  set rs=server.createobject("adodb.recordset")
     sql = "select * from SoftDown_SoftLinkType where id="&Trim(Request.QueryString("id"))
     rs.open sql,conn,1,1
	 msgTitle="修改"
	 else
	 msgTitle="添加"
	 end if
	 %>
      <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableBorder">
        <form action="Admin_SoftLinkType.asp" method="post" name="myform">
          <tr> 
            <th colspan="2" class="tdbg1"> 
              <% if isedit then
			Response.Write("<input type=""Hidden"" name=""action"" value=""modify"">")
			Response.Write("<input type=""Hidden"" name=""ID"" value="""&Trim(Request.QueryString("id"))&""">")
			 else
			Response.Write("<input type=""Hidden"" name=""action"" value=""saveadd"">")
			 end if
			Response.Write(msgTitle)
			 %>
            </th>
          </tr>
          <tr class="tdbgleft"> 
            <td><u>网站名称</u></td>
            <td > <input name="SiteName" type="text" value="<% if isedit then response.write trim(rs("SiteName"))%>" size="40" maxlength="50"> 
            </td>
          </tr>
          <tr class="tdbgleft"> 
            <td><u>网站URL</u></td>
            <td><input name="SiteURL" type="text" value="<% if isedit then response.write trim(rs("SiteURL"))%>" size="40" maxlength="50"> 
            </td>
          </tr>
          <tr class="tdbgleft"> 
            <td><u>下载名称列表</u><br>
              每个名称用<strong>回车</strong>分开 </td>
            <td><textarea name="DownloadName" cols="70" rows="7"><% if isedit then Response.Write replace(rs("DownloadName"),",",chr(10))%></textarea> 
            </td>
          </tr>
          <tr class="tdbgleft"> 
            <td><u>预定义URL列表</u><br>
              每个URL用<strong>回车</strong>分开</td>
            <td><textarea name="DownloadURL" cols="70" rows="7"><% if isedit then Response.Write replace(rs("DownloadURL"),",",chr(10))%></textarea> 
            </td>
          </tr>
          <tr class="tdbgleft"> 
            <td>网站简介<br> </td>
            <td> <textarea name="Readme" cols="70" rows="7"><% if isedit then Response.Write(rs("Readme"))%></textarea> 
            </td>
          </tr>
          <tr class="tdbgleft"> 
            <td>链接方式</td>
            <td> 
              <input type="radio" name="isLB" value="1" <%if isedit then
			  if rs("isLB")=1 then Response.Write "checked"
			  else
			  Response.Write "checked"
			  end if%>>
              显示全部 
              <input type="radio" name="isLB" value="0" <%if isedit then
			  if rs("isLB")=0 then Response.Write "checked"
			  end if%>>
              自动负载均衡</td>
          </tr>
          <tr class="tdbgleft">
            <td>设置默认</td>
            <td>
<input type="radio" name="isdefault" value="1" <%if isedit then
			  if rs("isdefault")=1 then Response.Write "checked"
			  end if%>>
              <input type="radio" name="isdefault" value="0" <%if isedit then
			  if rs("isdefault")=0 then Response.Write "checked"
			  else
			  Response.Write "checked"
			  end if%>>
              否 </td>
          </tr>
          <tr class="tdbgleft"> 
            <td align="center">&nbsp;</td>
            <td> <input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td>
          </tr>
        </form>
      </table>
      <% 
	  if edit then rs.close:set rs=nothing
	  end sub %>
      <% 	  
	else
		msgtitle="用户管理"
		msginfo="<li>操作错误,你不是系统管理员,没有权限进行此项操作!</li>" 
		call Sysmsg(msgtitle,msginfo) 
	end if
else
	msgtitle="用户管理"
	msginfo="<li>操作错误,你没有登录系统!<li><a href=""User.Asp"">点此登录系统</a><li><a href=""./"">返回频道首页</a></li>" 
	call Sysmsg(msgtitle,msginfo) 
end if %>
    </td>
  </tr>
</table>
<!-- #include file="admin_footer.asp" -->
</BODY></HTML>
<% CloseDatabase %>

⌨️ 快捷键说明

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