<!--#include file="conn.asp"-->
<%
if session("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');location.href='index.asp' ;</script>"
response.End
else
if request.cookies("sundxshop")("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');location.href='index.asp' ;</script>"
response.End
end if
end if
%>
<title>大类管理</title>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" BGCOLOR="#39867B">
  <tr> 
    <td height="20" BGCOLOR="#39867B" align="center"><font color="#FFFFFF">大类管理</font></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF">
	<table width="80%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
        <tr align="center" bgcolor="#FFFFFF" height="20"> 
          <td width="15%">分类名称</td>
           <td width="35%">图片</td>
          <td width="20%">图片链接地址</td>
          <td width="10%"> 分类排序</td>
          <td width="10%">显示</td>
          <td width="10%">确定操作</td>
        </tr>
        <%set rs=server.CreateObject("adodb.recordset")
		  rs.Open "select * from category order by categoryorder",conn,1,1
		  dim follows
		  if rs.EOF and rs.BOF then
		  response.Write "<div align=center><font color=red>还没有分类</font></center>"
		  follows=0
		  else
		  do while not rs.EOF
		  %>
        <form name="form<%=int(rs("categoryid"))%>" method="post" action="savebclass.asp?action=edit&id=<%=int(rs("categoryid"))%>">
          <tr bgcolor="#FFFFFF" align="center">
	     <td><input name="category" type="text" id="category" size="20" value="<%=trim(rs("category"))%>"></td>
              <td><input name="catpic" type="text" id="catpic" size="40" value="<%=trim(rs("catpic"))%>">
 <input type="button" name="Submit12" value="上传图片" onClick="window.open('upfile.asp?formname=form<%=int(rs("categoryid"))%>&editname=catpic&uppath=images/guanggao&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')">

</td>      <td><input name="caturl" type="text" id="caturl" size="30" value="<%=trim(rs("caturl"))%>"></td>
            <td><input name="categoryorder" type="text" id="categoryorder" size="4" value="<%=int(rs("categoryorder"))%>"></td>
            <td><select name="first" id="first">
			    <option value="0" <% if rs("first")=0 Then Response.write("Selected") %>>显示</option>
                <option value="1" <% if rs("first")=1 Then Response.write("Selected") %>>隐藏</option>
              </select></td>
              </td>
             
            <td><input type="submit" name="Submit" value="修 改">
                &nbsp; <a href="savebclass.asp?id=<%=int(rs("categoryid"))%>&action=del" onClick="return confirm('您确定进行删除操作吗？')"><font color=red>删除</font></a> 
              </td>
          </tr>
        </form>
        <%rs.MoveNext
          loop
          follows=rs.RecordCount
          end if%>
      </table><br></td>
  </tr>
</table>
<br>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" BGCOLOR="#39867B">
  <tr> 
    <td height="20" BGCOLOR="#39867B" align="center"><font color="#FFFFFF">添加大类</font></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF">
	<table width="80%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
        <tr align="center" bgcolor="#FFFFFF" height="20"> 
          <td width="40%"> 分类名称</td>
          <td width="10%">分类排序</td>
          <td width="20%">显示</td>
          <td width="30%">确定操作</td>
        </tr>
        <form name="form1" method="post" action="savebclass.asp?action=add">
          <tr align="center" bgcolor="#FFFFFF"> 
            <td><input name="category2" type="text" id="category2" size="12"></td>
            <td><input name="categoryorder2" type="text" id="categoryorder2" size="4" value="<%=follows+1%>"></td>
            <td><select name="first2" id="first2">
                <option value="0" selected>显示</option>
                <option value="1">隐藏</option>
              </select></td>
           
            <td><input type="submit" name="Submit3" value="添 加"></td>
          </tr>
        </form>
      </table></td>
  </tr>
</table>
<br>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" BGCOLOR="#39867B">
  <tr> 
    <td BGCOLOR="#39867B" height="20" align="center"><font color="#FFFFFF">操作注意事项及说明</font></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF"> 
	<table width="80%" border="0" align="center" cellpadding="5" cellspacing="0">
        <tr> 
          <td height="20"><font color="#930000">·请注意分类名称不要含有非法字符。<br>
            ·增加一级分类后，些分类将会被列出前台一级分类中。<br>
            ·进行删除操作的同时，会删除此大类下包含的所有小分类和商品。</font></td>
        </tr>
      </table></td>
  </tr>
</table>
<!--#include file="footer.asp"-->