<!--#include file="down_conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!--#include file="down_function.asp"-->
<%
dim founerr,FoundErr,filename,filename1,filename2,filename3,filename4,showname,classid,Nclassid,note,hot,system,sel,flagd
dim size1,fromurl,order,downshow2,daydown,softsx,utime,piclink,addu,hots,hide,localdown,con,content,sql2,rs2
Dvbbs.LoadTemplates("index")
Dvbbs.Stats="<a href=down_default.asp>下载中心</a>-修改软件信息"
Dvbbs.Nav()'输出头
Dvbbs.Head_var 2,0,Dvbbs.Stats,""
if not dvbbs.founduser then
FoundErrs  "客人没有进入下载中心管理的权限，请<a href=login.asp>登陆</a>或者同管理员联系。"
ShowErrs(Dvbbs.Stats)
end if
	set rss=conndown.execute("select * from [download] where id="&request("id")&"")

if rss("adduser")=Dvbbs.membername or dvbbs.master then
call edit() 
elseif rss("adduser")<>Dvbbs.membername then
sql2="select flag from [admin] where username='"&Dvbbs.membername&"'"
set rs2=conndown.execute(sql2)
if not(rs2.eof and rs2.bof) then
flagd=rs2("flag")
if flagd=2  then
call edit()
elseif  flagd=3 and (rss("downshow")=1 or rss("downshow")=2 or rss("downshow")=3) then
call edit()
else
FoundErrs  "<font color=red>只有软件添加者和部分管理员才能修改操作 </font>。请<a href=login.asp>登陆</a>或者同管理员联系。"
ShowErrs(Dvbbs.Stats)
end if
end if
end if





%>

<%sub edit()%>
<form method="POST" name=frmAnnounce id=up action="down_adminsave.asp?id=<%=request("id")%>&action=edit">
 <table  cellspacing=1 width="<%= Dvbbs.mainsetting(0) %>" align=center class="tableborder2"> 
 <tr>
    <th  height="25" colspan="2"><b>修 改 </b>        
   <tr>
  <td width="20%" height="20" align="right" valign="top"><b>软件类型：</b></td>
      <td width="85%"><select class="smallSel" name="classid" size="1" onChange="changelocation(document.frmAnnounce.classid.options[document.frmAnnounce.classid.selectedIndex].value)">
          <%
	
	classid=request("classid")
	Nclassid=request("Nclassid")
 	set rs=server.createobject("adodb.recordset")
  	sql="select * from Dclass"
 	rs.open sql,conndown,1,1
	if rs.eof and rs.bof then
	response.write "<option value="" name=classid>没有分类</option>"
	else
	do while not rs.eof
        if classid=cstr(rs("classid")) then
               sel="selected"
        else
               sel=""
        end if	
	response.write "<option " & sel & " value='"+CStr(rs("classID"))+"' name=classid>"+rs("class")+"</option>"+chr(13)+chr(10)
	rs.movenext
    	loop
	end if
	rs.close
%>
        </select>
&nbsp;&nbsp;选择分类：
      <select name="Nclassid" size="1">
        <%
  	sql="select * from DNclass"
 	rs.open sql,conndown,1,1
	if rs.eof and rs.bof then
	response.write "<option value="" name=Nclassid>没有分类</option>"
	else
        do while not rs.eof
        if Nclassid=cstr(rs("Nclassid")) then
               sel="selected"
        else
               sel=""
        end if	
        response.write "<option " & sel & " value='" +  Cstr(rs("Nclassid")) + "'>" + rs("Nclass") + "</option>"
        rs.MoveNext
        Loop
	end if
        rs.close
%>
      </select>
      <%
	sql="select * from download where id="&request("id")
	rs.open sql,conndown,1,1
