<!-- #include file="include/config_down.asp" -->
<%
dim id:id=trim(request.querystring("id"))
if not(isnumeric(id)) then
  call format_redirect("down.asp")
  reponse.end
end if
%>
<!-- #include file="include/jk_ubb.asp" -->
<!-- #include file="include/config_review.asp" -->
<!-- #include file="include/conn.asp" -->
<%
dim cname,sname,temp1,keyes,power,userp,emoney,url1,url2,sql2,rs2
set rs=server.createobject("ADODB.recordset")
sql="select * from down where hidden=1 and id="&id
rs.open sql,conn,1,1
if rs.eof and rs.bof then
  rs.close:set rs=nothing
  call close_conn()
  call format_redirect("down.asp")
  response.end
end if
cid=rs("c_id")
sid=rs("s_id")
keyes=rs("keyes")
power=rs("power")
emoney=rs("emoney")

cname="软件浏览":sname=""
if cid>0 then
  if sid>0 then
    sql2="select jk_class.c_name,jk_sort.s_name from jk_sort inner join jk_class on jk_sort.c_id=jk_class.c_id where jk_sort.c_id="&cid&" and jk_sort.s_id="&sid
  else
    sql2="select c_name from jk_class where c_id="&cid
  end if
  set rs2=conn.execute(sql2)
  if not (rs2.eof and rs2.bof) then
    cname=rs2("c_name"):tit=cname
    if sid>0 then sname=rs2("s_name"):tit=cname&"（"&sname&"）"
  end if
  rs2.close
end if

if action="download" then
  call web_head(1,0,0,0,0)
else
  call web_head(0,0,0,0,0)
end if
'--------------------------------download---------------------------------
userp=int(objv7.format_power(user_power,login_mode,2))

if action="download" then
  call emoney_notes(power,emoney,n_sort,id,"js",1,1,"?id="&id)
  'call emoney_notes(power,0,n_sort,id,"js",1,1,"?id="&id)
  if trim(request.querystring("url"))="download2" then
    index_url=rs("url2")
  else
    index_url=rs("url")
  end if
  rs.close:set rs=nothing
  sql="update down set counter=counter+1 where id="&id
  conn.execute(sql)
  call close_conn()
  
  response.redirect ""&objv7.url_true(objv7.web_var(web_down,5),index_url)&""
  response.end
end if
'------------------------------------left----------------------------------
call nsort_left("down",cid,sid,"down_list.asp?")
call down_sea()
call down_new_hot("","","","good",15,0,13,1,0,0)
call down_new_hot("","","","hot",15,0,13,1,0,0)
call down_new_hot("","","","new",15,0,13,1,0,0)
'----------------------------------left end--------------------------------
call web_center(0)
'-----------------------------------center---------------------------------
dim topic
topic=rs("name")
response.write kong&admin_bar("软件下载",1,"100%")
%>
<table border=0 width='100%' cellspacing=1 cellpadding=2 align=center>
<tr class=tdbg-tree>
  <td align=center colspan=3><font size=3><%response.write objv7.code_html(topic,1,0)%></font></td></tr>
  <tr class=tdbg-dark><td align=center width='15%'>授权类型：</td><td width='40%'><%response.write rs("genre")%>　</td>
  <td align=center width='45%' rowspan=8><script language=javascript>pic_url('<%response.write rs("pic")%>',2);</script></td></tr>
  <tr class=tdbg-dark><td align=center>运行环境：</td><td><%response.write rs("os")%>　</td></tr>
  <tr class=tdbg-dark><td align=center>软件大小：</td><td><%response.write rs("sizes")%></td></tr>
  <tr class=tdbg-dark><td align=center>推荐等级：</td><td><img src='images/down/star<%response.write rs("types")%>.gif' border=0></td></tr>
  <tr class=tdbg-dark><td align=center>下载次数：</td><td><font class=red><%response.write rs("counter")%></font></td></tr>
  <tr class=tdbg-dark><td align=center>发&nbsp;布&nbsp;人：</td><td><%response.write format_user_view(rs("username"),1,1)%></td></tr>
  <tr class=tdbg-dark><td align=center>发布日期：</td><td><%response.write objv7.time_type(rs("tim"),88)%></td></tr>
  <tr class=tdbg-dark><td align=center>软件主页：</td><td><%
temp1=rs("homepage")
if temp1="" or isnull(temp1) or temp1="http://" then
  response.write "<a href='"&objv7.web_var(web_config,2)&"' target=_blank>"&objv7.web_var(web_config,2)&"</a>"
else
  response.write "<a href='"&temp1&"' target=_blank>"&temp1&"</a>"
end if
%></td></tr>
  <tr class=tdbg-dark><td align=center>下载权限：</td><td>&nbsp;<%response.write power_pic(emoney,power,1)%></td><td align=center><%response.write commend_friend(tit,topic,"down_view.asp?id="&id)%></td></tr>
  <tr class=tdbg-dark><td align=center>下载地址：</td><td colspan=2>&nbsp;&nbsp;&nbsp;<a href='?action=download&id=<%response.write id%>'><img src='images/down/download.gif' border=0></a>&nbsp;
<% if len(rs("url2"))>8 then %>
&nbsp;&nbsp;&nbsp;<a href='?action=download&url=download2&id=<%response.write id%>'><img src='images/down/download2.gif' border=0></a>
<% end if %></td></tr>
  <tr class=tdbg-dark><td align=center>软件备注：</td><td colspan=2><table borer=0><tr><td><%
temp1=rs("remark")
if len(temp1)<3 then
  temp1="<font class=gray>好像没有关于该软件的介绍哦！</font>"
else
  temp1=code_jk(temp1)
end if
response.write temp1
rs.close
%></td></tr></table></td></tr>
  <tr valign=top class=tdbg-dark><td align=center>相关软件：</td><td colspan=2><table border=0><%
if len(keyes)<1 then
  response.write vbcrlf&"<tr><td class=gray>该软件没有与之相关的软件</td></tr>"
else
  sql="select id,name,tim,counter from down where hidden=1 and "&objv7.sql_key(keyes,"name",1)&" and id<>"&id&" order by id desc"
  set rs=conn.execute(sql)
  if rs.eof and rs.bof then
    response.write vbcrlf&"<tr><td class=gray>该软件没有与之相关的软件</td></tr>"
  else
    do while not rs.eof
      temp1=rs("name")
      response.write vbcrlf&"<tr><td><a href='down_view.asp?id="&rs("id")&"' title='"&objv7.code_html(temp1,1,0)&"'>"&objv7.code_html(temp1,1,30)&"</a>"&objv7.format_end(1,objv7.time_type(rs("tim"),33)&",<font class=blue>"&rs("counter")&"</font>")&"</td></tr>"
      rs.movenext
    loop
  end if
  rs.close
end if
set rs=nothing
%></table></td></tr>
  </table>
<%response.write admin_bar("",2,"100%")%>
<table border=0 width='100%' cellspacing=0 cellpadding=0 align=center>
<tr><td height=10></td></tr>
<tr><td align=center><% call review_type(n_sort,id,"down_view.asp?id="&id,1) %></td></tr>
<tr><td height=5></td></tr>
<tr><td align=center><%call down_remark()%></td></tr>
</table>
<%
'---------------------------------center end-------------------------------
call web_end(0)
%>