<%@ Page Language="C#" Inherits="Caicai.Jingpin.UI.Plugins.GuestBook" %>
<!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">
<head id="Head1" runat="server">
<link href="css.css" rel="stylesheet" type="text/css" />
<title><%= Caicai.Framework.Utils.CAppSettings.ConfigGet("Page.SiteCopyright") %>留言板</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" href="../style.css" rel="stylesheet" rev="stylesheet" media="all" />
<meta name="author" content="guqiu.com" />
<meta name="keywords" content="谷秋精品课程系统,精品课程,谷秋精品课程,精品课程软件,谷秋精品工具" />
<meta name="description" content="谷秋精品课程系统网站由《谷秋精品课程软件》生成，谷秋精品课程软件官方网站http://www.guqiu.com。" />
<script type="text/javascript">
function CheckInput() 
{
    //TB_Name验证
	if ($("TB_Name").value=='')
	{
		alert("请填写您的姓名！");
		$("TB_Name").focus(); 
		return false;
	} 
	if ($("TB_Name").value.length > 10)
	{
		alert("很抱歉，输入的姓名已经超出限制！");
		$("TB_Name").focus(); 
		return false;
	}
	
	//TB_Email验证
	if ($("TB_Email").value=='')
	{
		alert("请填写您的Email！");
		$("TB_Email").focus(); 
		return false;
	} 
	if ($("TB_Email").value.length > 30)
	{
		alert("很抱歉，输入的Email已经超出限制！");
		$("TB_Email").focus(); 
		return false;
	}
	if ($("TB_Email").value.search("^(?:\\w+\\.?)*\\w+@(?:\\w+\\.?)*\\w+$")!=0)
	{
		alert("很抱歉，输入的Email不符合规范！");
		$("TB_Email").focus(); 
		return false;
	}
	
	//TB_Content验证
	if ($("TB_Content").value=='')
	{
		alert("请填写留言内容！");
		$("TB_Content").focus(); 
		return false;
	} 
	if ($("TB_Content").value.length > 5024) 
	{
		alert("很抱歉，输入的留言内容已经超出限制！");
		$("TB_Content").focus(); 
		return false;
	} 
	
	//TB_Validate验证
	if ($("TB_Validate").value=='')
	{
		alert("请填写验证码！");
		$("TB_Validate").focus(); 
		return false;
	} 
	if ($("TB_Validate").value.length != 4)
	{
		alert("请认真填写验证码！");
		$("TB_Validate").focus(); 
		return false;
	}
	return true;
}
function $(id) 
{
	return document.getElementById(id);
}
</script>
</head>
<body id="guestbook">
<table class="table menu">
  <tr>
    <td><a href="?">留言首页</a><a href="../login.aspx?url=<%=Server.UrlEncode("guestbook/default.aspx")%>&table=C_GuestBook">管理登陆</a></td>
  </tr>
</table>
<form id="form1" runat="server">
<!-- 数据页面 -->
<asp:Panel ID="PanelDefault" runat="server">
<table class="table">
<tr>
    <td style="background:#f1f1f1; width:100px; text-align:right;">您的姓名</td>
    <td><Cai:CTextBox runat="server" ID="TB_Name" MaxLength="10" />&nbsp;&nbsp;Email&nbsp;&nbsp;<Cai:CTextBox runat="server" ID="TB_Email" style="width:160px" MaxLength="30" /></td>
</tr>
<tr>
    <td style="background:#f1f1f1;text-align:right;">留言内容</td>
    <td><Cai:CTextBox runat="server" ID="TB_Content" TextMode="MultiLine" Style="height:80px;width:90%;" /></td>
</tr>
<tr>
    <td style="background:#f1f1f1;text-align:right;">验证码</td>
    <td><asp:TextBox runat="server" ID="TB_Validate" style="width:50px" />&nbsp;<img src="Validate.aspx" alt="看不清？点击更换" onclick="this.src=this.src+'?'" style="cursor:pointer;border:1px solid #333; position:absolute" /></td>
</tr>
<tr>
    <td colspan="2" align="center"><asp:Button ID="ButtonInsert" runat="server" onclick="Insert_Click"  Text=" 提 交 " OnClientClick="return CheckInput();" />&nbsp;&nbsp;<input type="reset" value=" 重 置 " /></td>
</tr>
</table>
<table class="table">
<asp:Repeater ID="RepeaterShow" runat="server">
<ItemTemplate>
<tr>
    <td style="width:100px; text-align:center;" rowspan="2"><img src="images/member.gif" style="margin:5px;" /><br /><%# Caicai.Framework.Utils.CText.HtmlEncode(Eval("Name").ToString())%></td>
    <td style="background:#f1f1f1;"><span class="time">Time: <%# Eval("InputDate") %>&nbsp;&nbsp;Email: <%# Caicai.Framework.Utils.CText.HtmlEncode(Eval("Email").ToString()) %></span>&nbsp;&nbsp;<span class="time" runat="server" Visible="<%# IsAdmin %>"></span></td>
</tr>
<tr>
    <td style="table-layout:fixed;word-break:break-all; line-height:20px;"><%# Caicai.Framework.Utils.CText.HtmlEncode(Eval("Content").ToString())%>
    <hr />
    <asp:Panel ID="Panel1" runat="server" Visible='<%# Eval("ReContent").ToString()!="" %>' Style="color:Red;">
    <%# Eval("ReContent") %>&nbsp;&nbsp;<span class="time">Time:<%# Eval("ReInputDate") %>
    </asp:Panel>
    <asp:Panel ID="Panel2" runat="server" Visible="<%# IsAdmin %>">
    <hr />
    <a href="?action=update&id=<%# Eval("ID") %>"  title="update" class="button">回复</a><a href="?action=delete&id=<%# Eval("ID") %>"  title="delete" class="button">删除</a><asp:LinkButton ID="LinkButton1" runat="server" onclick="Loginout_Click"  Text="注销" CssClass="button" />
    </asp:Panel>
    </td>
</tr>
<tr>
    <td style="border:0px; height:14px;" colspan="2"></td>
</tr>
</ItemTemplate>
</asp:Repeater>
<tr>
    <td colspan="2"><Caicai:CPageSql ID="PageShow" runat="server" PageSize="5" /></td>
</tr>
</table>
</asp:Panel>

<!-- 更新页面 -->
<asp:Panel ID="PanelUpdate" runat="server">
<table class="table">
<tr>
    <td style="background:#f1f1f1; width:100px; text-align:right;">留言回复</td>
    <td><asp:TextBox runat="server" ID="TB_ReContent" TextMode="MultiLine"  Style="height:80px;width:90%;" /></td>
</tr>
<tr>
    <td colspan="2" align="center"><asp:Button ID="ButtonUpdate" runat="server" onclick="Update_Click"  Text=" 回 复 " />&nbsp;&nbsp;<input type="reset" value=" 重 置 " /></td>
</tr>
</table>
</asp:Panel>
</form>
</body>
</html>