<%@ Page CodeBehind="admin_ly.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="Typhoto.admin_ly" %>
<%@ Register TagPrefix="webdiyer" Namespace="Wuqi.Webdiyer" Assembly="AspNetPager" %>
<%@ Import namespace="System.Data"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<script type="text/javascript" src="../js/calendar.js"></script>
		<script language="javascript">
   var CalendarWebControl = new atCalendarControl();
		</script>
		<link href="img/main.css" rel="stylesheet" type="text/css">
			<style type="text/css">		
		.style5 { BORDER-RIGHT: 0px; BORDER-TOP: 0px; BACKGROUND: #e4f6ff; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px }		
		.STYLE6 { BACKGROUND: #ffffff }		
		.hf { FONT-WEIGHT: bold; COLOR: blue }		
		</style>
	</HEAD>
	<body>
		<script language="javascript">
function checkAll()
{
	var objID;
	objID=document.forms[0].elements;
	for (var i=1 ;i<objID.length-3;i++)
	{
		objID[i].checked=true;
		AddRemoveValues(objID[i]);
	}
}
function uncheckAll()
{
	var objID;
	objID=document.forms[0].elements;
	for (var i=1 ;i<objID.length-3;i++)
	{
		objID[i].checked=false;
		AddRemoveValues(objID[i]); 
	}
}
function AddRemoveValues(oChk) { 
if(oChk.checked)
document.Form1.HdnSelectedValues.value += "," + oChk.value; 
else
document.Form1.HdnSelectedValues.value = document.Form1.HdnSelectedValues.value.replace("," + oChk.value,""); 
}
		</script>
		<form name="Form1" method="post" id="Form1" runat="server">
			<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" id="brb"
				height="27">
				<tr>
					<td colSpan="3" class="td_title">
						<asp:Label id="type" runat="server"></asp:Label>留言管理</td>
				</tr>
				<tr bgcolor="#ffffff" class="page">
					<td colspan="2" align="right" class="page">
						<div align="center">
							<table width="100%" border="0" class="page">
								<tr class="page">
									<td colSpan="2" class="page"><div align="center">
											<asp:datalist id="DataList" runat="server" CellPadding="0" Width="100%">
												<ItemTemplate>
													<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#dfecff"
														class="page">
														<tr bgcolor="#E4F6FF" class="page">
															<td width="612" height="20" class="style5"><INPUT id=chkSelect onclick=AddRemoveValues(this) type=checkbox value='<%#((DataRowView)Container.DataItem)["id"]%>' name=chkSelect runat="server">
																<%# ((DataRowView)Container.DataItem)["ly_user"]%>
																[
																<%# DataBinder.Eval(Container.DataItem, "ly_time","{0:d}")%>
																]
															</td>
															<td width="105" class="style5"><div align="center">
																	<%if (Request["type"]==null) {%>
																	<%# Mark(DataBinder.Eval(Container, "DataItem.mark").ToString()) %>
																	<%}%>
																</div>
															</td>
															<td width="88" class="style5"><div align="center"><%if (Request["type"]==null) {%>
																	<asp:HyperLink id="Hyperlink3" Target="_blank" runat="server" Text='回复' NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "ID","../User_Ly_Reply.aspx?ID={0}") %>'>
																	</asp:HyperLink><%}%></div>
															</td>
															<td width="93" class="style5"><div align="center">
																	<asp:HyperLink id="Hyperlink2" runat="server" Target=_blank Text='<%#((DataRowView)Container.DataItem)["username"]%>' NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "username","admin_edituser.aspx?username={0}") %>'>
																	</asp:HyperLink></div>
															</td>
															<td width="75" class="style5"><div align="center"><%if (Request["type"]==null) {%>
																	<asp:HyperLink id="Hyperlink4" Target="_blank" runat="server" Text='编辑' NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "ID","admin_ly_edit.aspx?ID={0}") %>'>
																	</asp:HyperLink><%}%></div>
															</td>
															<td width="75" class="style5"><div align="center">
																	<a href="admin_ly.aspx?id=<%# DataBinder.Eval(Container.DataItem, "id")%><%if (Request["type"]!=null) Response.Write("&type=1");%>">删除</a></div>
															</td>
														</tr>
														<tr class="page">
															<td height="20" colspan="6" class="style6"><%# ShowContent(DataBinder.Eval(Container.DataItem, "ly_content").ToString())%>
																<span class="hf">
																	<%# ShowReply(DataBinder.Eval(Container.DataItem, "ly_reply").ToString())%>
																</span></td>
														</tr>
													</table>
												</ItemTemplate>
											</asp:datalist><webdiyer:aspnetpager id="Pager" runat="server" HorizontalAlign="Right" AlwaysShow="True" ShowCustomInfoSection="Left"
												NumericButtonCount="15" ShowBoxThreshold="21" PageSize="20" FirstPageText="<font face=webdings>9</font>" PrevPageText="<font face=webdings>3</font>"
												NextPageText="<font face=webdings>4</font>" LastPageText="<font face=webdings>:</font>" Height="20px" CssClass="page" onpagechanged="Pager_PageChanged"></webdiyer:aspnetpager>
											<p align="left"><a href="#" onClick="checkAll()"> 全选</a> <a href="#" onClick="uncheckAll()">
													全不选</a> 操作选中留言：
												<span class="forumrow">
													<span class="px14">
														<asp:Button ID="Submit1" runat="server" Width="70px" class="formbutton" Text="删除留言" onclick="Submit1_Click"></asp:Button>&nbsp;<asp:Button class="formbutton" id="Button2" runat="server" Width="70px" Text="审核留言" onclick="Button2_Click"></asp:Button>&nbsp;<asp:Button class="formbutton" id="Button3" runat="server" Width="70px" Text="取消审核" onclick="Button3_Click"></asp:Button>
														<INPUT type="hidden" id="HdnSelectedValues" name="HdnSelectedValues" runat="server">
													</span>
												</span>
											</p>
										</div>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
				<tr class="tableHeadLeft">
					<td colspan="2" align="right"><div align="center"><strong>搜索： </strong>用户： <input name="username" type="text" size="10" id="username" class="tableTdtext" runat="server">
							从： <input name="time1" type="text" size="10" id="time1" class="tableTdtext" onClick="CalendarWebControl.show(this,this.value);"
								runat="server"> 至 <input name="time2" type="text" size="10" id="time2" class="tableTdtext" onClick="CalendarWebControl.show(this,this.value);"
								runat="server">
							<asp:Button id="Button1" runat="server" Width="70px" class="formbutton" Text="列出" onclick="Button1_Click"></asp:Button>
							<span class="forumrow">
								<span class="px14"></span>
							</span>
						</div>
					</td>
				</tr>
			</table>
		</form>
	</body>
</HTML>
