File: D:/HostingSpaces/EBos/ellen-paragnost.nl/wwwroot/asp/includes/customerList.asp
<%class cls_customerList
public showRecentOnly
Private Sub Class_Initialize
showRecentOnly=false
end sub
Public Function table
set table=server.CreateObject ("scripting.dictionary")
dim sql, rs
if showRecentOnly then
set rs=db.execute("select iId from tblCustomer order by dCreatedTS desc")
else
set rs=db.execute("select iId from tblCustomer order by sName")
end if
dim customerObj, runner,contii
runner=0
contii=true
while not rs.eof and contii
set customerObj=new cls_customer
customerObj.pick(rs(0))
table.Add customerObj.iId, customerObj
set customerObj=nothing
rs.movenext
runner=runner+1
if showRecentOnly then
if runner=20 then contii=false
end if
wend
set rs=nothing
end function
Public function getAll
set getAll=db.execute("select iId,sName,sUrl,dCreatedTS,sUrl,webmasterEMAIL,iFolderSize from tblCustomer order by dCreatedTS desc")
end function
public function refreshFS
dim rs,urs
set rs=db.execute("select iId,sUrl from tblCustomer where iFolderSize is null order by iId desc")
while not rs.eof
on error resume next
dim oxmlhttp
set oxmlhttp=createobject("msxml2.ServerXMLHTTP")
if C_DIRECTORY_QUICKERSITE<>C_VIRT_DIR then
oxmlhttp.open "get",rs(1) & C_DIRECTORY_QUICKERSITE & "/asp/getFS.asp?I=" & sha256(rs(0)) ,false
else
oxmlhttp.open "get",rs(1) & C_VIRT_DIR & "/asp/getFS.asp?I=" & sha256(rs(0)) ,false
end if
oxmlhttp.send
dim fsize
fsize=oxmlhttp.responseText
if convertGetal(fsize)<1024000 and convertGetal(fsize)>1 then fsize=1024000
set urs=db.execute("update tblCustomer set iFolderSize=" & round(convertGetal(fsize)/1024/1024,0) & " where iId=" & rs(0))
set urs=nothing
set oxmlhttp=nothing
on error goto 0
rs.movenext
wend
set rs=nothing
end function
Public Property Get count
dim rs
set rs=db.execute("select count(*) from tblCustomer")
count=convertGetal(rs(0))
set rs=nothing
end Property
end class%>