<%@ Page language="c#" Codebehind="OrderReview.aspx.cs" AutoEventWireup="false" Inherits="XpShop.WebUI.Admin.OrderReview" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
	<HEAD>
	    <!--#include file="inc/head.inc"-->
		<title>Review</title>
	</HEAD>
	<body>
	    <div class="container">
		<div class="sub_container">
		<div class="sub_container_title"><a href="../default.aspx" target="_blank">桌面</a><img src="images/admin_title.jpg" height=9px width=8px align="absmiddle" />留言管理</div>
		<div class="sub_container_content">
		<form id="Form1" method="post" runat="server">
		    <div class="frame">
		        <div class="frame_title"><asp:Label ID="lbTitle" Runat="server" CssClass="tableHeaderText">订单留言管理</asp:Label></div>
		        <div class="frame_content">
		           <table class="tableBorder" cellSpacing="0" cellPadding="0" width="98%" align="center" border="0">
				        <tr>
					        <td height="23" class="forumRowHighlight">
						        <asp:datagrid id="dgReviews" runat="server" AllowPaging="True" PagerStyle-Mode="NumericPages"
							        AutoGenerateColumns="False" DataKeyField="OrderReviewID" Width="100%" HorizontalAlign="Center"
							        HeaderStyle-CssClass="summary-title">
							        <HeaderStyle Font-Bold="True" CssClass="summary-title"></HeaderStyle>
							        <Columns>
								        <asp:TemplateColumn HeaderText="对应订单号">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center" Width="70px"></ItemStyle>
									        <ItemTemplate>
										        <a href='OrderModify.aspx?OrderID=<%# DataBinder.Eval(Container.DataItem, "OrderID") %>&from=list' target=_self class="link_to_modify">
											        <%# GetOrderNo(DataBinder.Eval(Container.DataItem, "OrderID").ToString()) %>
										        </a>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="确定" HeaderText="回复" CancelText="取消" EditText="点击回复">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center" Width="55px"></ItemStyle>
								        </asp:EditCommandColumn>
								        <asp:TemplateColumn HeaderText="评论内容">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left"></ItemStyle>
									        <ItemTemplate>
										        内容：<%# DataBinder.Eval(Container.DataItem, "Body") %><br>
										        回复：<%# DataBinder.Eval(Container.DataItem, "Reply") %>
									        </ItemTemplate>
									        <EditItemTemplate>
										        内容：<br>
										        <asp:TextBox ID="txtBody" Runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Body") %>' TextMode="MultiLine" Width="200">
										        </asp:TextBox><br>
										        回复：<br>
										        <asp:TextBox ID="txtReply" Runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Reply") %>' TextMode="MultiLine" Width="200">
										        </asp:TextBox>
									        </EditItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="其它信息">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="120px"></ItemStyle>
									        <ItemTemplate>
										        时间：<%# DataBinder.Eval(Container.DataItem, "AddTime") %><br>
										        IP地址：<%# DataBinder.Eval(Container.DataItem, "IP") %>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="状态">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
									        <ItemTemplate>
										        <img src='images/<%# (DataBinder.Eval(Container.DataItem, "Reply").ToString()) == "" ? "replyno.gif" : "replyyes.gif"%>' alt='<%# (DataBinder.Eval(Container.DataItem, "Reply").ToString()) == "" ? "未回复" : "已回复"%>'>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:ButtonColumn Text="&lt;div id=&quot;de&quot; onclick=&quot;javascript:return confirm('确认删除吗？')&quot;&gt;删除&lt;/div&gt;"
									        CommandName="Delete">
									        <ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
								        </asp:ButtonColumn>
							        </Columns>
							        <PagerStyle Mode="NumericPages"></PagerStyle>
						        </asp:datagrid>
					        </td>
				        </tr>
			        </table> 
		        </div>
	        </div>
		</form>
		</div>
		</div>
		</div>
		
		<iframe id="frmModify" style="width:100%;" scrolling="no"></iframe>
	    <input type="hidden" id="frmHeight" /><%--记录窗口高度--%>
	    <script type="text/javascript">
	        $(document).ready(function(){
	            $('a.link_to_modify').each(function(){
	                $(this).click(function(){
	                    ShowModify($(this).attr('href'));
	                    return false;
	                });
	            });
	            
	            setInterval(function(){
                    $('#frmHeight').val($(window.parent.frames.right).height());//将窗口高度用hidden记录,在iframe中取值
                },100);
	        });
	        
	        //点击修改,显示修改订单的页面
            function ShowModify(href){
                $('#frmModify').attr('src',href+'&ran='+Math.random()).css('height',$(window.parent.frames.right).height()).show().siblings().hide();
            }
	    </script>
	</body>
</HTML>
