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

<%
dim action
dim p_inputnumber,localtypeid,uniontypeid,p_inputcount

dim obj_typeunion,ElapsedBloom
set ElapsedBloom=new CCAPI
set obj_typeunion=ElapsedBloom.createObject("CCAPI.TypeUnion")
action = getForm("action","get")
Select Case Lcase(action)
	Case "edit"
		p_inputcount=getForm("inputcount","post")
		for p_inputnumber=0 to p_inputcount
			localtypeid=getForm("localtypeid"&p_inputnumber,"post")
			uniontypeid=getForm("uniontypeid"&p_inputnumber,"post") 
			if obj_typeunion.validateNumber(localtypeid)=false or obj_typeunion.validateNumber(uniontypeid)=false then
				alertMsg numbererror,category
				set ElapsedBloom=nothing
				set obj_typeunion=nothing
				die() 
			end if
			obj_typeunion.addRelationStr localtypeid,uniontypeid																					
		next
		obj_typeunion.saveRelationFile()
	Case "viewtypelist"
		'response.Write union_config_array(5)
		'die
		call getUnionResourceTypeList(union_config_array(5))
	Case Else
		Call main
End Select
set ElapsedBloom=nothing
set obj_typeunion=nothing

conn.close
set conn=nothing


Sub main
%>


<html>
<head>
<title>类别管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="res/style.css" type=text/css rel=stylesheet>
<script language="JavaScript" src="res/fun.js"></script>
</head>

<body onLoad="drawobj()">
<form   action="?action=edit"  method="post">
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="tableBorder">
<tr><th colspan="3">资源库分类绑定</th></tr>
<tr>
	<td class="forumrow"  align="center">允许发帖的论坛版面(分类)ID</td>
	<td  class="forumrow" align="center">版面(分类)名称</td>
	<td class="forumrow"  align="center">填写CC资源库分类ID(<font style="color:red ">用英文逗号隔开，填写范例：1,2,3,4</font>)【<a href="#" onClick="callServer()"><font color=#ff0000><strong>查看资源库分类ID</strong></font></a>】</th>
</tr>
<%
dim localtypearray,localtypecount,inputcount,alllocaltypestr
inputcount=0
localtypearray=obj_typeunion.getLocalTypeList()


for localtypecount=0 to ubound(localtypearray,2)
	alllocaltypestr=obj_typeunion.getUnionIdByLocalId(localtypearray(0,localtypecount))
	'response.Write localtypearray(0,localtypecount)
	inputcount=inputcount+1
%>
<tr>
	<td class="forumrow" align="center"> <input type="text" name="localtypeid<%=localtypecount%>" readonly="true" value="<%=localtypearray(0,localtypecount)%>"> </td>
	<td class="forumrow" align="center"> <input type="text" name="localtypename<%=localtypecount%>"  disabled="true" value="<%=localtypearray(1,localtypecount)%>"> </td>
	<td class="forumrow"  align="center"><input type="text" size="50" name="uniontypeid<%=localtypecount%>" value="<%=alllocaltypestr%>">  </td>
</tr>
<%
next

%>
<tr>
	<td   class="forumrow" align="center"> <input type="hidden" value="<%=inputcount-1%>" name="inputcount"> </td>
	<td  class="forumrow" align="left"> </td>
	<td    class="forumrow" align="left">&nbsp;<input type="submit" name="localtypeid" value="修   改">&nbsp;<input type="reset" name="uniontypeid" value="重   置"></td>
</tr>
</table>
</form>
<div id='categoryNameDiv'  style='position:absolute;cursor:move;background:#E9F5F5; border:1px solid #89C3E4' ></div>
<script>document.getElementById('categoryNameDiv').style.display='none';</script>

</body>
</html>
<%end sub%>