<!--#include file=conn.asp-->
<!--#include file="function.asp"-->
<!--#include file="config.asp"-->
<!--#include file="md5.asp"-->
<%
if gx=1 then
if not IsNumeric(request("id")) or request("id")="" then
		Response.Write ("<script>alert('友情提示!\n\参数错误!');history.back();</script>")
		Response.end
	end if
%>
<%if request("id")<>"" then
	id=CLNG(request("id"))
	end if
	rs.open"select * from Share where id="&id,conn,1,1
	if rs.eof then
	Response.Write ("<script>alert('友情提示!\n\参数错误!');history.back();</script>")
	Response.end
	else
	rs2.open"select * from assort where id="&rs("flid")&"",conn,1,1
	shuxing=rs2("shuxing")
	topic2=rs2("topic")
	rs2.close
	rs2.open"select * from class where id="&shuxing&"",conn,1,1
	topic0=rs2("topic")
	id0=rs2("id")
	rs2.close
	rs2.open"select * from person where name='"&rs("upuser")&"'",conn,1,1
	touxian=rs2("touxian")
	rs2.close
	%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=rs("ftitle")%>_<%=webname%></title>
<style type="text/css">
<!--
a.f12og:link{color:#ff6600}
a.f12og:visited{color:#ff6600}
-->
</style>
<link href="iknow.css" rel="stylesheet" type="text/css">
</head>
<body class="bgbdy" topmargin="0">
<!--#include file=top.asp-->
<center>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
<tr> 
<td height="25" nowrap><a href="<%=weburl%>"><%=webname%></a> &gt; <a href=share.asp>共享资料</a> &gt; <a href=share.asp?id=<%=rs("flid")%>><%=topic2%></a></td>                                                                                                                                                          
</tr>
</table>
<div id="cDiv"><table border="0" align="right" cellpadding="0" cellspacing="0">
<tr><td width="170" valign="top" class="padL12">
 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="magBtm12">
<tr> 
<td class="bgtle" nowrap><%if session("person")<>"" then%>用户信息<%else%>用户登录<%end if%></td>
</tr>
<tr> 
 <td class="bgcntBor3">
 <%if request("login")="登录" then
 jiance=request("name")
if InStr(jiance,"or")<>0 or InStr(jiance,"'")<>0 or InStr(jiance,"`")<>0 or InStr(jiance,"=")<>0 or InStr(jiance,"-")<>0 or InStr(jiance,",")<>0 or InStr(jiance,"and")<>0 then 
Response.Write "<script language=JavaScript>{alert('用户名非法！');history.back();}</script>"
Response.End 
end if
		if not IsNumeric(request("verifycode")) then
		Response.Write ("<script>alert('友情提示!\n\n验证编码必须是数字!');history.back();</script>")
		Response.end
	end if
	if (int(session("SafeCode"))<>int(request("verifycode"))) then
		Response.Write ("<script>alert('友情提示!\n\n验证编码输入错误!');history.back();</script>")
		Response.end
	end if
	  if request("name")="" then
	  response.write"<script>alert('用户名不能为空!');history.back();</script>"
	  elseif request("pwd")="" then
	  response.write"<script>alert('密码不能为空!');history.back();</script>"
	  else
	  name=request("name")
	  pwd=request("pwd")
	  rs2.open"select * from person where name='"&name&"' and pwd='"&md5(pwd)&"'",conn,1,1
	  if rs2.eof then
	  response.write"<script>alert('用户名或密码错误!');history.back();</script>"
	  else
	  rs3.open"select * from person where name='"&name&"'",conn,1,3
	  rs3("logintime")=now
	  rs3.update
	  rs3.close
	  session("person")=name
	  %>
	  <%end if
	  rs2.close
	  end if
	  end if%>
	  
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="zhtable"><%if session("person")<>"" then%>
              <tr> 
                <td  class="f14">您好：<%=session("person")%> </td>
              </tr>
              <tr> 
                <td><%rs2.open"select * from person where name='"&session("person")&"'",conn,1,1%> 
                  <a href="help.asp#n5" target=_blank><%=rs2("touxian")%></a> ( <%=rs2("jifen")%> )</td>                                                                                                                                       
              </tr>
      </table>
<table cellSpacing=0 cellPadding=0 width="100%" border=0>
  <tr>
    <td height=22>&#8226; <a href="user.asp?lei=mywen" target=_blank>我的提问</a></td>                                                                                                                                       
    <td>&#8226; <a href="user.asp" target=_blank>个人中心</a></TD>                                                                                                                                       
  </tr>
  <tr>
    <td>&#8226; <a href="user.asp?lei=myda" target=_blank>我的回答</a></td>                                                                                                                                       
    <td>&#8226; <a href="exit.asp">退出</a><%rs2.close%></td>                                                                                                                                  
  </tr>
  <%end if%><%if session("person")="" then%><tr><form method=post action=Sharev.asp?id=<%=id%>><td align="center" valign="top">
	<p>用&nbsp;&nbsp;&nbsp;&nbsp;户: <input name="name" type="text" id="name" size="12"><br>密&nbsp;&nbsp;&nbsp;&nbsp;码: <input name="pwd" type="password" id="pwd" size="12"><br>验证码:<input type="text" size=3 maxlength=4 name=verifycode> <%Call GetSafeCode%><br><FONT color=#666666>(请输入图中数字)</FONT><br><input name="login" type="submit" id="login" value="登录">&nbsp;&nbsp;                                                                                                                             
    <a href="reg.asp">注册</a>
</td></form><%end if%></tr>
</table>

                </table>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
                    <td width="100%" height="14">

                        <table border="0" width="100%" cellspacing="0" cellpadding="0">
                          <tr>
<td class="bgtle" nowrap>本类共享资料</td>
                          </tr>
                          <tr>
 <td class="bgcntBor3">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%">
      <table class="zhtable" cellSpacing="0" cellPadding="0" width="152" border="0">
        <tbody>
        <%rs3.open"select top 5 * from Share where flid="&rs("flid")&"",conn,1,1
        if rs3.eof then%>本类暂时没有共享资料
        <%rs3.close
        else
        while NOT rs3.EOF
        %>
          <tr>
            <td class="ln23"><a href=sharev.asp?id=<%=rs3("id")%> target=_blank><%=rs3("ftitle")%></a></td>
          </tr>
          <%rs3.movenext 
          wend
          rs3.close
          end if%>
        </tbody>
      </table>
      <a class=lmore href=share.asp?id=<%=rs("flid")%> target=_blank>更多&gt;&gt;</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="userupfile.asp" target="_blank">我要上传</a></td>
  </tr>
</table>
</td>
</tr>
                          <tr>
                            <td width="100%" height="15"></td>
                          </tr>
                        </table>
                    </td>
                  </tr>
</table>


<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> <td class="bgcntBor4"><%rs2.open"select top 5 * from gonggao where flid=3 order by time desc",conn,1,1
                  if rs2.eof then%>暂时没有公告<%else
	  while not rs2.eof
	  %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=rs2("text")%><hr size="1" color="#999999">
<%rs2.movenext
	  wend
	  end if
	  rs2.close%>
</td>
</tr></table>
</td></tr></table>

<table width="588" border="0" cellpadding="0" cellspacing="0">
<tr> 
<td class="bgtle" nowrap>共享资料</td>
</tr>
<tr><td class="bgcntBor3">
<%
if rs("lei")="doc" then
geshi="<img border=0 src=img/doc_icon.gif> [Word]"
elseif rs("lei")="xls" then
geshi="<img border=0 src=img/excel_icon.gif> [Excel]"
elseif rs("lei")="txt" then
geshi="<img border=0 src=img/txt_icon.gif> [Txt]"
elseif rs("lei")="zip" then
geshi="<img border=0 src=img/zip_icon.gif> [Zip]"
elseif rs("lei")="rar" then
geshi="<img border=0 src=img/rar_icon.gif> [Rar]"
end if
%>
	<table width="100%" border="0" cellspacing="0" cellpadding="0" class=zhtable>
               <tr> 
               	<td  class="f14B"><%=rs("ftitle")%></td>          
             </tr>
              <tr>
                <td  valign="top"><span class="f12rd">文件格式：<%=geshi%></span> - <span class="f12rd">文件大小：<%=rs("b")%>字节</span> - <span class="f12rd">下载所须积分：<%=rs("fen")%>分</span> - <span class="f12gy">下载次数：<%=rs("xia")%></span></td>                                                                                                                                                                                                     
              </tr>
              <tr> 
                <td class="f14"><%=ubb(rs("text"))%></td>             
              </tr>
              <td align="right" class="f12gy">发布者：<a href=showperson.asp?name=<%=rs("upuser")%> target=_blank><%=rs("upuser")%></a> - <a href="help.asp#n5" target=_blank><%=touxian%></a> - <span class="f12gy">上传时间：<%=rs("uptime")%>
              <tr> 
                <td class="f14"><img border="0" src="img/download_icon.gif">  <a href="down.asp?id=<%=id%>" target="_blank">点这里可以下载</a></td>             
              </tr>
              <tr> 
                <td class="f14">下载声明：<br>· 本服务的所有资料文件是其作者提供和网友推荐收集整理的，如有侵犯版权敬请指出。<br>· 所有资料文件的准确性、安全性和完整性未经验证，"<%=webname%>"不承担用户因使用这些下载内容而造成的任何形式的损失或伤害。</td>                        
              </tr>
<tr><td></td> </tr></table>
</td>
</tr>
</table>
<br>
<%   
  if request("submitping")="提交评论" then
	  if session("person")="" then
	  response.redirect "login.asp"
	  end if
	  if session("person")=rs("upuser") then
	  response.write"<script>alert('您不能对自己的答案进行评价!');history.back();</script>"
	  end if
	  if request("co")="" then
	  response.write"<script>alert('评论内容不能为空!');history.back();</script>"
	  else
	  ping=request("co")
	  rs3.open"select * from sharep where upid="&id&" and pinguser='"&session("person")&"'",conn,1,1
	  if not rs3.eof then
	  response.write"<script>alert('您已经发表过评论!');history.back();</script>"
	  rs3.close
	  else
	  rs3.close
	  rs3.open"select * from Sharep",conn,1,3
	  rs3.addnew
	  rs3("pinguser")=session("person")
	  rs3("ping")=ping
	  rs3("upid")=id
	  rs3("pingtime")=now
	  rs3.update
	  rs3.close
	  response.write"<script>alert('评论发表成功!');window.navigate('Sharev.asp?id="&id&"');</script>"	  
	  end if
	  end if
	  end if
%>
  <%                      
  rs1.open"select * from sharep where upid="&rs("id")&" order by pingtime desc",conn,1,1
  if not rs1.eof then
  %>
      <table width="588" border="0" cellpadding="0" cellspacing="0"  class=zhtable>
        <tr> 
          <td nowrap class="bgtle"> 对此资料的评论</td>
        </tr>
		<tr><td class="bgcntLn">
		<%
		  rs1.pagesize=10
		maxnum=rs1.recordcount
		maxpage=rs1.pagecount
		if request("p")="" then
		p=1
		else
		p=cint(request("p"))
		end if
		if p>maxpage then
		p=maxpage
		end if
		if p=0 then
		p=1
		end if
		if p<>1 then
		rs.move (p-1)*rs.pagesize
		end if
		for i=1 to rs1.pagesize
		 rs3.open"select * from person where name='"&rs1("pinguser")&"'",conn,1,1
	touxianp=rs3("touxian")
	rs3.close
		%>
<div class="f14"><%=ubb(rs1("ping"))%></div>
<div align="right"><span class="f12gy">评论者：</span>	<a href=showperson.asp?name=<%=rs1("pinguser")%> target=_blank><%=rs1("pinguser")%></a> - <a href="help.asp#n5" target=_blank><%=touxianp%></a> - <%=rs1("pingtime")%> </div>                                            
<div style="padding-top:5px;padding-bottom:5px;"><hr size="1" color="#999999"></div>
<%rs1.movenext
		if rs1.eof then exit for
		next%>
<div align=center class=f14>评论数:<font color=red><%=maxnum%></font> | 每页数:<font color=green><%=rs1.pagesize%></font> | 总页数:<font color=green><%=maxpage%></font> | 当前页:<font color=red><%=p%></font>                                                                                                                                                                                                       
		  <a href=share.asp?id=<%=id%>&p=1>首页</a>                                                                                                                                                                                                        
		  <a href=share.asp?id=<%=id%>&p=<%=p-1%>>上页</a>                                                                                                                                                                                                        
		  <a href=share.asp?id=<%=id%>&p=<%=p+1%>>下页</a>                                                                                                                                                                                                        
		  <a href=share.asp?id=<%=id%>&p=<%=maxpage%>>尾页</a></div><table width="588" border="0" cellspacing="0" cellpadding="0" >                
</table>
</td></tr>
</table>
<br>
<%
rs1.close
  end if
%>
<%                                       
rs3.open"select * from sharep where upid="&id&" and pinguser='"&session("person")&"'",conn,1,1
	  if rs3.eof then
	  if rs("upuser")<> session("person") then
%>
      <table width="588" border="0" cellpadding="0" cellspacing="0">
        <form action="Sharev.asp?id=<%=id%>" method="post" onSubmit = "return limitpl(this,'评论内容');">
<input type="hidden" name="id" value="<%=jiaid%>">
		<tr> 
          <td class="bgcntBor4"><table width="100%" border="0" cellpadding="0" cellspacing="0" >
              <tr valign="top"> 
                <td width="22%" nowrap class="f14">对此共享资料的评论:</td>
                <td width="78%"><textarea name="co" cols="50" rows="6"></textarea> 
                  <br>
                  评论字数200字以内 </td>
              </tr>
            </table>
            <br> <table width="100%" border="0" cellpadding="0" cellspacing="0" >
              <tr> 
                <td width="22%" class="f14">&nbsp;</td>
                <td width="78%"><input type="submit" name="submitping"  value="提交评论" class="bnsrh">
                </td>
              </tr>
            </table></td>
        </tr></form>
      </table>
<%
end if
end if
rs3.close
end if
rs.close
%>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0" style="clear:both;">  <tr>    <td height="30" align=center><!--#include file=end.asp--></td> 
  </tr>
</table>
</center>
</body>
</html>
<%
else
Response.Write ("<script>alert('对不起,共享资料功能未启用!');history.back();</script>")
		Response.end
	end if
%>
