<%
'后台通用类
Class master
'后台管理员检测类
 function adminlogin()
Session("Admin") = Request.Cookies("Admin")
   If Session("Admin") = "" Then
       Response.Write "<script language=JavaScript>" & vbCrLf
       Response.Write "window.open('Admin_Login.asp','_parent');" & vbCrLf
       Response.Write "</script>" & vbCrLf
       Response.End()
   End If
End Function 
'分类列表
Public Function sortselect(title,sqlif,names,selecteds)
If sqlif<>"" Then sqlsif=" where "&sqlif
sql="select title,id,[level],sortlist from tx_catasort "&sqlsif&" order by code asc"
sortemp=tx_common.query(sql)
Selects= "<tr class=td2><td nowap>"&title&"</td>"
Selects=Selects& " <td><select name="&names&""
Selects=Selects& ">"
selects=selects& "<option value='0' selected>== 请选择分类 ==</option>"
if isarray(sortemp) then 
For i=0 To UBound(sortemp,2)
Selects=Selects& "<option value="&sortemp(1,i)
If  selecteds=sortemp(1,i) Then Selects=Selects& " selected"
Selects=Selects& ">┗"
 for j=1 to sortemp(2,i)-1
		Selects=Selects& "_"
 next

Selects=Selects&sortemp(0,i)&"</option>"
next 
end if  
Selects=Selects& "  </select></td></tr>"
sortselect=selects
End Function
'专题列表
Public Function topicselect(title,sqlif,names,selecteds)
If sqlif<>"" Then sqlsif=" where "&sqlif
sql="select title,id from tx_topic "&sqlsif&" order by id desc"
topictemp=tx_common.query(sql)
Selects= "<tr class=td2><td nowap>"&title&"</td>"

Selects=Selects& " <td><select name="&names&""
Selects=Selects& ">"
selects=selects& "<option value='0' selected>== 请选择专题 ==</option>"
if isarray(topictemp) then 
For i=0 To UBound(topictemp,2)
Selects=Selects& "<option value="&topictemp(1,i)
If  selecteds=topictemp(1,i) Then Selects=Selects& " selected"
Selects=Selects& ">"
Selects=Selects&topictemp(0,i)&"</option>"
next 
end if
Selects=Selects& "  </select></td></tr>"
topicselect=selects
End Function  
'会员组列表
Public Function userselect(title,sqlif,names,selecteds)
If sqlif<>"" Then sqlsif=" where "&sqlif
sql="select id,title from tx_usergroup "&sqlsif&" order by id"
usertemp=tx_common.query(sql)
Selects= "<tr class=td2><td nowap>"&title&"</td>"
Selects=Selects& " <td><select name="&names&""
Selects=Selects& ">"
selects=selects& "<option value='0' selected>== 请选择会员组 ==</option>"
if isarray(usertemp) then 
For i=0 To UBound(usertemp,2)
Selects=Selects& "<option value="&usertemp(0,i)
If  selecteds=usertemp(0,i) Then Selects=Selects& " selected"
Selects=Selects&">"&usertemp(1,i)&"</option>"
next 
end if 
Selects=Selects& "  </select></td></tr>"
userselect=selects
End Function 
End Class

   %>