<%dbs="../"%>
<!--#include file="../inc/config.asp"-->
<!--#include file="uccook.asp"-->
<%
action=request("action")
if action="del" then
set rs=Server.CreateObject("Adodb.Recordset")
	sql="select * from H_pcing where H_Industry2="&request("id")&""
	rs.open sql,conn,1,1
	if not rs.eof then
	response.Write "<script >alert('提示：\n\n该分类有产品，请转移产品所属分类后删除！...');location.href='pc_Industry1.asp';</script>"
	response.End()
	end if 
conn.execute("delete from PC_Industry where id="&request("id")&"")
	response.Write "<script >alert('提示：\n\n删除成功立即返回！...');location.href='pc_Industry1.asp';</script>"
	response.End()
end if
action=request.QueryString("action")
H_ID=request.QueryString("H_ID")
if action="add" then
H_name=Replace(Replace(Left(request.Form("H_name"),10),"<","["),">","]")
H_Px=Replace(Replace(Left(request.Form("H_Px"),5),"<","["),">","]")
if H_name=""  or H_Px=""  then
response.Write "<script >alert('提示：\n\n对不起，有没有填写的内容...');history.back(-1);</script>"
response.end 
end if
if H_Px="" or IsNumeric(H_Px)<>true then
response.Write "<script >alert('提示：\n\n对不起，排序必须是数字...');history.back(-1);</script>"
response.end 
end if

set rs=Server.CreateObject("Adodb.Recordset")
	sql="select * from PC_Industry"
	rs.open sql,conn,1,3
	rs.addnew
    rs("H_name")=H_name
	rs("H_ID")=H_ID
	rs("H_Px")=H_Px
	rs.update
	rs.close
	set rs=nothing	
	response.Write "<script >alert('提示：\n\n添加成功,立即返回...');location.href='pc_Industry1.asp';</script>"
	response.End()	
end if
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<title><%=W_title%>,总管理中心</title>


<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="style.css" type=text/css rel=stylesheet>
<script>
function CheckAll(form)  {
  for (var i=0;i<form.elements.length;i++)    {
    var e = form.elements[i];
    if (e.name != 'chkall')       e.checked = form.chkall.checked; 
   }
  }
</script>
<script>
function oa_tool1(){
window.parent.mm.rows="20,200,10,*";
}
</script>
<SCRIPT language=javascript src="images/jquery.js" 
type=text/javascript></SCRIPT>

<SCRIPT language=javascript src="images/function.js" 
type=text/javascript></SCRIPT>

<SCRIPT language=javascript type=text/javascript>
<!--


/*
function AddnewType()
*/
-->
</SCRIPT>

<META content="MSHTML 6.00.3790.4426" name=GENERATOR>
</HEAD>
<BODY><!--用户中心头部-->
<!--#include file="top.asp"-->
<table width="960" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td width="150" valign="top"><!--#include file="left.asp"--></td>
      <td width="810" align="right" valign="top"><table width="800" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td width="20" align="center"><img src="images/ico_4.gif" width="12" height="12"></td>
                <td height="30" align="left"><a href="index.asp" target="_self">管理中心</a> <span class="uc_huise">&gt;权限设置</span></td>
            </tr>
            <tr>
                <td height="1" colspan="2" bgcolor="#EEEEEE"></td>
        </tr>
        </table>
            <table width="600" height="5" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td></td>
                </tr>
            </table>
		
            <table width="800" border="0" cellpadding="0" cellspacing="1" bgcolor="#EEEEEE">
			
              <tr>
                <td height="28" colspan="5" bgcolor="#FFFFFF" class="uc_huise">分类管理 - <%
				if H_ID="" or H_ID=0 then 
				lei="根分类"
				else
				lei=conn.execute("select H_name from PC_Industry where ID="&H_ID&"")("H_name")
				end if
				%><%=lei%></td>
              </tr>
			  <form action="PC_Industry2.asp?action=add&h_id=<%=request.QueryString("H_ID")%>" method="post" target="_self">
              <tr>
                <td width="78" height="28" bgcolor="#FFFFFF" class="uc_huise">分类名称：</td>
                <td width="179" bgcolor="#FFFFFF" class="uc_huise"><input name="H_name" type="text" id="H_name">
                  条</td>
                <td width="48" bgcolor="#FFFFFF" class="uc_huise">排序</td>
                <td width="310" bgcolor="#FFFFFF" class="uc_huise"><input name="H_Px" type="text" id="H_Px" size="5">
                数字大靠前排</td>
                <td width="179" bgcolor="#FFFFFF" class="uc_huise"><input name="Submit2" type="submit" class="UCform" value="添 加"></td>
              </tr>
			  </form>
            </table>
			<table width="200" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table>
			<table width="800" border="0" cellpadding="0" cellspacing="1" bgcolor="#EEEEEE">
              <tr>
                <td height="30" colspan="6" align="left" bgcolor="#FFFFFF" class="uc_huise">分类管理</td>				
              </tr>
			  
			  <%
		set rs=Server.CreateObject("Adodb.Recordset")
	sql="select * from PC_Industry where H_ID="&H_ID&"  order by H_Px desc"
	rs.open sql,conn,1,1
	if rs.eof then
	response.Write " <td class=uc_huise bgcolor=#FFFFFF height=30 align=center >没有增加分类</td>"
	else
	do while not rs.eof 
		%>
			  
			  
			  
              <tr>
                <td width="77" height="30" align="right" bgcolor="#FFFFFF" class="fc_green" >分类名称：</td>
                <td width="179" height="30" align="left" bgcolor="#FFFFFF" class="uc_huise" ><%=rs("H_name")%></td>
                <td width="49" align="left" bgcolor="#FFFFFF" class="uc_huise" >排序</td>
                <td width="260" align="left" bgcolor="#FFFFFF" class="uc_huise" ><%=rs("H_Px")%>
                数字大，靠前排</td>
                <td width="112" align="left" bgcolor="#FFFFFF" class="uc_huise" ><a href="pc_Industry_edit.asp?id=<%=rs("id")%>" target="_self">编辑</a></td>
                <td width="116" align="center" bgcolor="#FFFFFF" >
				<table width="66" height="23" border="0" cellpadding="0" cellspacing="0" class="biao">
                  <tr>
                    <td align="center"><a href="?action=del&id=<%=rs("id")%>" target="_self">删除</a></td>
                  </tr>
			  </table></td>				
              </tr>
			  
		  	  
				
				<%
				rs.movenext 
				
				loop
				rs.close
				end if
				%>
			  
            </table>
      </td>
    </tr>
</table>

<!--#include file="end.asp"-->

</BODY></HTML>
