<!--#include file="conn.asp"-->
<!--#include file="ad_chk.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href=inc/css.css rel=STYLESHEET type=text/css>
<body topmargin="5" leftmargin="5" rightmargin="5" bottommargin="5">
<%
if Request.Cookies("WrzcNet")("admin_class")<>0 and Request.Cookies("WrzcNet")("admin_class")<>1 then
response.write "你没有这个权限!"
response.end
end if
%>
<table border="0" cellspacing="0" cellpadding="5"><form method="POST" action="ad_delhw.asp">
<tr><td align="right">搜索商品：</td>
<td align="center"><input type="text" name="hw_name" size="20"></td>
<td><input type="submit" value="搜索" name="B1"></td>
<td><a href="ad_delhw.asp?quehuo=yes">缺货商品管理</a></td></tr></form></table>
<%
set rs=server.createobject("adodb.recordset")
selectid=request("selectid")
if request("action")="del" then
set rs=server.createobject("adodb.recordset")
sql="select * from WrzcNet_hw where hw_id in ("&selectid&")"
rs.open sql,conn,1,3
do while not rs.eof
if delt=2 then
hp=split(rs("hw_pic"),"*")
for i=1 to ubound(hp)
img="../"&hp(i)
SET FSO=Server.CreateObject("Scripting.FileSystemObject")
If FSO.FileExists(Server.Mappath(img)) Then
FSO.DeleteFile Server.Mappath(img),True
End If
SET FSO=Nothing
next
end if
rs.delete
rs.update
rs.movenext
loop
rs.close
set rs=nothing
call deleok(delet,"ad_delhw.asp")
elseif request("action")="tjindex" then
set rs=server.createobject("adodb.recordset")
sql="select tjindex from WrzcNet_hw where hw_id in ("&selectid&")"
rs.open sql,conn,1,3
do while not rs.eof
rs("tjindex")=1
rs.update
rs.movenext
loop
rs.close
set rs=nothing
call editok(editt,"ad_delhw.asp","ad_delhw.asp")
elseif request("action")="tjindexno" then
set rs=server.createobject("adodb.recordset")
sql="select tjindex from WrzcNet_hw where hw_id in ("&selectid&")"
rs.open sql,conn,1,3
do while not rs.eof
rs("tjindex")=0
rs.update
rs.movenext
loop
rs.close
set rs=nothing
call editok(editt,"ad_delhw.asp","ad_delhw.asp")
elseif request("action")="tjsort" then
set rs=server.createobject("adodb.recordset")
sql="select tjsort from WrzcNet_hw where hw_id in ("&selectid&")"
rs.open sql,conn,1,3
do while not rs.eof
rs("tjsort")=1
rs.update
rs.movenext
loop
rs.close
set rs=nothing
call editok(editt,"ad_delhw.asp","ad_delhw.asp")
elseif request("action")="tjsortno" then
set rs=server.createobject("adodb.recordset")
sql="select tjsort from WrzcNet_hw where hw_id in ("&selectid&")"
rs.open sql,conn,1,3
do while not rs.eof
rs("tjsort")=0
rs.update
rs.movenext
loop
rs.close
set rs=nothing
call editok(editt,"ad_delhw.asp","ad_delhw.asp")
elseif request("action")="tejia" then
set rs=server.createobject("adodb.recordset")
sql="select tejia from WrzcNet_hw where hw_id in ("&selectid&")"
rs.open sql,conn,1,3
do while not rs.eof
rs("tejia")=1
rs.update
rs.movenext
loop
rs.close
set rs=nothing
call editok(editt,"ad_delhw.asp","ad_delhw.asp")
elseif request("action")="tejiano" then
set rs=server.createobject("adodb.recordset")
sql="select tejia from WrzcNet_hw where hw_id in ("&selectid&")"
rs.open sql,conn,1,3
do while not rs.eof
rs("tejia")=0
rs.update
rs.movenext
loop
rs.close
set rs=nothing
call editok(editt,"ad_delhw.asp","ad_delhw.asp")
elseif request("action")="sort" then
set rs=server.createobject("adodb.recordset")
sql="select sort_id,nsort_id from WrzcNet_hw where hw_id in ("&selectid&")"
rs.open sql,conn,1,3
do while not rs.eof
rs("sort_id")=request("sort_id")
rs("nsort_id")=request("nsort_id")
rs.update
rs.movenext
loop
rs.close
set rs=nothing
call editok(editt,"ad_delhw.asp","ad_delhw.asp")
end if
%>