%>
      ******** 上传者：<b><font color=red><%=rs("adduser")%></font></b> </td>
  </tr>
  <tr>
    <td width="20%" height="30" align="right"><b>下载属性：</b></td>
    <td width="85%" height="30"><input type=radio name="downshow" value="1" <%if rs("downshow")=1 then%>checked<%end if%>>
      开放下载
        <input type=radio name="downshow" value="2" <%if rs("downshow")=2 then%>checked<%end if%>>
        会员下载
        <input type=radio name="downshow" value="3" <%if rs("downshow")=3 then%>checked<%end if%> <%if vipshow=1 then response.write"disabled" end if%>>
        VIP下载
        <%if dvbbs.master  or flagd=2 or flagd=1 then%>
        <input type=radio name="downshow" value="6" <%if vipshow=1 then response.write"disabled" end if%> <%if rs("downshow")=6 then%>checked<%end if%> >
        金牌下载
        <input type=radio name="downshow" value="4" <%if rs("downshow")=4 then%>checked<%end if%>>
        特约下载
        <%end if%>
        <input type=radio name="downshow" value="5" <%if rs("downshow")=5 then%>checked<%end if%>>
        付费下载
        <input name="money" size=6 value="<%=rs("point")%>">
        <input type=radio name="downshow" value="7" <%if rs("downshow")=7 then%>checked<%end if%>>
        帖数下载
        <input name="tieshu" size=6 value="<%=rs("tieshu")%>">
    </td>
  </tr>
  <tr>
    <td width="20%" height="30" align="right"><b>软件属性：</b></td>
    <td width="85%" height="30"><select name="softsx" size="1">
        <option value="0" name="softsx" <%if rs("softsx")=0 then%>selected<%end if%>>普通软件</option>
        <option value="1" name="softsx" <%if rs("softsx")=1 then%>selected<%end if%>>RealPlay播入</option>
        <option value="2" name="softsx" <%if rs("softsx")=2 then%>selected<%end if%>>MediaPlay播入</option>
        <option value="3" name="softsx" <%if rs("softsx")=3 then%>selected<%end if%>>FLASH动画</option>
      </select>
      **</td>
  </tr>
  <tr>
    <td width="20%" height="30" align="right"><b>显示名称：</b></td>
    <td width="85%" height="30"><input type="text" name="txtshowname" size="60"
          class="smallinput" maxlength="100" value="<%=rs("showname")%>">
      **</td>
  </tr>
  <tr>
    <td width="20%" height="30" align="right"><b>下载地址1：</b></td>
    <td width="85%" height="30"><input type="text" name="txtfilename" size="60"
          class="smallinput" maxlength="200" <%if rs("filename")<>"" then%>value="<%=split(dvbbs.htmlencode(rs("filename")),"#")(0)%>"<%End if%>>
      ** <font
color=red>下载地址方式</font>
      <select name="ldown1" size="1">
        <option value="0" name="ldown1" <%if rs("filename")<>"" then if split(rs("filename"),"#")(1)=0 then response.write"selected" end if end if%>>★普通连接</option>
        <option value="1" name="ldown1" <%if rs("filename")<>"" then if split(rs("filename"),"#")(1)=1 then response.write"selected" end if end if%>>☆本地上传</option>
        <option value="2" name="ldown1" <%if rs("filename")<>"" then if split(rs("filename"),"#")(1)=2 then response.write"selected" end if end if%>>※FTP 下载</option>
    </select></td>
  </tr>
  <tr>
    <td width="20%" height="30" align="right"><b>下载地址2：</b></td>
    <td width="85%" height="30"><input type="text" name="txtfilename1" size="60"
          class="smallinput" maxlength="100" <%if rs("filename1")<>"" then response.write"value='"&split(dvbbs.htmlencode(rs("filename1")),"#")(0)&"'" End if%> id="Text1">
      ** <font
color=red>下载地址方式</font>
      <select name="ldown2" size="1" id="Select1">
        <option value="0" name="ldown2" <%if rs("filename1")<>"" then if split(rs("filename1"),"#")(1)=0 then response.write"selected" end if end if%>>★普通连接</option>
        <option value="1" name="ldown2" <%if rs("filename1")<>"" then if split(rs("filename1"),"#")(1)=1 then response.write"selected" end if end if%>>☆本地上传</option>
        <option value="2" name="ldown2" <%if rs("filename1")<>"" then if split(rs("filename1"),"#")(1)=2 then response.write"selected" end if end if%>>※FTP 下载</option>
    </select></td>
  </tr>
  <tr>
    <td width="20%" height="30" align="right"><b>下载地址3：</b></td>
    <td width="85%" height="30"><input type="text" name="txtfilename2" size="60"
          class="smallinput" maxlength="100" <%if rs("filename2")<>"" then response.write"value='"&split(dvbbs.htmlencode(rs("filename2")),"#")(0)&"'" End if%> id="Text2">
      ** <font
color=red>下载地址方式</font>
      <select name="ldown3" size="1" id="Select2">
        <option value="0" name="ldown3" <%if rs("filename2")<>"" then if split(rs("filename2"),"#")(1)=0 then response.write"selected" end if end if%>>★普通连接</option>
        <option value="1" name="ldown3" <%if rs("filename2")<>"" then if split(rs("filename2"),"#")(1)=1 then response.write"selected" end if end if%>>☆本地上传</option>
        <option value="2" name="ldown3" <%if rs("filename2")<>"" then if split(rs("filename2"),"#")(1)=2 then response.write"selected" end if end if%>>※FTP 下载</option>
    </select></td>
  </tr>
  <tr>
    <td width="20%" height="30" align="right"><b>下载地址4：</b></td>
    <td width="85%" height="30"><input type="text" name="txtfilename3" size="60"
          class="smallinput" maxlength="100" <%if rs("filename3")<>"" then response.write"value='"&split(dvbbs.htmlencode(rs("filename3")),"#")(0)&"'" End if%> id="Text3">
      ** <font
