<%@Page Language="C#" Inherits="IWMS.Pages.Search" EnableSessionState="false" EnableViewState="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<!--#include file="inc/html_head.inc"-->
</head>
<body>

<!--#include file="head.inc" -->
<div id="navbar">
<div class="l"></div>
<div class="r"></div>
<div class="m">
	<!--#include file="inc/navclass.inc"-->
</div>
</div>

<div id="navsub">
<div class="l"></div>
<div class="r"></div>
<div class="m">

</div>
</div>

<div id="middle">
<div class="<%=GetFrameCss(style.CssSearch,"mframe")%>">
<div class="tl"></div>
<div class="tr"></div>
<div class="tm">
	<span class="tt"><asp:Literal id="ltTitle" runat="server"/></span>
</div>
<div class="wrapper">
<div class="ml"></div>
<div class="mr"></div>
<div class="mm">
	<asp:PlaceHolder id="phForm" runat="server">
	<script type="text/javascript" src="inc/calendarDateInput.js"></script>
	<script type="text/javascript">
		function dispTime(disp)
		{
			document.getElementById("trTime").style.display=disp ? "" : "none";
		}
	</script>
		<form method="get" action="">
		<table width="100%" cellpadding="4">
			<tr><td>
				关键字：
			</td><td>
				<input type="text" name="keyword" size="20" maxlength="50"/>
				<span class="gray" style="line-height:150%">(支持"AND"逻辑搜索)</span>
			</td></tr>
			<tr>	<td width="100">
			搜索内容：
			</td><td>
				<%if (config.SearchCol.IndexOf("title")>=0){%>
				<input type="radio" name="where" value="title" onclick="dispTime(true)" checked="checked"/>
				标题
				<%}%>
				<%if (config.SearchCol.IndexOf("content")>=0){%>
				<input type="radio" name="where" value="content" onclick="dispTime(true)"/>
				内容
				<%}%>
				<%if (config.SearchCol.IndexOf("author")>=0){%>
				<input type="radio" name="where" value="author" onclick="dispTime(false)"/>
				作者
				<%}%>
			</td></tr>
			<tr><td valign="top">
				搜索分类：
			</td><td>
				<%=classSelect%>
			</td></tr>
			<tr id="trTime"><td>
				日期范围：
			</td><td>
				从
				<input type="text" size="10" name="sdate"/>
				<script type="text/javascript">
				DateInput('sdate', 'YYYY-MM-DD', '<%=DateTime.Now.AddYears(-1).ToString("yyyy-MM-dd")%>');
				</script>
				&nbsp;到
				<input type="text" size="10" name="edate"/>
				<script type="text/javascript">
				DateInput('edate', 'YYYY-MM-DD', '<%=DateTime.Now.AddDays(1).ToString("yyyy-MM-dd")%>');
				</script>
			</td></tr>
			<tr><td>
			</td><td>
				<button type="submit">&nbsp;搜索&nbsp;</button>
			</td></tr>
		</table>
		</form>
	</asp:PlaceHolder>
	<asp:PlaceHolder id="phResult" runat="server">
		<asp:Repeater id="rpList" runat="server">
			<ItemTemplate>
			<div class="sResult">
				<div class="title"><a href="<%#Eval("aurl")%>" class="nLink" target="_blank"><%#TitleRedKey((string)Eval("title"),"red")%></a></div>
				<div class="sum"><%#Eval("summary")%></div>
				<div class="foot">
				<span><%#new Uri(Request.Url, Eval("aurl").ToString())%></span>日期：<span><%#Eval("dateandtime")%></span>
				</div>
			</div>
			</ItemTemplate>
		</asp:Repeater>
		<asp:Repeater id="rpPost" runat="server">
			<ItemTemplate>
			<div class="sResult">
				<div class="title"><a href="<%#GetUrlThread((int)Eval("id"))%>" class="nLink" target="_blank"><%#TitleRedKey((string)Eval("title"),"red")%></a></div>
				<div class="foot">
				<span><%#new Uri(Request.Url, GetUrlThread((int)Eval("id")))%></span>
				分类：<span><%#(int)Eval("sortId")>0 ? "<a href=\""+ GetUrlPosts((int)Eval("sortid")) +"\" target=\"_blank\">"+ Eval("sortName") +"</a>" : ""%></span>
				作者：<span><%#Eval("userName")!=DBNull.Value ? "<a href=\"memberProfile.aspx?id="+ Eval("memberid") +"\"target=\"_blank\">"+ Eval("userName") +"</a>" : "游客"%></span>
				日期：<span><%#Eval("postDate")%></span>
				</div>
			</div>
			</ItemTemplate>
		</asp:Repeater>
		<div style="text-align:center;padding:10px"><asp:Literal id="ltPage" runat="server"/></div>
	</asp:PlaceHolder>	
</div>
</div>
<div class="bl"></div>
<div class="br"></div>
<div class="bm"></div>
</div>
</div>

<!--#include file="foot.inc" -->
</body>
</html>