<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<!--#include file="Connections/conn_news.asp" -->
<!--#include file="yns_config.asp" -->
<!--#include file="yns_chklogin.asp" -->
<% chk_user_login(3) %>
<%
Dim rst
Dim rst_numRows

Set rst = Server.CreateObject("ADODB.Recordset")
rst.ActiveConnection = MM_conn_news_STRING
rst.Source = "SELECT * FROM t_type"
rst.CursorType = 0
rst.CursorLocation = 2
rst.LockType = 1
rst.Open()

rst_numRows = 0
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>湖南百润医药有限公司-------康曼德www.hnicp.com</title>
<link href="style/css.css" rel="stylesheet" type="text/css">
<script language="javascript">
function checkdata(){
    var ex = /^[0-9a-zA-Z_]*$/;
    var retu = ex.test(form1.ts_dir.value);
if (document.form1.ts_name.value=="") {
window.alert ("请输入小类名称 !")
return false
}
if (document.form1.ts_dir.value=="") {
window.alert ("请输入文件夹名称 !")
return false
}
if (retu==false) {
window.alert ("文件夹名称只能是字母, 数字,下划线 !")
return false
}
return true
}
</script>
</head>

<body>
<form ACTION="yns_tsadd_save.asp" METHOD="POST" name="form1" onSubmit="return checkdata()">
  <table width="94%" border="1" cellpadding="4" cellspacing="0" class="table-line">
    <tr class="td-title-color">
      <td height="30" colspan="2" >创建小类</td>
    </tr>
    <tr class="td-body-color">
      <td width="30%" align="right">小类名称:</td>
      <td> <input name="ts_name" type="text" id="ts_name"> </td>
    </tr>
    <tr class="td-body-color">
      <td align="right">文件夹:</td>
      <td> <input name="ts_dir" type="text" id="ts_dir">
        必须是英文,数字或下划线,系统会生成该文件夹.</td>
    </tr>
    <tr class="td-body-color">
      <td align="right">所属大类:</td>
      <td><select name="ts_pid" class="px12" id="ts_pid">
          <%
While (NOT rst.EOF)
%>
          <option value="<%=(rst.Fields.Item("t_id").Value)%>" <% if cint(request.QueryString("t_id")) =(rst.Fields.Item("t_id").Value) then response.Write("selected") end if %>><%=(rst.Fields.Item("t_name").Value)%></option>
          <%
  rst.MoveNext()
Wend
If (rst.CursorType > 0) Then
  rst.MoveFirst
Else
  rst.Requery
End If
%>
        </select>
      </td>
    </tr>
    <tr class="td-body-color">
      <td>&nbsp;</td>
      <td> <input type="submit" name="Submit" value="增加小类" >
        <input name="t_dir" type="hidden" id="t_dir" value="<% = request.querystring("t_dir") %>"> </td>
    </tr>
  </table>
</form>
</body>
</html>
<%
rst.Close()
Set rst = Nothing
%>