<table border="0" cellpadding="0" width="100%" cellspacing="0" >
<tr><td width="130" valign="top" align="center"><SCRIPT language=javascript1.2 src="inc/menu.js"></SCRIPT>
<table border="0" cellspacing="0" cellpadding="5" class="st">
<tr><td align="center" class="sa"><font color="#000000"><b>商品分类</b></font></td></tr>
<%set rs=server.createobject("adodb.recordset")
sql="select * from WrzcNet_sort" 
rs.open sql,conn,1,1 
i=0
do while not rs.eof
i=i+1
id=rs("sort_id")%>
<tr><td class="s<%=i mod 2%>"><a href="ad_delhw.asp?sort_id=<%=rs("sort_id")%>">
	<b><%=rs("sort_name")%></b></a><b>&nbsp;&nbsp;
<u><font color="#0000FF"><span  class="helpimg" onClick="menuclick(submenu<%=rs("sort_id")%>,bar<%=rs("sort_id")%>)" id=bar<%=rs("sort_id")%>>小类</span></font></u></b></td></tr>
<tr id=submenu<%=rs("sort_id")%> style="DISPLAY: none;"><td bgcolor="#F0F0F0">
<%set rs8=server.CreateObject("adodb.recordset")
rs8.open "select * from WrzcNet_nsort where sort_id="&id&"" ,conn,1,1
do while not rs8.eof and not rs8.bof%>
<p style="margin: 5px;"><a href="ad_delhw.asp?nsort_id=<%=rs8("Nsort_id")%>"><%=rs8("Nsort_name")%></a>
<%rs8.movenext
loop
rs8.close
set rs8=nothing%>
</td></tr>
<%rs.movenext 
loop
rs.close
set rs=nothing%>
</table></td>
	<td width="5" valign="top" align="center">　</td>
<td valign="top">
<table border="0" cellspacing="0" cellpadding="5" class="st">
<form name="form" method="post"  onsubmit=TwoSubmit(this)>
<tr><td align="center" height="23" class="sa">商品名称</td>
<td align="center" class="sa">价格</td>
<td align="center" class="sa">首页推荐</td>
<td align="center" class="sa">类别推荐</td>
<td align="center" class="sa">特价</td>
<td align="center" class="sa">配件</td>
<td align="center" class="sa">操作</td>
<td align="center" class="sa">


