<%
Function GetBBSType(ByVal Val, ByVal JsCode)
    GetBBSType = GetTypeList("BBS_Type", "Id,TypeCnName", "所属类别", "ClassId", Val, JsCode, "select")
End Function


Function GetLinkType(ByVal Val, ByVal JsCode)
    GetLinkType = GetTypeList("LinkType", "", "所属分类", "ClassId", Val, JsCode, "select")
End Function

Function GetHdpType(ByVal Val, ByVal JsCode)
    GetHdpType = GetTypeList("HdpType", "", "所属分类", "ClassId", Val, JsCode, "select")
End Function

Function GetBookType(ByVal Val, ByVal JsCode)
    GetBookType = GetTypeList("BookType", "", "所属分类", "ClassId", Val, JsCode, "select")
End Function

Function GetAdType(ByVal Val, ByVal JsCode)
    GetAdType = GetTypeList("AdType", "", "所属分类", "ClassId", Val, JsCode, "select")
End Function

Function GetAttrType(ByVal TitleName, ByVal ClassId, ByVal Val, ByVal JsCode)
    GetAttrType = GetTypeList("AttrType", "", TitleName, ClassId, Val, JsCode, "n")
End Function

Function GetShowAdTypeName(id)
    Dim strTemp
    Select Case CmsFun.ChkNumEric(id)
        Case 1
            strTemp = "普通广告"
        Case 2
            strTemp = "左边漂浮广告"
        Case 3
            strTemp = "右边漂浮广告"
        Case 4
            strTemp = "代码广告(Html文件形式)"
        Case 5
            strTemp = "代码广告(Js文件形式)"
        Case Else
            strTemp = "广告类型错误"
    End Select
    GetShowAdTypeName = strTemp
End Function

Function GetShowAdType(ByVal Val, ByVal JsCode)
    Dim strTemp, ArrayList, ii
    ArrayList = Array("所属类型", "普通广告", "左边漂浮广告", "右边漂浮广告", "代码广告(Html文件形式)", "代码广告(Js文件形式)")
    strTemp = "<select name=""TypeId"" id=""TypeId"" class=""select2"""& JsCode &" datatype=""select"" errormsg=""请选择所属类型"">" & vbCrLf
    For ii = 0 To UBound(ArrayList)
        strTemp = strTemp & "<option value="""& ii &""""& Easp.IIf(Trim(Val) = Trim(ii), " selected=""selected""", "") &">"& ArrayList(ii) &"</option>" & vbCrLf
    Next
    strTemp = strTemp & "</select>"
    GetShowAdType = strTemp
End Function

Function GetTypeList(ByVal TabName, ByVal TabField, ByVal TitleName, ByVal ListName, ByVal Val, ByVal JsCode, ByVal DataType)
    Dim strTemp, oRs, arrList, i, IfSelect
    strTemp = "<select name="""& ListName &""" id="""& ListName &""" class=""select2"""& JsCode &" datatype="""& DataType &""" errormsg=""请选择"& TitleName &""">" & vbCrLf
    strTemp = strTemp & "<option value=""0"">"& TitleName &"</option>" & vbCrLf
    Set oRs = Easp.db.GR(TablePrefix & TabName & ":" & Easp.IIf(Easp.IsN(TabField), "Id,CnName", TabField), "", " Px Asc,Id Desc ")
    If Not Easp.IsN(oRs) Then
        arrList = oRs.GetRows()
    End If
    Easp.C oRs
    If IsArray(arrList) Then
        For i = 0 To UBound(arrList, 2)
            IfSelect = ""
            IfSelect = Easp.IIf(Trim(arrList(0, i)) = Trim(Val), " selected=""selected""", "")
            strTemp = strTemp & "<option value="""& arrList(0, i) &""""& IfSelect &">"& arrList(1, i) &"</option>" & vbCrLf
        Next
    End If
    strTemp = strTemp & "</select>" & vbCrLf
    GetTypeList = strTemp
End Function

Function SelectTableField(TalbeName)
    If Not Easp.IsN(TalbeName) Then
        Dim oRs, oSQL, TempStr, i, ii
        TempStr = ""
        oSQL = "Select * From [" & TalbeName & "]"
        Set oRs = Easp.db.GRS(oSQL)
        For i = 0 To oRs.Fields.Count -1
            ii = ii + 1
            TempStr = TempStr & oRs.Fields(i).Name & ","
            If ii = 15 Then
                ii = 0
                TempStr = TempStr & Chr(10)
            End If
        Next
        Easp.C oRs
        If TempStr <> "" Then
            TempStr = Replace(TempStr, "FontMode,", "", 1, -1, 1)
            TempStr = Replace(TempStr, "ColorMode,", "", 1, -1, 1)
            TempStr = Replace(TempStr, "DataIsTop,", "", 1, -1, 1)
            TempStr = Replace(TempStr, "DataIsBest,", "", 1, -1, 1)
            TempStr = Replace(TempStr, "DataIsHot,", "", 1, -1, 1)
            TempStr = Replace(TempStr, "DataIsXp,", "", 1, -1, 1)
            TempStr = Replace(TempStr, "DataIsTs,", "", 1, -1, 1)
        End If
        If Right(TempStr, 1) = "," Then
            TempStr = Left(TempStr, Len(TempStr) -1)
        End If
        SelectTableField = TempStr
    Else
        SelectTableField = ""
    End If
End Function
%>