<%@ Control Language="c#" AutoEventWireup="false" Codebehind="Leave.ascx.cs" Inherits="WebUI.MMS.Leave" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<script language="javascript" type="text/javascript">
<!--
function checkFormAll(chk)
{
	myform = document.forms[0];
	for( var i = 0; i < myform.elements.length; i++ )
	{
		if ( myform.elements[i].type=="checkbox" )
		{
			myform.elements[i].checked = chk;
		}
	}
}

function go(i)
{
	var theform;
	if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
		theform = document.forms["myform2"];
	}
	else {
		theform = document.myform2;
	}
	theform.PageIndex.value = i;
	theform.submit();		
}

function SelectDate(DivID)
{
     var fullPath="calendar/PopDate.Htm";
     var strDate;	//Chinese date formate
     var intDate;	//Integer date formate
     var objEffectDate=eval("myform2." + DivID);
     intDate=showModalDialog(fullPath,window,"dialogWidth=360px;dialogHeight=310px;center=yes;border=this;help=no");
     if (intDate!=null)
     {
         objEffectDate.value=intDate.substr(0,4)+"-"+intDate.substr(5,2)+"-"+intDate.substr(8,2);
         if (objEffectDate.value!="undefined")
         {
             strDate=intDate.substr(0,4)+"-"+intDate.substr(5,2)+"-"+intDate.substr(8,2);
             objEffectDate.value=strDate;
         }
         else
         {
             objEffectDate.value="";
         }
     }
     event.returnValue =false;
}
//-->
</script>
<input id=PageIndex type=hidden value="<%= this.PageIndex%>" name=PageIndex>
<TABLE cellSpacing="0" cellPadding="0" width="98%" align="center">
	<TR>
		<TD class="mframe-t-left"></TD>
		<TD class="mframe-t-mid"><SPAN class="mframe-t-text"><%=this.PageTitle%></SPAN></TD>
		<TD class="mframe-t-right"></TD>
	</TR>
