<%
 
Function Getsearchsortcount()
sql="select count(info_id) from [Websen_Info] where [sortid]="&rssort("sortid")&" and [flag]=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
set totle=conn.execute(sql)
totle=totle(0)
Getsearchsortcount=totle
End Function

Function Getsearchtypecount()
sql="select count(info_id) from [Websen_Info] where [typeid]="&rstype("typeid")&" and [flag]=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
set totle=conn.execute(sql)
totle=totle(0)
Getsearchtypecount=totle
End Function

Function Getsearchtypecount_sale()
sql="select count(info_id) from Websen_Info where type='卖' and typeid="&rstype("typeid")&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
set totle=conn.execute(sql)
totle=totle(0)
Getsearchtypecount_sale=totle
End Function

Function Getsearchsortcount_sale()
sql="select count(info_id) from Websen_Info where type='卖' and sortid="&rssort("sortid")&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
set totle=conn.execute(sql)
totle=totle(0)
Getsearchsortcount_sale=totle
End Function

Function Getsearchtypecount_buy()
sql="select count(info_id) from Websen_Info where type='买' and typeid="&rstype("typeid")&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
set totle=conn.execute(sql)
totle=totle(0)
Getsearchtypecount_buy=totle
End Function

Function Getsearchsortcount_buy()
sql="select count(info_id) from Websen_Info where type='买' and sortid="&rssort("sortid")&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
set totle=conn.execute(sql)
totle=totle(0)
Getsearchsortcount_buy=totle
End Function

Function Getsearchtypecount1()
sql="select count(info_id) from Websen_Info where type='卖' and typeid="&typeid&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
set totle=conn.execute(sql)
totle=totle(0)
Getsearchtypecount1=totle
End Function

Function Getsearchtype_2count1()
sql="select count(info_id) from Websen_Info where type='卖' and typeid_2="&typeid_2&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
set totle=conn.execute(sql)
totle=totle(0)
Getsearchtype_2count1=totle
End Function


Function Getsearchtypecount1_1()
sql="select count(info_id) from Websen_Info where type='买' and typeid="&typeid&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
set totle=conn.execute(sql)
totle=totle(0)
Getsearchtypecount1_1=totle
End Function

Function Getsearchtypecount1_1_1()
sql="select count(id) from Websen_productshow where typeid="&typeid&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
set totle=conn.execute(sql)
totle=totle(0)
Getsearchtypecount1_1_1=totle
End Function

Function Getsearchtypecount1_1_1_1()
sql="select count(id) from Websen_corporation where typeid="&typeid&" and  flag=1"
if keywords<>"" then sql=sql&" and zycp like '%"&keywords&"%'"
set totle=conn.execute(sql)
totle=totle(0)
Getsearchtypecount1_1_1_1=totle
End Function

Function Getsearchsortcount1()
sql="select count(info_id) from Websen_Info where type='卖' and sortid="&sortid&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"


if datetime<>"" then

if Database_type=1 then
 sql=sql&" and Websen_info.dateandtime>=getdate()-"&datetime&""
else
 sql=sql&" and Websen_info.dateandtime>=now()-"&datetime&""
 end if
 
 end if
set totle=conn.execute(sql)
totle=totle(0)
Getsearchsortcount1=totle
End Function

Function Getsearchsalecount1()
sql="select count(info_id) from Websen_Info where type='卖' and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
 if datetime<>"" then 
 if Database_type=1 then
sql=sql&" and Websen_info.dateandtime>=getdate()-"&datetime&""
else
sql=sql&" and Websen_info.dateandtime>=now()-"&datetime&""
end if
 end if
set totle=conn.execute(sql)
totle=totle(0)
Getsearchsalecount1=totle
End Function

Function Getsearchtypecount2()
sql="select count(info_id) from Websen_Info where type='买' and typeid="&rstype("typeid")&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
 if datetime<>"" then 
 if Database_type=1 then
sql=sql&" and Websen_info.dateandtime>=getdate()-"&datetime&""
else
sql=sql&" and Websen_info.dateandtime>=now()-"&datetime&""
end if
 end if
 
set totle=conn.execute(sql)
totle=totle(0)
Getsearchtypecount2=totle
End Function

