<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Send_Form.aspx.cs" Inherits="RM.Web.Training.UserStudents.Send_Form" %>

<!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 runat="server">
    <title>发送消息</title>
    <link href="/Themes/Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="/Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/artDialog/artDialog.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/artDialog/iframeTools.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/FunctionJS.js" type="text/javascript"></script>
    <script type="text/javascript">
        function CheckValid() {
            var send_Content = $("#send_Content").val();
            var user_id = $("#user_id").val();
            if (send_Content.length <= 0) {
                alert("消息内容不能为空！");
                return;
            }

            $.get("/Training/UserStudents/SendMSM.ashx", { action: "msmsend", uid: user_id, sendcontent:decodeURI(send_Content) }, function (data) {
                alert(data);
                if (data == "-1") { showTipsMsg('账号未注册', '2500', '3'); }
                else if (data == "-2") { showTipsMsg('其他错误', '2500', '3'); }
                else if (data == "-3") { showTipsMsg('帐号或密码错误', '2500', '3'); }
                else if (data == "-5") { showTipsMsg('余额不足，请先充值', '2500', '3'); }
                else if (data == "-6") { showTipsMsg('定时发送时间不是有效的时间格式', '2500', '3'); }
                else if (data == "-7") { showTipsMsg('提交信息未签名，请添加中文的企业签名【 】', '2500', '3'); }
                else if (data == "-8") { showTipsMsg('发送内容需在1到300字之间', '2500', '3'); }
                else if (data == "-9") { showTipsMsg('发送号码为空', '2500', '3'); }
                else if (data == "-10") { showTipsMsg('定时时间不能小于系统当前时间', '2500', '3'); }
                else if (data == "-101") { showTipsMsg('调用接口速度太快', '2500', '3'); }
                else if (data == "-99") { showTipsMsg('用户手机号码不存在', '2500', '3'); }
                else {
                    if (parseInt(data) >= 0) {
                        showTipsMsg('发送成功', '2500', '4');
                    }
                    else {
                        showTipsMsg('发送失败', '2500', '3');
                    }
                }
                top.main.target_right.windowload();
                OpenClose();
            });
        }
        

        $(document).ready(function () {
            $("#user_id").val(QueryString("key"));
        });
        
    </script>

    <style type="text/css">
    table td,th{ padding:2px; }
    </style> 

</head>
<body>
    <form id="form1" runat="server">
    <div class="frmtop">
        <table style="padding: 0px; margin: 0px;" cellpadding="0" cellspacing="0">
        <tr>
            <th style="width:100px;"> 信 息 内 容 </th>
            <td><textarea style="width:550px; height:260px;" id="send_Content" ></textarea>
            <input type="hidden" id="user_id"  />
            </td>
        </tr>
        <tr>
        <td></td>
        </tr>
        </table>
    </div>
    <div class="frmbottom">
        <a class="l-btn" href="javascript:void(0)" onclick="CheckValid();"><span class="l-btn-left"><img src="/Themes/Images/disk.png" alt="发送消息" />发 送</span></a>
        <a class="l-btn" href="javascript:void(0)" onclick="OpenClose();"><span class="l-btn-left">
            <img src="/Themes/Images/cancel.png" alt="" /><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Close")%></span></a>
    </div>

    </form>
</body>
</html>