color=red>下载地址方式</font>
      <select name="ldown4" size="1" id="Select3">
        <option value="0" name="ldown4" <%if rs("filename3")<>"" then if split(rs("filename3"),"#")(1)=0 then response.write"selected" end if end if%>>★普通连接</option>
        <option value="1" name="ldown4" <%if rs("filename3")<>"" then if split(rs("filename3"),"#")(1)=1 then response.write"selected" end if end if%>>☆本地上传</option>
        <option value="2" name="ldown4" <%if rs("filename3")<>"" then if split(rs("filename3"),"#")(1)=2 then response.write"selected" end if end if%>>※FTP 下载</option>
    </select></td>
  </tr>
  <tr>
    <td width="20%" height="30" align="right"><b>下载地址5：</b></td>
    <td width="85%" height="30"><input type="text" name="txtfilename4" size="60"
          class="smallinput" maxlength="100" <%if rs("filename4")<>"" then response.write"value='"&split(dvbbs.htmlencode(rs("filename4")),"#")(0)&"'" End if%> id="Text4">
      ** <font
color=red>下载地址方式</font>
      <select name="ldown5" size="1" id="Select4">
        <option value="0" name="ldown5" <%if rs("filename4")<>"" then if split(rs("filename4"),"#")(1)=0 then response.write"selected" end if end if%>>★普通连接</option>
        <option value="1" name="ldown5" <%if rs("filename4")<>"" then if split(rs("filename4"),"#")(1)=1 then response.write"selected" end if end if%>>☆本地上传</option>
        <option value="2" name="ldown5" <%if rs("filename4")<>"" then if split(rs("filename4"),"#")(1)=2 then response.write"selected" end if end if%>>※FTP 下载</option>
    </select></td>
  </tr>
  <tr>
    <td width="20%" height="30" align="right"><b>日下载数限制：</b></td>
    <td width="85%" height="30"><input type="text" name="daydown" size="15"
          class="smallinput" maxlength="100" value="<%=rs("daydown")%>">
      人次**（填写“0”表示无限制）</td>
  </tr>
  <tr>
    <td width="20%" height="30" align="right"><b>下载有效期：</b></td>
    <td width="85%" height="30"><select name="usetime" size="1">
        <option selected value="0" name="usetime" <%if rs("usetime")=0 then%>selected<%end if%>>无限期</option>
        <option value="1" name="usetime" <%if rs("usetime")=1 then%>selected<%end if%>>一天</option>
        <option value="2" name="usetime" <%if rs("usetime")=2 then%>selected<%end if%>>二天</option>
        <option value="3" name="usetime" <%if rs("usetime")=3 then%>selected<%end if%>>三天</option>
        <option value="7" name="usetime" <%if rs("usetime")=7 then%>selected<%end if%>>一周</option>
        <option value="14" name="usetime" <%if rs("usetime")=14 then%>selected<%end if%>>二周</option>
        <option value="30" name="usetime" <%if rs("usetime")=30 then%>selected<%end if%>>一个月</option>
        <option value="60" name="usetime" <%if rs("usetime")=60 then%>selected<%end if%>>二个月</option>
        <option value="90" name="usetime" <%if rs("usetime")=90 then%>selected<%end if%>>三个月</option>
        <option value="180" name="usetime" <%if rs("usetime")=180 then%>selected<%end if%>>半年</option>
        <option value="360" name="usetime" <%if rs("usetime")=360 then%>selected<%end if%>>一年</option>
      </select>
      **</td>
  </tr>
  <tr>
    <td width="20%" height="30" align="right"><b>推荐度：</b></td>
    <td width="85%" height="30"><select name="hot" size="1">
        <option <%if rs("hot")=1 then%> selected <%end if%> value="1" name="hot">一星级</option>
        <option <%if rs("hot")=2 then%> selected <%end if%> value="2" name="hot">二星级</option>
        <option <%if rs("hot")=3 then%> selected <%end if%> value="3" name="hot">三星级</option>
        <option <%if rs("hot")=4 then%> selected <%end if%> value="4" name="hot">四星级</option>
        <option <%if rs("hot")=5 then%> selected <%end if%> value="5" name="hot">五星级</option>
      </select>
      **
      <!--<input type="text" name="hot" size="60" class="smallinput" maxlength="100" value="3">--></td>
  </tr>
  <tr>
    <td width="20%" height="30" align="right"><b>运行环境：</b></td>
    <td width="85%" height="30"><select name="system" size="1">
        <option <%if rs("system")="ASP环境" then%>selected<%end if%> value="ASP环境" name="system">ASP环境</option>
        <option <%if rs("system")="CGI环境" then%>selected<%end if%> value="CGI环境" name="system">CGI环境</option>
        <option <%if rs("system")="PHP环境" then%>selected<%end if%> value="PHP环境" name="system">PHP环境</option>
        <option <%if rs("system")="JSP环境" then%>selected<%end if%> value="JSP环境" name="system">JSP环境</option>
        <option <%if rs("system")="Windows9x/NT/xp/03" then%>selected<%end if%> value="Windows9x/NT/xp/03" name="system">Windows9x/NT/xp/03</option>
        <option <%if rs("system")="Linux环境" then%>selected<%end if%> value="Linux环境" name="system">Linux环境</option>
      </select>
      **
      <!--<input type="text" name="system" size="60" class="smallinput" maxlength="100" value="Win98/2000+PWS4&NT+IIS4/5">--></td>
  </tr>
  <tr>
    <td width="20%" height="30" align="right"><b>软件大小：</b></td>
    <td width="85%" height="30"><input type="text" name="size1" size="60"
          class="smallinput" maxlength="100" value="<%=rs("size")%>"></td>
  </tr>
  <tr>
    <td width="20%" height="30" align="right"><b>软件来源：</b></td>
    <td width="85%" height="30"><input type="text" name="fromurl" size="60"
          class="smallinput" maxlength="100" value="<%=rs("fromurl")%>"></td>
  </tr>
  <tr>
    <td width="20%" height="30" align="right"><b>授权形式：</b></td>
    <td width="85%" height="30"><select name="order" size="1">
        <option selected value="免费软件" name="order">免费软件</option>
        <option  value="破解软件" name="order">破解软件</option>
        <option  value="共享软件" name="order">共享软件</option>
        <option value="付费软件" name="order">付费软件</option>
        <option value="商业软件" name="order">商业软件</option>
      </select>
        <!--<input type="text" name="order" size="60" class="smallinput" maxlength="100" value="免费">-->
      是否推荐
      <input type="checkbox" name="hots" value="on" <%if rs("hots")=1 then%>checked<%end if%>>
      是否隐藏
      <input type="checkbox" name="hide" value="on" <%if rs("stop")=1 then%>checked<%end if%>>
      <%if flagd<3 or dvbbs.master then%>
      <font color=red>固顶推荐</font>
      <input type="checkbox" name="guding" value="1" <%if rs("gudin")=1 then%>checked<%end if%>>
      <%end if%>
    </td>
  </tr>
  <tr>
    <td width="20%" height="30" align="right"><b>上传图片：</b></td>
    <td width="85%" height="30"><iframe name=ad frameborder=0 width=322 height=40 scrolling=no src=down_picupload.asp></iframe>
    </td>
  </tr>
  <tr>
    <td width="20%" height="30" align="right"><b>软件图片：</b></td>
    <td width="85%" height="30"><input type="text" name="pic" size="60"
          class="smallinput" maxlength="100" value="<%=rs("pic")%>">
    </td>
  </tr>
  <tr>
    <td width="20%" align="right" valign="top"></td>
    <td width="85%"></td>
    <%