Function Getsearchsortcount2()
sql="select count(info_id) from Websen_Info where type='买' and sortid="&rssort("sortid")&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"




if datetime<>"" then

if Database_type=1 then
 sql=sql&" and Websen_info.dateandtime>=getdate()-"&datetime&""
else
 sql=sql&" and Websen_info.dateandtime>=now()-"&datetime&""
end if

end if
set totle=conn.execute(sql)
totle=totle(0)
Getsearchsortcount2=totle
End Function

Function Getsearchsortcount3()
sql="select count(info_id) from Websen_Info where type='买' and sortid="&rstype("sortid")&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"



if datetime<>"" then 

if Database_type=1 then
sql=sql&" and Websen_info.dateandtime>=getdate()-"&datetime&""
else
sql=sql&" and Websen_info.dateandtime>=now()-"&datetime&""
end if


end if
set totle=conn.execute(sql)
totle=totle(0)
Getsearchsortcount3=totle
End Function

Function Getsearchtypecount4()
sql="select count(info_id) from Websen_Info where typeid="&rssort("typeid")&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"



if datetime<>"" then

if Database_type=1 then
 sql=sql&" and Websen_info.dateandtime>=getdate()-"&datetime&""
else
 sql=sql&" and Websen_info.dateandtime>=now()-"&datetime&""
  end if
 
 end if
 
 
set totle=conn.execute(sql)
totle=totle(0)
Getsearchtypecount4=totle
End Function

Function Getsearchsortcount4()
sql="select count(info_id) from Websen_Info where sortid="&sortid&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"




if datetime<>"" then

if Database_type=1 then
 sql=sql&" and Websen_info.dateandtime>=getdate()-"&datetime&""
else
 sql=sql&" and Websen_info.dateandtime>=now()-"&datetime&""
  end if
 
 end if
set totle=conn.execute(sql)
totle=totle(0)
Getsearchsortcount4=totle
End Function

Function Getsearchsortcount5()
sql="select count(info_id) from Websen_Info where sortid="&rstype("sortid")&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"





if datetime<>"" then 

if Database_type=1 then
sql=sql&" and Websen_info.dateandtime>=getdate()-"&datetime&""
else
sql=sql&" and Websen_info.dateandtime>=now()-"&datetime&""
end if

end if

set totle=conn.execute(sql)
totle=totle(0)
Getsearchsortcount5=totle
End Function

Function Getsearchtypecount6()
sql="select count(info_id) from Websen_Info where type='卖' and typeid="&rssort("typeid")&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"



if datetime<>"" then

if Database_type=1 then
 sql=sql&" and Websen_info.dateandtime>=getdate()-"&datetime&""
else
 sql=sql&" and Websen_info.dateandtime>=now()-"&datetime&""
  end if


 end if
set totle=conn.execute(sql)
totle=totle(0)
Getsearchtypecount6=totle
End Function

Function Getsearchsortcount6()
sql="select count(info_id) from Websen_Info where type='卖' and sortid="&sortid&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"



if datetime<>"" then

if Database_type=1 then
 sql=sql&" and Websen_info.dateandtime>=getdate()-"&datetime&""
else
 sql=sql&" and Websen_info.dateandtime>=now()-"&datetime&""
 end if
 
 end if
 
set totle=conn.execute(sql)
totle=totle(0)
Getsearchsortcount6=totle
End Function

Function Getsearchsortcount7()
sql="select count(info_id) from Websen_Info where type='卖' and sortid="&rstype("sortid")&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"



if datetime<>"" then 

if Database_type=1 then
sql=sql&" and Websen_info.dateandtime>=getdate()-"&datetime&""
else
sql=sql&" and Websen_info.dateandtime>=now()-"&datetime&""
end if

end if
set totle=conn.execute(sql)
totle=totle(0)
Getsearchsortcount7=totle
End Function

Function Getsearchtypecount8()
sql="select count(info_id) from Websen_Info where type='买' and typeid="&rssort("typeid")&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
 if datetime<>"" then
  if Database_type=1 then
  sql=sql&" and Websen_info.dateandtime>=getdate()-"&datetime&""
  else
  sql=sql&" and Websen_info.dateandtime>=now()-"&datetime&""
end if
end if



set totle=conn.execute(sql)
totle=totle(0)
Getsearchtypecount8=totle
End Function

