<!--#include file ="Conn.asp"-->
<!--#include file ="Check_Manager.asp"-->
<html>
<head>
<title>管理中心</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><LINK href="admin/admin.css" type=text/css rel=stylesheet><script language="JavaScript" src="admin/js.js"></SCRIPT></head>
<SCRIPT language=javascript>
function ConfirmDel()
{
   if(confirm("确定要删除吗？一旦删除将不能恢复！"))
     return true;
   else
     return false;	 
}
</Script>
<%
Dim tname 
tname = Request.QueryString("tname")
function fieldtype(typeid)
select case typeid
	case 130	fieldtype = "文本"
	case 2		fieldtype = "整型"
	case 3		fieldtype = "长整型"
	case 7		fieldtype = "日期/时间"
	case 5		fieldtype = "双精度型"
	case 11		fieldtype = "是/否"
	case 128	fieldtype = "OLE 对象"
	case else	fieldtype = "其他("&typeid&")"
end select
end function
%>

<body text="#000000">
<br>
 <table width="87%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="48%" height="15">
<div align="center"><a href="JaAcc_Manage.asp">返回数据表选择页面</a> <A href="javascript:history.back()">返回上一页</a></div></td>
    <td width="52%"><strong><font color="#990000">对表操作：</font>&nbsp;<a href="JaAcc_del.Asp?tname=<%=tname%>" onclick="return ConfirmDel();">删除此表</a></strong></td>
  </tr>
</table>
<form name="reSelected" action="JaAcc_Seidt.asp?tname=<%=tname%>" method="post" onSubmit="return chk(this)">
<table width="87%" border="0" align="center" cellpadding="4" cellspacing="0" class=tableBorder>
  <tr> 
    <td height="25" background="admin/admin_bg_1.gif"><div align="center"><strong><font color="#FFFFFF">数据库表<font color=#990000>[ <%=tname%> ]</font>管理</font></strong></div></td>
  </tr>
 
    <tr> 
    <td height="25"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
         
    <tr bgcolor="#FFFFCC"> 
          <td width="33%" height="8"><b><font color=#990000>字段名</font></b></td>
          <td width="33%" height="8"><b><font color=#990000>数据类型</font></b></td>
          
        <td width="33%" height="8"><b><font color=#990000>字段大小(不能大于255)</font></b></td>
         
        </tr>
   <tr>
    <%
     Dim i
     Dim k
     Dim lname
     i= 0 
     Set objColumnRS = Conn.OpenSchema(4,Array(Empty, Empty, tname))
     do while not objColumnRS.EOF
     lname = lname & objColumnRS("Column_Name") & "|"
      iLength = objColumnRS("Character_Maximum_Length")
		iPrecision = objColumnRS("Numeric_Precision")	
	            iScale = objColumnRS("Numeric_Scale")
		iDefaultValue = objColumnRS("Column_Default")
              	If IsNull(iLength) then iLength = "&nbsp;"	
	            If IsNull(iPrecision) then iPrecision = "&nbsp;"
		If IsNull(iScale) then iScale = "&nbsp;"
		If IsNull(iDefaultValue) then iDefaultValue = "&nbsp;"%>
 
 <td width="33%" height="20"><input value="<%=objColumnRS("Column_Name")%>" name='f<%=i%>' type='text' size=20 maxlength=100></td>
          <td width="33%" height="20"><select name=LB<%=i%> onChange=reSubmit<%=i%>(this.form)>
             <option value='字符&50'>字符</option>
             <option value='数字&18'>数字</option>
             <option value='整数&10'>整数</option>
             <option value='链接&212'>链接</option>
             <option value='日期&8'>日期</option>
             <option value='图片&211'>图片</option>
             <option value='备注&0'>备注</option>
            </select><%=fieldtype(objColumnRS("Data_Type"))%></td>
          <td width="33%" height="20"><input class=input value='<%=iLength%>' type='text' name='CD<%=i%>'></td>
        </TR>
            
        <% 
         
         i=i+1
         objColumnRS.MoveNext
         Loop
         Response.Write "<input  value='"&i&"' type='hidden' name='i'>"
         Response.Write "<input  value='"&lname&"' type='hidden' name='lname'>"
         Set objColumnRS = Nothing	
        %>  
		 <tr> 
          <td height="40">&nbsp;</td>
          <td> <INPUT type=submit value="保存修改" name=Submit> &nbsp;&nbsp; 
          <INPUT type=reset value="重置数据" name=Submit2></td>
</tr>
          <tr> 
          <td height="20">&nbsp;</td>
          <td>注：ID自动编号字段系统保留选择修改无效</td>
          </tr>

</table>
</form>
<Script language="JavaScript">
 <%for a=0 to i%>
 function reSubmit<%=a%>(theform) {  
 with (theform) {
 var arr;
 arr =LB<%=a%>.value.split("&");
 CD<%=a%>.value = arr[1];
  if (arr[1]=213) {
   document.reSelected.CD<%=a%>.Enabled="False;"
    }
 } }
 <%Next%>
  
 function chk()
{
<%for a=0 to i%>
  if (document.reSelected.CD<%=a%>.value>255)
  {
    alert("字段<%=a%>不能大于255！");
    document.reSelected.CD<%=a%>.focus();
    return false;
  }
 <%Next%>
}
</Script>