<!--#include file="../conn.asp"-->
<!-- #include file="check_master.asp" -->
<%
if request("act")="y" then
   boardid1=request("boardid1")
   boardid2=request("boardid2")
   boardid3=request("boardid3")
   boardid4=request("boardid4")
   if InStr(boardid2,boardid1)<=0 or InStr(boardid4,boardid3)<=0 then
      response.write "错误:一级类别与二级类别不对应"
	  response.end
   end if
   strsql="update bbstitle set BoardID_1='"&boardid3&"',BoardID_2='"&boardid4&"',deleted=8 where BoardID_1='"&boardid1&"' and BoardID_2='"&boardid2&"'"
   conn.execute(strsql)
   strsql="update bbsmenu set BoardID_1='"&boardid3&"',BoardID_2='"&boardid4&"' where BoardID_1='"&boardid1&"' and BoardID_2='"&boardid2&"'"
   conn.execute(strsql)
   conn.close
   msg="类别转换成功"
end if
%>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../css/xmwuye.css" type=text/css rel=stylesheet>
<TITLE>类别转换</TITLE>
<base target="right">
<style type="text/css">
<!--
body {
	background-color: #f7f7f7;
}
.STYLE1 {color: #FF0000}
-->
</style>
</HEAD>
<BODY topmargin="0">
<table width="98%" align="center">
  <tr><td height="35" valign="bottom"><div align="center"><strong>贴子类别转换</strong></div></td>
</tr></table>

<table width="98%" align="center">
<tr><td width=90% >
<form action="" method="post" target="main">
        <p><b>请在下面选择需要转换的条件 (此操作主要是实现贴子的合并或转换功能)</b><br>
          <br>
          <br>
          (<span class="STYLE1">说明: 类别选择一定要相对应如:选择的二级类别一定要是在所选一级类别下的二级类别</span>)<br>
          <br>
          将 
<select name="boardid1">
<%
sql="select BBS_Cate_Name,BBS_Cate_ID,BBS_Cate_PID,BBS_Cate_Qs,BBS_Cate_Note,BBS_Cate_Topic,BBS_Cate_Reply,BBS_Cate_Manager_Name from BBS_Cate where BBS_Cate_PID='0' order by totop asc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,3,1
do while not rs.eof
%>
            <option value="<%=rs("BBS_Cate_ID")%>"><%=rs("BBS_Cate_Name")%></option>
<%
rs.movenext
loop
rs.close
%>
          </select>
          的 
<select name="boardid2">
<%
sql="select BBS_Cate_Name,BBS_Cate_ID,BBS_Cate_PID,BBS_Cate_Qs,BBS_Cate_Note,BBS_Cate_Topic,BBS_Cate_Reply,BBS_Cate_Manager_Name from BBS_Cate where BBS_Cate_PID<>'0' order by totop asc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,3,1
do while not rs.eof
%>
            <option value="<%=rs("BBS_Cate_ID")%>"><%=rs("BBS_Cate_Name")%></option>
<%
rs.movenext
loop
rs.close
%>
          </select>
          <label></label>
          转换到
<select name="boardid3">
<%
sql="select BBS_Cate_Name,BBS_Cate_ID,BBS_Cate_PID,BBS_Cate_Qs,BBS_Cate_Note,BBS_Cate_Topic,BBS_Cate_Reply,BBS_Cate_Manager_Name from BBS_Cate where BBS_Cate_PID='0' order by totop asc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,3,1
do while not rs.eof
%>
            <option value="<%=rs("BBS_Cate_ID")%>"><%=rs("BBS_Cate_Name")%></option>
<%
rs.movenext
loop
rs.close
%>
       </select>
          的 
<select name="boardid4">
<%
sql="select BBS_Cate_Name,BBS_Cate_ID,BBS_Cate_PID,BBS_Cate_Qs,BBS_Cate_Note,BBS_Cate_Topic,BBS_Cate_Reply,BBS_Cate_Manager_Name from BBS_Cate where BBS_Cate_PID<>'0' order by totop asc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,3,1
do while not rs.eof
%>
            <option value="<%=rs("BBS_Cate_ID")%>"><%=rs("BBS_Cate_Name")%></option>
<%
rs.movenext
loop
rs.close
%>
          </select>
          <input name="act" type="hidden" id="act" value="y">
          <input type=submit value="开始转换" <%if instr(session("admin_qs"),2)<=0 then%>disabled<%end if%>>
          <br>
        </p>
  </form>
</td>
</tr>
<tr><td>

</td></tr>
</table>
<table width="95%" height="60" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><div align="center"><a href="btob.asp" target="main"><font color=red><%=msg%></font></a></div></td>
  </tr>
</table>
