<%
'前后台通用表格类
Class tables
'提交表单头
Function formtop(action,title)
formtop= "<form action="&action&" method='post' name='myform'>"
'response.write "<table width='100%' cellpadding=3 cellspacing=1 class=td1>
'response.write "<tr class=td4><td colspan=2><strong>"&title&"</strong></td></tr>"
formtop=formtop& tablestop(title)
End Function 
'提交表单尾部
Function formfoot()
formfoot= "<tr class=td4><td colspan=2 align=center>"
formfoot=formfoot& "<input type='submit' name='Submit' value=' 提 交 '></td></tr>"
formfoot=formfoot& "</table></form>"
End Function 
'隐藏输入文本框
Function inputhidden(names,values)
inputhidden = "<input name="&names&" type=hidden value="&values&">"
End Function 
'文本输入框
Function inputs(title,names,types,values)
If value=0 Then value=""
inputs= "<tr class=td2><td nowap>"&title&"</td>"
inputs=inputs& "<td width='80%'><input name="&names&" type="&types&" size='75' value="&values&"></td></tr>"
End Function 
'是否选择
Function yesno(title,names,values)
yesno= "<tr class=td2><td nowap>"&title&"</td>"
yesno=yesno& "<td><select name="&names&">"
yesno=yesno& "<option value='1'"
If values=1 Then yesno=yesno& " selected"
yesno=yesno& ">是</option>"
yesno=yesno& "<option value='0' "
If values=0 Then yesno=yesno& " selected"
yesno=yesno& ">否</option></td></tr>"
End Function 
'下拉列表
Function Selects(title,names,multiples,values,options,selecteds)
Selects= "<tr class=td2><td nowap>"&title&"</td>"

Selects=Selects& " <td><select name="&names&""
If multiple=1 Then 
Selects=Selects& " size='10' multiple"
End If 
Selects=Selects& ">"
For i=0 To UBound(values)
Selects=Selects& "<option value="&values(i)
If  selecteds=values(i) Then Selects=Selects& " selected"
Selects=Selects& ">"&options(i)&"</option>"
next 
Selects=Selects& "  </select></td></tr>"

End Function 

'多行文本框
Function textarea(title,names,values)
If values="0" Then values=""
textarea= "<tr class=td2><td nowap>"&title&"</td>"
textarea=textarea& "<td width='80%'><textarea name="&names&" cols='75' rows='5'>"&values&"</textarea></td></tr>"
End function 
Function ewebtext(title,names,values,w,h)
ewebtext="<tr class=td2><td nowap>"&title&"</td>"
ewebtext=ewebtext & "<td width='80%'><INPUT type='hidden' name='"&names&"' value='"&values&"'>"
ewebtext=ewebtext&"	<IFRAME ID='eWebEditor1' src='../editor/eWebEditor.htm?id="&names&"&style=coolblue&originalfilename=d_originalfilename &savefilename=d_savefilename &savepathfilename=d_savepathfilename' frameborder='0' scrolling='no' width='"&w&"' height='"&h&"'></IFRAME></td></tr>"
End Function 
Function tablebr()
 tablebr= "</table>"
End function 
'表格头
Function tablestop(title)
tablestop= "<table width='100%' cellpadding=3 cellspacing=1 class=td1>"
tablestop=tablestop& "<tr class=td4><td colspan=2><strong>"&title&"</strong></td></tr>"
End function
'表格尾部
Function tablesfoot()
tablesfoot= "</table>"
End Function 
' ===============================================
' 初始化下拉框
'  s_FieldName  : 返回的下拉框名  
'  a_Name    : 定值名数组
'  a_Value    : 定值值数组
'  v_InitValue  : 初始值
'  s_Sql    : 从数据库中取值时,select name,value from table
'  s_AllName  : 空值的名称,如:"全部","所有","默认"
' ===============================================
Function InitSelect(title,s_FieldName, a_Name, a_Value, v_InitValue, s_Sql, s_AllName)
  Dim i
  InitSelect = "<tr class=td2><td nowap>"&title&"</td><td><select name='" & s_FieldName & "' size=1>"
  If s_AllName <> "" Then
    InitSelect = InitSelect & "<option value=''>" & s_AllName & "</option>"
  End If
  If s_Sql <> "" Then
    Rs.Open s_Sql, Conn, 0, 1
    Do While Not Rs.Eof
      InitSelect = InitSelect & "<option value=""" & tx_common.inHTML(Rs(1)) & """"
      If Rs(1) = v_InitValue Then
        InitSelect = InitSelect & " selected"
      End If
      InitSelect = InitSelect & ">" & tx_commonoutHTML(Rs(0)) & "</option>"
      Rs.MoveNext
    Loop
    Rs.Close
  Else
    For i = 0 To UBound(a_Name)
      InitSelect = InitSelect & "<option value=""" & tx_common.inHTML(a_Value(i)) & """"
      If a_Value(i) = v_InitValue Then
        InitSelect = InitSelect & " selected"
      End If
      InitSelect = InitSelect & ">" & tx_common.outHTML(a_Name(i)) & "</option>"
    Next
  End If
  InitSelect = InitSelect & "</select></td></tr>"
End Function

End Class 

%>