<!--#include file="../inc/Conn.asp"-->
<!--#include file="Inc/Admin.Asp"-->
<!--#include file="Inc/Function.asp"-->
<%
PurviewValue="adddownload"
If not CheckAdmin(PurviewValue) then
Response.Write("<script language=""JavaScript"">alert(""越权操作!"");history.go(-1);")
response.end
End If
%>
<%
dim rs
dim sql
dim count
dim BigClassName,SmallClassName

set rs=server.createobject("adodb.recordset")
sql = "select * from SmallClass_down order by SmallClassID asc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
        <%
        count = 0
        do while not rs.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("SmallClassName"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecount=<%=count%>;
  // 当上传图片等文件时，往下拉框中填入图片路径，可根据实际需要更改此函数
  function doChange(objText, objDrop){
    if (!objDrop) return;
    var str = objText.value;
    var arr = str.split("|");
    var nIndex = objDrop.selectedIndex;
    objDrop.length=1;
    for (var i=0; i<arr.length; i++){
      objDrop.options[objDrop.length] = new Option(arr[i], arr[i]);
    }
    objDrop.selectedIndex = nIndex;
  }

function changelocation(locationid)
    {
    document.myform.SmallClassName.length = 1; 
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.myform.SmallClassName.options[document.myform.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
    }    

</script>
<!-- #include file="Inc/Head.asp" -->
<table cellpadding="2" cellspacing="1" border="0" width="610" align="center" class="border">
	<tr>
		<td class="topbg" height="25" align="center"><strong>添 加 下 载</strong></td>
	</tr>
	<tr>
		<td align="center">
			<form method="POST" name="myform"  action="Download_Save.asp?action=add" target="_self">
<table width="100%"  border="0" cellpadding="0" cellspacing="1">
							<tr> 
								<td width="155" height="22" align="right"  class="tdbgl">所属类别：</td>
								<td colspan="2"   class="tdbg"> 
<%
		sql = "select * from BigClass_down"
		rs.open sql,conn,1,1
if rs.eof and rs.bof then
	response.write "请先添加栏目。"
else
%>

<select name="BigClassName" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)" size="1">
<option selected value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option>
<%
dim selclass
		selclass=rs("BigClassName")
		rs.movenext
	do while not rs.eof
%>
<option value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option>
<%
			rs.movenext
		loop
end if
	rs.close
%>
</select>

<select name="SmallClassName">
<option value="" selected>不指定小类</option>
<%
sql="select * from SmallClass_down where BigClassName='" & selclass & "'"
rs.open sql,conn,1,1
if not(rs.eof and rs.bof) then
%>
<option value="<%=rs("SmallClassName")%>"><%=rs("SmallClassName")%></option>
<%
rs.movenext
do while not rs.eof
%>
<option value="<%=rs("SmallClassName")%>"><%=rs("SmallClassName")%></option>
<%
rs.movenext
loop
end if
rs.close
%>
</select>							  </td>
							</tr>
							<tr> 
								<td width="155" height="25" align="right"  class="tdbgl">标题名称：</td>
							  <td colspan="2"  class="tdbg">
								<input type="text" name="Title" id="Title" size="50" maxlength="80">
							  <font color="#FF0000">*</font></td>
							</tr>
							<tr> 
								<td width="155" height="25" align="right"  class="tdbgl">软件语言：</td>
							  <td colspan="2"  class="tdbg"> <INPUT type=radio CHECKED value=简体中文 name=Language>简体中文 <INPUT type=radio value=繁体中文 name=Language>繁体中文 <INPUT type=radio value=英文 name=Language>英文 <INPUT type=radio value=多国语言 name=Language>多国语言 <FONT color=#ff0000>*</FONT></td>
							</tr>
							<tr> 
								<td width="155" height="50" align="right"  class="tdbgl">授权类型：</td>
							  <td colspan="2"  class="tdbg"> <INPUT type=radio CHECKED value=共享软件 name=Softclass>共享软件 <INPUT type=radio value=免费软件 name=Softclass>免费软件 <INPUT type=radio value=自由软件 name=Softclass>自由软件 <INPUT type=radio value=试用软件 name=Softclass>试用软件 <INPUT type=radio value=演示软件 name=Softclass>演示软件 <BR><INPUT type=radio value=商业软件 name=Softclass>商业软件 <INPUT type=radio value=破解软件 name=Softclass>破解软件 <INPUT type=radio value=注册软件 name=Softclass>注册软件 <FONT color=#ff0000>*</FONT> </td>
							</tr>
							<tr> 
								<td width="155" height="50" align="right"  class="tdbgl">运行环境：</td>
							  <td colspan="2"  class="tdbg"> <INPUT type=checkbox value=Win2003 name=System>Win2003 <INPUT type=checkbox CHECKED value=WinXP name=System>WinXP <INPUT type=checkbox CHECKED value=Win2000 name=System>Win2000 <INPUT type=checkbox CHECKED value=NT name=System>NT <INPUT type=checkbox CHECKED value=WinME name=System>WinME <INPUT type=checkbox CHECKED value=Win9X name=System>Win9X <BR><INPUT type=checkbox value=Dos name=System>Dos <INPUT type=checkbox value=Linux name=System>Linux <INPUT type=checkbox value=Unix name=System>Unix <INPUT type=checkbox value=Mac name=System>Mac <INPUT type=checkbox value=ASP环境 name=System>ASP环境 <INPUT type=checkbox value=PHP环境 name=System>PHP环境 <INPUT type=checkbox value=CGI环境 name=System>CGI环境 <FONT color=#ff0000>*</FONT> </td>
							</tr>
							<tr > 
								<td width="155" height="25" align="right"  class="tdbgl">软件简介：</td>
								<td colspan="2" valign="middle" class="tdbg"><input type="hidden" name="content" value="">
                                  <iframe id="eWebEditor1" src="Editor/ewebeditor.asp?id=content&style=download&savepathfilename=UploadFiles" frameborder="0" scrolling="no" width="550" height="450"></iframe></td>
							</tr>
							<tr>
                              <td width="155" height="25" align="right"  class="tdbgl">图片地址：
                                  <input type=hidden name=UploadFiles onChange="doChange(this,document.myform.DefaultPicList)"></td>
							  <td   class="tdbg"><input type="text" name="PhotoUrl" id="PhotoUrl" size="50" maxlength="120">
                                  <br>
							    首页的图片,直接从上传图片中选择：
							    <select name="DefaultPicList" id="select" onChange="PhotoUrl.value=this.value;">
							      <option value="" selected>不指定首页图片</option>
						        </select></td>
		                      <td   class="tdbg"><iframe style="top:2px" ID="UploadFiles" src="../upload_Photo.asp?PhotoUrlID=0" frameborder=0 scrolling=no width="320" height="25"></iframe></td>
		  </tr>
          <tr class=tdbg> 
            <td width="155" height="25" align="right" class="tdbgl"><font color="#FF0000">*</font>下载地址：</td>
            <td width="77" class="tdbg"> <input name="DownloadUrl" type="text" id="DownloadUrl" size="30" maxlength="200"></td>
            <td width="78" class="tdbg"><iframe style="top:2px" id="UploadFiles" src="../upload_Photo.asp?PhotoUrlID=1" frameborder=0 scrolling=no width="320" height="25"></iframe></td>
          </tr>
			          <tr> 
            <td width="155" height="25" align="right" class=tdbgl><font color="#FF0000">*</font>文件大小：</td>
            <td colspan="2" class=tdbg> <input name="FileSize" type="text" class="input" id="fileSize" size="30">
              K </td>
							</tr>
							<tr> 
								<td width="155" height="25" align="right"  class="tdbgl">已通过审核：</td>
								<td colspan="2"  class="tdbg">
								<input type="checkbox" name="Passed" id="Passed" value="yes" checked>
							  <font color="#0000FF">（如果选中的话将直接发布）</font></td>
							</tr>
							<tr> 
								<td width="155" height="25" align="right"  class="tdbgl">下载推荐：</td>
								<td colspan="2"  class="tdbg">
								<input type="checkbox" name="Elite" id="Passed" value="yes">
							  <font color="#0000FF">（是否设为推荐）</font></td>
							</tr>
							<tr> 
								<td width="155" height="11" align="right"  class="tdbgl">加入时间：</td>
								<td colspan="2"  class="tdbg">
							  <input type="text" name="AddDate" id="AddDate" value="<%=now()%>" maxlength="50">当前时间为：<%=now()%> 注意不要改变格式。</td>
							</tr>
							<tr>
							  <td width="155" height="12" align="right"  class="tdbgl">&nbsp;</td>
							  <td colspan="2"  class="tdbg"><input	name="Add" type="submit"  id="Add" value=" 添 加 " 
				onClick="document.myform.action='Download_Save.asp?action=add';document.myform.target='_self';" >
							    &nbsp;
                                <input name="Cancel" type="button" id="Cancel" value=" 取 消 " onClick="window.location.href='Download_Add.asp'" ></td>
						  </tr>
			  </table>
		    </form>
		</td>
	</tr>
</table>
<BR>
<!-- #include file="Inc/foot.asp" -->