<!--#include file="../utf-8.asp" -->
<!--#include file="../js/Function.asp" -->
<!--#include file="../CheckAdmin.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META NAME="copyright" CONTENT="Copyright 2010-2012 - yidacms.com" />
<META NAME="Author" CONTENT="世纪伟成  yidacms.com" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../js/admin.css" rel="stylesheet" type="text/css">
<title>产品分类管理！</title>
</head>
<body>
<%

		'版权：世纪伟成(http://yidacms.com)
		'本信息不会影响您网站的正常访问，无论免费用户或是收费用户请保留这里的信息.
		'如果您删除了这里的版权信息,将追究法律责任.
		set rs = server.createobject("adodb.recordset")
		sql="select * from shuaiweb_productsclass WHERE id= "&request("id")&""
		rs.open sql,dbok,1,1
		T_products = rs("id")
        T_productsclass = rs("wait_pcyi")

		if request("t")="productsclassedit" Then
			if len(trim(request.Form("shuaiweb_classname")))<1 then
				response.write ("<script language=javascript> alert('类别名称必填且不能少于1个字符！');history.back(-1);</script>")
				response.end
			end if
			if len(trim(request.Form("shuaiweb_classsort")))<1 then
				response.write ("<script language=javascript> alert('排序不能为空，且不少于1个字符！');history.back(-1);</script>")
				response.end
			end if 
		dim rs,sql
		set rs=server.createobject("adodb.recordset")
		sql="select * from shuaiweb_productsclass WHERE id= "&request("id")&""
		rs.open sql,dbok,1,3
			rs("shuaiweb_classname")=trim(request.form("shuaiweb_classname"))
			rs("shuaiweb_classsort")=trim(request.form("shuaiweb_classsort"))
			rs("wait_pcyi")=trim(request.form("wait_pcyi"))
			rs("wait_pcsi")=trim(request.form("wait_pcsi"))
			rs("yida_language")="ch"
			rs("shuaiweb_productshtml")=trim(request.form("shuaiweb_productshtml"))
		rs.update
		rs.close
		set rs=nothing
		response.write "<script language=javascript> alert('成功修改！');location.replace('admin_productsclass.asp');</script>"
        response.end
		End If
%>
		  <table width="98%" height="100%" border="0" cellpadding="10" cellspacing="0" bordercolor="#666666" style="border-collapse:collapse" bgcolor="#FFFFFF" align="center">
		  <form id="form1" name="form1" method="post" action="admin_productsclassedit.asp?t=productsclassedit&id=<%=rs("id")%>">
			<tr>
			  <td>栏目归属<br />
<select name="wait_pcyi" id="wait_pcyi" class="winla">
<%
set rs = server.createobject("adodb.recordset")
sql="select * from shuaiweb_productsclass where wait_pcyi = '0' ORDER BY shuaiweb_classsort ASC"
rs.open sql,dbok,1,1
if T_productsclass = "0" then
%>
<option value="0" >一级分类不可修改!</option>
<%
else
do while not rs.eof
%>
<option value="<%=rs("id")%>" <%if T_productsclass = ""&rs("id")&"" then%>selected<%end if%>><%=rs("shuaiweb_classname")%></option>
<%
rs.MoveNext
loop
end if
		set rs = server.createobject("adodb.recordset")
		sql="select * from shuaiweb_productsclass WHERE id= "&request("id")&""
		rs.open sql,dbok,1,1
%>
</select>
                          </td>
			</tr>
			<tr>
			  <td>栏目名称<br /><input name="shuaiweb_classname" type="text" id="shuaiweb_classname" value="<%=rs("shuaiweb_classname")%>" class="win"/></td>
			</tr>
		<tr>
		  <td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">栏目自定义html<br /><textarea name="shuaiweb_productshtml" style="width:450px;height:200px;"><%=rs("shuaiweb_productshtml")%></textarea></td>
		</tr>
                        <tr>
                          <td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">状态<br /> 
<select name="wait_pcsi" id="wait_pcsi" class="winla">
<option value="1" <%if rs("wait_pcsi") = "1" then%>selected<%end if%>>显示</option>
<option value="2" <%if rs("wait_pcsi") = "2" then%>selected<%end if%>>隐藏(可调用)</option>
</select>		  
</td>
			</tr>
			<tr>
			  <td>排序<br /><input name="shuaiweb_classsort" type="text" id="shuaiweb_classsort" onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" value="<%=rs("shuaiweb_classsort")%>" size="5" onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" class="win2"/>
			  这里必须是数字！</td>
			</tr>
			<tr>
			  <td><input type="submit" name="Submit" value="提 交" class="inanniu"/>
			  <input type=button onclick="window.location.href('admin_productsclass.asp')"value="返 回" class="inanniu"> </td>
			</tr>
			</form>
		  </table>
<%
rs.close
set rs=nothing
%>
</body>
</html>
