
<%riqi=now+timeset/24   
ip=request.servervariables("remote_addr")                                                                                       
pic=1                                                                                      
name=nosql(session("username"))
conn.execute("delete from online")   
set jilu=conn.execute("select ip from online where ip='"&ip&"'")                                                                                      
if jilu.eof then                                                                                      
conn.execute("insert into online (ip,ltime)VALUES('"&ip&"','"&riqi&"')")                                                                                      
else                                                                                      
conn.execute("update online set ltime='"&riqi&"' where ip='"&ip&"'")                                                                                      
end if                                                                                      
set jilu=nothing                                                                                      
if name<>"" then                                                                                      
set ujilu=conn.execute("select name from online where name='"&name&"'")                                                                                      
if ujilu.eof then                                                                                      
conn.execute("delete from online where ip='"&ip&"'")                                                                                      
 conn.execute("insert into online (name,ltime,ip)VALUES('"&name&"','"&riqi&"','"&ip&"')")                                                                                     
else                                                                                      
conn.execute("update online set ltime='"&riqi&"' where name='"&name&"'")                                                                                      
end if                                                                                      
set ujilu=nothing                                                                                      
end if                                                                                      
mostonline=conn.execute("select mostonline from info")(0)                                                                               
mosttime=conn.execute("select mosttime from info")(0)                                                                                         
usno=conn.execute("Select count(ltime)from online where name<>''")(0)                                                                                      
lineno=conn.execute("Select count(ltime)from online")(0)                                                                      
if int(lineno)>int(mostonline) then                                                                                      
conn.execute("update info set mostonline="&lineno&",mosttime='"&now&"'")                                                                    
mostonline=lineno                                                                                      
end if                                                                                      
nusno=lineno-usno 
hyzc=conn.execute("Select count(*)from shop_user")(0) 
zhhy=conn.execute("Select top 1 username from shop_user order by userid desc")(0) 
sptj=conn.execute("Select count(*)from wygkcn_shop")(0) 
xwtj=conn.execute("Select count(*)from shop_news")(0) 
zttj=conn.execute("Select count(*)from shop_zhuanti")(0) 
gqtj=conn.execute("Select count(*)from shop_infomsg")(0)
sql="select newuser,alluser,alltopic,allreply from info"                     
Set Rs2=Conn.Execute(sql)
zt=rs2("alltopic")
hf=rs2("allreply")

if session("over")="" then
    jsqtoday=1
	if application("dntime")="" then
	application("dntime")=now()
	end if
    if  datediff("d",application("dntime"),now())<1 then
	conn.execute("update shop_Dept set jsqtoday=jsqtoday+1")
	tmprs=conn.execute("Select jsqtoday From shop_Dept")
	jsqtoday=tmprs(0)
    else
	conn.execute("update shop_Dept set jsqtoday=1")
	tmprs=conn.execute("Select jsqtoday From shop_Dept")
	jsqtoday=tmprs(0)
	application("dntime")=now()
    end if    
    set tmprs=nothing    
	conn.execute("update shop_Dept set jsq=jsq+1")
	tmprs=conn.execute("Select jsq From shop_Dept")
	jsq=tmprs(0)
    set tmprs=nothing    
    session("over")=true
else
    jsqtoday=1
	tmprs=conn.execute("Select jsqtoday From shop_Dept")
	jsqtoday=tmprs(0)	
	tmprs=conn.execute("Select jsq From shop_Dept")
	jsq=tmprs(0)
    set tmprs=nothing
end if
 %> 