<%@Page Language="C#" Inherits="IWMS.Admin.RemarkMan" MasterPageFile="admin.master"%>
<asp:Content ContentPlaceHolderId="cphHead" runat="server">
<%BtDelete.Attributes["onclick"] = "return confirm_batch_delete()";%>
	<script type="text/javascript" src="inc/remark.js"></script>
	<script type="text/javascript">
	<!--
	
	remark.maxSize=<%=config.RemarkSize%>;
	remark.minSize=<%=config.RemarkMinSize%>;
	remark.add=function(){};
	
	// 回复
	function reply(ele, rid, aid, atitle){
		iwms.vCode="<%=config.IwmsVcode%>";
		iwms.aId=aid;
		remark.disp(ele,rid);
	}
	
	-->
	</script>
	<style type="text/css">
	.pBody {border:1px solid #ccc;border-left:4px solid #ccc;color:#666;padding:2px;margin-bottom:2px}
	</style>
</asp:Content>


<asp:Content ContentPlaceHolderId="cphMain" runat="server">

	<div class="mframe">
	<div class="tl"></div>
	<div class="rt"></div>
	<div class="tm">
		<table width="98%" cellpadding="0" cellspacing="0"><tr>
			<td>
				<span class="tt">管理评论</span>
			</td><td align="right">
				<form action="" method="get">
				<input type="hidden" name="id" value="<%=articleid%>"/>
				<input type="text" size="15" name="keyword"/>
				<select name="where" >
					<option value="body">内容</option>
					<option value="username">作者</option>
				</select>
				<input type="submit" value="搜索"/>
				</form>
			</td>
		</tr></table>
	</div>
	<div class="wrapper">
	<div class="ml"></div>
	<div class="mr"></div>
	<div class="mm">
	<asp:Label id="myLabel" class="msgBar" EnableViewState="false" runat="server"/>
	<form id="myForm" runat="server">
		<ASP:DataGrid id="MyDataGrid" runat="server"
				Width="100%"
				align="center"
				ShowHeader="true"
				ShowFooter="false"
				OnEditCommand="MyDataGrid_Edit"
				OnCancelCommand="MyDataGrid_Cancel"
				OnUpdateCommand="MyDataGrid_Update"
				AutoGenerateColumns="false"
				DataKeyField="remarkid"
				CssClass="grid"
				BorderColor="#cccccc"
				HeaderStyle-CssClass="gridHead"
				ItemStyle-CssClass="tdbg"
				Style="word-break:break-all;"
				CellPadding="6"
				CellSpacing="0" >
			
			<Columns>
				<asp:EditCommandColumn
					ButtonType="LinkButton"
					EditText="修改"
					UpdateText="更改"
					CancelText="取消"
					>
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="60"/>
				</asp:EditCommandColumn>
				<asp:TemplateColumn
					>
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="30"/>
					<ItemTemplate>
						<a href="###" onclick='reply(this,<%#Eval("remarkid")%>,<%#Eval("articleid")%>, "<%#Eval("title").ToString().Replace("\"","&quot;")%>")'>回复</a>
					</ItemTemplate>
				</asp:TemplateColumn>
				<asp:TemplateColumn
					HeaderText="<input type=&quot;checkbox&quot; onclick=&quot;checkFormAll(this)&quot;/>"
					>
					<ItemTemplate>
						<asp:CheckBox id="chk" runat="server"/>
					</ItemTemplate>
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="20"/>
				</asp:TemplateColumn>
				<asp:TemplateColumn
					HeaderText="评论内容"
					>
					<ItemTemplate>
					<%#Eval("body")%>
					</ItemTemplate>
					<EditItemTemplate>
					<asp:TextBox TextMode="MultiLine" Rows="4" Columns="45" Text='<%#Server.HtmlDecode(CorrectBody((string)Eval("body")))%>' runat="server"/>
					</EditItemTemplate>
				</asp:TemplateColumn>
				<asp:TemplateColumn
					HeaderText="作者/IP"
					>
					<ItemTemplate>
					<%#Eval("username")%><br/><%#Eval("ip")%>
					</ItemTemplate>
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="80"/>
				</asp:TemplateColumn>
				<asp:BoundColumn
					HeaderText="日期"
					DataField="dateandtime"
					DataFormatString="<span title='{0:HH:mm}'>{0:yyyy-MM-dd}</span>"
					ReadOnly="true">
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="70"/>
				</asp:BoundColumn>
				<asp:TemplateColumn
					HeaderText="新闻 | 评论"
					>
					<ItemTemplate>
					<a href="show.aspx?id=<%#Eval("articleid")%>&amp;cid=<%#Eval("classid")%>" target="_blank" title="<%#Eval("title").ToString().Replace("\"","&quot;")%>"><%#StringLeft(Eval("title").ToString(),16)%></a>
					| <a href="?id=<%#Eval("articleid")%>">评</a>
					</ItemTemplate>
					<HeaderStyle Width="130"/>
				</asp:TemplateColumn>
			</Columns>
		</ASP:DataGrid>
		
		<table><tr><td align="left">
		<asp:Literal id="PageList" runat="server"/>
		</td></tr>
		<tr><td align="left">
			<asp:Button id="BtDelete" OnClick="BtDelete_OnClick" Text="删除" runat="server"/>
		</td></tr>
		</table>
	</form>
		
	</div>
	</div>
	<div class="bl"></div>
	<div class="br"></div>
	<div class="bm"></div>
	</div>

</asp:Content>