<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE>周公解梦列表,查实用查询</TITLE>
<link href="images/css.css" type=text/css rel=stylesheet>
</head>
<body><SCRIPT language=javascript>
<!--
function valid_checkdream(){
if(  document.form1.word.value.length==""  )
{window.alert("对不起，请输入梦的关键字！");
document.form1.word.focus();
return false;
} ;
if(  document.form1.word.value.length>20  )
{window.alert("对不起，请将描述控制在20个字以内！");
document.form1.word.focus();
return false;
} ;
win = window.open('','dream',);
form1.submit();
return ;
}
//-->
</SCRIPT>
<!--#include file="conn.asp"-->  
<!--#include file="function.asp"-->
<div id="center">
<div style="width:100%">
<table width="100%" border="0" align="center" cellspacing="0" cellpadding="0" class="b1" style="table-layout:fixed;word-wrap:break-word;">
<%
     MaxPerPage=3
   if not isempty(request("page")) then 
      currentPage=cint(request("page")) 
   else 
      currentPage=1 
   end if 
   set rs=server.createobject("adodb.recordset")
if request("act")=1 then
cxgjz="title"
elseif request("act")=2 then
cxgjz="content"
end if
sql="select * from zgjm where "&cxgjz&" like '%"& request("word") &"%'"
rs.open sql,conn,1,1
if rs.eof then
response.write("<script>alert('没有找到相关解梦内容');window.close()</script>")
response.end
else
allshu=rs.recordcount
rs.pagesize=MaxPerPage 
mpage=rs.pagecount     
rs.move  (currentPage-1)*MaxPerPage
%>
  <tr>
    <td height='25' bgcolor="#FFFFFF"><a href="http://www.9qu.org/">9qu.org</a> &gt; <a href="http://www.9qu.org">网络花园</a></td>
	<td align="right">共找到<FONT COLOR="#FF0000"><%=allshu%></FONT>个解梦结果，分为<font color="#FF0000"><%=mpage%></font>页，目前是第<font color="#FF0000"><%=currentPage%></font>页</TD></td>
  </tr>
</table>

  <table width="100%" border="0" align="center" cellspacing="0" cellpadding="0" class="b1" style="table-layout:fixed;word-wrap:break-word;">
<tbody>
<form method="post" action="jm.asp" name="form1" onSubmit="return valid_checkdream()" target="dream">
<input type="hidden" name="act" value="ok" />
  <tr>
    <td colspan="2" class="new">
请输入做梦内容的关键字 ：<input name="word" type="text" id="word" size="20" onKeyUp="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" maxLength="20">
<select size="1" name="act">
<option selected="" value="1">简明</option>
<option value="2">详细</option>
</select>  <input type="submit" name="Submit1" value="开始解梦" style="cursor:hand;">
    </form></td>
    </tr>
</tbody>
</table>
<table width="100%" border="0" align="center" cellspacing="0" cellpadding="0" class="b1" style="table-layout:fixed;word-wrap:break-word;">
 <tbody><%i=0
do while not rs.eof
  i=i+1 
jmlb=rs("jmlb")
		 set rs2=server.createobject("adodb.recordset")
sql2="select * from jmlb where id="&jmlb
rs2.open sql2,conn,1,3%>
<tr><td style="line-height:200%">
<font color="green">［<%=i%>.<%=rs2("jmlb")%>］</font> <font color="red">（<%=rs("title")%>）</font><br />
<%word=request("word")
content=rs("content")
%>
<%=replace(content,word,"<font color=red>"&word&"</font>")%>
</td></tr>  <%
 
if i>=MaxPerPage then exit do
 rs.movenext
 loop 
   end if
%>
</tbody></table>
</div>
<!--分页开始-->
<div align="center">
<script>
PageCount=<%=mpage%> //总页数
topage=<%=currentPage%>   //当前停留页
if (topage>1){document.write("<a href='?Act=<%=request("act")%>&page<%=request("word")%>=0' title='上一页'>上一页</a>");}
for (var i=1; i <= PageCount; i++) {
if (i <= topage+6 && i >= topage-6 || i==1 || i==PageCount){
if (i > topage+7 || i < topage-5 && i!=1 && i!=2 ){document.write(" ... ");}
if (topage==i){document.write("<font color=#d2d0d0> "+ i +" </font>");}
else{
document.write(" <a href='?Act=<%=request("act")%>&page<%=request("word")%>="+i+"'>["+ i +"]</a> ");
}
}
}
if (PageCount-topage>=1){document.write("<a href='?Act=<%=request("act")%>&page<%=request("word")%>=2' title='下一页'>下一页</a>");}
  </script>
</div>
<!--分页结束-->
</TD></TR>
</TBODY>
</table>
</div>
</div>
<table height="35" width="760" border="0" align="center" cellpadding="0" cellspacing="0">  
  <tr>
    <td align="center">Copyright &copy; <a href="http://www.9qu.org/">9qu.org</a> Some Rights Reserved</td>
  </tr>
</table>
</body></html>
