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

<!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">
    <title>12345便民服务热线</title>
    <link href="../scripts/ui/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <link href="images/login.css" rel="stylesheet" type="text/css" />
    <script src="../scripts/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script src="../scripts/ui/js/ligerui.min.js" type="text/javascript"></script>
    <script src="seatformjs/formopt.js" type="text/javascript"></script>
    <%--<link href="favicon.ico" rel="shortcut icon" />--%>
    <style type="text/css">
        .tabs2
        {
            width: 270px;
            height: 38px;
            background: url("images/tabs_bg1.jpg") repeat-x scroll 0 0 #DDDDDD;
        }
        .tabs2 ul li
        {
            margin: 0;
            padding: 0;
            list-style: none;
            outline: none;
            float: left;
            width: 135px;
            height: 38px;
            line-height: 38px;
            text-align: center;
            font-size: 14px;
            font-weight: 700;
            display: list-item;
        }
        .tabs2 .menub1_1
        {
            background: url("images/tabs_bg2.jpg") repeat-x scroll 0 0 #1764C0;
            color: #fff;
            cursor: pointer;
        }
        .tabs2 .menub1_1 a
        {
            display: block;
            color: #fff;
        }
        
        .tabs2 .menub1_2 a
        {
            display: block;
        }
        a:hover
        {
            color: #e30000;
            text-decoration: none;
        }
        a
        {
            cursor: pointer;
            color: #4d4d4d;
            text-decoration: none !important;
        }
        ul
        {
            margin: 0;
            padding: 0;
            list-style: none;
            outline: none;
            display: block;
            list-style-type: disc;
            -webkit-margin-before: 1em;
            -webkit-margin-after: 1em;
            -webkit-margin-start: 0px;
            -webkit-margin-end: 0px;
        }
    </style>
    <script type="text/javascript">
        function showtabs(index) {
            if (index == 0) {
                document.getElementById("menu0").className = "menub1_1";
                document.getElementById("menu1").className = "menub1_2";
                document.getElementById("trTelphone").style.display = "none";
            }
            else {
                document.getElementById("menu1").className = "menub1_1";
                document.getElementById("menu0").className = "menub1_2";
                document.getElementById("txtTel").value = "";
                document.getElementById("trTelphone").style.display = "none";
            }
        }
    </script>
    <script type="text/javascript">
        function loginsys() {
            var IsVerification = verification();
            if (IsVerification == true) {
                var username = document.getElementById("txtUserName").value;
                var extensionphone = document.getElementById("txtTel").value;
                var password = document.getElementById("txtUserPwd").value;//todo，这里需加密
                var params = "&username=" + username + "&extensionphone=" + extensionphone + "&password=" + password;
                $.post("tools/login.ashx?action=login" + params, function (data, states) {
                    if (states == "success") {
                        if (data.length > 10) {
                            var newdata = data.substr(0, 10);
                            if (newdata == "firstlogin") {
                                $.ligerDialog.open({
                                    url: 'firstlogin.aspx?ResetPass=' + data.substr(10, data.length - 10),
                                    title: '修改初始密码',
                                    height: 400,
                                    width: 500,
                                    isResize: true
                                });
                            }
                            else {
                                lblTip.innerHTML = data;
                                WriteFileLogs(3, "login.aspx", data);
                            }
                        }
                        else {
                            if (data == "success") {
                                location.href = "/default.aspx";
                            }
                            else {
                                lblTip.innerHTML = data;
                                WriteFileLogs(3, "login.aspx", data);
                            }
                        }
                    }
                })
            }
        }
        function verification() {
            if (document.getElementById("trTelphone").style.display != "none") {
                if (document.getElementById("txtUserName").value == "") {
                    lblTip.innerHTML = "请填写帐号";
                    return false;
                }
                else if (document.getElementById("txtTel").value == "") {
                    lblTip.innerHTML = "请填写分机号";
                    return false;
                }
                else if (document.getElementById("txtUserPwd").value == "") {
                    lblTip.innerHTML = "请填写密码";
                    return false;
                }
                return true;
            }
            else {
                if (document.getElementById("txtUserName").value == "") {
                    lblTip.innerHTML = "请填写帐号";
                    return false;
                }
                else if (document.getElementById("txtUserPwd").value == "") {
                    lblTip.innerHTML = "请填写密码";
                    return false;
                }
                return true;
            }
        }
        var isform = false;
        function Init() {
            try {
                //isform = window.external.Web_PageInit();
                if (isform) {
                    document.getElementById("trTelphone").style.display = "none";
                }
                else {
                    document.getElementById("trTelphone").style.display = "none";
                }
            }
            catch (e) {
                document.getElementById("trTelphone").style.display = "none";
            }
        }
        document.onkeydown = function (event) {
            var e = event || window.event || arguments.callee.caller.arguments[0];
            if (e && e.keyCode == 13) {
                loginsys();
            }
        };
    </script>
</head>
<body class="loginbody" onload="Init();">
    <form id="form1" runat="server">
    <div id="main">
        <div class="box">
            <p>
            </p>
            <div class="foot">
                <span><a target="_blank" style="color:Red;" href="zxkhd.rar">下载坐席客户端</a>&nbsp;&nbsp;&nbsp;&nbsp; 西安众擎电子科技有限公司</span></div>
            <div class="login_from">
                <div class="title" style="padding-top: 5px; padding-left: 70px;">
                    <div class="tabs2" style=" display:none;">
                        <ul>
                            <li class="menub1_1" id="menu0" onclick="showtabs(0)"><a title="坐席用户">坐席用户</a></li>
                            <li class="menub1_2" id="menu1" onclick="showtabs(1)"><a title="普通用户">普通用户</a></li>
                        </ul>
                    </div>
                </div>
                <table width="90%" align="center" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                        <tr>
                            <td width="54">
                                账号
                            </td>
                            <td height="70" align="left" valign="middle">
                                <asp:TextBox ID="txtUserName" runat="server" CssClass="input_style frsd required"
                                    Text=""></asp:TextBox>
                            </td>
                        </tr>
                        <tr id="trTelphone" style="display:none;">
                            <td width="54">
                                分机
                            </td>
                            <td height="70" align="left" valign="middle">
                                <asp:TextBox ID="txtTel" runat="server" CssClass="input_style frsd required" onKeyUp="this.value=this.value.replace(/[^\d]/g,'');"
                                    Text=""></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td width="54">
                                密码
                            </td>
                            <td width="122" align="left" valign="middle">
                                <asp:TextBox ID="txtUserPwd" runat="server" CssClass="input_style frsd required"
                                    Text="" TextMode="Password"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="center" valign="middle">
                                &nbsp;
                            </td>
                            <td height="70" align="center" valign="middle">
                                <input id="btnSubmit" class="btn_ok" type="button" onclick="loginsys()" />
                            </td>
                        </tr>
                    </tbody>
                </table>
                <div class="login_tip" style="text-align: center">
                    <asp:Label ID="lblTip" runat="server" Text="" ForeColor="Red" />
                </div>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