Function Getsearchsortcount8()
sql="select count(info_id) from Websen_Info where type='买' and sortid="&sortid&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
 if datetime<>"" then
  if Database_type=1 then
 sql=sql&" and Websen_info.dateandtime>=getdate()-"&datetime&""
else
 sql=sql&" and Websen_info.dateandtime>=now()-"&datetime&""
end if
 end if


set totle=conn.execute(sql)
totle=totle(0)
Getsearchsortcount8=totle
End Function

Function Getsearchsortcount9()
sql="select count(info_id) from Websen_Info where type='买' and sortid="&rstype("sortid")&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
 if datetime<>"" then 
if Database_type=1 then
sql=sql&" and Websen_info.dateandtime>=getdate()-"&datetime&""
else
sql=sql&" and Websen_info.dateandtime>=now()-"&datetime&""
end if
end if


set totle=conn.execute(sql)
totle=totle(0)
Getsearchsortcount9=totle
End Function

Function Getsearchtypecount10()
sql="select count(id) from Websen_productshow where typeid="&rssort("typeid")&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
set totle=conn.execute(sql)
totle=totle(0)
Getsearchtypecount10=totle
End Function

Function Getsearchsortcount10()
sql="select count(id) from Websen_productshow where sortid="&sortid&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
set totle=conn.execute(sql)
totle=totle(0)
Getsearchsortcount10=totle
End Function

Function Getsearchsortcount11()
sql="select count(id) from Websen_productshow where sortid="&rstype("sortid")&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
set totle=conn.execute(sql)
totle=totle(0)
Getsearchsortcount11=totle
End Function

Function Getsearchtypecount12()
sql="select count(id) from Websen_corporation where typeid="&rssort("typeid")&"' and flag=1"
if keywords<>"" then sql=sql&" and zycp like '%"&keywords&"%"
set totle=conn.execute(sql)
totle=totle(0)
Getsearchtypecount12=totle
End Function

Function Getsearchsortcount12()
sql="select count(id) from Websen_corporation where sortid="&sortid&" and  flag=1"
if keywords<>"" then sql=sql&" and zycp like '%"&keywords&"%"
set totle=conn.execute(sql)
totle=totle(0)
Getsearchsortcount12=totle
End Function

Function Getsearchsortcount13()
sql="select count(id) from Websen_corporation where sortid="&rstype("sortid")&" and  flag=1"
if keywords<>"" then sql=sql&" and zycp like '%"&keywords&"%"
set totle=conn.execute(sql)
totle=totle(0)
Getsearchsortcount13=totle
End Function

Function Getsearchprocount()
sql="select count(id) from Websen_productshow where flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
 if datetime="1" then
 if Database_type=1 then
 sql=sql&" and idate>=getdate()-1"
else
 sql=sql&" and idate>=now()-1"
  end if
  end if
 
set totle=conn.execute(sql)
totle=totle(0)
Getsearchprocount=totle
End Function

Function Getsearchprosortcount()
sql="select count(id) from Websen_productshow where sortid="&sortid&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"


if datetime="1" then

if Database_type=1 then
 sql=sql&" and idate>=getdate()-1"
else
 sql=sql&" and idate>=date()-1"
end if

end if

set totle=conn.execute(sql)
totle=totle(0)
Getsearchprosortcount=totle
End Function

Function Getsearchprotypecount()
sql="select count(id) from Websen_productshow where typeid="&typeid&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
 if datetime="1" then
 if Database_type=1 then
 sql=sql&" and idate>=getdate()-1"
else
 sql=sql&" and idate>=now()-1"
end if
end if


set totle=conn.execute(sql)
totle=totle(0)
Getsearchprotypecount=totle
End Function

Function Getsearchprotype_2count()
sql="select count(id) from Websen_productshow where typeid_2="&typeid_2&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
 if datetime="1" then
 if Database_type=1 then
  sql=sql&" and idate>=getdate()-1"
 else
 sql=sql&" and idate>=now()-1"
end if
end if


set totle=conn.execute(sql)
totle=totle(0)
Getsearchprotype_2count=totle
End Function

Function Getsearchprosortcount1()
sql="select count(id) from Websen_productshow where sortid="&rssort("sortid")&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"



if datetime="1" then
if Database_type=1 then
 sql=sql&" and idate>=getdate()-1"
 else
  sql=sql&" and idate>=now()-1"
end if
end if
 set totle=conn.execute(sql)
totle=totle(0)
Getsearchprosortcount1=totle
End Function

Function Getsearchprotypecount1()
sql="select count(id) from Websen_productshow where typeid="&rstype("typeid")&" and flag=1"
if keywords<>"" then sql=sql&" and keywords like '%"&keywords&"%'"
 if datetime="1" then 
if Database_type=1 then
sql=sql&" and idate>=getdate()-1"
else
sql=sql&" and idate>=now()-1"
end if
end if


set totle=conn.execute(sql)
totle=totle(0)
Getsearchprotypecount1=totle
End Function

Function Getsearchcorcount()
sql="select count(id) from Websen_corporation where  flag=1"
if keywords<>"" then sql=sql&" and zycp like '%"&keywords&"%' or qymc like '%"&keywords&"%'"
  if datetime="1" then
if Database_type=1 then
 sql=sql&" and idate>=getdate()-1"
else
  sql=sql&" and idate>=now()-1"
end if
end if

set totle=conn.execute(sql)
totle=totle(0)
Getsearchcorcount=totle
End Function

Function Getsearchcorsortcount()
sql="select count(id) from Websen_corporation where sortid="&sortid&" and  flag=1"
if keywords<>"" then sql=sql&" and zycp like '%"&keywords&"%' or qymc like '%"&keywords&"%'"
 
if datetime="1" then
if Database_type=1 then
 sql=sql&" and idate>=getdate()-1"
 else
  sql=sql&" and idate>=now()-1"
end if 
end if


set totle=conn.execute(sql)
totle=totle(0)
Getsearchcorsortcount=totle
End Function

Function Getsearchcortypecount()
sql="select count(id) from Websen_corporation where typeid="&typeid&" and  flag=1"
if keywords<>"" then sql=sql&" and zycp like '%"&keywords&"%' or qymc like '%"&keywords&"%'"
 if datetime="1" then
  if Database_type=1 then
  sql=sql&" and idate>=getdate()-1"
 else
  sql=sql&" and idate>=now()-1"
 end if
 end if
 set totle=conn.execute(sql)
totle=totle(0)
Getsearchcortypecount=totle
End Function

Function Getsearchcortype_2count()
sql="select count(id) from Websen_corporation where typeid_2="&typeid_2&" and  flag=1"
if keywords<>"" then sql=sql&" and zycp like '%"&keywords&"%' or qymc like '%"&keywords&"%'"




if datetime="1" then

if Database_type=1 then
 sql=sql&" and idate>=getdate()-1"

else
 sql=sql&" and idate>=now()-1"
end if
end if 


set totle=conn.execute(sql)
totle=totle(0)
Getsearchcortype_2count=totle
End Function

Function Getsearchcorsortcount1()
sql="select count(id) from Websen_corporation where sortid="&rssort("sortid")&" and  flag=1"
 if keywords<>"" then sql=sql&" and zycp like '%"&keywords&"%' or qymc like '%"&keywords&"%'"
 if datetime="1" then 
if Database_type=1 then
sql=sql&" and idate>=getdate()-1"
else
sql=sql&" and idate>=now()-1"
end if
end if
 set totle=conn.execute(sql)
 totle=totle(0)
Getsearchcorsortcount1=totle
End Function

Function Getsearchcortypecount1()
sql="select count(id) from Websen_corporation where typeid="&rstype("typeid")&" and  flag=1"
if keywords<>"" then sql=sql&" and zycp like '%"&keywords&"%' or qymc like '%"&keywords&"%'"
 if datetime="1" then
 if Database_type=1 then
 sql=sql&" and idate>=getdate()-1"
else
 sql=sql&" and idate>=now()-1"
end if 
end if

set totle=conn.execute(sql)
totle=totle(0)
Getsearchcortypecount1=totle
End Function

'一级分类统计---供应
Function yijicount_sale() 
sql="select count(info_id) from Websen_Info where type='卖' and sortid="&rssort("sortid")&" and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
yijicount_sale=totle
End Function

