<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MessageBoardRelease.aspx.cs" Inherits="Web.MessageBoardRelease" %>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head runat="server">
    <title>信息发表</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link type="text/css" rel="stylesheet" href="../Css/normalize.css" />
    <link type="text/css" rel="stylesheet" href="../Css/public.css" />
    <link type="text/css" rel="stylesheet" href="../user/css/userfunc.css" />

    <script type="text/javascript" src="../js/jquery.js" ></script>
    <script type="text/javascript" src="../Js/validate.js" charset="utf-8"></script>
   
</head>
<body>
    <form id="form1" runat="server">
    <div class="edit-func-box func-box">
        <div class="hd">信息发表窗口</div>
        <asp:Label ID="LabelMessage" runat="server" Text="" Visible="false"></asp:Label>
        <asp:Panel ID="Panel1" runat="server" CssClass="bd">
            <table class="edit-table">
                <tr>
                    <th>
                        标题：
                    </th>
                    <td>
                        <asp:TextBox ID="TitleTextBox" CssClass="input-txt" runat="server" notNull="true" msgName="标题" MaxLength="50"></asp:TextBox><font color="#ff0000">*</font>
                    </td>
                </tr>
                <tr>
                    <th>
                        留言内容：
                    </th>
                    <td>
                        <asp:TextBox ID="ContentTextBox" runat="server"  CssClass="input-txt" Width="90%" Height="80"  TextMode="MultiLine" notNull="true" msgName="留言内容" MaxLength="500"></asp:TextBox><font color="#ff0000">*</font>
                    </td>
                </tr>
                <tr>
                    <th>
                        是否保密：
                    </th>
                    <td>
                        <asp:CheckBox ID="IsSecrecy" runat="server" Text="该条信息保密"></asp:CheckBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        姓名：
                    </th>
                    <td>
                        <asp:TextBox ID="AuthorTextBox" CssClass="input-txt" runat="server" notNull="true" msgName="姓名" MaxLength="20"></asp:TextBox><font color="#ff0000">*</font><asp:TextBox ID="IsSecrecyUserName" runat="server" Visible="false"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        性别：
                    </th>
                    <td>
                        <asp:RadioButtonList ID="Sex" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                            <asp:ListItem Value="男" Selected="True">男&emsp;&emsp;</asp:ListItem>
                            <asp:ListItem Value="女">女</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <th>
                        电子邮箱：
                    </th>
                    <td>
                        <asp:TextBox ID="EmailTextBox" CssClass="input-txt" runat="server" notNull="true" regex="/^(\w)+(\.\w+)*@(\w)+((\.\w{2,3}){1,3})$/"
                            regexMsg="电子邮箱格式不正确" MaxLength="80"></asp:TextBox><font color="#ff0000">*</font>
                    </td>
                </tr>
                <tr style="display:none;">
                    <th>
                        主页：
                    </th>
                    <td>
                        <asp:TextBox ID="HomePageTextBox" runat="server" MaxLength="100"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        手机号码：
                    </th>
                    <td>
                        <asp:TextBox ID="TelTextBox" runat="server" CssClass="input-txt" notNull="true" datatype="integer" msgName="手机号码" MaxLength="25"></asp:TextBox><font color="#ff0000">*</font>
                    </td>
                </tr>
                <tr id="trPostCode" runat="server">
                    <th>
                        验证码：
                    </th>
                    <td>
                        <asp:TextBox ID="PhoneVerifyCode" runat="server" CssClass="input-txt" notNull="true" msgName="手机验证码" MaxLength="6" Width="45"></asp:TextBox><input id="zphone" type="button" value="获取手机验证码" style="width:110px;" onclick="get_mobile_code();" />
                    </td>
                </tr>
                <tr id="trVerifyCode" runat="server">
                    <th>
                        验证码：
                    </th>
                    <td>
                        <asp:TextBox ID="VerifyCode" runat="server" CssClass="input-txt"  notNull="true" msgName="验证码" MaxLength="10"></asp:TextBox> &nbsp;<img align="middle" src="../user/verifyimg.aspx" title="单击可换图" alt="" onclick="this.src='../user/verifyImg.aspx?v='+Math.random()"/>
                    </td>
                </tr>
                <tr>
                    <th></th>
                    <td>
                        <div class="action-field text-center">
                            <asp:Button ID="AddButton" class="btn" runat="server" Text="发表" OnClientClick="return checkAll()" OnClick="AddButton_Click"></asp:Button>&nbsp; &nbsp;
                            <input type="button" class="btn" name="Submit" value="关闭" onclick="javascript: window.close()" />
                            <asp:Label ID="showLable" runat="server" ></asp:Label>
                        </div>
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </div>
    </form>
        <!--#include file="../Css/foot.htm"-->
     <script type="text/javascript">
         function checkAll() {
             //验证
             if (checkAllValidate()) {
                 return confirm("您确认要发表吗？");
             } else {
                 return false;
             }
         }

         function get_mobile_code() {
             if ($('#TelTextBox').val() == "") {
                 alert("手机号码不能为空!")
             }
             else {
                 var myreg = /^0?1[3|4|5|8][0-9]\d{8}$/;
                 if (!myreg.test($('#TelTextBox').val())) {
                     alert('请输入有效的手机号码!');
                 }
                 else {
                     $.get('SMSSend.aspx', { mobile: jQuery.trim($('#TelTextBox').val()) }, function (msg) {
                         alert(jQuery.trim(unescape(msg)));
                         if (msg == '短信验证码已发送') {
                             RemainTime();
                         }
                     });
                 }
             }
         };

         var iTime = 59;
         var Account;
         function RemainTime() {
             document.getElementById('zphone').disabled = true;
             var iSecond, sSecond = "", sTime = "";
             if (iTime >= 0) {
                 iSecond = parseInt(iTime % 60);
                 iMinute = parseInt(iTime / 60)
                 if (iSecond >= 0) {
                     if (iMinute > 0) {
                         sSecond = iMinute + "分" + iSecond + "秒";
                     } else {
                         sSecond = iSecond + "秒后可重新获取";
                     }
                 }
                 sTime = sSecond;
                 if (iTime == 0) {
                     clearTimeout(Account);
                     sTime = '获取手机验证码';
                     iTime = 59;
                     document.getElementById('zphone').disabled = false;
                 } else {
                     Account = setTimeout("RemainTime()", 1000);
                     iTime = iTime - 1;
                 }
             } else {
                 sTime = '没有倒计时';
             }
             document.getElementById('zphone').value = sTime;
         }
    </script>
</body>
</html>
