<%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true	
%>
<!--#include file="../include/Conn.jsp"-->
<!--#include file="../Article/inc/function.jsp"-->
<!--#include file="admin_islogin.jsp"-->
<%
Call Main()
'关闭数据库链接
Call CloseDatabase()
Call CloseConnItem()
Sub Main%>
<html>
<head>
<title>采集系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Images/Style.css" rel="stylesheet" type="text/css">
<%call SetChannel%>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
  <tr> 
    <td height="22" colspan="2" align="center" class="topbg"><strong>采&nbsp;&nbsp;集&nbsp;&nbsp;系&nbsp;&nbsp;统&nbsp;&nbsp;项&nbsp;&nbsp;目&nbsp;&nbsp;管&nbsp;&nbsp;理</td>
  </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
  <tr class="tdbg"> 
    <td width="65" height="30"><strong>管理导航：</strong></td>
    <td height="30"><a href="Admin_ItemAddNew.jsp">添加项目</a> >> <font color=red>基本设置</font> >> 列表设置 >> 链接设置 >> 正文设置 >> 采样测试 >> 属性设置 >> 完成</td>         
  </tr>         
</table>
<br>         
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >
<form method="post" action="Admin_ItemAddNew2.jsp" name="myform">
    <tr> 
      <td height="22" colspan="2" class="title"> <div align="center"><strong>添 加 新 
		项 目--基 本 设 置</strong></div></td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg"><strong>项目名称：</strong></td>
      <td class="tdbg" width="75%">
		<input name="ItemName" type="text" size="27" maxlength="30">&nbsp;&nbsp;<font color=red>*</font>如：新浪网－新闻中心 既简单又明了      </td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg"><strong> 所属频道：</strong></td>
      <td class="tdbg" width="75%"><select ID="ChannelID" name="ChannelID" onChange="changelocation(document.myform.ChannelID.options[document.myform.ChannelID.selectedIndex].value)"><%call Admin_ShowChannel_Option(1)%></select>      </td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg"><strong> 所属栏目：</strong></td>
      <td class="tdbg" width="75%"><select ID="ClassID" name="ClassID"><%call Admin_ShowClass_Option(1,0)%></select>      </td>
    </tr>
    <tr>
      <td width="20%" class="tdbg"><strong> 网站名称：</strong></td>
      <td class="tdbg" width="75%">
		<input name="WebName" type="text" size="27" maxlength="30">      </td>
    </tr>
    <tr>
      <td width="20%" class="tdbg"><strong> 网站网址：</strong></td>
      <td class="tdbg" width="75%"><input name="WebUrl" type="text" size="49" maxlength="150">      </td>
    </tr>
   <tr class="tdbg"> 
      <td width="20%" class="tdbg"><strong> 网站登录：</strong></td>
      <td class="tdbg">
		<input type="radio" value="0" name="LoginType" checked onClick="Login.style.display='none'">不需要登录<span lang="en-us">&nbsp;
		</span>
		<input type="radio" value="1" name="LoginType" onClick="Login.style.display=''">设置参数</td>
    </tr>
   <tr class="tdbg" id="Login" style="display:none"> 
      <td width="20%" class="tdbg"><strong> 登录参数：</strong></td>
      <td class="tdbg">
        登录地址：<input name="LoginUrl" type="text" size="40" maxlength="150" value=""><br>
        提交地址：<input name="LoginPostUrl" type="text" size="40" maxlength="150" value=""><br>
        用户参数：<input name="LoginUser" type="text" size="30" maxlength="150" value=""><br>
        密码参数：<input name="LoginPass" type="text" size="30" maxlength="150" value=""><br> 
		失败信息：<input name="LoginFalse" type="text" size="30" maxlength="150" value=""></td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg"><strong>项目备注：</strong></td>
      <td class="tdbg" width="75%"><textarea name="ItemDemo" cols="49" rows="5"></textarea></td>
    </tr>
    <tr class="tdbg"> 
      <td colspan="2" align="center" class="tdbg"><input name="Action" type="hidden" id="Action" value="SaveAdd">
        <input name="Cancel" type="button" id="Cancel" value=" 返&nbsp;&nbsp;回 " onClick="window.location.href='Admin_ItemManage.jsp'" style="cursor: hand;background-color: #cccccc;">
        &nbsp; 
        <input  type="submit" name="Submit" value="下&nbsp;一&nbsp;步" style="cursor: hand;background-color: #cccccc;"></td>
    </tr>
</form>
</table>
     
</body>         
</html>
<%end Sub%>
<%
Sub SetChannel
Dim Arr_Channel,i_Channel,i_Class,i,ArrShowLine(20)
Dim Rs,Sql,ClassID,ClassName,F_ID,F_Value
Set Rs=server.createobject("adodb.recordset")
Sql = "select F_ID from T_BigCategory order by F_Grade ASC"
Rs.Open Sql,Conn,1,1
If Not Rs.Eof Then
   Arr_Channel=Rs.GetRows()
End If
Rs.Close
Set Rs=Nothing

If IsArray(Arr_Channel)= True then
   i_Class=0
   For i=0 To Ubound(ArrShowLine)
      ArrShowLine(i)=False
   Next
%>
<script language = "JavaScript">
var count_class;
arr_class = new Array();;
<%
   For i_Channel=0 To Ubound(Arr_Channel,2)
      Set Rs=server.createobject("adodb.recordset")
      Sql = "select * from T_SmallCategory where F_BigCategoryID=" & Arr_Channel(0,i_Channel) & ""
      Rs.Open Sql,Conn,1,1
%>
arr_class[<%=i_Class%>] = new Array("<%=Arr_Channel(0,i_Channel)%>","0","请选择栏目");
<%
      i_Class=i_Class+1
      If Not Rs.Eof Then
         Do While Not Rs.Eof
            F_Value="" 
			F_ID=Rs("F_ID")
			F_Value=F_Value & Rs("F_Value")
	%>
	arr_class[<%=i_Class%>] = new Array("<%=Arr_Channel(0,i_Channel)%>","<%=F_ID%>","<%=F_Value%>");
	<%
				i_Class = i_Class + 1
				Rs.MoveNext
         Loop
      End if
      Rs.Close
      Set Rs=Nothing
%>
<%  
   Next
%>
count_class=<%=i_Class%>;

function changelocation(locationid)
    {
    document.myform.ClassID.length = 0; 
    var locationid=locationid;
    var i;
    for (i=0;i < count_class; i++)
        {
            if (arr_class[i][0] == locationid)
            { 
                document.myform.ClassID.options[document.myform.ClassID.length] = new Option(arr_class[i][2], arr_class[i][1]);
            }        
        }
   
    }    
</script>
<%
End if
End sub
%>