'专项商机总数
Function zxshangji_all() 
sql="select count(vipinfo_id) from Websen_vipinfo"
set totle=conn.execute(sql)
totle=totle(0)
zxshangji_all=totle
End Function

'专项商机统计---一级HTML页
Function listcount_vipinfo_html() 
sql="select count(vipinfo_id) from Websen_vipinfo where viptype="&ttid&""
set totle=conn.execute(sql)
totle=totle(0)
listcount_vipinfo_html=totle
End Function

'一级分类统计---采购
Function yijicount_buy() 
sql="select count(info_id) from Websen_Info where type='买' and sortid="&rssort("sortid")&" and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
yijicount_buy=totle
End Function

'一级分类统计---供应及采购
Function yijicount_buy_sale() 
sql="select count(info_id) from Websen_Info where sortid="&rssort("sortid")&" and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
yijicount_buy_sale=totle
End Function

'二级分类统计---供应
Function erjicount_sale() 
sql="select count(info_id) from Websen_Info where type='卖' and typeid="&rstype("typeid")&" and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
erjicount_sale=totle
End Function

'三级分类统计---供应
Function sanjicount_sale() 
sql="select count(info_id) from Websen_Info where type='卖' and typeid_2="&rstype("typeid_2")&" and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
sanjicount_sale=totle
End Function

'list级统计---供应
Function listcount_sale() 
sql="select count(info_id) from Websen_Info where type='卖' and typeid="&typeid&" and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
listcount_sale=totle
End Function

'list级统计---供应(html)
Function listcount_sale_html() 
sql="select count(info_id) from Websen_Info where type='卖' and typeid="&ttid&" and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
listcount_sale_html=totle
End Function

'offerlist级统计---供应(html)
Function listcount_sale_html_2() 
sql="select count(info_id) from Websen_Info where type='卖' and typeid_2="&ttid&" and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
listcount_sale_html_2=totle
End Function

'二级分类统计---采购
Function erjicount_buy() 
sql="select count(info_id) from Websen_Info where type='买' and typeid="&rstype("typeid")&" and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
erjicount_buy=totle
End Function

'三级分类统计---采购
Function sanjicount_buy() 
sql="select count(info_id) from Websen_Info where type='买' and typeid_2="&rstype("typeid_2")&" and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
sanjicount_buy=totle
End Function

'list级统计---采购(html)
Function listcount_buy_html() 
sql="select count(info_id) from Websen_Info where type='买' and typeid="&ttid&" and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
listcount_buy_html=totle
End Function

'offerlist级统计---采购(html)
Function listcount_buy_html_2() 
sql="select count(info_id) from Websen_Info where type='买' and typeid_2="&ttid&" and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
listcount_buy_html_2=totle
End Function

'公司库一级分类统计
Function yijicount_cor() 
sql="select count(id) from Websen_corporation where sortid="&rssort("sortid")&" and  flag=1"
set totle=conn.execute(sql)
totle=totle(0)
yijicount_cor=totle
End Function

'公司库二级分类统计
Function erjicount_cor() 
sql="select count(id) from Websen_corporation where typeid="&typeid&" and  flag=1"
set totle=conn.execute(sql)
totle=totle(0)
erjicount_cor=totle
End Function

'公司库二级分类统计html
Function erjicount_cor_html() 
sql="select count(id) from Websen_corporation where typeid="&rstype("typeid")&" and  flag=1"
set totle=conn.execute(sql)
totle=totle(0)
erjicount_cor_html=totle
End Function

'公司库三级分类统计
Function sanjicount_cor() 
sql="select count(id) from Websen_corporation where typeid_2="&rstype("typeid_2")&" and  flag=1"
set totle=conn.execute(sql)
totle=totle(0)
sanjicount_cor=totle
End Function

'list级相关公司统计
Function listcount_cor() 
sql="select count(id) from Websen_corporation where typeid="&typeid&" and  flag=1"
set totle=conn.execute(sql)
totle=totle(0)
listcount_cor=totle
End Function

'list级相关公司统计(HTML页）
Function listcount_cor_html() 
sql="select count(id) from Websen_corporation where typeid="&ttid&" and  flag=1"
set totle=conn.execute(sql)
totle=totle(0)
listcount_cor_html=totle
End Function

