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

📄 admin_updatesoftnum.asp

📁 网络电视免费版
💻 ASP
字号:
<!--#include file="Config.asp" -->
<HTML><HEAD><TITLE><%= Title_Name %><%= CategoryName_CHS %> ==>> 数据更新 </TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<meta name=keywords content="视听新时空(网络电视,网络广播,免费电影:全球最大的中文网络电视,广播网站)">
<link rel="stylesheet" href="admin.css" type="text/css">
</HEAD>
<BODY  leftMargin=0>
<%
if not isnull(UserName) and UserName<>"" then
    if chkMaster(UserName) then
       call main()
	else
	   msgtitle="更新节目数"
       msginfo="<li>操作错误,你不是系统管理员,没有权限进行此项操作!</li>" 
       call Sysmsg(msgtitle,msginfo)
	end if
else
    msgtitle="更新节目数"
    msginfo="<li>操作错误,你没有登录系统!<li><a href=""User.Asp"">点此登录系统</a></li>" 
    call Sysmsg(msgtitle,msginfo)  
end if


sub main()
  dim Rs,SubRs,NumRs
  set Rs=server.createobject("adodb.recordset")
  set SubRs=server.createobject("adodb.recordset")
  set NumRs=server.createobject("adodb.recordset")
 rs.open "select * from "&CategoryName&"_Cate order by CateID asc",conn,1,1
        if err.number <> 0 then
	           response.write "数据库出错"
           else
	           if rs.bof and rs.eof then
		        response.write "没有添加大类"
	           else
			  do while not rs.eof 			  
			 NumRs.open "select Count(SoftID) as SoftNum from "&CategoryName&"_SoftInfo where CateID="&rs("CateID")&"",conn,1,1 			 
			 CateNum=NumRs("SoftNum")
			 NumRs.close
           sql="update "&CategoryName&"_Cate set CateNum="&CateNum&" where CateId=" & rs("CateID")
	        conn.execute sql
           
		   SubRs.open "select * from "&CategoryName&"_SubCate where CateID="&Rs("CateID")&" order by SubCateID asc",conn,1,1
        if err.number <> 0 then
	           response.write "数据库出错"
           else
	           if SubRs.bof and SubRs.eof then
		        response.write "没有添加小类"
	           else

			 do while not SubRs.eof 
			 
			 NumRs.open "select Count(SoftID) as SoftNum from "&CategoryName&"_SoftInfo where SubCateID="&SubRs("SubCateID")&"",conn,1,1 			 
			 SubCateNum=NumRs("SoftNum")
			 NumRs.close
			 
           sql="update "&CategoryName&"_SubCate set SubCateNum="&SubCateNum&" where SubCateId=" & SubRs("SubCateID")
	        conn.execute sql

			SubRs.movenext
	               loop
	           end if
  end if
  SubRs.close
  rs.movenext
loop
end if
  end if
  rs.close
  set rs=nothing
  set SubRs=nothing
  set NumRs=nothing
  
  msgtitle="更新节目数"
  msginfo="操作成功,各分类的节目数已经更新!"
  call Sysmsg(msgtitle,msginfo)
end sub

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>
<%
CloseDatabase
%>

⌨️ 快捷键说明

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