<!--#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>
<%
Dim tname
Dim fname
Dim i
tname=Trim(Request.Form("table"))
fname=Split(Trim(Request.Form("files")),",")
 
Dim objTableRs
Dim tablename
i = 0
Set objTableRS = Conn.OpenSchema(20,Array(Empty, Empty, Empty, "TABLE"))
if tablename="" then tablename=objTableRS("Table_Name").Value
Do While Not objTableRS.EOF
If tname  = objTableRS("Table_Name").Value Then
  Response.Write("<script language=""JavaScript"">alert(""此数据表已经存在，请返回修改!"");history.go(-1);</script>")
    Response.End
End if 
objTableRS.MoveNext
Loop
%>
<Script language="JavaScript">
 <%for i=0 to ubound(fname)%>
 function reSubmit<%=i%>(theform) {  
 with (theform) {
 var arr;
 arr =LB<%=i%>.value.split("&");
 CD<%=i%>.value = arr[1];
  if (arr[1]=213) {
   document.reSelected.CD<%=i%>.Enabled="False;"
    }
 } }
 <%Next%>
  
 function chk()
{
<%for i=0 to ubound(fname)%>
  if (document.reSelected.CD<%=i%>.value>255)
  {
    alert("字段<%=i%>不能大于255！");
    document.reSelected.CD<%=i%>.focus();
    return false;
  }
 <%Next%>
}
</Script>
<body text="#000000">
<br>
<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">创建表[ <b><%=tname%></b> ]  -  选择字段属性</font></strong></div></td>
  </tr>
  <tr>
    <td> 
<form name="reSelected" method="post" action="JaAcc_save.asp?num=<%=i%>&t=<%=tname%>" onSubmit="return chk(this)">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="31%" height="22"><strong>字段名</strong></td>
          <td width="29%"><strong>字段类型</strong></td>
          <td width="40%"><strong>字段宽度</strong></td>
        </tr>
        <%
for i=0 to ubound(fname)
%>
        <tr> 
          <td height="33"><div align="center"><font color=#990000><b><input class=input  type="text" name="aa<%=i%>" value="<%=fname(i)%>"></b></font></div></td>
          <td><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></td>
          <td><input class=input value='50' type='text' name='CD<%=i%>'></td>
        </tr>
        <%Next%>
        <tr> 
          <td height="28" colspan="3"><div align="center"> <INPUT type=submit value="创建" name=Submit> &nbsp;&nbsp; 
          <INPUT type=reset value="重置" name=Submit2></div></td>
        </tr>
       <tr> 
          <td height="28" colspan="3">注：ID字段自动编号系统自己添加</td>
        </tr>
      </table></tr>
</Form>
</table>