'offerlist级相关公司统计(HTML页）
Function listcount_cor_html_2() 
sql="select count(id) from Websen_corporation where typeid_2="&ttid&" and  flag=1"
set totle=conn.execute(sql)
totle=totle(0)
listcount_cor_html_2=totle
End Function

'产品目录一级分类统计
Function yijicount_pro() 
sql="select count(id) from Websen_productshow where sortid="&rssort("sortid")&" and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
yijicount_pro=totle
End Function

'产品目录二级分类统计
Function erjicount_pro() 
sql="select count(id) from Websen_productshow where typeid="&typeid&" and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
erjicount_pro=totle
End Function

'产品目录三级分类统计
Function sanjicount_pro() 
sql="select count(id) from Websen_productshow where typeid_2="&rstype("typeid_2")&" and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
sanjicount_pro=totle
End Function

'list级产品目录统计
Function listcount_pro() 
sql="select count(id) from Websen_productshow where typeid="&typeid&" and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
listcount_pro=totle
End Function

'list级产品目录统计(HTML页）
Function listcount_pro_html() 
sql="select count(id) from Websen_productshow where typeid="&ttid&" and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
listcount_pro_html=totle
End Function

'offerlist级产品目录统计(HTML页）
Function listcount_pro_html_2() 
sql="select count(id) from Websen_productshow where typeid_2="&ttid&" and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
listcount_pro_html_2=totle
End Function

'供应信息总数
Function allinfo_sale() 
sql="select count(info_id) from Websen_Info where type='卖' and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
allinfo_sale=totle
End Function

'求购信息总数
Function allinfo_buy() 
sql="select count(info_id) from Websen_Info where type='买' and flag=1"
set totle=conn.execute(sql)
totle=totle(0)
allinfo_buy=totle
End Function

'今日供应信息总数
Function todayinfo_sale() 
if database_type=1 then
	sql="select count(info_id) from Websen_Info where type='卖' and dateandtime>=getdate()-1 and flag=1"
else
	sql="select count(info_id) from Websen_Info where type='卖' and dateandtime+1>=now() and flag=1"
end if
set totle=conn.execute(sql)
totle=totle(0)
todayinfo_sale=totle
End Function

'今日供应信息总数---- 一级
Function yijitodayinfo_sale() 
if database_type=1 then
	sql="select count(info_id) from Websen_Info where type='卖' and sortid="&rssort("sortid")&" and dateandtime>=getdate()-1 and flag=1"
else
	sql="select count(info_id) from Websen_Info where type='卖' and sortid="&rssort("sortid")&" and dateandtime+1>=now() and flag=1"
end if
set totle=conn.execute(sql)
totle=totle(0)
yijitodayinfo_sale=totle
End Function

'今日供应信息总数---- 二级
Function erjitodayinfo_sale() 
if database_type=1 then
	sql="select count(info_id) from Websen_Info where type='卖' and typeid="&rstype("typeid")&" and dateandtime>=getdate()-1 and flag=1"
else
	sql="select count(info_id) from Websen_Info where type='卖' and typeid="&rstype("typeid")&" and dateandtime+1>=now() and flag=1"
end if
set totle=conn.execute(sql)
totle=totle(0)
erjitodayinfo_sale=totle
End Function

'今日求购信息总数
Function todayinfo_buy() 
if database_type=1 then
	sql="select count(info_id) from Websen_Info where type='买' and dateandtime>=getdate()-1 and flag=1"
else
	sql="select count(info_id) from Websen_Info where type='买' and dateandtime+1>=now() and flag=1"
end if
set totle=conn.execute(sql)
totle=totle(0)
todayinfo_buy=totle
End Function

'今日新增专项商机数
Function listcount_vipinfo_tade_html()
if database_type=1 then
	sql="select count(vipinfo_id) from Websen_vipinfo where viptype="&ttid&" and dateandtime>=getdate()-1"
else
	sql="select count(vipinfo_id) from Websen_vipinfo where viptype="&ttid&" and dateandtime+1>=now()"
end if
set totle=conn.execute(sql)
totle=totle(0)
listcount_vipinfo_tade_html=totle
End Function