con=rs("note")
if con<>"" then
	content=replace(con,"<br>",chr(13))
	content=replace(content,"&nbsp;","")
	content=content+chr(13)
end if%>
  </tr>
  <tr>
    <td width="20%" align="right" valign="top"><b>程式简介：</b></td>
    <td width="85%"><textarea rows="8" name="Content" cols="105" class="smallarea"><%=con%></textarea>
      **</td>
  </tr>
  <tr>
    <td width="20%" align="right" valign="top">&nbsp;</td>
    <td><input type="submit" value=" 保 存 "
  name="cmdok" class="buttonface">
      &nbsp;
      <input type="reset" value=" 清 除 "
  name="cmdcancel" class="buttonface"> &nbsp;
      <input name="Submitasd" type="button" id="Submitasd" onclick=window.history.back() value=" 取 消 "></td>
  </tr>
        </table>
  


</form>
</body>
<%dim count
set rs=server.createobject("adodb.recordset")
     sql = "select * from DNclass order by Nclassid asc"
     rs.open sql,conndown,0,1
%>
<SCRIPT language = "JavaScript">
    var onecount;
    onecount=0;
    subcat = new Array();
        <%count = 0
        do while not rs.eof %>
    subcat[<%=count%>] = new Array("<%= trim(rs("Nclass"))%>","<%=cstr(rs("classid"))%>","<%=cstr(rs("Nclassid"))%>");<%count = count + 1
        rs.movenext
        loop
        rs.close
        %>
    onecount=<%=count%>;

function changelocation(locationid)
    {
    document.frmAnnounce.Nclassid.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.frmAnnounce.Nclassid.options[document.frmAnnounce.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
    </SCRIPT> 

<%
response.write "</CENTER></td></tr></table>"
end sub

Dvbbs.footer()
%>