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

📄 admin_softlist.asp

📁 网络电视免费版
💻 ASP
字号:
<!--#include file="Config.asp" -->
<%  const MaxPerPage=30
   	dim totalPut   
   	dim CurrentPage
   	dim TotalPages
   	dim i,j
   	dim sql
   	dim rs
	dim CateID,SubCateID,TitleName
    if not isempty(request("page")) then
      		currentPage=cint(request("page"))
   	else
      		currentPage=1
   	end if
	keyword=Trim(Request("keyword"))
	if not isnull(keyword) and keyword<>"" then 
	keyword=checkStr(keyword)
	else
	likeword=""
	end if
	
	set Rs=server.createobject("adodb.recordset")
	
	if request("CateID")<>"" and request("SubCateID")<>"" then
	CateID=" CateID="&request("CateID")&" and  "
	SubCateID=" SubCateID="&request("SubCateID")&" "
       sql="select * from "&CategoryName&"_SubCate where SubCateID="&request("SubCateID")
	   rs.open sql,conn,1,1
	   TitleName=trim(rs("SubCateName"))
	   rs.close
	 end if
     if request("CateID")<>"" and request("SubCateID")="" then
		CateID="CateID="&request("CateID")&" "
		sql="select CateName from "&CategoryName&"_Cate where CateID="&request("CateID")
		rs.open sql,conn,1,1
		TitleName=trim(rs("CateName"))
		rs.close
	end if
	if request("CateID")="" and request("SubCateID")="" then
	CateID=""
	SubCateID=""
    TitleName="全部节目"
	end if

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>节目管理列表</title>
<link rel="stylesheet" href="admin.css" type="text/css">
<script src="Admin_SoftCateMenu.Asp"></script>
<BODY leftmargin="0" bottommargin="0" rightmargin="0" topmargin="0"  onmousemove="HideMenu()">
<div id=menuDiv style='Z-INDEX: 2; VISIBILITY: hidden; WIDTH: 1px; POSITION: absolute; HEIGHT: 1px; BACKGROUND-COLOR: #9cc5f8'></div>
<table cellpadding=3 cellspacing=1 border=0 width=100% align=center>
  <tr>
    <td width="100%" align="center" valign=top> 
      <% rs.open "select * from "&CategoryName&"_Cate order by CateID asc",conn,1,1
	 if rs.bof and rs.eof then
	   response.write "没有添加大类"
	 else
	   do while not rs.eof
	   Response.Write " <a href=""Admin_SoftList.asp?CateID="&rs("CateID")&""" onMouseOver='ShowMenu(catemenu"&rs("cateid")&",70)'>"&rs("CateName")&"</a>" & vbcrlf
	   rs.movenext
	   loop
	 end if
	 rs.close
	 %>
    </td>
</tr>
</table>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<% sub showContent 
    dim i 
	i=0 
    if isMaster=true then  Response.Write("<form name=""myform"" method=""post"" action="""">") 
	 do while not rs.eof
	%>
  <tr> 
    <td class="forumRow">
	<% 
	if isMaster then
	Response.Write("<input type=""checkbox"" name=""selSoftID"" value="""&rs("SoftID")&""" title="""&rs("SoftID")&""">")
	else
	Response.Write("·")
	end if
	response.write "<A href=""SoftView.asp?SoftID="&rs("SoftID")&""" title=""" & trim(rs("SoftName"))& " "& trim(rs("SoftVer")) & """ target=_blank>" & trim(rs("SoftName"))& " "& trim(rs("SoftVer")) & "</a>"
	 %>
	</td>
    <td align="center" class="forumRow"><%
	       if rs("UserName")=UserName then
            response.write "<a href=""Admin_SoftInfo.Asp?action=edit&SoftID="&rs("SoftID")&""">修改</a>"
			elseif isMaster then
            response.write "<a href=""Admin_SoftInfo.Asp?action=edit&SoftID="&rs("SoftID")&""">修改</a>"
			else
			response.write "修改"
			end if %></td>
    <td align="center" class="forumRow"><% if rs("isCommend") then
			response.write "<font color=red><b>√</b></font>"
			else
			response.write "<b>×</b>"
			end if %></td>
    <td align="center" class="forumRow"><% response.write rs("SoftType") %></td>
	<td align="center" class="forumRow"><% if rs("SoftTime")=Date() then
			response.write "<font color=red>"&rs("SoftTime")&"</font>"
			else
			response.write rs("SoftTime")
			end if %></td>
  </tr>
  <% i=i+1
   if i>=MaxPerPage then exit do
	rs.movenext
	loop 
	rs.close
	
if isMaster=true then
     sql = "select * from "&CategoryName&"_SubCate order by SubCateID asc"
     rs.open sql,conn,1,1
%>
<tr>    
<td colspan="5" class="forumRow">
<SCRIPT language = "JavaScript">
    var onecount;
    onecount=0;
    subcat = new Array();
        <%count = 0
        do while not rs.eof %>
    subcat[<%=count%>] = new Array("<%= trim(rs("SubCateName"))%>","<%=cstr(rs("cateid"))%>","<%=cstr(rs("subcateid"))%>");<%count = count + 1
        rs.movenext
        loop
        rs.close
        %>
    onecount=<%=count%>;

function changelocation(locationid)
    {
    document.myform.selsubcateid.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.myform.selsubcateid.options[document.myform.selsubcateid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    

function SelectAll() {
	for (var i=0;i<document.myform.selSoftID.length;i++) {
		var e=document.myform.selSoftID[i];
		e.checked=!e.checked;
	}
}
</script>
<a href="javascript:SelectAll()">全选/反选</a>
       <select name="selcateid" onChange="changelocation(document.myform.selcateid.options[document.myform.selcateid.selectedIndex].value)">
     <%
	 Response.Write("<option value="""&Trim(Request.QueryString("cateid"))&""">↓移时选择↓</option>")
    sql="select * from "&CategoryName&"_Cate"
 	rs.open sql,conn,1,1
	if rs.eof and rs.bof then
		response.write "<option value""0"">没有大类</option>"
	else
	do while not rs.eof
	response.write "<option value="""&cstr(rs("cateid"))&""">"+trim(rs("CateName"))+"</option>"
	rs.movenext
    loop
	end if
	rs.close
%> </select>  
 <select name="selsubcateid" >
<% 
 Response.Write("<option value="""&Trim(Request.QueryString("subcateid"))&""">↓移时选择↓</option>")
sql="select * from "&CategoryName&"_SubCate"
 	    rs.open sql,conn,1,1
	    if rs.eof and rs.bof then
		    response.write "<option value""0"">没有小类</option>"
	    else
            do while not rs.eof
            response.write "<option value="""&cstr(rs("subcateid"))&""">" + trim(rs("SubCateName")) + "</option>"
            rs.MoveNext
            Loop
	    end if
        rs.close
%>  </select>
	 <select name="SoftType">
          <option value="">↓选类型↓</option>
          <option value="国产节目">国产节目</option>
          <option value="国外节目">国外节目</option>
          <option value="汉化补丁">汉化补丁</option>
          <option value="破解补丁">破解补丁</option>
        </select><br> 
			<input type="radio" name="action_type" value="isdel">批量删除
            <input type="radio" name="action_type" value="ismove">批量移动
			<input type="radio" name="action_type" value="setSoftType">设置节目类型
			<input type="radio" name="action_type" value="isCommend">设置推荐
			<input type="radio" name="action_type" value="noCommend">取消推荐
            <input type="submit" name="Submit" value="执行"  onclick="{if(confirm('您确定执行的操作吗?')){this.document.myform.submit();return true;}return false;}">
</td>
</tr>
  <%
Response.Write "</form> "& vbcrlf
end if
end sub  %>
</table>
<%
if not isnull(UserName) and UserName<>"" then 
dim isMaster
isMaster=false
  if chkMaster(UserName) then
     isMaster=true
      if not isempty(Request.Form("selSoftID")) then
      dim selSoftID
      selSoftID=Request.Form("selSoftID")
      select case Trim(Request.Form("action_type"))
      case "isdel"
		call isdel()
      case "ismove"
		call ismove()
	  case "setSoftType"
	    call setSoftType()
	  case "isCommend"
	    call isCommend()
	  case "noCommend"
	    call noCommend()
      case else
		founderr=true
      end select
      end if
  end if 
call SoftList()
else
  msgtitle="节目管理"
  msginfo="<li>操作错误,你没有登录系统!<li><a href=""User.Asp"">点此登录系统</a></li>" 
  call Sysmsg(msgtitle,msginfo) 
end if

sub isdel()
Response.Write("批量删除操作成功!")
conn.execute("delete from "&CategoryName&"_SoftInfo where SoftID in ("&selSoftID&")")
end sub

sub ismove()
if Trim(Request.Form("selcateid"))<>"" and Trim(Request.Form("selsubcateid"))<>"" then
conn.execute("update "&CategoryName&"_SoftInfo set CateID='"&Trim(Request.Form("selcateid"))&"',SubCateID='"&Trim(Request.Form("selsubcateid"))&"' where SoftID in ("&selSoftID&")")
Response.Write("批量删除操作成功!")
end if
end sub

Sub setSoftType()
if Trim(Request.Form("SoftType"))<>"" then
conn.execute("update "&CategoryName&"_SoftInfo set SoftType='"&Trim(Request.Form("SoftType"))&"' where SoftID in ("&selSoftID&")")
Response.Write("批量设置节目类型操作成功!")
end if
end Sub

sub isCommend()
conn.execute("update "&CategoryName&"_SoftInfo set isCommend=1 where SoftID in ("&selSoftID&")")
end sub

sub noCommend()
conn.execute("update "&CategoryName&"_SoftInfo set isCommend=0 where SoftID in ("&selSoftID&")")
end sub

 sub SoftList()
 %>
<table cellpadding="3" cellspacing="1" border="0" width="99%" class="tableBorder" align=center>
  <tr> 
    <th  height="22">节目名称</th>
    <th>修改编辑</th>
	<th>推荐</th>
    <th>节目类型</th>
    <th>整理时间</th>
  </tr>
  <%
if not isnull(keyword) and keyword<>"" then 
		sql="select SoftID,SoftName,SoftVer,SoftSize,SoftTime,SoftType,UserName,isCommend from "&CategoryName&"_SoftInfo where SoftName like '%"&keyword&"%'"
		sql=sql&" order by SoftTime desc"
else
  	if request("CateID")<>"" and request("SubCateID")<>"" then
		sql="select SoftID,SoftName,SoftVer,SoftSize,SoftTime,SoftType,UserName,isCommend from "&CategoryName&"_SoftInfo where "&CateID&" "&SubCateID&" "
		sql=sql&" order by SoftTime desc"
	end if
	if request("CateID")<>"" and request("SubCateID")="" then
	    sql="select SoftID,SoftName,SoftVer,SoftSize,SoftTime,SoftType,UserName,isCommend from "&CategoryName&"_SoftInfo where "&CateID&" "
		sql=sql&" order by SoftTime desc"
	end if
	if request("CateID")="" and request("SubCateID")="" then
		sql="select SoftID,SoftName,SoftVer,SoftSize,SoftTime,SoftType,UserName,isCommend from "&CategoryName&"_SoftInfo "
		sql=sql&" order by SoftTime desc"
	end if
end if
	rs.open sql,conn,1,1 
	   if not(rs.eof and rs.bof) then 		 
     		totalPut=rs.recordcount
      		if currentpage<1 then
          		currentpage=1
      		end if
      		if (currentpage-1)*MaxPerPage>totalput then
	   		if (totalPut mod MaxPerPage)=0 then
	     			currentpage= totalPut \ MaxPerPage
	  		else
	      			currentpage= totalPut \ MaxPerPage + 1
	   		end if
      		end if
       		if currentPage=1 then
             		showpage totalput,MaxPerPage,"Admin_SoftList.asp"
            		showContent
            		showpage totalput,MaxPerPage,"Admin_SoftList.asp"
       		else
          		if (currentPage-1)*MaxPerPage<totalPut then
            			rs.move  (currentPage-1)*MaxPerPage
            			dim bookmark
            			bookmark=rs.bookmark
            			showpage totalput,MaxPerPage,"Admin_SoftList.asp"
            			showContent
             			showpage totalput,MaxPerPage,"Admin_SoftList.asp"
        		else
	        		currentPage=1
           			showpage totalput,MaxPerPage,"Admin_SoftList.asp"
           			showContent
           			showpage totalput,MaxPerPage,"Admin_SoftList.asp"
	      		end if
		    end if
		 end if

%>
</table>
<% end sub 
	function showpage(totalnumber,maxperpage,filename)
  	dim n

  	if totalnumber mod maxperpage=0 then
     		n= totalnumber \ maxperpage
  	else
     		n= totalnumber \ maxperpage+1
  	end if
  	response.write "<form method=Post action="&filename&"?CateID="&request("CateID")&"&SubCateID="&request("SubCateID")&findword&"><tr><td align=""center"" class=""forumRow""  colspan=""5"">"
  	response.write "[<font color='red'>"&TitleName&"</font>] "

  	if CurrentPage<2 then
    		response.write "共"&totalnumber&"个节目 首页 上一页 "
  	else
    		response.write "共"&totalnumber&"个节目 <a href="&filename&"?page=1&CateID="&request("CateID")&"&SubCateID="&request("SubCateID")&findword&">首页</a> "
    		response.write "<a href="&filename&"?page="&CurrentPage-1&"&CateID="&request("CateID")&"&SubCateID="&request("SubCateID")&findword&">上一页</a> "
  	end if

  	if n-currentpage<1 then
    		response.write "下一页 尾页"
  	else
    		response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&CateID="&request("CateID")&"&SubCateID="&request("SubCateID")&findword&">"
    		response.write "下一页</a> <a href="&filename&"?page="&n&"&CateID="&request("CateID")&"&SubCateID="&request("SubCateID")&findword&">尾页</a>"
  	end if
   	response.write " 页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
    	response.write " <b>"&maxperpage&"</b>个节目/页 "
		   response.write " 转到:<select name=""page"" size=""1"" style=""font-size: 9pt"" onChange=""javascript:submit()"">" & vbcrlf
		   for i = 1 to n
           response.write "<option value="""&i&""""
		   if CurrentPage=cint(i) then Response.Write " selected"
		   Response.Write ">第"&i&"页</option>" & vbcrlf
           next
           Response.Write "</select>" & vbcrlf
	       response.write "</td></tr></FORM>"
end function

sub Sysmsg(msgtitle,msginfo)
%>
 <br> 
<table width="85%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableBorder" >
  <tr> 
   <th><%=msgtitle%></th>
  </tr>
  <tr>           
    <td class="forumRow"><%=msginfo%></td>
  </tr>
   <tr>           
    <td height="22" align="center" class="forumRowHighlight"><a href="javascript:history.go(-1)" >&lt;&lt; 
      返回上一页</a></td>
   </tr>
 </table>
      <br> 
<%end sub %>
</body>
</html>
<%
  set rs=nothing
CloseDatabase
%>

⌨️ 快捷键说明

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