📄 x.asp
字号:
<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Const.asp"-->
<%
'response.buffer=false
'------------------------------------------------设置参数
LoginID=trim(session("LoginID")) : if LoginID="" then LoginID=0 '当前用户ID
news_id=request("id") '新闻ID
'------------------------------------------------
'------------------------------------------------取记录
'------------------------------------------------添加阅读人
set rs1=Server.CreateObject("ADODB.RecordSet")
sql_stmt="SELECT count(*) from tbioaInfoRead where userid=" & LoginID & " and newsid=" &("id")
rs1.open sql_stmt,oConn,1,1
if rs1(0)=0 then
oConn.execute "insert into tbioaInfoRead (newsid,userid,sdate) values (" & news_id & "," & LoginID & ",'" & now() & "')"
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/main.css" type=text/css>
<title>main</title>
<base target="FrmMain">
</head>
<body topmargin="10" leftmargin="10">
<table width="100%" cellpadding="2" cellspacing="1" class="tab">
<%while not N_rsdir.eof
%>
<%
N_rsdir.MoveNext
wend
N_rsdir.close
set N_rsdir=nothing
%>
</table>
<br>
<%
set rsdir=Server.CreateObject("ADODB.RecordSet")
sql="select * from tbioaDownload_sort where id="&typeid&" order by name"
rsdir.open sql,oConn,1,1
if not rsdir.eof then
viewAuth=ReturnManage(rsdir("viewermod"),rsdir("id"),"viewer","tbioaDownload_sort") '取当级目录查看权限
manageAuth=ReturnManage(rsdir("managermod"),rsdir("id"),"manager","tbioaDownload_sort") '取当级目录管理权限
if (not viewAuth) and (not manageAuth) then
response.write "没有权限查看该文件夹!"
response.end
else
set rs=Server.CreateObject("ADODB.RecordSet")
sqlstr="select * from tbioaDownloadFile where Typeid="&TypeId
rs.open sqlstr,oconn,1,1
' Showpage=SearchPaging(rs,maxmessage,currentpage,Search)
if rs.RecordCount=0 then
response.write "<BR><BR>暂时为空!"
else %>
<table width="100%" cellpadding="2" cellspacing="1">
<tr bgcolor="#000000">
<td bgcolor=#EBEBEB colspan="2" class="tdTop">文件介绍</td>
<td bgcolor=#EBEBEB class="tdTop">大小</td>
<td bgcolor=#EBEBEB align=center class="tdTop">发布日期</td>
<td bgcolor=#EBEBEB align=right class="tdTop">下载次数</td>
<td bgcolor=#EBEBEB align=right class="tdTop"> </td>
</tr>
<% set fs=createobject("scripting.filesystemobject")
do while not rs.eof
%>
<tr>
<td align=center class="td1" width="60"><img src=../images/system.jpg width=32 border=1></td>
<td class="td1"><font color="#0033CC"><% =HtmlOut(rs("name")) %></font>
<br>简介:<%if len(rs("body"))>102 then%><%=HtmlOut(left(rs("body"),100))%>...<%else%><%=HtmlOut(rs("body"))%><%end if%>
</td>
<td class="td1">
<%
if fs.fileExists(server.mappath("./FILES/"&rs("url"))) then
set f=fs.getfile(server.mappath("./FILES/"&rs("url")))
if f.size<1024 then
response.write f.size&"Bytes"
elseif f.size<1048576 then
response.write Round(f.size/1024.1)&"KB"
else
response.write Round((f.size/1024)/1024.1)&"MB"
end if
else
response.write "文件不存在!"
end if %>
</td>
<td align=center class="td1"><%=HtmlOut(rs("SDate"))%></td>
<td align=right class="td1"><%=HtmlOut(rs("num"))%> 次</td>
<td align=right class="td1"> <%
set rs1=Server.CreateObject("ADODB.RecordSet")
sql="select * from tbioaInfoRead where newsid=" & news_id
rs1.open sql,oConn,1,1
do while not rs1.eof
response.write GetUserName(rs1("userid"))&"("&year(rs1("sdate"))&"-"&month(rs1("sdate"))&"-"&day(rs1("sdate"))&") "
rs1.movenext
loop
%></td>
</tr>
<tr>
<td colspan=3></td>
<td colspan=3 align="right">
<img src=../images/icon_show.gif align="absmiddle" border=0 alt=>
<a href=display.asp?id=<% =rs("id") %> target="_blank">查看</a>
<img src=../images/icon_close.gif align="absmiddle" border=0 alt=>
<a href=download.asp?id=<% =rs("id") %>>下载</a>
<%if manageAuth or returnqx("0402") then%>
<img src=../images/icon_edit.gif align="absmiddle" border=0 alt=>
<a href="file_edit.asp?id=<%=rs("id")%>&typeid=<%=rs("typeid")%>&page=<%=currentpage%>&Name=<%=SearchName%>">编辑</a>
<img src=../images/icon_dele.gif align="absmiddle" border=0 alt=>
<a href="file_del.asp?id=<%=rs("id")%>&typeid=<%=rs("typeid")%>&page=<%=currentpage%>&Name=<%=SearchName%>" onclick="return window.confirm('你确定要删除该文件吗?');">删除</a>
<%end if%>
</td>
</tr>
<tr>
<td class="tdTop" colspan="6"></td>
</tr>
<%
rs.MoveNext
loop
%>
</table>
<%
end if
rs.close
set rs=nothing
end if
end if
rsdir.close
set rsdir=nothing%>
</body>
</html>
<%'释放对象变量
oConn.close
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -