Global Management
<%
If Not session("admin_loggedin" & strSUnique) = Session.SessionID then Response.Redirect "default.asp"
Response.Write "Category Name | Category ID | Total Ads |
"
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 "" & catName & " | " & catID & " | " & numrows & " |
"
rs.MoveNext
Loop
rs.close
Response.Write "Total Count: " & totalCatCount
%>
<%
Response.Write "Subcategory Name | Subcategory ID | Total Ads |
"
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 "" & scatName & " | " & scatID & " | " & numrows & " |
"
rs.MoveNext
Loop
rs.close
%>
<%
Response.Write "3-rd Level Name | 3-rd Level Name ID | Total Ads |
"
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 "" & scat3Name & " | " & scat3ID & " | " & numrows & " |
"
rs.MoveNext
Loop
rs.close
objConn.Execute("UPDATE " & tablUPfx & "User SET ads = 0 WHERE ads < 0;")
%>
Ads Count for All Categories has been reconciled