<input type="checkbox" name="checkbox2" value="Check All" onClick="allss()">全选</td></tr>
<%
page=request("page")
if page="" then page=1
if not(isnumeric(page)) then page=1
if page<1 then page=1
page=int(page)
set rs=server.createobject("adodb.recordset")
if request("nsort_id")<>"" then
nsortid=request("nsort_id")
sql="select * from WrzcNet_hw where nsort_id=" + nsortid + " order by hw_id DESC"
elseif request("sort_id")<>"" then
sortid=request("sort_id")
sql="select * from WrzcNet_hw where sort_id=" + sortid + " order by hw_id DESC"
elseif request("hw_name")<>"" then
hwname=request("hw_name")
sql="select * from WrzcNet_hw where hw_name like '%"&hwname&"%' order by hw_id DESC"
elseif request("quehuo")="yes" then
sql="select * from WrzcNet_hw where hw_kucun<=0 order by hw_id DESC"
else
sql="select * from WrzcNet_hw order by hw_id DESC"
end if
rs.open sql,conn,1,1
if rs.eof then
response.write "<tr><td align=center bgcolor=ffffff height=30  colspan=10>没有商品</td></tr>"
else
rs.pagesize=20
totalrec=rs.recordcount
totalpage=rs.pagecount
if page>totalpage then page=totalpage
rs.absolutepage=page
i=0
do while not rs.eof and (i<rs.pagesize)
i=i+1%>
<tr><td height="23" class="s<%=i mod 2%>">&nbsp;<a href="ad_changehw.asp?hw_id=<%=rs("hw_id")%>"><%=rs("hw_name")%><%if rs("hw_kucun")<=0 then%><font color="#FF0000">（缺）</font><%end if%></a>
&nbsp;<img border="0" src="Img/ad_help.gif" class="helpimg" 
alt="购买次数：<%=rs("hw_buys")&vbcrlf%>点击次数：<%=rs("hw_views")&vbcrlf%>库存：<%=rs("hw_kucun")&vbcrlf%>编号：<%=rs("hw_sn")&vbcrlf%>积分：<%=rs("hw_jifen")%>" align="absmiddle"></td>
<td align="center" class="s<%=i mod 2%>"><%=rs("hw_price2")%></td>
<td align="center" class="s<%=i mod 2%>"><%if rs("tjindex")=1 then%><font color="#FF0000">√</font><%else%>×<%end if%></td>
<td align="center" class="s<%=i mod 2%>"><%if rs("tjsort")=1 then%><font color="#FF0000">√</font><%else%>×<%end if%></td>
<td align="center" class="s<%=i mod 2%>"><%if rs("tejia")=1 then%><font color="#FF0000">√</font><%else%>×<%end if%></td>
<td align="center" class="s<%=i mod 2%>"><a href="ad_tao.asp?hw_id=<%=rs("hw_id")%>">配件</a><img border="0" src="Img/ad_help.gif" class="helpimg" alt="用于商品促销：买一赠一，加×元送×礼品等"></td>
<td align="center" class="s<%=i mod 2%>"><a href="ad_changehw.asp?hw_id=<%=rs("hw_id")%>">修改</a>&nbsp;<a href="ad_changehwadd.asp?hw_id=<%=rs("hw_id")%>">复制</a></td>
<td align="center" class="s<%=i mod 2%>"><input name="selectid" type="checkbox" id="selectid" value="<%=rs("hw_id")%>"></td></tr>
<%
rs.movenext
loop
rs.close
set rs=nothing%>
<tr><td bgcolor="#FFFFFF" colspan="8">
<p style="line-height: 200%">
<INPUT type=radio value=del name=Ref>删除
<INPUT type=radio value=tjindex name=Ref>首页推荐
<INPUT type=radio value=tjsort name=Ref>大类推荐
<INPUT type=radio value=tejia name=Ref>特价
<INPUT type=radio value=tjindexno name=Ref>取消首页推荐
<INPUT type=radio value=tjsortno name=Ref>取消大类推荐
<INPUT type=radio value=tejiano name=Ref>取消特价<br>
<INPUT type=radio value=sort name=Ref>转移分类&nbsp;&nbsp;&nbsp;&nbsp; 转移到：
<%dim count%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
        <%
        count = 0
        %>
<%
set rss=server.createobject("adodb.recordset")
sql="select * from WrzcNet_sort order by sort_id asc"
rss.open sql,conn,1,1
do while not rss.eof
%>
subcat[<%=count%>] = new Array("不选择小类","<%= trim(rss("sort_id"))%>","0");
        <%
        count = count + 1
        rss.movenext
        loop
        rss.close
        set rss=nothing
        %>
        
