<%

%>

<!--#include file="te_config.asp"-->
<!--#include file="te_header.asp"-->

<table border=0 cellspacing=1 cellpadding=2 bgcolor = "#ffe4b5" width=100%>
	<tr>
		<td class="smallertext">
			<a href="index.asp">管理首页</a> <a href="te_admin.asp">编辑页面</a> <a href="te_listtables.asp?cid=<%=request("cid")%>"><%=arrDesc(request("cid"))%></a> <a href="te_showtable.asp?cid=<%=request("cid")%>&tablename=<%=request("tablename")%>&ipage=<%=request("ipage")%>">表格 [<%=request("tablename")%>]</a> 搜索表格
		</td>
		<td class="smallerheader" width=130 align=right>
		<%
		if bProtected then 
			response.write session("teFullName")
			response.write "<a href=""te_logout.asp""> (退出)</a>" 
		end if
		%>
		</td>
	</tr>
</table>
	    
<form action="te_showtable.asp?<%=request.querystring%>" method="post" name="kayitform">
	<table border=0 cellspacing=2 cellpadding=3 bgcolor = "#ffe4b5" width=500>

<%
	    lConnID = request("cid")
	    sTableName = request("tablename")
	    sFieldName = request("fld")
	    sFieldValue = request("val")
	    lFieldType = CLng(request("fldtype"))
	    iPage = request("ipage")
	    sQuery = request("q")
    	
	    OpenRS arrConn(lConnID)
    	
	    sSQL = "SELECT * FROM [" & sTableName & "]" 

	    rs.Open sSQL, , , adCmdTable
    		
	    on error resume next
	    for each fld in rs.fields
		    response.write "<tr>"
		    response.write "<td class=""smallerheader"">" & fld.name & "</td>"
		    select case fld.type
			    case adLongVarWChar	'memo
				    response.write "<td><textarea class=""tbflat"" cols=60 rows=6 name=""" & fld.name & """></textarea></td>"
			    case adLongVarBinary	'ole
				    'response.write "<td><img src=""te_getole.asp?cid=" & lConnID & "&tablename=" & sTableName & "&fld=" & fld.name & """></td>"
				    response.write "<td></td>"
			    case adBoolean
				    response.write "<td><input type=""checkbox"" name=""" & fld.name & """>"
			    case else
				    response.write "<td><input class=""tbflat"" size=64 type=""text"" name=""" & fld.name &  """></td>"
		    end select
		    response.write "</tr>"
	    next
    			
%>
		<tr>
			<td></td>
			<td class="smallerheader"><input type="checkbox" name="chkSubstring"> Substring search (仅用于申请非数字区域)</td>
		</tr>
	    
	    <tr>
		    <td></td>
		    <td>
			    <input type="submit" name="cmdsearch" value="  搜索  " class="cmdflat">
		    </td>
	    </tr>
    	</table>
</form>
<!--#include file="te_footer.asp"-->	
 