</TABLE>
<table class="awidth" cellSpacing="0" cellPadding="0" align="center">
	<tr>
		<td class="mframe-m-left"></td>
		<td class="mframe-m-mid">
			<!--------添加留言---------><asp:panel id="pnlAdd" runat="server">
				<TABLE cellSpacing="1" cellPadding="3" width="98%" align="center">
					<TR>
						<TD align="right">留言内容：</TD>
						<TD>
							<asp:TextBox id="txtContent" runat="server" Width="350px" Height="150px" TextMode="MultiLine"></asp:TextBox><FONT color="red">*</FONT>
						</TD>
					</TR>
					<TR>
						<TD align="right"></TD>
						<TD>
							<asp:Button id="Submit1" runat="server" Text="提  交"></asp:Button></TD>
					</TR>
				</TABLE>
			</asp:panel>
			<!--------查看回复---------><asp:panel id="pnlView" runat="server">
				<TABLE cellSpacing="1" borderColorDark="#ffffff" cellPadding="3" width="98%" align="center"
					borderColorLight="#cccccc" border="1">
					<TR>
						<TD align="right" width="80">留言日期：</TD>
						<TD>
							<asp:Label id="lblDate" runat="server"></asp:Label></TD>
					</TR>
					<TR>
						<TD align="right">会员姓名：</TD>
						<TD><FONT face="宋体">
								<asp:Label id="lblName" runat="server"></asp:Label></FONT></TD>
					</TR>
					<TR>
						<TD align="right">留言内容：</TD>
						<TD>
							<asp:Label id="lblContent" runat="server"></asp:Label>&nbsp;</TD>
					</TR>
					<TR>
						<TD align="right">回复内容：</TD>
						<TD>
							<asp:Label id="lblRevert" runat="server"></asp:Label>&nbsp;</TD>
					</TR>
					<TR>
						<TD align="center" colSpan="2"><INPUT onclick="history.back();" type="button" value="返 回">
						</TD>
					</TR>
				</TABLE>
			</asp:panel>
			<!--------回复留言---------><asp:panel id="pnlRevert" runat="server">
				<TABLE cellSpacing="1" borderColorDark="#ffffff" cellPadding="3" width="98%" align="center"
					borderColorLight="#cccccc" border="1">
					<TR>
						<TD align="right" width="80">留言日期：</TD>
						<TD><FONT face="宋体">
								<asp:Label id="lblDate2" runat="server"></asp:Label></FONT></TD>
					</TR>
					<TR>
						<TD align="right">会员姓名：</TD>
						<TD><FONT face="宋体">
								<asp:Label id="lblName2" runat="server"></asp:Label></FONT></TD>
					</TR>
					<TR>
						<TD align="right">留言内容：</TD>
						<TD><FONT face="宋体">
								<asp:Label id="lblContent2" runat="server"></asp:Label></FONT>&nbsp;</TD>
					</TR>
					<TR>
						<TD align="right">回复内容：</TD>
						<TD>
							<asp:TextBox id="txtRevert" runat="server" Width="350px" Height="150px" TextMode="MultiLine"></asp:TextBox><FONT color="red">*</FONT>&nbsp;
						</TD>
					</TR>
					<TR>
						<TD align="center" colSpan="2">
							<asp:Button id="Submit2" runat="server" Text="提  交"></asp:Button></TD>
					</TR>
				</TABLE>
			</asp:panel>
			<!--------留言列表---------><asp:panel id="pnlList" runat="server">
				<ASP:DataGrid id="DataGrid1" runat="server" Width="100%" AllowPaging="True" Align="center" ShowHeader="True"
					ShowFooter="false" AutoGenerateColumns="false" DataKeyField="ID" ItemStyle-CssClass="tdbg"
					CellSpacing="0" CellPadding="0" OnItemCreated="DataGrid1_ItemCreated">
					<PagerStyle Visible="False" />
					<HeaderStyle HorizontalAlign="center" CssClass="summary-title" Height="25" />
					<ItemStyle Height="22" />
					<EditItemStyle CssClass="tdbg-dark" />
					<Columns>
						<asp:TemplateColumn ItemStyle-Width="15%" ItemStyle-HorizontalAlign="center">
							<ItemTemplate>
								<a href='?mms=<%# Request["mms"]%>&action=view&id=<%# DataBinder.Eval(Container.DataItem, "ID")%>'>
									查看回复</a>
								<%# Session["UserType"].ToString() == "1" ? "| <a href='?mms=" + Request["mms"].ToString() + "&action=revert&id=" + DataBinder.Eval(Container.DataItem, "ID").ToString() +"'>回复</a>" : ""%>
							</ItemTemplate>
						</asp:TemplateColumn>
						<asp:BoundColumn HeaderText="序号" DataField="ID" ReadOnly="true">
							<ItemStyle Width="8%" HorizontalAlign="Center" />
						</asp:BoundColumn>
						<asp:BoundColumn HeaderText="姓 名" DataField="Name" ReadOnly="true">
							<ItemStyle Width="10%" HorizontalAlign="Center" />
						</asp:BoundColumn>
						<asp:BoundColumn HeaderText="留言内容" DataField="Content" ReadOnly="true">
							<ItemStyle Width="45%" HorizontalAlign="Center" />
						</asp:BoundColumn>
						<asp:BoundColumn HeaderText="日 期" DataField="Dtime" ReadOnly="true">
							<ItemStyle Width="15%" HorizontalAlign="Center" />
						</asp:BoundColumn>
						<asp:TemplateColumn ItemStyle-Width="5%" ItemStyle-HorizontalAlign="center" HeaderText="<input type='checkbox' onclick='checkFormAll(this.checked)'>">
							<ItemTemplate>
								<input type="checkbox" name="chk" value='<%# DataBinder.Eval(Container.DataItem, "ID")%>' />
							</ItemTemplate>
						</asp:TemplateColumn>
					</Columns>
				</ASP:DataGrid>
				<TABLE width="100%">
					<TR>
						<TD align="center" height="25"><%= this.PageNavigation%></TD>
					</TR>
				</TABLE>
				<TABLE height="30" width="100%" align="center">
					<TR>
						<TD>留言日期：
							<asp:TextBox onkeypress="SelectDate('_ctl0_txtDate2')" id="txtDate2" onclick="SelectDate('_ctl0_txtDate2')"
								Width="80px" Runat="server"></asp:TextBox>
							<asp:button id="btnSearch" Text="查 询" Runat="server"></asp:button></TD>
						<TD align="right"><INPUT id="btnLeave" onclick="location.href='?mms=MMS^Leave&amp;action=add'" type="button"
								value="我要留言" runat="server">
							<asp:Button id="btnDelete" onclick="Delete_OnClick" Text="删除所选" Runat="server"></asp:Button></TD>
					</TR>
				</TABLE>
			</asp:panel></td>
		<td class="mframe-m-right"></td>
	</tr>
</table>
<TABLE cellSpacing="0" cellPadding="0" width="98%" align="center">
	<TR>
		<TD class="mframe-b-left"></TD>
		<TD class="mframe-b-mid">&nbsp;</TD>
		<TD class="mframe-b-right"></TD>
	</TR>
</TABLE>