'今日求购信息总数---- 一级
Function yijitodayinfo_buy() 
if database_type=1 then
	sql="select count(info_id) from Websen_Info where type='买' and sortid="&rssort("sortid")&" and dateandtime>=getdate()-1 and flag=1"
else
	sql="select count(info_id) from Websen_Info where type='买' and sortid="&rssort("sortid")&" and dateandtime+1>=now() and flag=1"
end if
set totle=conn.execute(sql)
totle=totle(0)
yijitodayinfo_buy=totle
End Function

'今日求购信息总数---- 二级
Function erjitodayinfo_buy() 
If database_type=1 Then
	sql="select count(info_id) from Websen_Info where type='买' and typeid="&rstype("typeid")&" and dateandtime>=getdate()-1 and flag=1"
Else
	sql="select count(info_id) from Websen_Info where type='买' and typeid="&rstype("typeid")&" and dateandtime+1>=now() and flag=1"	
End If
set totle=conn.execute(sql)
totle=totle(0)
erjitodayinfo_buy=totle
End Function

'供求信息总数
Function allinfo_sale_buy() 
sql="select count(info_id) from Websen_Info where flag=1"
set totle=conn.execute(sql)
totle=totle(0)
allinfo_sale_buy=totle
End Function

'公司总数
Function allcorporation() 
sql="select count(id) from Websen_corporation where  flag=1"
set totle=conn.execute(sql)
totle=totle(0)
allcorporation=totle
End Function

'新增公司数
Function today_corporation() 
If database_type=1 then
	sql="select count(id) from Websen_corporation where idate>=getdate()-1 and flag=1"
Else
	sql="select count(id) from Websen_corporation where idate+1>=now() and flag=1"
End If
set totle=conn.execute(sql)
totle=totle(0)
today_corporation=totle
End Function

'询价数
Function xunjia() 
sql="select count(id) from Websen_getprice"
set totle=conn.execute(sql)
totle=totle(0)
xunjia=totle
End Function

'资讯总数
Function zixun_all() 
sql="select count(newsid) from Websen_news"
set totle=conn.execute(sql)
totle=totle(0)
zixun_all=totle
End Function

'二级资讯总数
Function zixun_erji() 
sql="select count(newsid) from Websen_news where typeid="&typeid&""
set totle=conn.execute(sql)
totle=totle(0)
zixun_erji=totle
End Function

'今日资讯数
Function zixun_datetime() 
If database_type=1 Then
	sql="select count(newsid) from Websen_news where dateandtime>=getdate()-1"
Else
	sql="select count(newsid) from Websen_news where dateandtime+1>=now()"
End If
set totle=conn.execute(sql)
totle=totle(0)
zixun_datetime=totle
End Function

'今日二级资讯数
Function zixun_datetime_erji() 
if database_type=1 then
	sql="select count(newsid) from Websen_news where typeid="&ttid&" and dateandtime>=getdate()-1"
Else
	sql="select count(newsid) from Websen_news where typeid="&ttid&" and dateandtime+1>=now()"
End If
set totle=conn.execute(sql)
totle=totle(0)
zixun_datetime_erji=totle
End Function

'各咨讯相关评论数统计
Function news_com() 
sql="select count(com_id) from Websen_Infocom where bpjid="&newsid&" and pass=1"
set totle=conn.execute(sql)
totle=totle(0)
news_com=totle
End Function

'行业大类统计
Function sort_all() 
sql="select count(SortID) from Websen_class_1"
set totle=conn.execute(sql)
totle=totle(0)
sort_all=totle
End Function

'行业小类统计
Function type_all() 
sql="select count(typeID) from Websen_class_2"
set totle=conn.execute(sql)
totle=totle(0)
type_all=totle
End Function

'统计帮助信息小类
Function type_len() 
sql="select count(typeid) from Websen_help_type where sortid="&rssort("sortid")&""
set totle=conn.execute(sql)
totle=totle(0)
type_len=totle
End Function

'昨日供求信息总数
Function yesterdayinfo_all() 
if database_type=1 then
	sql="select count(info_id) from Websen_Info where dateandtime>=getdate()-2 and flag=1"
else
	sql="select count(info_id) from Websen_Info where dateandtime+2>=now() and flag=1"
end if
set totle=conn.execute(sql)
totle=totle(0)
yesterdayinfo_all=totle
End Function
%>