<%set rss=server.createobject("adodb.recordset")
sql="select * from WrzcNet_nsort order by Nsort_id asc"
rss.open sql,conn,1,1%>
        <%
        do while not rss.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rss("Nsort_name"))%>","<%= trim(rss("sort_id"))%>","<%= trim(rss("Nsort_id"))%>");
        <%
        count = count + 1
        rss.movenext
        loop
        rss.close
        set rss=nothing
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.form.Nsort_id.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
   document.form.Nsort_id.options[document.form.Nsort_id.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script><%set rss=server.createobject("adodb.recordset")
rss.open "select * from WrzcNet_sort order by sort_xu desc",conn,1,1
if not rss.eof and not rss.bof then
selclass=rss("sort_id")%>
<select name="sort_id" onChange="changelocation(document.form.sort_id.options[document.form.sort_id.selectedIndex].value)" size="1">
<%do while not rss.eof%>
<option value="<%=trim(rss("sort_id"))%>"><%=trim(rss("sort_name"))%></option>
<%rss.movenext
loop
end if
rss.close
set rss=nothing%></select> 
<select name="Nsort_id">
<option value="0">不选择小类</option>
<%set rss=server.createobject("adodb.recordset")
sql="select * from WrzcNet_nsort where sort_id="&selclass&""
rss.open sql,conn,1,1
do while not rss.eof%>
<option value="<%=rss("Nsort_ID")%>"><%=rss("Nsort_name")%></option>
<%rss.movenext
loop
rss.close
set rss = nothing



%></select>



<input type="submit" name="Submit" value="选择完毕 执行操作" onClick="return scheck();"></td></tr>
<%end if%>
</form></table>
<script language=javascript>
function scheck()
{
  if(!confirm('确认进行该操作吗？')) return false;
}


function TwoSubmit(form)
{
 if (form.Ref[0].checked)
  {form.action = "ad_delhw.asp?action=del";}
 else if (form.Ref[1].checked)
  {form.action = "ad_delhw.asp?action=tjindex";}
   else if (form.Ref[2].checked)
  {form.action = "ad_delhw.asp?action=tjsort";}
   else if (form.Ref[3].checked)
  {form.action = "ad_delhw.asp?action=tejia";}
   else if (form.Ref[4].checked)
  {form.action = "ad_delhw.asp?action=tjindexno";}
   else if (form.Ref[5].checked)
  {form.action = "ad_delhw.asp?action=tjsortno";}
   else if (form.Ref[6].checked)
  {form.action = "ad_delhw.asp?action=tejiano";}
   else if (form.Ref[7].checked)
  {form.action = "ad_delhw.asp?action=sort";}
form.submit();
}


function allss()
{
   var aa = document.form.getElementsByTagName("input");
   if(aa[1].checked == true){
   for (var ii=0; ii<aa.length; ii++)
      if (aa[ii].type == "checkbox") aa[ii].checked = false;
   }
   else
   {
   for (var ii=0; ii<aa.length; ii++)
      if (aa[ii].type == "checkbox") aa[ii].checked = true;
   }
}
</script>


<table border="0" width="100%" cellspacing="0">
<form action=<%=filename%>?nsort_id=<%=request("nsort_id")%>&sort_id=<%=request("sort_id")%>&hw_name=<%=request("hw_name")%>&quehuo=<%=request("quehuo")%> method=post>
<tr><td height="30">共<font color=red><%=totalpage%></font>页&nbsp;第<%=page%>页&nbsp;
<%if page-1>0 then%><a href="ad_delhw.asp?nsort_id=<%=request("nsort_id")%>&sort_id=<%=request("sort_id")%>&hw_name=<%=request("hw_name")%>&quehuo=<%=request("quehuo")%>&page=<%=page-1%>">上一页</a><%else%>上一页<%end if%>
&nbsp;
<%if page+1<=totalpage then%><a href="ad_delhw.asp?nsort_id=<%=request("nsort_id")%>&sort_id=<%=request("sort_id")%>&hw_name=<%=request("hw_name")%>&quehuo=<%=request("quehuo")%>&page=<%=page+1%>">下一页</a><%else%>下一页<%end if%>
&nbsp;&nbsp;页面跳转：<input type="text" name="page" value="<%=page+1%>" size="1" style="text-align: center" class=input><input type="submit" value="GO" class=input>
</td></tr></form></table>


</td></tr></table><!--#include file="ad_bottom.asp"-->