⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.asp

📁 建造工业系统所需的SQL源代码
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Conn/Conn.asp"-->
<%
If Session("UserName")<>"" Then
	UStatus=""
	Set rs=Server.CreateObject("ADODB.RecordSet")
	SQL="Select * From tb_User Where UserName='"&Session("UserName")&"'"
	rs.Open SQL,Conn,1,3	
	If rs.Eof and rs.Bof Then
		Session("UserName")=""
		UStatus=""
	Else
		If rs("Status")="版主" Then 	UStatus="版主" End If
	End If
End If
'在显示留言信息时,应用了视图view_Board,该视图中涉及了表tb_User、tb_Topic、tb_Reply
If Request.Form("key")="" Then
	Qfield=Request.QueryString("field")
	QKey=Request.QueryString("Key")
	If Qfield="" and QKey="" Then
		Set rs=Server.CreateObject("ADODB.RecordSet")
		SQL="Select * From view_Board Order By CreateTime DESC"
		rs.Open SQL,Conn,1,3
	Else
		Set rs=Server.CreateObject("ADODB.RecordSet")
		SQL="Select * From view_Board Where "&Qfield&" like '%"&QKey&"%' Order By CreateTime DESC"
		rs.Open SQL,Conn,1,3
	End If
Else
	Qfield=Request.Form("field")
	QKey=Request.Form("key")
	Set rs=Server.CreateObject("ADODB.RecordSet")
	SQL="Select * From view_Board Where "&Qfield&" like '%"&QKey&"%' Order By CreateTime DESC"
	rs.Open SQL,Conn,1,3
End If
%>
<html>
<head>
<title>明日留言簿首页!</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="./Css/style.css" rel="stylesheet">
<script src="JS/function.asp"></script>
</head>
<body onLoad="clockon()">
<%'转换UBB代码
Function UBBCodeDeal(InString)
	InString1=Server.HTMLEncode(InString)
	InString1=Replace(InString1,"[","<")
	InString1=Replace(InString1,chr(13),"<BR>")
	UBBCodeDeal=Replace(InString1,"]",">")
End Function
%> 
<DIV id=toolTipLayer style="VISIBILITY: hidden; POSITION: absolute"></DIV>
<SCRIPT language=JavaScript>initToolTips(); </SCRIPT>
<table width="777" height="341"  border="0" align="center" cellpadding="-2" cellspacing="-2">
  <tr>
    <td valign="top"><table width="100%" height="47"  border="0" cellpadding="-2" cellspacing="-2" class="tableBorder">
      <tr bgcolor="#9CA6C6">
        <td height="8"></td>
        </tr>
      <tr>
        <td></td>
        </tr>
      <tr>
        <td height="2"></td>
      </tr>
      <tr>
        <td valign="top"><!--#include file="Navigate.asp"-->
      <table width="100%" height="205"  border="0" cellpadding="-2" cellspacing="-2" class="tableBorder">
        <tr>
          <td width="13" height="32" background="Images/board_left.gif">&nbsp;</td>
          <td width="689" background="Images/board_left.gif" style="color:#FFFFFF"> ≡ 最新留言


 ≡ </td>
          <td width="73" background="Images/board_right.gif">&nbsp;</td>
        </tr>
        <tr valign="top">
          <td height="171" colspan="3"><table width="100%" height="129"  border="0" cellpadding="-2" cellspacing="-2">
            <tr>
              <td valign="top" align="center">
			  <%
			  If rs.Eof and rs.Bof Then
				Qfield=Request.Form("field")
				QKey=Request.Form("key")	
				If Qfield="UserName" Then
					Sfield="按“用户名”查询 &nbsp;"
				Else
					Sfield="按“留言内容”查询 &nbsp;"
				End If		  
			  	If QKey="" Then
					Response.Write("<br>暂无留言!")
			  	Else %>
					<table width="100%" height="152"  border="0" cellpadding="-2" cellspacing="-2">
                      <tr>
                        <td width="15%" rowspan="2" align="center"><img src="Images/clue.gif" width="32" height="32"></td>
                        <td width="82%" height="84"><%=Sfield%><br>                        <br>查询关键字:" <%=Request.Form("key")%> "</td>
                        <td width="3%" rowspan="3">&nbsp;</td>
                      </tr>
                      <tr>
                        <td height="34" style="color:#660033 ">很报歉!没有找到任何您要查询的信息,请您用其他关键字再试一次!</td>
                      </tr>
                      <tr>
                        <td height="34" colspan="2" align="center"><div align="center">[ <a href="index.asp">返回留言簿首页</a> ]</div></td>
                      </tr>
                    </table>
					<% End If
			  Else
			'分页显示类别列表
			rs.pagesize=2
			page=CLng(Request("page"))
			if page<1 then page=1
			rs.absolutepage=page
			for i=1 to rs.pagesize
			  %>			  <table width="100%" height="109"  border="0" cellpadding="-2" cellspacing="-2" class="tableBorder_Top">
			  <tr>
			  <td height="5"></td>
			  </tr>
                <tr>
                  <td width="136" valign="top"><div align="center"><br>
				<%'获取用户信息
				ID=rs("ID")
				UserName=rs("UserName")
				Email=rs("Email")
				homepage=rs("homepage")
				QQ=rs("QQ")
				CreateTime=rs("CreateTime")
				Sex=rs("sex")
				ICO=rs("ICO")
				IP=rs("IP")
				Reply_Content=rs("Reply_Content")
				Reply_CreateTime=rs("Reply_CreateTime")
				%>
                     <%=UserName%></p>
                   <img src="Images/head/<%=ICO%>" width="60" height="60" onmouseover="toolTip('<%=UserName %>', '<%=Email%>', '<%=homepage%>', '<%=QQ%>', '<%=IP%>', '<%=CreateTime%>');" 
      onmouseout=toolTip(); border=0><br>
                    我是:<%=Sex%>生<br>
                      心情:<img src="Images/Face/<%=rs("face")%>" width="20" height="20"> <br><br>
