Global Management

<% If Not session("admin_loggedin" & strSUnique) = Session.SessionID then Response.Redirect "default.asp" Response.Write "" set rs = objConn.Execute("SELECT catID,catName FROM " & tablPfx & "Cat ORDER BY catName;") Do while not rs.EOF catID = rs(0) catName = rs(1) set rsads = objConn.Execute("SELECT ID FROM " & tablPfx & "Ads WHERE (catID = " & CLng(catID) & " AND status = 1);") If not rsads.EOF then rsdata = rsads.getrows numrows = UBound(rsdata,2) + 1 Else numrows = 0 End If totalCatCount = totalCatCount + numrows rsads.close objConn.Execute("UPDATE " & tablPfx & "Cat SET ads = " & numrows & " WHERE catID = " & CLng(catID) & ";") Response.Write "" rs.MoveNext Loop rs.close Response.Write "Total Count: " & totalCatCount %>
Category NameCategory IDTotal Ads
" & catName & "" & catID & "" & numrows & "

<% Response.Write "" set rs = objConn.Execute("SELECT sCatID,scatName FROM " & tablPfx & "Scat WHERE catID < 50000;") Do while not rs.EOF scatID = rs(0) scatName = rs(1) set rsads = objConn.Execute("SELECT ID FROM " & tablPfx & "Ads WHERE (scatID = " & CLng(scatID) & " AND status = 1);") If not rsads.EOF then rsdata = rsads.getrows numrows = UBound(rsdata,2) + 1 Else numrows = 0 End If rsads.close objConn.Execute("UPDATE " & tablPfx & "Scat SET ads = " & numrows & " WHERE scatID = " & CLng(scatID) & ";") Response.Write "" rs.MoveNext Loop rs.close %>
Subcategory NameSubcategory IDTotal Ads
" & scatName & "" & scatID & "" & numrows & "

<% Response.Write "" set rs = objConn.Execute("SELECT sCatID,scatName FROM " & tablPfx & "Scat WHERE catID > 49999;") Do while not rs.EOF scat3ID = rs(0) scat3Name = rs(1) set rsads = objConn.Execute("SELECT ID FROM " & tablPfx & "Ads WHERE (cat3rdID = " & CLng(scat3ID) & " AND status = 1);") If not rsads.EOF then rsdata = rsads.getrows numrows = UBound(rsdata,2) + 1 Else numrows = 0 End If rsads.close objConn.Execute("UPDATE " & tablPfx & "Scat SET ads = " & numrows & " WHERE scatID = " & CLng(scat3ID) & ";") Response.Write "" rs.MoveNext Loop rs.close objConn.Execute("UPDATE " & tablUPfx & "User SET ads = 0 WHERE ads < 0;") %>
3-rd Level Name3-rd Level Name IDTotal Ads
" & scat3Name & "" & scat3ID & "" & numrows & "

Ads Count for All Categories has been reconciled