<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="col_Header.ascx.cs" Inherits="MTCUN.Mobile.User_Col.col_Header" %>
<%@ Import Namespace="MTCUN" %>
<script src="../JScript/Cookie.js" type="text/javascript"></script>
<script type="text/javascript">

    var xmlHttp = null;
    //var newcount = 0;

    //接收消息并返回本地未读消息数。
    function ReceiveMsg() {
        try {
            if (window.XMLHttpRequest) {
                xmlHttp = new XMLHttpRequest();
            }
            else if (window.ActiveXObject) {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            xmlHttp.open("GET", __mt_requesturl + "&action=1&s=" + Math.random(), false);
            xmlHttp.send("");

            var text = xmlHttp.responseText;
            var count = parseInt(text);

            if (count > 0) {
                var sound = true;

                var chat = document.getElementById("__mt_chat");
                if (chat != null) {
                    doRefresh(); //刷新消息列表或对话窗。
                    sound = false;
                }

                //显示消息数。
                setMsgCount(count, sound);
            }
        }
        catch (ex) {
            //alert(ex);
        }
    }

    //心跳程序，保持与服务器连接。
    function HeartRequest() {
        try {

            if (window.XMLHttpRequest) {
                xmlHttp = new XMLHttpRequest();
            }
            else if (window.ActiveXObject) {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }

            //连接心跳程序。
            xmlHttp.open("GET", __mt_requesturl + "&action=0&s=" + Math.random(), false);
            xmlHttp.send("");

            //存在新消息，需要更新。
            if (xmlHttp.responseText == "1") {
                ReceiveMsg();
            }

            window.setTimeout(HeartRequest, 15000);
        }
        catch (ex) {
            //alert(ex);
            window.setTimeout(HeartRequest, 15000);
        }
    }
    window.setTimeout(HeartRequest, 15000);

    //显示消息数。
    function setMsgCount(num, sound) {
        if (num > 0) {
            divNum.innerHTML = num;
            divNumBg.style.display = "block";
            if (sound)
                PaySound();
        } else {
            divNum.innerHTML = "";
            divNumBg.style.display = "none";
        }
    }

    //播放声音。
    function PaySound() {
        try {
            document.getElementById('bgaudio').play();
        } catch (e) {
        }
    }

</script>
<div id="header">
    <div id="header_menu">
        <ul>
            <li id="__mt_menu2" runat="server" class="homemenu" onclick="OpenSub(1)" onmouseover="__mt_NavMouseover(this,'homemenu')" onmouseout="__mt_NavMouseout(this,'homemenu')">菜单
            </li>
            <li class="header_menu_item" onclick="window.location='../frame/index.aspx';" onmouseover="__mt_NavMouseover(this,'header_menu_item')" onmouseout="__mt_NavMouseout(this,'header_menu_item')">桌面
            </li>
            <li class="header_menu_item" onclick="window.location='../Msg/Topic.aspx';" onmouseover="__mt_NavMouseover(this,'header_menu_item')" onmouseout="__mt_NavMouseout(this,'header_menu_item')" style="position: relative">消息
                <div id="divNumBg" style="display: none; border-radius: 10px; position: absolute; background-color: rgba(255, 0, 0,0.9); color: #ffffff; width: 18px; height: 18px; bottom: 1px; right: 1px"></div>
                <div id="divNum" style="position: absolute; color: #ffffff; width: 18px; height: 18px; line-height: 18px; vertical-align: middle; text-align: center; bottom: 1px; right: 1px"></div>
            </li>
            <li>
                <asp:DropDownList ID="ddlSchool" Width="100px" runat="server" CssClass="schoollist" DataTextField="SchoolName" DataValueField="SchoolID"
                    AutoPostBack="True" OnSelectedIndexChanged="ddlSchool_SelectedIndexChanged">
                </asp:DropDownList>
            </li>
            <li class="header_menu_item" onclick="setMode()" id="sysMode" onmouseover="__mt_NavMouseover(this,'header_menu_item')" onmouseout="__mt_NavMouseout(this,'header_menu_item')">平</li>
            <li id="h_help" class="header_menu_item" onmouseover="__mt_NavMouseover(this,'header_menu_item')" onmouseout="__mt_NavMouseout(this,'header_menu_item')" onclick="window.open('http://www.mtcnsoft.com/help/wmt3/','_blank');">帮助</li>
            <li id="h_exit" class="header_menu_item" onmouseover="__mt_NavMouseover(this,'header_menu_item')" onmouseout="__mt_NavMouseout(this,'header_menu_item')" onclick="window.location='../frame/exit.aspx';">退出</li>
            <li id="__mt_menu" runat="server" class="homemenu" onclick="OpenSub(1)" onmouseover="__mt_NavMouseover(this,'homemenu')" onmouseout="__mt_NavMouseout(this,'homemenu')">菜单
            </li>
        </ul>
    </div>
    <div id="header_sub" class="header_sub_bg" style="display: none; text-align: right; padding-top: 4px; overflow-y: auto;">
        <div id="items" style="text-align: right; margin-top: 4px;">
        </div>
        <div class="header_sub_bg dian" style="position: fixed; top: 30px; width: 10px; height: 10px; border-top-left-radius: 7px; border-top-right-radius: 7px; z-index: 100000"></div>
        <div style="text-align: left">
            <ul class="sub_menus">
                <li class="sub_menu" style="background-image: url('<%=UserFace %>'); background-repeat: no-repeat; background-position: 0px center;"><span style="margin-left: 15px" class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                    <b class="username_width"><a href="../User/Password.aspx"><%=TrueName %></a></b></span> </li>
                <li class="sub_menu study">
                    <span style="margin-left: 15px" class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../../frame/ToMTService.aspx" target="_blank">学习中心</a></span>
                </li>
                <li id="s_exit" class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')"><a href="../frame/exit.aspx">退出</a></li>
                <li id="s_help" class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')"><a href="http://www.mtcnsoft.com/help/wmt3/" target="_blank">帮助</a></li>
            </ul>
        </div>
    </div>
    <span style="display: none; visibility: hidden">
        <audio id="bgaudio">
            <source src='<%=swq.SystemVirtualPath + "Sound/msg.mp3" %>' type="audio/mpeg">
        </audio>
    </span>


</div>


<script type="text/javascript">
    if (__mt_newmsgcount > 0) {
        divNum.innerHTML = __mt_newmsgcount;
        divNumBg.style.display = "block";
    }
</script>

<script type="text/javascript">
    function OpenSub(id) {
        if (header_sub.style.display == 'none') {
            header_sub.style.display = 'block';
        }
        else {
            header_sub.style.display = 'none';
        }

        items.innerHTML = document.getElementById(__mt_SelectedModule).innerHTML;
    }

    function setMode() {
        var num = __mt__getModeCookie();
        if (num == 1) {
            sysMode.innerHTML = '平';
            __mt__setModeCookie(0);
            location.replace(location.href);
        }
        else {
            sysMode.innerHTML = '手';
            __mt__setModeCookie(1);
            location.replace(location.href);
        }
    }

    function defaultMode() {
        var num = __mt__getModeCookie();
        if (num == 0) {
            document.getElementById("sysMode").innerHTML = '平';
        }
        else {
            document.getElementById("sysMode").innerHTML = '手';
        }
    }

    defaultMode();

    //初始化数目。
    setMsgCount(__mt_newmsgcount, true);
</script>

<div style="display: none">
    <div id="menu_1" style="text-align: right" runat="server" visible="false">
        <div id="group_1_1" class="menu_group" style="border-radius: 5px; padding: 3px; text-align: right">
            <div><b>咨询回访</b></div>
            <div>
                <ul class="sub_menus">
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Consultant/PostPotential.aspx">意向登记</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Consultant/PotentialList.aspx">咨询回访</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Consultant/Course.aspx">咨询课程</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Consultant/Media.aspx">媒体设置</a>
                    </li>
                </ul>
            </div>
        </div>
        <div id="group_1_2" class="menu_group" style="border-radius: 5px; padding: 3px; text-align: right">
            <div><b>学员报名</b></div>
            <div>
                <ul class="sub_menus">
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Register/PostStudent.aspx">学员报名</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Register/StudentList.aspx">学员查询</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Register/ClassList.aspx">开班查询</a></li>
                </ul>
            </div>
        </div>
    </div>
    <div id="menu_2" style="text-align: right" runat="server" visible="false">
        <div id="group_2_1" class="menu_group" style="border-radius: 5px; padding: 3px; text-align: right">
            <div><b>老师工作台</b></div>
            <div>
                <ul class="sub_menus">
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Teacher/ClassList.aspx">我的班级</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Teacher/LessonTable.aspx">我的课表</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div id="menu_3" style="text-align: right" runat="server" visible="false">
        <div id="group_3_1" class="menu_group" style="border-radius: 5px; padding: 3px; text-align: right">
            <div><b>班级管理</b></div>
            <div>
                <ul class="sub_menus">
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Class/PostClass.aspx">开设班级</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Class/ClassList.aspx">班级查询</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Class/Classroom.aspx">教室管理</a></li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Class/PeriodTime.aspx">时段管理</a></li>
                </ul>
            </div>
        </div>
        <div id="group_3_2" class="menu_group" style="border-radius: 5px; padding: 3px; text-align: right">
            <div><b>学员管理</b></div>
            <div>
                <ul class="sub_menus">
                    <%--                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Affairs/SelectClass.aspx">选班处理</a>
                    </li>--%>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Affairs/StudentList.aspx">学员查询</a>
                    </li>
                </ul>
            </div>
        </div>
        <div id="group_3_3" class="menu_group" style="border-radius: 5px; padding: 3px; text-align: right">
            <div><b>考勤管理</b></div>
            <div>
                <ul class="sub_menus">
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Class/LessonTable.aspx">课程总表</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Class/LessonDay.aspx">今日班级</a>
                    </li>
                </ul>
            </div>
        </div>
        <div id="group_3_4" class="menu_group" style="border-radius: 5px; padding: 3px; text-align: right">
            <div><b>统计分析</b></div>
            <div>
                <ul class="sub_menus">
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Affairs/TeacherLessons.aspx">课时统计</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div id="menu_7" style="text-align: right" runat="server" visible="false">
        <div id="group_7_1" class="menu_group" style="border-radius: 5px; padding: 3px; text-align: right">
            <div><b>校长监管</b></div>
            <div>
                <ul class="sub_menus">
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Report/Analysis.aspx">今日分析</a>
                    </li>

                </ul>
            </div>
        </div>
    </div>
    <div id="menu_8" style="text-align: right" runat="server" visible="false">
    </div>
    <div id="menu_9" style="text-align: right" runat="server" visible="false">
        <div id="group_9_1" class="menu_group" style="border-radius: 5px; padding: 3px; text-align: right">
            <div><b>App消息管理</b></div>
            <div>
                <ul class="sub_menus">
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../SMS/SendToUser.aspx?app=true">发给员工</a>
                    </li>

                </ul>
            </div>
        </div>
        <div id="group_9_2" class="menu_group" style="border-radius: 5px; padding: 3px; text-align: right">
            <div><b>我的短信</b></div>
            <div>
                <ul class="sub_menus">
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../SMS/SendToUser.aspx">发给员工</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../SMS/SmsReceive.aspx">接收短信</a>
                    </li>

                </ul>
            </div>
        </div>
        <div id="group_9_3" class="menu_group" style="border-radius: 5px; padding: 3px; text-align: right">
            <div><b>短信管理员</b></div>
            <div>
                <ul class="sub_menus">
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../SMS/sys_Account.aspx">短信帐户</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../SMS/sys_Sending.aspx">正在发送</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../SMS/sys_SendEvent.aspx">事件短信</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../SMS/sys_Success.aspx">成功短信</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../SMS/sys_Failure.aspx">失败短信</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../SMS/sys_SmsReceive.aspx">接收短信</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div id="menu_4" style="text-align: right" runat="server" visible="false">
        <div id="group_4_1" class="menu_group" style="border-radius: 5px; padding: 3px; text-align: right">
            <div><b>财务管理</b></div>
            <div>
                <ul class="sub_menus">
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Finance/StudentList.aspx">学员查询</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Finance/Bills.aspx">消费单</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Finance/Payments.aspx">充值单</a></li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Finance/Arrearage.aspx">欠费查询</a></li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Finance/FeeTable.aspx">对账单</a></li>
                </ul>
            </div>
        </div>
    </div>
    <div id="menu_10" style="text-align: right" runat="server" visible="false">
        <div id="group_1" class="menu_group" style="border-radius: 5px; padding: 3px; text-align: right">
            <div><b>系统设置</b></div>
            <div>
                <ul class="sub_menus">
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Admin/Basic.aspx">基础设置</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Admin/School.aspx">校区管理</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Admin/CourseType.aspx">课程分类</a>
                    </li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Admin/Course.aspx">课程设置</a></li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Admin/FeeItem.aspx">收费项</a></li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Admin/UserGroup.aspx">用户组</a></li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')">
                        <a href="../Admin/User.aspx">用户管理</a></li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')" id="wxbasic" runat="server" visible="false">
                        <a href="../WeiXin/Basic.aspx">微信设置</a></li>
                    <li class="sub_menu" onmouseover="__mt_NavMouseover(this,'sub_menu')" onmouseout="__mt_NavMouseout(this,'sub_menu')" id="wxmenu" runat="server" visible="false">
                        <a href="../WeiXin/menu.aspx">微信菜单</a></li>

                </ul>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    if (__mt_MicroMode == 2 && __mt_menm == 1)
        OpenSub(1);
</script>