</div></td>
                  <td width="1" background="Images/line.gif"></td>
                  <td width="666" valign="top"><table width="100%"  border="0" cellspacing="-2" cellpadding="-2">
				  <script language="javascript">
				  	function del(ID){
					if(confirm("真的要删除该条留言吗?")){
						window.location.href="Topic_del.asp?TopicID="+ID;
					 }
					}
				  </script>
                    <tr>
                      <td width="80%" height="30"> &nbsp;<img src="Images/email.gif" alt="<%=UserName%>的Email是:<%=Email%>" width="16" height="16">Email&nbsp; <img src="Images/home.gif" alt="<%=UserName%>的个人主页是:<%=homepage%>" width="16" height="16">个人主页&nbsp; <img src="Images/oicq.gif" alt="<%=UserName%>的QQ号码是:<%=QQ%>" width="16" height="16">QQ&nbsp; <img src="Images/ip.gif" alt="IP为:<%=rs("IP")%>" width="16" height="15">IP地址&nbsp; <img src="Images/time.gif" width="16" height="16">发表时间:<%=CreateTime%></td>
                      <td width="20%"><% If UStatus="版主" Then%><a href="#" onClick="del(<%=ID%>)">
					  <img src="Images/del.gif" width="22" height="22" border="0"> 删除</a><%End If%>&nbsp; 
					  <%
					  If IsNull(Reply_Content) and UStatus="版主" Then%>
					  <a href="Reply.asp?TopicID=<%=ID%>"><img src="Images/reply.gif" width="15" height="15" border="0">回复</a>
					  <%End If%></td>
                    </tr>
                    <tr>
                      <td colspan="2"><hr align=left width="92%" size=1 noshade></td>
                    </tr>
<tr>
<%Content=rs("Content")%>
  <td colspan="2" style="padding-left:10px"><%=UBBCodeDeal(Content)%></td>
</tr>
                  </table></td>
                </tr>
				<%
				If Reply_Content<>"" Then
				%>
                <tr>
                  <td valign="top"><div align="center">
                    <hr align=right width="90%" noshade size=1> 
                    </div></td>
                  <td background="Images/line.gif"></td>
                  <td><hr align=left width="95%" size=1 noshade></td>
                </tr>
                <tr>
                  <td valign="top"><div align="center">版主回复<br>
                        <%=Reply_CreateTime%></div></td>
                  <td background="Images/line.gif"></td>
                  <td style="padding-left:10px; color:#333366"><%=Reply_Content%></td>
                </tr>
				<tr>
				<td height="5"></td>
				</tr>
				<%End If%>
              </table>
			  <%
			  rs.MoveNext
			  If rs.Eof Then exit For 
			  Next
			  End If%>			   </td>
            </tr>
          </table>
		  </td>
        </tr>
      </table>
<table width="100%" height="25"  border="0" cellpadding="-2" cellspacing="-2">
  <tr>
    <td width="42%" valign="bottom"><form name="form1" method="post" action="index.asp">
      <table width="100%"  border="0" cellspacing="-2" cellpadding="-2">
        <tr>
          <td height="27">搜索:
            <input name="field" type="radio" class="noborder" value="Content" checked>
按内容
<input name="field" type="radio" class="noborder" value="UserName">
按用户名
<input name="key" type="text" class="txt_grey" id="key"></td>
        </tr>
      </table>
    </form></td>
	<%If not(rs.Eof and rs.Bof) Then%>	
    <td width="31%" align="right">
	      		<% if page<>1 then %><a href=?page=1&field=<%=Qfield%>&key=<%=Qkey%> class="white">第一页</a>
				<a href=?page=<%=(page-1)%>&field=<%=Qfield%>&key=<%=Qkey%> class="white">上一页</a> 
			<%end if 
			if page<>rs.pagecount then %>
   				<a href=?page=<%=(page+1)%>&field=<%=Qfield%>&key=<%=Qkey%> class="white">下一页</a> 
				<a href=?page=<%=rs.pagecount%>&field=<%=Qfield%>&key=<%=Qkey%> class="white">最后一页</a> 
		  <%end if%>
	</td>
    <td width="27%" align="right" class="word_grey">[<%=page%>/<%=rs.PageCount%>]&nbsp;&nbsp;每页<%=rs.PageSize%>条&nbsp;&nbsp;共<%=rs.RecordCount%>条留言</td>
		<%End If   
	%>	
  </tr>
</table>    </td>
  </tr>
</table>
<table width="777" height="77" border="0" align="center" cellpadding="-2" cellspacing="-2">
  <tr>
    <td align="center" style="color:#666666 ">
	<hr size="1">
	本站请用IE5.0或以上版本浏览,1024*768为最佳效果<br>
    CopyRight &copy; 2005 长春市明日实业有限公司</td>
  </tr>
</table>
</body>
</html>
<%
rs.close()
Set rs=Nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -